Power Factor Improvement Plant Using AVR Microcontroller | PART:02
Before we proceed to download the project files and open schematic using proteus 7.8 or later version and open code using Atmel studio 6.00 or later version.
Power Factor Improvement Plant.rar file includes
- Atmel studio 6.2 project file (full source code)
- Proteus 7.8 schematic file.
- PDF schematic.
- upload the hex file(filename:PFI test1.hex) in atmega32 and connect lcd. In LCD connection 15(Anode) & 16(Cathode), no pin are not shown in schematic.
These two pins will be connected with Vcc and GND. Connect VCC and GND with 15 & 16 pins of LCD and if LCD light is on then connection ok. if not, swipe the connection. Calibrate the brightness of LCD using potentiometer connected with VO (3 No) pin if you don’t see any text.
- There is one contradiction in hardware and software connection.For simulation purpose, DC and AC ground are same. But in real circuit Ac ground will be 2.5V dc offset and AC and DC ground would not be shorted.
- Connect the current transformer according to the image given below.
- It is not good practice to connect all the components initially. Now you just connect the voltage divider for voltage sense and dc offset and a resistive load so that you can calculate power factor.
- So when you see for resistive load your power factor close to unity, then your connection may be ok. if not you to debug the connection.
- If you find garbage value then check whether your voltage and current signal are distorted(peak to peak are not +2.5V to -2.5V) or garbage signal. So a USB to serial monitor can help you to see your voltage and current signal.
- So you need to print ADC value of voltage and current. So open the source code and uncomment the function print_voltage_current() and upload hex file into atmega32. I hope everything will be clear watching the video.
Some problems and Solutions:
Solution: In that case I changed LCD port and connected LCD with PORTB. For this, you need to edit lcd.h file. I edited this portion to connect LCD with PORTB.
#define LCD_DATA B //Port PB0-PB3 are connected to D4-D7
#define LCD_DATA_POS 0 // This is the position first data pin D4.
#define LCD_E B //Enable/strobe signal
#define LCD_E_POS PB4 //Position of enable in above port
#define LCD_RS B //RS SIGNAL
#define LCD_RS_POS PB6
#define LCD_RW B //RW SIGNAL
#define LCD_RW_POS PB5
At one point I observed through I was connecting capacitors in parallel with resistive load, but power factor was not changing & remained close to unity. Just a strange and weird problem.
Solution: I connected USB to the serial(FT232) converter to see waveform and uncomment print_voltage_current() function to plot the graph of voltage and the current waveform. plotting the ADC value in excel according to video given in our first part of this project, I found such graph.
As current signal shown unusual behave. The problem is in the resistive load. Connecting new resistive load, the system was behaving accurately.
This is how we solved two problems. There are many problems you may face while doing this project. I hope you can solve the problem by yourself.