Automatic Load Sharing and Control System Using a Microcontroller

: Power failure is a short or long term loss of electric power to an area mostly cost cause by short circuit, damage to electric transmission line, overvoltage, faults at power stations and more commonly failure due to overloading. The possible damage areas are affected by losing power. The one inherent problem with standard power sharing and monitoring units is their broadcast strength. Since you have to be physically close to the alarm to hear it, you might not get notified in time to actually prevent overload. The microcontroller based load sharing and control system is a device that automatically controls overload on a generator by sharing power and cut off supply once the power consumption exceeds the amount of power supplied. The control system for controlling the AC loads will be selected within a power range of 500W. This is achieved by using a microcontroller PIC16F877A to automatically detect an overload and subsequently cut off supply. The method used in the project provides necessary stages from overload detection to switching/cutting off supply. The main aim of the work is to provide a non-interrupted power supply to the energy consumers. By implementation of this scheme the problem of interruption of supply due to generator overloading can be avoided. The work was fairly successful and there liability level expected is commendable as this may also create room for improvement. The project was tested and observed that it cut off supply as soon as the microcontroller senses an overload on the system by the user.


Introduction
Electricity is an extremely handy and useful form of energy. It plays an ever growing role in our modern industrialized society. The electrical power systems are highly non-linear, extremely huge and complex networks [1]. Such electric power systems are unified for economical benefits, increased reliability and operational advantages. They are one of the most significant elements of both national and global infrastructure, and when these systems collapse it leads to major direct and indirect impacts on the economy and national security [2]. This makes one to realize that if load is increasing rapidly and power generation is constant then it is not possible for the system to drive the future needs. For this reason distributed power generations is receiving an attention of the researchers around the globe to be used in remote and rural areas [3].
A power system consists of components such as generators, lines, transformers, loads, switches and compensators. However, a widely dispersed power sources and loads are the general configuration of modern power systems. Electric power systems can be divided into two subsystems, namely, transmission systems and distribution systems. The main process of a transmission system is to transfer electric power from electric generators to customer area, whereas a distribution system provides an ultimate link between high voltage transmission systems and consumer services. This generator can supply important domestic or industrial loads during power shortages. One problem facing generator usage is overloading by consumers which affects the efficiency of the generator. To improve the quality of power with sufficient solutions, it is necessary to be familiar with what sort of constraint as occurred. Additionally, if there is any inadequacy in the protection, monitoring and control of a power system, the system might become unstable. The problems of overloading, voltage variation and heating effects are very common. It takes a lot of time for its repair and also involves lot of expenditure. This work is all about protecting the generator from overload condition. Therefore, it necessitates a monitoring system that is able to automatically detect, monitor, typify and classify the existing constraints on the generator. The introduction of the power sharing and monitoring unit will help to protect the generator against overload by different consumers and automatically disconnect the consumer when the load exceeds the maximum power demand to the particular consumer. Many attempts have been made to design a load sharing and control for power system. Some similar works were reviewed. P. Biczel et al worked on control unit for power sources and load [4]. Similarly B. Enayati et al presented a model for control of power flow for autonomous micro grid operations [5]. Abhishek G. et al proposed an Automatic Transformer Distribution and Load Sharing Using Microcontroller in which a number of transformers were operated in parallel in order to avoid overloading. It is same like parallel operation of transformers where the number of transformers shares the system load. In the suggested approach slave transformers will share the load when the load on the main transformer will rise above its rated capacity [6]. J. Liangand Q. Zhong also presented a control technique for voltage source inverters connected to microgrid, but this requires information of impedance which degrades its reliability [7].
The review of these work shows their limitations of lack of functionality. A standard device control system which require no human effort is yet to be constructed. This can be achieved through the use of a Microcontroller which is very flexible and few components are used due to the fact that most of the work is soft ware based. The Microcontroller used in this project is Peripheral Interface Controller (PIC16F877A) due to its obvious advantages. The one inherent problem with standard power sharing and monitoring units is their broadcast strength. The main aim of the proposed scheme is to design and construct a microcontroller based load sharing and control system which serves to distribute the power to the consumers and protect the electrical power supply against overload. The control system will be design for controlling an AC loads within a selected power range at 500W that can efficiently and automatically read the load current and disconnect the load when overload is detected. And also to construct the system that controls the load power test within a range maximum at dual 500watts.

Methodology
The design of the various units of the system built up, the theory of operation of the devices used and their operations are considered. The design is based on the availability of the components for the system realization. The overall system consists of five modules as shown in Figure 1. The power unit supply is regulated dc of +5v to the circuit by the use of a transformer, rectifier, filter capacitor and regulator IC7805 to keep the dc at +5v for the remains of the circuit. The second stage is the sensing unit. This unit uses a current transformer to monitor the load current at a maximum 3A load. The current transformer serves to convert the load current in equivalent AC voltage; the diode rectified the AC voltage into pulsating DC and the filter capacitor remove the AC ripples. The resistors serve as a voltage divider for analogue digital converter (ADC) input to the PIC16F877A. While the potentiometer is used in selecting the maximum power for the load demand. The third stage is the control unit. The control unit act to activate the whole output, when detect the load current from sensing unit, the Microcontroller PIC16F877A employs to perform the operation of the project, whereby it will act as a central controller of the entire project circuit. The fourth stage is the load control unit. This unit serve to control the AC load, disconnect the overload occur and connect the load within the range. The transistor acts as a switch there for driving the AC load. The final stage is a display and alarming unit. The unit displays the operational result of the project, and alarming circuit for alerting when overload occur. The display unit uses a liquid crystal display while alarming unit uses a buzzer.  Most electronic devices required AC voltage to operate. Therefore, batteries are very useful in low power or portable devices but the operating time of such devices is limited unless the batteries are recharged or replaced constantly. The more readily available source of power is the 50Hz, 240VAC outlet. Where a DC voltage is required, a dc power supply circuit may be employed to convert the AC voltage to a DC voltage. A voltage regulation may be in corporate in a power supply circuit in order to eliminate the variation of power supply voltage with changing input current. A typical arrangement for dc power supply is shown bellow in Figure 2 [8].
i. Transformer Selection In considering transformer selection, the maximum and minimum values of operating voltage and current are important. The supply from mains considered is 220V-240V at 50Hz as in Figure 3. To calculate the power ratings of the transformer to the maximum current that will flow in the system at full load was estimated as shown in Table 1 using the specified current rating for each component from data sheet.  ii. Rectifier Selection When selecting a rectifier, the peak inverse voltage (PIV) is considered. The PIV is the maximum voltage that occurs across the rectifying diode in the reverse direction.
From the transformer secondary: V rms= 12V Root mean square voltage from secondary terminal of transformer is; PIV=16.97V The peak value of current that the diode must be able to pass safely with resistance load I peak is; IN4001 diode with the following specifications was selected from the data sheet and used. The complete rectifier circuit is shown in Figure 4.
Average rectified voltage V RWM =50V Output current=1Aat75°C iii. Filter Capacitor Using a ripple factor of 4% for high current √ To find the value of the capacitor, .

C=1404µF
The standard value of 2200µF was selected from datasheets.
The voltage across the capacitor is iv. Voltage Regulator To maintain a constant output level, a voltage regulator is needed at the output of the filter. IC7805 voltage regulator integrated circuit was used. It is a member of 78xxseries of fixed linear voltage regulator ICs. The 7805 provides +5V regulated power supply. The complete circuit diagram of the power supply unit is shown in Figure 5.

Microcontroller Design
The PIC (Peripheral Interface Controller) is the IC which was developed to control peripheral devices, alleviating the load from the main CPU Compared to a human being, the brain is the main CPU and the PIC is equivalent to the autonomic nervous system. The PIC source code was developed and debugged using the MIKRO C program. The Load control unit uses a potentiometer of 5kΩ to control the ADC input of the PIC16F877A to regulate the amount of power consumed by the load as shown Figure 6. The ADC input read the analogue voltage from potentiometer at 10mV scale at 10w duty cycle across the output of PIC16F877A. PIC (Peripheral Interface Controller) is the IC which was developed to control peripheral devices, alleviating the load from the main CPU Compared to a human being, the brain is the main CPU and the PIC is equivalent to the autonomic nervous system. The PIC, like the CPU, has calculation functions and memory, and is controlled by the software. Depending on the kind of PIC, the maximum clock operating frequency is about 4MHz and the memory capacity (to write the program) is about 1K to 4Kwords. The control unit is mainly the PIC16F877A microcontroller IC and most of it values for the design were gotten from the data sheet except in some few cases.

Automatic Load Control
This unit controls the load under normal condition by using an NPN transistor, dc relay and diode D1-2 acted as a free wheel diode for protect against back electromotive force (emf) to the circuit as shown in Figure 7. A general purpose medium power BC547 (BJT) transistor was used for this design and it has the following specifications from datasheet The areas of operation for a transistor switch are known as the Saturation Region and the Cut-off Region [9]. This means that we can ignore the transistor in the active biasing operating region and use the transistor as a switch by driving it back and forth between its "fully-OFF" (cut-off) and "fully-ON" (saturation) regions. In the Cut-off region the input and Base are grounded (0V), Base-Emitter voltage V BE <0.7v, Base-Emitter junction is reverse biased, Base-Collector junction is reverse biased, no Collector current flows (I C =0) i.e V OUT= V CE= V CC= "1″ therefore the Transistor operates as an open switch. In the Saturation region, the transistor will be biased so that the maximum amount of base current is applied, resulting in maximum collector current resulting in the minimum collector emitter voltage drop which results in the depletion layer being as small as possible and maximum current flowing through the transistor. The input and Base are connected to V CC , Base-Emitter voltage V BE >0.7v, Base-Emitter junction is forward biased, Base-Collector junction is forward biased, maximum Collector current flows (I C =Vcc/R L ) and V CE =0 (ideal saturation), V OUT =V CE ="0″ therefore Transistor operates as a "closed switch" [10]. =5162.64Ω≈5.1KΩ (9) A standard value of 5.9 KΩ resistor was used for R=R5=R6.
The automatic load control unit consists of the display and buzzer unit.   Table 3 shows the buzzer standard specifications at normal operating condition.
A standard value of 1.5K resistor and circuit is shown in Figure 8.

Interfacing Lcd to Pic16f877a
Depending on how many lines are used for connecting an LCD to the microcontroller, there are 8-bit and 4-bit LCD modes. The appropriate mode is selected at the beginning of the operation in the process called 'initialization'. The 8-bit LCD mode uses outputs D0-D7 to transfer data. The main purpose of the 4-bit LCD mode is to save valuable I/O pins of the microcontroller. Only 4 higher bits (D4-D7) are used for communication, while others may be left unconnected. Each piece of data is sent to the LCD in two steps-four higher bits are sent first (normally through the lines D4-D7), and then four lower bits. Initialization enables the LCD to link and interpret received bits correctly. Figure 9 shows LCD interfaced PIC16F877A.
In applications where great time precision is not necessary, Crystal oscillator offers additional savings during purchase. The standard crystal oscillator gives an accurate frequency and in this case 4MHz crystal was used in micro controller in order to get internal frequency of 1MHz. The4MHz crystal oscillator was chosen is shown in Figure 9. The diagram shows how XT oscillator is connected with PIC16F877A. A clock of the oscillator must be divided by four. Oscillator clock divided by 4 canals to be obtained on OSC2/CLK OUT pin, and can be used for testing or synchronizing other logical circuits.

Testing and Results
This section deals with the testing, evaluation and assembling of components in relation to the design circuit. In order to verify the correct functionality of the system, all components were tested individually and each of the sub unit was build on the board and monitored before it was finally transformed to main construction board. This was done in order to verify its workability. The entire circuit was arranged logically according to design specification.
The project was implemented using suitable component obtained from the design. The complete circuit diagram of the automatic load sharing and control system is shown in Figure 11. The Peripheral interface controller (PIC) 16F877A is used to suit the design. This was selected base on the function it performs and the number of pins it has. The written program was burned into the PIC. Also current transformer was wound of the required number of turns obtained from the designed to suit the design. Power supply of 5V was also design for powering the circuit. The component was first tested on the breadboard before transferring the Vero board for the soldering.

Discussion
Here the regulated power supply of the system was tested to ensure that the desired 5VDC was produced and how regulated the output was. Table 4 shows the result obtained from this unit. The power was set to 90W for each load and when the voltage and current were measured for load 1 and load 2, the result obtained is tabulated in table 5 and 6 below: The results of the various tests performed above suggested that the system sub-units are effectively designed and when coupled will give a satisfactory result as with regard to the system as a whole. From the load test performed above, it was found that when the power consumed by the consumer exceeds the power supplied, the system automatically disconnects the consumer. Solution is also simple and cost effective as it is using simple micro controller. The presented results clearly show the effectiveness of the proposed methodology.

Conclusions
The proposed work provides an efficient way for load sharing and control at real time. The micro controller based load sharing and control system is a system designed specifically to monitor over load on generator. The design scheme consists of dual load system capable of supplying 500w load maximum each. This was achieved by the use of some solid state components like micro controller, transistors, LCD display, resistors and relays. The method used in the project provides necessary stages from overload detection to switching/cutting off supply. The work was fairly successful and there liability level expected is commendable as this may also create room for improvement. The project was tested and observed that it cut off supply as soon as the micro controller senses an over load on the system by the user. In future the work can be modified by using switch gear to monitor high power load. The micro controller program can also be modified to store or long the time, at a particular period (e.g. weekly, or monthly). The power supplied to each load can be modified to be more than 500w to accommodate higher power demands.