Step 1: The Power Section Block Diagram
The main power section is the one which is used to derive a regulated DC voltage from the mains 220 V AC input. The diagram is divided into four sections. First one is the step down section which converts the 220 V AC input into 20 V AC. This uses a step down transformer. Then second section is the rectification section which rectifies the AC component of the signal of its input. It uses a bridge rectifier. Then the signal is passed onto the third section which is the filtering section which consists of capacitors which act as a first order low pass filter and further smooths the signal. After this stage, we get a smoothened DC voltage which is ready to be interfaced to the next section which is the regulator section. Now as we have three channels for our supply output that is one variable supply channel and two others are fixed ones, so the regulator section is further divided into three sections one for each channel. The two regulator sections comprise of a fixed linear voltage regulator while the third one consists of a variable linear voltage regulator. Thus at the end, we get our three channels of power supply which goes to the output terminals.
Step 2: The Interface and Display Section Block Diagram
Step 3: Power Stage Circuit Description
Version 2 description (in addition to version 1) :
Version 2 of this power section is similar to the version 1, rather only some minor improvements were made like we have increased two more 4700uf,50V filtering capacitors, and added 100nf ceramic caps after LM7805 and LM7812 for functional stability purpose. Now earlier,we were directly feeding >25v DC to the inputs of LM7805 and LM7812 regulators which was not a good idea because the power (as heat) dissipated from the regulator is directly proportional to the voltage difference across it and current taken from the regulator, so to minimise the power dissipation, we have to minimise the voltage difference across the regulators. So we have included a series array of 1N4002 (or any general purpose diode) to make an appropriate voltage drop before it goes to the two fixed voltage regulators.So after diode D18, we will get a nominal voltage of 16v which feed the LM7812 and a nominal voltage of 10v after D26 which feeds the LM7805. Although this is not the best way to do it, you can also use a dual secondary core transformer with lower voltage at the second secondary to feed the LM7805 or LM7812.
Version 1 description :
It comprises of a step down transformer (TR1), four 6A diodes(D1-D4), regulator LM338(IC1), regulator LM7812(IC2), regulator LM7805(IC3),and a few discrete components.
A fuse of 0.6 Ampere rating is connected in series with the primary of the transformer to prevent short circuit. The step down transformer can be any with primary input of 220V AC and secondary output of 20V AC with a current rating of >7Ampere. The four diodes used are any general purpose power diode with current rating of more than 6 Ampere, example GI820, MBR750, P600, etc. A 100nF, 50V capacitor is connected in parallel to each of the rectifier diodes(D1-D4).These capacitors are mainly meant for smoothing purpose. Instead of these four diodes, one can use a single module bridge rectifier with power rating of more than 6 Ampere.
The LM338 is an adjustable 3-terminal positive voltage regulator, capable of supplying in excess of 5A over a 1.2V to 32V output range. It is exceptionally easy to use and require only 2 resistors to set the output voltage. A unique feature of the LM338 is time-dependent current limiting. The current limit circuitry allows peak currents of up to 12A to be drawn from the regulator for short periods of time. This allows the LM338 to be used with heavy transient loads and speeds start-up under full-load conditions. Under sustained loading conditions, the current limit decreases to a safe value protecting the regulator. Also included on the chip are thermal overload protection and safe area protection for the power transistor. Overload protection remains functional even if the adjustment pin is accidentally disconnected. The device provides an excellent line regulation of 0.005%/V when 3V ≤ (VIN − VOUT) ≤ 35V and load regulation of 0.1% when 10 mA ≤ IOUT ≤ 5A.
The LM7805 and LM7812 are three terminal positive regulators are available in the TO-220 package and with fixed output voltages of 5V and 12V, making them useful in a wide range of applications. Each type employs internal current limiting, thermal shut down and safe operating area protection, making it essentially indestructible. If adequate heat sinking is provided, they can deliver over 1A output current. A maximum of 35 V DC can be supplied to the input of these regulators provided that the device is properly mounted on a heatsink.
The 20V AC secondary output of the transformer(TR1) is fed directly to the bridge rectifier which rectifies the AC component and convert it into DC voltage.
As because, we are using bridge rectification configuration, the ideal average magnitude of the output of the bridge rectifier is given as:
V(peak) = V(rms) X √2 = 20 X √2 = 28.2848 volts
And after subtracting the voltage drop of the two diodes that work in series in working of bridge rectification,we get the actual approx output voltage as:
V(actual) = 28.2848 - (2 X 0.7) = 26.88 volt
which is approximate to 27 volt.
This is filtered with the help of C1 capacitor which acts as a low pass filter there.
The LED(LED1) lights up when the circuit is switched ON.Then this signal is fed to the input of the three regulators.
Referring to the datasheet of LM338, a dropout of 1.5 to 3 volt appears in the output of the regulator from the input when the working temperature is increased from -75 degree celcius to +150 degree celcius. However at normal working range from 20 to 40 degree celcius, a typical dropout of 2.6 V is obtained when the current drawn from the device is max 5 ampere.
Thus at practical 27 volt DC input we obtain a variable voltage range from 1.2 volt to 24.4 volt which is sufficient for our purpose. A fixed voltage of 5 Volt and 12 Volt is obtained from LM7805 and LM7812.The LM338, LM7805 and LM 7812 should be mounted on a proper heatsink. However, it is very important to note that the heatsink of LM338 should not touch the heatsink of the other two regulators. It should be mounted on a different heatsink. This is because, the metal cap(body) of LM338 is connected to its V(out) internally while that of LM7805 and LM7812 to the ground pin. If all of them are connected on the same heatsink, it will lead to short circuit of LM338. When external capacitors are used, it is sometimes necessary to add protection diodes to prevent the capacitors from discharging through low current points into the regulator. Most 20 μF capacitors have low enough internal series resistance to deliver 20A spikes when shorted. Although the surge is short, there is enough energy to damage parts of the IC. In operation, the LM338 develops a nominal 1.25V reference voltage, VREF, between the output and adjustment terminal. The reference voltage is impressed across program resistor R1 which is of 240 ohm and an external potentiometer of 5 kilo ohm is connected between the adjust pin and ground.
Step 4: Interface and Display Circuit Description
Version 1 description :
This stage is composed of a stepdown transformer(TR2),an AVR microcontroller ATmega8, serial interface MAX232,an op-amp LM741, a 16X2 character LCD and a few other discrete components.
This stage is powered by a different transformer(TR2).This is because if we power this section with that of the power section transformer only, and if a heavy load is connected at the output of any of the regulator, it will drop the voltage across the terminals which will either restart the microcontroller or not let this section to function properly because microcontrollers are more sensitive to voltage fluctuations. A 500mA , 220V AC to 9V AC stepdown transformer is sufficient here to power this module. Using bridge rectification by four 1N4007 diodes and filter capacitor C1, C2 and another LM7805 regulator, we obtain a regulated 5 volt output which powers the microcontroller.
ATmega8 is a low power,8-bit microcontroller based on the AVR RISC architecture. It has 8kB in-system programmable flash memory with read-while-write capabilities, 512 bytes of EEPROM,1kB serial random-access memory(RAM),23 general purpose input/output (I/O), 32 general purpose working registers, three flexible timers/counters with compare modes, internal and external interrupts, analog to digital converter and a two wire serial interface.
The LM741 is a general purpose op-amp easily available in DIP8 packages.
However other op-amps can be used but LM741 is an efficient and economic solution for what we need in our application.
MAX232 is serial interface IC that provides voltage level conversion between the serial port of microcontroller with that of the personal computer. This is essential here, as the microcontroller operates at max 5 V DC supply and the computer’s serial port operate at different voltage levels like it uses -3 to -25 volt to indicate logic 1 while +3 to +25 V to indicate logic 0. So MAX232 acts as a translator between the two devices.
Two switches A and B are connected to pins PC.5 and PC.4 of the atmega8 respectively externally pulled up by 10k resistors, which will be used for changing the display mode of the supply and for enabling/disabling the serial transmission. A LED is connected to pin PC.3 which is used to display the status of serial transmission. A piezzo buzzer is also connected to pin PB.0 which gives audio beeps when device is switched ON or a button is pressed to change the menu.
As shown in the circuit,the lower D port is connected to the lower nibble of the LCD, and the E and RS pins on the LCD are connected to PD.3 and PD.2 respectively. Pin R/W on the LCD is grounded. The pot R3 here is used to adjust the contrast of the LCD.
The TXD and RXD pins of the microcontroller are interfaced with the MAX232 on pins 10 and 9, and pins 7 and 8 are connected to the external DB9 serial connector which can be connected to the computer via a serial cable. Pin 16 and 15 of MAX232 are Vcc and ground respectively.
Pin 20,21 and 22 on the atmega8 setups the configuration for using internal 2.56 voltage reference for the inbuilt ADC of the chip. Pin 1, which is the reset pin is pulled up with the help of an external 10k resistor.
Now coming on to the current and voltage sensing sections, a voltage divider made up of two resistors R6 and R7 scales down the variable supply channel voltage so that it can be interfaced to the inbuilt analog to digital converter of atmega8.This is the connected to ADC0 (pin PC.0) of the controller.
For current sensing we use a shunt resistor of 0.3 ohm in series of the variable supply channel, thus a voltage Vsense is developed across the resistor which is amplified with the help of non-inverting amplifier made by LM741 op-amp. The gain is set to 1.7 with the help of resistors R9 and R8.
The connection A is connected to after the shunt resistor, and connection B to positive terminal of LM338 output as shown in the last figure.The ground of the two sections is made common and is utmost necessary to connect the ground of both the sections with each other.
Step 5: The Microcontroller Code (for V2)
It is hence very easy to comprehend. Initially we set the microcontroller configuration file and the crystal frequency. It is important to note that the code is developed to run on 8MHz frequency and the internal 8MHz RC oscillator is used here because this much frequency is more than enough for our operations and we use internal oscillator of the microcontroller only so as to reduce the cost of space and cost of external crystal. The baud rate is set to 9600. After that we initialize various variables to implement our algorithm, and the ADC, IO ports, LCD is also configured. The software uses two functions that is the movingaveragevoltage and movingaveragecurrent which implements the moving average window for the calculated values of current and voltage. This increases the accuracy of the calculations and also maintains stability of the display variables. Instantaneous power is also calculated and displayed using these variables only. The software calculates the current and voltage after getting reading from the ADC0 and ADC1 and the uses some inverse ohms law and display it on the LCD. For serial transmission, it frames the values of current , voltage and power in a string and send it to the computer which is decoded at the computer side only which is running a Visualbasic application.
Two zip files are enclosed here:
MCU CODE v1 zip file----> for version 1 power section and display section circuit
MCU CODE v2 zip file----> for version 2 power section and display section circuit
Step 6: The Computer Application
To start the application, simply select the com port number from the dropdown menu to which your hardware is connected to the computer, then press the “Open” com port button. The com port is ready to receive data now. Now on the hardware,click “Button B” which will enable the serial data transmission from the hardware. Now you will see that the updation of reading is started in the application. You can stop it using the same button again. To reset the graph click on “Reset” button. You can also change the strip chart view by using additional buttons provided to the left side of the application like WRAP/PAN mode,enable handles,enable grids,etc.To stop the com port simply click on the “Close” button.It is to note there that if you want those digital display fonts in the application,simply copy “digifaw” font provided in the source code folder to your font folder in the computer and then restart the application.