Comparison between Arduino based wireless and wire methods for the provision of power theft detection

ABSTRACT


Introduction
In Libya, power theft is a common problem, which results in loss of electrical. The general electricity company of Libyan (GECOL) is the solely company responsible for supplying electricity. Because of the electricity theft, GECOL is facing the frequent problems of load shedding. This power theft phenomenon is definitely needed to be decreased as much as possible. The paper is designed to overcome of this phenomenon. As the ways for stealing the electricity is European Journal of Engineering Science and Technology, 2 (4): 44-9 4 45 countless so we can never keep track where exactly the theft has occurred. The proposed system via Arduino kit will automatically calculate the real power consumption from houses or buildings in general and compare the real measured data with the assumed consumption data. The Arduino kit attached to energy meter at substation side, which is pole 1, named Master kit. The Arduino kit attached to energy meter at home side, which is pole 2, named Slave kit. The measured data will be transferred via wires from Master kit to Slave kit. The Arduino kit attached to every pole consists of Atmega328 and ACS712 module-current sensor, voltage sensor, and LCD display. The current sensor senses the amount of current that flow through the Slave kit. the sensed reading will be fed to microcontroller/Atmega328 type. Then the Arduino will calculate this sensed reading and send it to Master kit. Depending on current sensor readings at poles 1 and 2, the power theft is detected. The target of the paper is to design a system which automatically detects and control illegal connection of electricity. The simulation was done in this paper by Proteus to design and model of power theft detection and monitoring. Many studies related to electricity theft have been done. In 2013, Pandey, Gill, and Sharma proved that applied Zigbee technology to wirelessly detect the electricity theft, give high efficient and inexpensive method [1]. Moreover, in this year, Patil, Gopal, and Kirtikumar made a real time system to identify wirelessly where exactly the location of illegal tapping is done on a specific distribution line in case a theft is done by tapping.

The Idea of the Proposed System
This paper presented a wire control system that provides a solution of power theft problem by placing the system which will be constructed utilizing the Arduino UNO microcontroller. Arduino with current sensor and voltage sensor will be formed as a number of Master and Slave boards.
The proposed system was designed to detect exactly where the probable of both "the power theft" and "the excessive power usage" have occurred in a specific home. They will assist in the distinction of the illegal consumption. However, the Microcontroller will be interfaced between the energy meter and a wire communication network in order to transfer data. A signal will be sent from the consumer side to the substation side in case there is a difference in the compared values. The paper shows the technique of transferring data from Slave board, which is supposed to be connected with consumer side, to Master board, which is supposed to be connected with substation side . Actually, using a communication module to wirelessly send data is easier, more interesting, and reliable. While, sending data using wire style is less expensive. However, sending a notification message to inform GECOL that there is an additional unexpected consumption detected in that specific home or in that particular electricity pole. As a result, GECOL can ensure whether or not this detected power is authorized by the company. Consequently, the power theft once detected the procedures will be taken by the company. The Master and Slave boards consist of same components (explained in section 2). As each board has a different functionality, the difference between them is the code written in C/ C++ language. This paper will provide the analysis of three different forms of source codes with comments, explanation of how to build Arduino Code written with Arduino C, information to assist you with understanding what you need to do to communicate electronic devices with Arduino kit, and guidance to show you how to implement the simulation of the system in Proteus simulator.

Arduino UNO microcontroller
Arduino is an open-source electronics platform based on easy-to-use hardware and software. It's intended for anyone making interactive project. Arduino board senses the environment by receiving inputs from many sensors, and affects its surroundings by controlling lights, motors, and other actuators. Arduino software, you can tell your Arduino what to do by writing code in the Arduino programming language and using the Arduino development environment [8].

Atmega328:
An Arduino board consist of Atmega328 IC. In this Atmega328 IC we can implement our program [11].

ACS 712 module-current sensor
The ACS 712consists of a a precise, low-offset, linear Hall sensor circuit with a copper conduction path located near the surface of the die. Applied current flowing through this copper conduction path generates a magnetic field which is sensed by the integrated Hall IC and converted into a proportional voltage. Device accuracy is optimized through the close proximity of the magnetic signal to the Hall transducer. A precise, proportional voltage is provided by the low-offset, chopper-stabilized BiCMOS Hall IC, which is programmed for accuracy after packaging [13].
Using of ACS712 AC Module is the best solution due reliable, accuracy and simplicity of connections.
European Journal of Engineering Science and Technology, 2 (4):44-9 4 47 ACS712 has no a specific commands into the code. it give current-proportional DC voltage on A0 Arduino pin. in code this value is routine. ACS 712 has galvanic insulation low-voltage logical part from AC high voltage input . AC-DC 5V converters has galvanic insulation too. So, when ACS712 is connected to Arduino, it won't burn the Arduino kit. Arduinos, , LCDs, current sensors and voltage sensors supply take from individual DC 5V voltage sources ( do not take from AC 230 lines).

Rf 433 MHZ
The RF 433MHz Transmitter/Receiver modules with Arduino. One of its application environment is the automobile anti-theft products [9]. An RF module stands for radio frequency module. It is a small electronic device used to transmit and/or receive radio signals between two devices. The medium of this wireless communication does not require line. It is either through optical communication or through radio frequency (RF) communication [10]. It will be hard to run the RF 433MHZ module for wireless communication., but it cheap, stable and it has enough communication range.

WCS 2702 module-current sensor
The WCS2702consists of a precise, low-temperature drift linear hall sensor IC with temperature compensation circuit and a current path with 98mΩ typical internal conductor resistance. This extremely low resistance can effectively reduce power loss, operating temperature and increase the reliability greatly. Applied current flowing through this conduction path generates a magnetic field which is sensed by the integrated Hall IC and converted into a proportional voltage [14].

Power part of stand
On scheme: any low-voltage relay with enough for theft + consumer loads current.
any n-p-n transistor with enough for relay current.
-Vrplus of supply source of relay. Relay cannot be supplied from Arduino internal stabilizer because much more current is need. Also relay work voltage usually exceed 5V. In my stand I use 24V relay and consequently 24V DC current source to +Vr and GND is connected.

Relay (10A)
The low voltage side of relay is connected to Arduino as shown in next figure. Power contacts of relay connected to the main line. The high voltage side of relay has to two exits, one of its exits contact to plug, and other connected to the source current sensor. No matter which types of relay is the best because all give 10 A. They are equivalent.

Software implementation for hardware project
In this paper, we are going to discuss and compare between two techniques of data transmitting, by wire and wireless communication.

Data transmitting by wire communication:
The proposed system was designed in hardware project. The system takes power supply from the Ammeter as shown in figure1. Also because ACS712 has overheating if current exceed 10A, so I used 13A max current. If you use 30A current on my opinion ACS712 will damage. If the power = 1000 kw, 1000 kW/ 230 v = 1000W*1000/230V = 4347 A -its first 1000 kW is very big power. like power station, but not substation. So, you must to controll current by ammeter or connect lowpower load. for ex. if consumer_load_power+theft_load_power = 2.3 kW you get 2300W/230V=10A current it is safe for ACS712.
On scheme, relative to AC source. We have three electrical circuits (Master, Slave, and Theft Circuits):

The Master Circuit:
The Master circuit contains AC input top, source current sensor, relay and LCD. Relative to AC source, it's serial connection of components.

The Slave Circuit:
The Slave circuit contains AC input top, source current sensor, consumer lamp, and LCD. Relative to AC source, it's serial connection of components.

The Theft Circuit:
The Theft circuit contains AC input top, source current sensor, tumbler switch, theft lamp, source current sensor, relay, and ac input bottom. Relative to AC source, it's serial connection of components. If we received 5 times in a row current exceeding we make conclusion theft=true.  Also you may use your own scheme lcd connection but you must change pin configuration in Master Arduino and Slave Arduino sketches.

Connection of consumer Arduino to source Arduino by 3 wire connection:
A4 pin to A4 pin, A5 pin to A5 pin, GND pin to GND pin.

The source code of Master kit for wire communication:
Here, we just calculated and compared the current values between Master and Slave. The instructions that have been used in the code of Master board for wire communication are:
Wire.read (); // receive a byte as character.  1); } // If we received 5 times in a row current exceeding we make conclusion theft=true. You can put any number instead of number 5. The greatest value you put the great reliability you achieve, low value reduces the response time. We have AC current, that have a sine form. so, for measuring we must integrate current for few current periods. RMS AC CURRENT = 1/number of measuring*sqrt( (i1)^2 + (i2)^2 + (i3)^2 + ...). Now we use " String consumer_current_str = ""; ", because I2C wire connection transmit char-type data.
bool theft=false; // because it bool-type data. We can use char instead of bool, , but some code rewriting is need. ACS712 has a some measuring error and sometime source_current>consumer_current for no theft mode is occurred , so if we will do theft=true conclusion from one measuring we will often get wrong result. so I did also so: we calculate amount of source_current>consumer_current event and if that more some threshold value theft=true conclusion is do. (0,4));} lcd.setCursor(5,1); print A; // if consumer_current<10, (ex. 9.81 A), then 4 symbols is needed. So by substring(0,4), get first 4 symbols, then print 9.81. else{ lcd.print(((String)source_current).substring(0,5));} // else, for ex. 20.31 A -5 symbols is needed. So substring(0,5) -get first 5 symbols, then print 20.31.

Data transmitting by wireless communication:
The proposed system was designed in Proteus version 8.6. the system takes power supply from the main distribution line as shown in figure 9.

Interfacing devices with Arduino:
The system detects the theft whenever is occurred. It is supposed that at substation side which is pole 1 there is Arduino kit named Master board, and at consumed side which is pole 2 there is Arduino kit as well named Slave board. Transferring data from Arduino at pole 2 to Arduino at pole 1 through modulo RF 433 MHZ modules. Figures 10 and 11 show the Simulation results of both Master and Slave Board respectively. For best accuracy it will be more correct to use external ADC module (it has greater resolution than in-build arduino ADC). In the proposed system there are two potentiometers and switch:  Switch 1 "SW1" for switching power line regime (theft or no theft).  First Potentiometer "Consumer" for adjusting consumer current consumption.  Second Potentiometer "Theft" for adjusting theft current.
The internal resistance of potentiometer is equal it full resistances (500 Ohm) * percent. From the last figure, it can be clearly seen that voltage drop across a 98 mΩ resistor (its equal to wcs2702 internal resistance) and amplifying the signal to the levels specified in the data sheet for the wcs2702 module [13].

The simulation of the power theft detection circuit:
Here, in Proteus simulation, Arduino at pole 1 will calculate electricity theft and transmit data via the UART interface to the UART-terminal embedded in the Proteus as shown in figure 12. When developing a real project (in hardware), the UART interface easily connects to a computer COM port or USB port through USB-RS232 adapter.

Results of The simulation of the power theft detection circuit:
In normal condition (no theft) ( Figure 13) consumer part send to source part information about own current consumption and source part compared it with own measured line current. As far as this data is similar, no power theft signal is generated. Also model has a program over current protectionif consumer current is greater than current limit of wcs2702 module, then it shows on LCD display (Consumer current: MAX, Source current: MAX) as shown in figure 14. In power theft mode ( Figure 15) Source part is detected consumer and source currents mismatch and generated power theft signal on Proteus terminal by UART interface.  ((source_current-previous_source_current  >  0 ? source_current previous_source_current:evious_source_current-source_current) < source_current*0.03) // it means further code will do if measured source current equal previous measured source current +/-3% . It needs because consumer and source parts work is asynchronous and if model work conditions are changed and new consumer current will compare with previous source current it be miscalculation. So currents comparing provided when current doesn't change and so system work condition is stable. +/-3% because there is ADC conversion error.

Conclusion
A wired connection uses cables to connect Arduino uno kit with devices was used to carry either digital or analogue signals from one end to the other. While a wireless connection uses Proteus simulator to connect Arduino with devices was used. There are differences between the wire and wireless connection between the Master and the Slave boards. The differences in data transfer between the two boards are clearly shown in the microcontroller programming. In wire connection we needed to use wire library, commands and functions related wire data sending and receiving including join i2c bus, register event, ADC result for current, requesting address from consumer Arduino, Sending consumer current to source part Arduino, minimizing the measurement error produced by ACS712, receiving a byte as character, protection from ADC convert error, and finding current value from ADC value. However, in wireless connection we needed to use wire library, commands and functions related wire data sending and receiving including tx and rx modules declaration, error response protection, storing system time on beginning, receiving data from Slave board, reading the ADC data, then converting it to source current, and protection from ADC conversion error. This paper is the fourth fact paper in a series of papers.