Masudul Haider Imtiaz et. al. / International Journal of Engineering Science and Technology Vol. 2(12), 2010, 7518-7523
DESIGN OF MCU BASED UNIVERSAL POWER ADAPTER FOR UTILIZING PHOTOVOLTAIC ENERGY MASUDUL HAIDER IMTIAZ*, ZAMSHED IQBAL CHOWDHURY, MUHAMMAD MOINUL AZAM, MST.RUMANA AKTAR SUMI Department of Applied Physics, Electronics & Communication Engineering, University of Dhaka, Bangladesh
[email protected]*
MD.ISTIAQ MAHBUB, NAFISA SHAHERA NUR Department of Electrical & Electronics Engineering Ahsanullah University of Science & Technology
Dhaka, Bangladesh
[email protected] Abstract: This paper demonstrates design and implementation of an improved power adapter that can be used with AC main supply as well as photovoltaic power supply by means of DC. This adapter takes input from both ac main supply and dc supply and gives an output of adjustable voltage over a pre-defined range. Whenever the adapter is fed from both the supplies, it makes a decision and takes feed from only one input based on pre-defined preference. The whole system is built around a MCU (Microcontroller Unit), which monitors all the operations and takes decision. The output voltage and system feed status are shown numerically on a display for users. Keywords: Adjustable output regulator; display; PIC 16f72; relay; universal adapter.
1. Introduction Sometimes, it becomes very important to use utility devices when there is no source of main power supply. Even if there is alternative energy source present such as photo voltaic cells, charged batteries etc. that can produce electricity, it cannot be used due to lack of adaptability of interface. In this paper, a power adapter is designed so that both kinds of power supply can be utilized to power any device. When there is only DC (Direct Current) input is present, the adapter serves the output from the DC input and when there is only AC (Alternating Current) input present, the adapter supplies from the AC input. However, when both the input is active, it prefers the DC input over the AC input and takes in only DC. A microcontroller is employed to execute the algorithm and to perform the monitoring operations. Fig. 1 shows the block diagram of the total system. AC supply input is taken through a switch, which is controlled by a MCU (Microcontroller Unit). Then the input is fed to a step down transformer and the output voltage is fed to a full wave rectifier with a capacitor smoothing circuit. After the rectification process, the rippling DC is given into the input of an adjustable output voltage regulator. DC supply input is taken through a threshold detector to ensure proper voltage level for adapter. The output is fed to the adjustable voltage regulator. The final output is feedback connected to the microcontroller. The microcontroller monitors the final output voltage and shows it numerically on a display so that user can set the voltage as desired. The final output is feedback connected to the microcontroller. The AC switch is ON by default. When there is a DC supply present with proper voltage level, the microcontroller turns OFF the AC switch and takes feed from only the DC source. The users can control the output by a variable resistor from outside the circuit. This adapter is designed to prefer the use of Photovoltaic power over grid supply. If there is no sunshine and AC grid supply is present, the adapter will connect the output to the grid supply. But when there is enough sunshine, it will make use of the solar power.
ISSN: 0975-5462
7518
Masudul Haider Imtiaz et. al. / International Journal of Engineering Science and Technology Vol. 2(12), 2010, 7518-7523
Fig.1. Adapter block diagram
2. Working Circuit The working circuit is divided into mainly 4 sections namely AC, DC, regulator sections and microcontroller section. These sections deal with the corresponding processing circuitry. AC section consists of a relay, a transformer, a full wave rectifier and voltage smoothing circuit. DC section consists of a threshold detector circuit. The regulator section is a voltage regulator IC with associated circuitry. MCU controls switching action and monitors output voltage. 2.1. AC Section This section is shown in the Fig.2. It has the following parts: Relay: It is a SPDT (Single Pole Double Throw) relay used as the AC switch. Transformer: It is a 220 V to 9V step down converter. Full wave rectifier: The rectifier is a bridge rectifier made by connecting four silicon diodes in special configuration. It produces pulsating DC. Smoothing circuit: The smoothing circuit is consists of a surge current limiter resistor, a load resistor and a capacitor. The AC main supply is connected to the NC (Normally Connected) pin of the SPDT relay and the NO (Normally Open) pin is connected to ground. The common pin is connected to the transformer primary. 2.2. DC section It has an intelligent section i.e. threshold detector circuit is built with LM 324 which is a quad - comparator IC. On the positive input 4.25V is applied which is the reference voltage and the negative input is connected with the DC supply. 2.3. Regulator Section The regulator section is consists of an adjustable output regulator IC LM317 and other circuit elements. This section is shown in the Fig.3.
Fig.2. Schematic of AC section
ISSN: 0975-5462
7519
Masudul Haider Imtiaz et. al. / International Journal of Engineering Science and Technology Vol. 2(12), 2010, 7518-7523
Fig.3. Schematic of regulator section
2.4. Microcontroller & the Display Section The microcontroller IC used in this adapter is a PIC IC PIC 16f72 from Microchip Corporation. It has 10-bit A/D converter unit, two 8-bit digital ports and 5 A/D input channels. The LCD display data pins are connected to the PORTC. LCD control pins (RW, RS and EN) are connected to RB7, RB6 and RB5 respectively. The feedback voltage, the threshold detector circuit output and AC switch are connected to RA0, RB0 and RB2 ports of the MCU respectively. The pin diagrams are shown in Fig.4. 3. Circuit operation The total circuit operation is divided in four sections: 3.1. AC section When a DC input is absent, the microcontroller connects the AC input line to the transformer through the relay switching. The transformer takes an input of 220V and outputs a lower voltage of 9V-12V. A full wave rectifier rectifies this voltage and the rectified pulsating DC voltage is smoothed by the action of an R-C circuit. The value of R and C is obtained from design procedure. RS is for limiting the surge current. The smoothed DC is then applied to the regulator input. 3.2. DC section When a DC input is equal to or higher than the reference voltage, the comparator generates a HIGH pulse that signals the microcontroller. The microcontroller then outputs a HIGH that turn on the BJT (Bipolar Junction Transistor) which in turn energize the relay and connects the AC section to the ground thereby disconnecting from the AC supply. The DC input is applied to the regulator input. The regulated output voltage is then due to DC source.
Fig.4. Schematics of Microcontroller, display & DC sections
ISSN: 0975-5462
7520
Masudul Haider Imtiaz et. al. / International Journal of Engineering Science and Technology Vol. 2(12), 2010, 7518-7523 3.3. Regulator Section Both the voltages from DC and AC circuits are applied to the input through individual diodes. The diodes D1 and D2 serve to protect the corresponding circuits from the active one. The reference voltage on the ADJ (Adjust) pin of the regulator IC LM 317 is 1.25V [1]. The regulated voltage appears across resistors R1 and R2. As the voltage across R2 is same as the reference voltage, the output voltage can be regulated within a range of 1.25V-37V by changing the R1 value. Co improves the transient response of the regulator and ensures AC stability, and Cadj improves the ripple rejection ratio [2]. 3.4. Voltage feedback and display section The regulated voltage output is connected back to an input pin of the microcontroller IC. This pin takes in the regulated analog voltage and A/D converts it, and finally shows the output voltage numerically on a LCD display. 4. Design Procedure This section includes the calculations associated to the Adapter. First the calculation of the capacitor smoothing circuit and after that adjustable voltage design is presented here considering [3]. Measured Capacitor and resistance were prompt to use in practical circuits. The bridge rectifier output is shown in the Fig.5. 4.1. Capacitor smoothing circuit design Here, AC main frequency, f = 50Hz period, T = 0.02 sec Θ1 = Sin-1 (E0(min) / E0(max)) = Sin-1 (8.5V/9V) = 70.81o Θ2 = 90o – 70.81o = 19.19o t2
= (Θ2 T/360o) = 0.001066 sec
t1
= (T/2) – t2 = 0.01 – 0.001066 sec = 0.008934 sec = 8.394 ms
Load resistor is assumed to be 500Ω. Then, the load current is IL = E0(avg) / RL = 8.95V/500 = 17.9 mA
Figure 5: Ripple voltage, waveform angles and time periods for a full wave rectifier with capacitor smoothing
ISSN: 0975-5462
7521
Masudul Haider Imtiaz et. al. / International Journal of Engineering Science and Technology Vol. 2(12), 2010, 7518-7523 Hence, C = IL t1/ Vr = IL / 10% of E0 avg = 17.9 mA* 8.394 ms / 10% of 8.95 V = 167.88 µF. 4.2. Adjustable regulator design The current through R2 is I1 which is assumed to be = 1 mA. And the reference voltage is 1.25 V. Thus the value of R2 = 1.25/1 mA = 1.25 KΩ. Now, if the required output voltage is 2.00 V, then the value of R1 = 2.00V – 1.25V/ 1 mA = 750 Ω. Again, is the required voltage is 37V, then the value of R1 = 37V -1.25V/ 1 mA = 35.75 KΩ. The value of Cadj and Co is assumed to be 10µF and 1µF respectively [1]. A potentiometer of 100Kohms was used for convenience. 5. Charge Controller Unit Utilizing MCU composed of PIC 16f72 this adapter has some advanced feature like charge controller unit that has the capability of exact voltage level sensing and charging current controlling ability that is not described in this paper. Based on these criteria, this adapter could be used in any kind of home and business applications. MCU unit may be utilized to extend the battery lifetime and MPPT section [2] might be implemented that is left open for the future. 6. Software The switching action between AC supply and DC supply is performed by the MCU which is chosen to be PIC 16f72. To execute the preference of selection of power supply, the MCU is loaded with a program coded using a specific algorithm. The flowchart of this program is shown in the Fig.6. Begin
Yes
Yes
AC switch closed?
DC input detected
Open AC switch No
Yes
AC switch closed?
No
Close AC switch
Monitor output voltage
Display voltage
Fig.6. Software flowchart
ISSN: 0975-5462
7522
Masudul Haider Imtiaz et. al. / International Journal of Engineering Science and Technology Vol. 2(12), 2010, 7518-7523 After the program begins, the first task is to check whether a DC input supply is present with a proper voltage level for this adapter. If yes, the microcontroller checks the status of AC switch. If the switch is closed, MCU makes RB3 pin HIGH to trigger the relay. Energizing the relay coil will result in disconnecting the AC source from the AC section. Then the MCU starts monitoring the output voltage through the feedback input and display it. Then it again checks that if the stat us of pin RB0 is still HIGH. If yes, it again checks for the status of the AC switch. If it is already open, MCU continues the HIGH state on RB3 and performs the monitoring and checking action sequentially. For DC section to remain active RB0 must remain HIGH at all times. If there is no DC input supply with proper level is present, MCU checks the AC switch to see if it is closed. If not closed, it makes a low on the RB3 and the relay connects the common terminal to the AC main input. Then it monitors the output voltage and displays it and again checks for a proper DC supply. If no DC supply detected, it checks the AC switch status. If already closed, it simply monitors the output voltage and displays it and then again starts by checking for DC supply. 7. Conclusion The universal adapter is designed keeping in mind the use of photovoltaic energy for utility purpose. When there is both AC and DC (from photovoltaic supply) are present, the DC supply gets the upper hand over the AC. By this way, it saves the consumer cost. Furthermore, this adapter supplies a range of output voltage and output current defined by using an adjustable regulator IC. Output is adjustable from outside which allows user to use a variety of utility devices such as lamp, mobile charger etc. Further works can be done on this adapter to improve performance such as the output current can be amplified to support devices of higher current ratings, availability and switching between various power outputs etc.
8. References [1] [2] [3] [4]
LM 317 Datasheet, National Semiconductor. David A. Bell, Electronic Devices & Circuits, Prentice-Hall India, Fourth Edition, pp. 582-585. IEEE Recommended practice for Utility Interface of Photovoltaic (PV) Systems, IEEE Std 929-2000, Jan. 2000. W.Xiao,N.Ozog R,W.G.Dunfold (2007). Topology Study of Photovoltaic Interface for Maximum Power Point Tracking: IEEE transaction on Industrial Electronics, vol. 54, no. 3, june 2007
ISSN: 0975-5462
7523