Upload
ozgur-m-duman
View
126
Download
2
Embed Size (px)
Citation preview
T.CDOKUZ EYLUL UNIVERSITY FACULTY OF ENGINEERING ELECTRICAL & ELECTRONIC
ENGINEERING DEPARTMENT
EE422 Embedded SystemsPic Controlled Lead Acid Battery Charger
FINAL REPORT
2005502020 ÖZGÜR MEHMET DUMAN
11.04.2011
1
1. ABSTRACT ………………………….2
2. INTRODUCTION ………………………….2
3. METHODOLOGY ………………………….3
3.1 LEAD ACID BATTERY & CHARACTERISTIC ………………………….3
3.2 STATE of CHARGE (SOC) ………………………….4
3.3 TERMINAL ADJUSTABLE REGULATOR ( LM 317)…………………………4
3.4 MICROCONTROLLER ………………………….5
3.5 SHUNT RESISTANCE AND LM324 AMPLIFIER………….……………......5
4. BLOCK DIAGRAM & SCHEMATIC ………………………….6
5. FLOW CHART ………………………….7
6. EXPERIMENTS & RESULTS ………………………….8..
7. PHOTOS of PROJECT ………………………...10
8. CONCLUSION ………………………...11
9. REFERENCES ………………………...11
10. APPENDIX ………………………..12
10.1 CODES ………………………..12
2
1. ABSTRACT
In this project lead acid batteries are charged by pic controlled power electronic circuits.
Ac power source is rectified to dc. Dc regulator IC circuits are used for supplying adjusted current
and voltage on lead charging by pic’s pin outs which can create selection and adjustment signal.
2. INTRODUCTION
Lead acid batteries are used in Ups devices, cars’ electric system as starter or dc supply of
electronic devices, etc. A lot of applications are able to meet in life. Their advantages are suitable
to be charged any Dc source which supplies lower voltage than lead acid’s maximum charge
voltage value and protecting against explosion and fire.
In my final year project topic is lithium polymer battery charger circuit realization, but lipo
batteries are so dangerous and risky wrong charging applications. Lead acid battery charging is a
step of final year project before lipo charging. Thus power electronic information fundamentals are
tried with charging experiments. Circuit elements behavior and effects on embedded systems are
able to observe.
In nowadays technology, too many type lead acid battery charger circuit designs are
available. Their features are controlling battery type, lead acid, lithium polymer, nickel metal
hybrids batteries then charge them suitable algorithms. They can count battery number and give
error message about your batteries. Also their discharge and charge abilities provide to users,
balancing to battery and creating characteristic curves of battery.
In this project a current and voltage adjustable lead acid battery charger circuit is designed
in addition state of charge (SoC) information due to time is represented with Hyperterminal until
charging.
3
3. METHODOLOGY
3.1 LEAD ACID BATTERY & CHARACTERISTIC
Battery is a complex electrochemical device which converts and stores chemical energy to electric energy. Battery term defines one unity. But the unity has one or more than one cell which fundamental element of battery.
Figure 1: Structure of Lead Acid Battery. [1]
In project battery packet has 3 cells and 4Ah capacity. That’s why nominal voltage of battery is 6Volt, Max. Charge Voltage 7.50V, Min. Discharge Voltage 5.25V .While charging operation current must be limited to protect the battery against oxidation. This current is 0.4 (0.1C) for 1C,4 Ah lead acid batteries .Battery characteristics give all information about battery performance, constant voltage charge is showed in figure 2.
4
Figure2: 6V 4Ah lead acid battery Characteristic.[2]
a. STATE of CHARGE (SOC)
Deep discharge of the battery will reduce the life of the battery. Frequent overcharging also has a damaging effect on the battery. Accurate indication of the state of charge of battery is necessary to utilize the batteries to the maximum extent.State of charge data gives us charged capacity of battery due to time. Current integration and open circuit voltage measuring are used for implementation of reliable SOC in formula1.
Formula1
Q(to) is initial capacity of battery α charging is charging efficiency i is charge current[3] Rated Capacity is data of battery in nominal usage.
b. TERMINAL ADJUSTABLE REGULATOR ( LM 317)
Regulator IC is suitable for charging operation because of voltage adjustment pin to supply constant voltage in addition extreme current increasing is prevented by current limiting circuit of IC. Also different output resistors and extra IC combinations provide to create different capacity batteries’ chargers.
5
Figure3: Adjustable output voltage circuit with LM117 (or LM317).[4]
c. MICROCONTROLLER
Another fundamental part is pic 16f877 microcontroller. In this project state of charge, charge current and voltage are critical values for charging process. 10 bit Analog to Digital converter pins of 16f877 Mcu are used for data transmission on battery. Timer0 block is adjusted for time counting. In addition, B port is connected start /stop and adjustment buttons.
Interrupt time=( Division timefoscillator ) x 4 x (256−set value)
6
Figure4 :16f877 pin configuration and timer0 interrupt calculation[5]
d. SHUNT RESISTANCE AND LM324 AMPLIFIER
Shunt resistor is used for charge current measuring, calibration value is 1A/1mV, analog input
resolution of 16f877 is 4.8mV (10bit A/D 5Volt/210=4.8mV) so 4.8A changing effects least
significant bit changing. It’s not sensitive. But output value of shunt is amplified 101 times by
lm324 amplifier.
Photo1: Shunt resistor.
4. BLOCK DIAGRAM & SCHEMATIC
POWER
DATA
7
microcontroller
Current Limiter Power Switch
Power Switch DriversPower Regulator
Lcd Screen Configuration Buttons
Bu
Figure 5.Block diagram of charger.
In this block diagram power source is regulated to system supply. Charge current is limited by circuit and energy flowing through battery switched to suit algorithm steps. Charging data is showed in LDC and logged in laptop with rs232 connection.
Figure 6: ISIS schematic of charge circuit.
5. FLOW CHART
8
6. EXPERIMENTS & RESULTS
9
LM317 regulator applications are takes place in project literature search. This IC is called as current limiter, but this term doesn’t mean adjustable current output, it’s only protection from extreme current flowing on IC, with extra transistor connection. Aim of the project was adjustable current and voltage supplying so Lm317 wasn’t suitable the project. Therefore Vout is effected small input voltage changing. Only advantage is maximum flowing current higher than 78XX voltage regulator family.
Photo 2: Lm317 application circuit.
The other feature of charger is distinguishing different capacity LA batteries. Firstly, battery choosing with switches was planned but project couldn’t catch up time table. That’s why switches are used for current adjustment with changing rock resistances. Switches are run with transistors.
Photo 3:Battery distinguishing with switches
10
Reliable charging and SoC reading are able to realized only with characteristic curves of battery. I sent mail to firm of my battery but couldn’t take answer so I consulted the tutors to create lookup table any same capacity battery characteristic from internet search. But my batteries were different and aging that’s why I created own characteristic of battery. Thus I can determine SoC value on intersection with curve. Experience and curve were realized by Lipo balancer machine in photo 4 and figure7.
.
Photo4: Charging with 0.1A.
Figure7:Charge and Discharge curves of battery.
11
7. PHOTOS of PROJECT
12
8. CONCLUSION
In this project main purpose was controlling of all steps of lead acid battery charging. Lm 317 IC doesn’t prove all steps of this project. Only constant voltage charging algorithm is suitable for lm317. Boost converter or buck converter type choppers have more features than lm317 so charging circuits are includes these power electronic circuit structures. Output Current and voltages are able to adjust with pwm changing on mosfet of chopper circuits.
State of Charge couldn’t measure, because of lm 317 couldn’t constant current so constant current charge and discharge characteristic curves anytime intersect with charging curves by lm317.Only constant voltage curves give information about SoC of battery.
The circuit abilities, which were realized, are changing of initial charge current. In addition button configurations provide rock resistance selection which is used for adjustment of the charge current.
Problems of project obstructed to realize planned purposes. Firstly button connection didn’t work so I couldn’t close box of project. Box shape of project, which is my choice, limited me at location of circuit elements, cable connection of circuit between different pieces of circuit’s affected reliable working of circuit. Ventilator of circuit is connected to 7805 regulator as parallel to microcontroller it caused of wrong analog data transferring, quickly temperature increasing and suddenly shut off itself.
9. REFERENCES1. Haze Battery Company Ltd Lead Acid Catalogue2. BB Battery Free Rechargeable Sealed Lead Acid Battery BP4.5_63. D.Jaya Deepti and V. Ramanarayanan,” State of Charge of Lead Acid
Battery”,Proceedings of India International Conference on Power Electronics 20064. National Semiconductor Lm117 Datasheet5. Micro Chip 16f877 Datasheet
13
10. APPENDIX
10.1 CODES
#include <16f877.h>#device ADC=10#use delay(clock=4000000)#fuses HS,NOWDT,NOPROTECT,NOBROWNOUT,NOLVP,NOPUT,NOWRT,NODEBUG,NOCPD#use fast_io(a)#use fast_io(b)#use fast_io(c)#use fast_io(d)#use fast_io(e)#include <lcd.c>#byte portb=6 //portb variable determined as portb connection#use rs232 (baud=2400, xmit=pin_C6, rcv=pin_C7, parity=N, stop=1) //initialized fundamental software adjustments
unsigned long int anadata;float voltage,current;int led=0,time=0,i=0,button,r1,r2,r3,r4,sum,as; // variables of analog measurements and buttons
// timer 0 INTERRUPT#int_timer0void timer0_kesme(){output_high(pin_c0);
if(input(pin_b0)==0) {button=0; output_b(0X00); disable_interrupts(INT_timer0);
} portb=button; led++; if (led>40) {time=time+1; set_adc_channel(1); delay_us(50); current=read_adc();
14
delay_us(10); set_adc_channel(0); delay_us(50); voltage=read_adc(); delay_us(10); //LCD Showing lcd_gotoxy( 1, 1 ); printf( lcd_putc, "Vol(V)Cur(A)Time(Sec)" ); delay_ms(100); lcd_gotoxy( 1, 2 ); printf( lcd_putc,"V=%.1gVI=%.1gAT=%dsc",voltage,current,time);//rs232 Data sending printf(" Voltage(V) Current(A) Time(Sec)\n\r"); printf("V=%.1gV I=%.1gA T=%dSec \n\r",voltage,current,time); //output_b(akim)set_timer0(255);led=0;}output_low(pin_c0);}
// External intterupt because of buttons#int_extvoid ext_kesmesi (){for(as=0;as<50;as++){output_high(pin_c0);delay_ms(100);output_low(pin_c0);delay_ms(100);} adjust: button=input_c(); printf("Push Any Charge Current Adjustment Button\n\r"); // delay_ms(1000); r1=bit_test(button,1); r2=bit_test(button,2); r3=bit_test(button,3); r4=bit_test(button,4); sum=r1+r2+r3+r4;
if((sum>=2)|(sum==0)) { printf("Can't push more than ONE\n\r"); goto adjust; } else
15
{ set_timer0(255); enable_interrupts(INT_timer0); }
output_low(pin_c0);delay_ms(100);}
void main(){ setup_psp(PSP_DISABLED); // PSP unit close setup_spi(SPI_SS_DISABLED); // SPI unit close setup_timer_1(T1_DISABLED); // T1 timer close setup_timer_2(T2_DISABLED,0,1); // T2 timer close
setup_CCP1(CCP_OFF); // CCP1 unit close setup_CCP2(CCP_OFF); // CCP2 unit close setup_timer_0(rtcc_div_256|rtcc_internal); setup_adc(adc_clock_div_8); setup_adc_ports(ALL_ANALOG); enable_interrupts(INT_EXT); // INT_EXT activation enable_interrupts(GLOBAL); set_tris_e(0X00); output_e(0x00); set_tris_b(0X01); output_b(0x00); set_tris_c(0X1E); output_c(0X00); set_tris_a(0X0F); output_a(0x00); printf(lcd_putc,"\f"); lcd_init();lcd_gotoxy( 1, 1 ); printf( lcd_putc, "LA CHARGER " );delay_ms(1000); lcd_gotoxy( 1, 2 ); printf( lcd_putc, "OzgurMehmetDuman " );while(1){
}}
16
17