Increasing Transmission of Inter-Integrated Circuit in Home Automation Solutions

Home automation systems are widely offered and increasingly available. The number of people who would like to purchase a property with intelligent solutions or equip their own home with such solutions is increasing. The devices and solutions of the home automation systems being built are most often based on IEEE 802.11g Wi-Fi communication, whose operation depends on the level of the wireless signal and is characterised by high latency. The use of communication based on the Inter-Integrated Circuit (I 2 C) protocol in the control of home appliances significantly reduces the cost of building the system. The aim of this paper is to analyse, compare and identify the most optimal solution for home automation based on I 2 C transmission. The analysis covers commercially available systems for simply and cheaply increasing I 2 C transmission for the smart home.


INTRODUCTION
A protocol is a standardised way of communicating between computers, network devices or a computer and terminals, capturing the rules and procedures for accessing the cabling system. The network communication protocols that have been developed thus serve the purpose of computers communicating with each other and the efficient and reliable transfer of data. In network communication, the most widely used protocols are TCP/IP (Transmission Control Protocol), UDP (User Datagram Protocol) and ARP (Address Resolution Protocol). These present approaches to the problem of efficient and effective data delivery over a transmission medium susceptible to interference, such as cables or Wi-Fi [1].
The devices and solutions for building home automation systems are mostly based on IEEE 802.11g Wi-Fi communication, which depends on the level of the wireless signal and is characterised by high latency. The use of wired communication significantly increases reliability, speed and reduces the cost of building a system in the home. The Inter-Integrated Circuit (I 2 C) protocol includes almost every modern processor and mini-computers used for smart home management [2].
There are currently several communication protocols that are used in communication and industrial and home automation. The most common communication protocols should be noted. The CAN (Controlled Area Network) bus was developed in 1981 for the automotive industry and in 1985 electronic circuits were developed to implement CAN transmission in many industries. CAN is a very popular communication protocol in which the main objective is not high transmission speed, but high noise immunity through the use of hardware-based protocol handling and error control. Communication between modules reaches speeds of up to 1 Mbps and is a two-wire, half-duplex network. Each subsystem of the network is a peer, initiating the transmission. It is excellent for communication between sensors, controllers and recorders. The Profibus FMS (Fieldbus Messaging Specification) communication protocol was developed at the end of the 1980's and is designed for mutual communication on the control level of PLC central units and PCs. In 1993, a simple and fast Profibus DP (Decentralised Periphery) protocol was developed for RS-485 transmission technology, which is now available in three versions: DP-V0, DP-V1 and DP-V2. The first two allow cyclic and acyclic data exchange between master and slave stations. DP-V2 allows slaveto-slave communication in isochronous mode. This protocol is used for communication between controllers, sensors, actuators and other devices, which can come from a number of manufacturers. Together with other systems, PROFIBUS is now part of IEC 61158 and IEC 61784 standards.
The Modbus protocol was designed in 1979 for communication between multiple devices over a twisted pair of wires. It is a master-slave protocol and allows bi-directional communication of up to 248 devices, connected within the same network. Only one master can be present in a Modbus-based installation, while no more than 255 slaves can be connected. The role of master can be played by a PLC, DCS system (distributed modules), RTU (remote terminal) or PC. In RTU mode, the message data is stored in binary code, while in ASCI mode, it is stored in characters. This solution is ideal for use in RS232 and RS485 transmission, with transmission rates of up to 115 kbit/sec. IP (Internet Protocol) -Internet layer communication protocol in the TCP/IP model (Transmission Control Protocol/Internet Protocol), in which data is sent in the form of blocks of socalled packets. The IP protocol is unreliable, as it does not guarantee that packets will reach their addressee, that they will not be fragmented or duplicated, and that they may reach the addressee in a different order than they were sent.
In the IP protocol, each computer has a 4-byte Internet address, assigned by the Internet provider. A so-called subnet mask is used to identify the computer's place in the network. When communicating with another device, a test is performed that zeros the bits in the computer's address in place of the zero in the subnet mask. The reliability of data transmission is ensured by the transport layer protocol TCP (Transmission Control Protocol). During data transmission, TCP establishes a connection between the communicating parties by initiating a so-called session, in which the recipient acknowledges receipt of each message in the same order in which they were sent.
One wire -a communication protocol in which transmission takes place in a master-slave configuration. The master searches for and addresses the slave, controls the data flow and sends the clock signal. Data is transmitted synchronously at a maximum speed of up to 16.3 kbps. Data transmission in the One wire protocol strictly adheres to the values of the time slots (lasting for a strictly defined period of time) for reading and writing.
The synchronous serial interface I 2 C is used for communication with various sensors, memory chips, digital switches, LCD displays, etc. The data transfer rate is not high, reaching up to 3.4 Mbps in fast mode and mostly 100 kbps. The connection of the synchronous serial interface interintegrated circuit is realised via two signal lines: SDA (Serial Data Line), which is responsible for data transmission, and SCL (Serial Clock Line), which is responsible for clock timing. The problem of I 2 C transmission is interference and errors due to the lack of a CRC error correction mechanism in the inter-integrated circuit protocol, so that erroneously received frames cannot be corrected [3].
The chips have the option of operating in either master or slave mode. The master chips take control of the bus, managing the data transmission, i.e. initialising the connection, terminating it and setting the timing. The slave chips are selected by the master. The length of the data frame is 8 bits. Data is transmitted byte by byte in order from the most significant bit to the least significant bit. After 8 bits have been transmitted in one direction, an additional ACK data receipt acknowledgement bit is transmitted in the opposite direction. The standard assumes 7-bit device addressing, allowing up to 128 devices to be connected.
A significant limitation of the I 2 C bus is its maximum line capacity, which in practice limits its length to a few metres. The other data bus systems mentioned above, such as CAN or MOD-BUS, for example, offer more extensive transmission, but the I 2 C bus is much simpler and cheaper to implement. There are many systems on the market that use and are very useful when building, for example, a smart home system. These include, for example: PCF8574 -lead expander; DS1307 -RTC clock; BMP280 -temperature and pressure sensor; AHT10 -pressure and humidity sensor; HT16K33 -LED driver; INA219 -current, voltage measurement circuit; MCP4725 -DAC converter. There are a number of ready-made, free libraries available for all of these circuits, making it relatively simple to write code for a working program to support these circuits [3,4].

RESEARCH METHODOLOGY
Of the commercially available ICs for the inter-integrated circuit transmission enhancement analysis, several were preselected based on availability, price and manufacturer data, shown in the Table 1. Due to the prevalence, availability and price of the chips, four popular chips were selected for fi nal analysis.
The prepared algorithm sent data from the Arduino transmitting chip to the receiving chip, showing errors and blocked transmission. The test was carried out on sections of 3, 5, 10, 25, 50 and 300 m of Cat5e copper cable in the direct presence of YDYp 3x1.5 mm electrical cable for each of the analysed circuits at transmission frequencies of 100 Hz and 400 Hz. The electrical cable was loaded with a 100 W and 2.2 KW induction device. Since switching on the 2.2 KW induction motor caused a lot of interference, the cable was limited to being loaded with the 100 W device [5]. Table 2 below shows the results obtained. It includes the manufacturer's transmission distance data, the data obtained on the analysed cable lengths with the 100 W device.

RESULTS
Based on the I 2 C protocol specifi cation, a maximum line capacitance of 400 pF is required at standard baud rate (100 kHz). The typical capacitance of a Cat5e cable is 50 pF/m, so the theoretical range of the I 2 C bus is about 7 metres. Practice shows that after about 5 metres, transmission errors can already occur. On an oscilloscope, it can be seen that already after a few metres, the rise time of the signal edge increases signifi cantly and the rectangular waveform of the SDA signal changes into a saw-tooth waveform ( Fig. 1 and Fig. 2). This is due to the parasitic capacitance of the line and the reduced maximum current required to step down the supply line voltage. The standard stipulates a maximum line current of 3mA, so pull-up resistors must not be less than 1.8 kΩ.
In view of this, the use of Inter-Integrated Circuit (I 2 C) transmission for the construction of the smart home requires increased transmission and the exclusion of interference and errors.
The Arduino transmitting and receiving circuits do not communicate over distances as short as 3m, pull-up resistors must be used. For the purpose of testing, 3 kΩ resistors were used. In laboratory conditions, the I 2 C protocol worked at a maximum distance of 8 m cable at 100 kHz,   Table 2 allow us to conclude that the I 2 C protocol at frequencies of 100 kHz and 400 kHz is not resistant to interference at all. Even at a distance of 3 m, sporadic interference was observed at 100 kHz. An inductive device operating in close proximity causes interference and suspension of transmission at any cable length. The solution is to use a transmission enhancement circuit. As we can see, the data in the Table 2 indicate that, despite the manufacturer's data, transmission errors are observed on each length of the Cat5e cable of the B82B715 and LTC4311 circuits.
The use of the PCA9615 chip ensured correct transmission over a distance of 5 m at 100 kHz. However, the PCA9600/TJA1051T chip analysed was the most resistant to interference, with correct transmission achieved over a distance of 25 m.
It should be emphasised that the correctness of transmission for all the systems analysed occurs at a minimum of 15 cm from electrical cables and appliances at 100 Hz and at a minimum of 20 cm for 400 Hz. Therefore, when building smart homes, twisted-pair cables should not be laid in the immediate vicinity of electrical cables and domestic appliances, but at a minimum distance of 15 cm, which guarantees the correct operation of the protocol using transmission enhancement circuits of I 2 C.

CONCLUSIONS
One way to increase the range of the interintegrated circuit bus is to use the P82B715 buff er from Texas Instruments. This is a very low-cost and simple circuit that increases the line pulldown current I 2 C to 30 mA increasing the transmission range to 20 metres, according to the manufacturer, and helping to reduce susceptibility to interference. Similarly, the LTC4311 chip acts as an active current source pulling up the SDA and SCL lines.
The next way to increase the range of the I 2 C bus is to use diff erential transmission. A chip that has an integrated diff erential transmitter and receiver is NXP's PCA9615 chip. An alternative to this chip is to use a PCA9600 chip that 'splits' the Table 2. Transmission results for individual systems and transmission cable lengths bidirectional I 2 C signal into two separate unidirectional transmission paths and two TJA1051 chips that act as a differential transmitter and receiver.