26
An-Najah National University INTELLIGENT BATTERY CHARGER By Al-motasem aqel Ahmad nidal Year : 2014-2015

Intelligent battery charger

  • Upload
    slmnsvn

  • View
    116

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Intelligent battery charger

An-Najah National University

INTELLIGENT BATTERY CHARGER

By

Al-motasem aqelAhmad nidal

Year : 2014-2015

Page 2: Intelligent battery charger

ABSTRACT

The intention of the project is to design a battery charger that could intelligently charge several different types of batteries, using PIC control with voltage and temperature feedback from the battery.

The charger is designed to charge AA NiMH, AAA NiCad, Li-Ion batteries with constant voltage and constant current modes, depending on each battery’s physical characteristics and ideal charge profile. Each battery’s charging process is broken up into distinct stages, in which the charge rate and the type of charge are varied. The charger takes 220V AC input that is converted to a constant current or constant voltage DC output.

The device consists of rectifier, filter, and regulator circuits, which will remain unchanged for each different charging process. For each given stage, the PIC will generate a PWM signal based on a calculated duty cycle value, which will then control the level of the voltage and current outputted to the battery by adjusting the duty cycle of the buck converter.

Page 2

Page 3: Intelligent battery charger

TABLE OF CONTENTS

1. INTRODUCTION....................................................................................................................11.1 Purpose...............................................................................................................................11.2 Specifications......................................................................................................................11.3 Subprojects.........................................................................................................................21.3.1 AC-DC.............................................................................................................................21.3.2 Buck Converter................................................................................................................31.3.3 5 V Supply Rail...............................................................................................................31.3.4 PIC...................................................................................................................................31.3.5 LCD.................................................................................................................................3

2. DESIGN PROCEDURE...........................................................................................................42.1 AC-DC Design....................................................................................................................42.2 Buck Converter Design.......................................................................................................52.3 5 V Supply Rail Design......................................................................................................6

2.4 PIC………………………………………………………………………………………...6 2.5 LCD………………………………………………………………………………………..9

3. Design Simulating……………………………………………………………………………….11

4. CONCLUSIONS....................................................................................................................15

Page 3

Page 4: Intelligent battery charger

1. INTRODUCTION

The intention of the project is to design a battery charger that could intelligently charge several different types of batteries, using PIC control with voltage and temperature feedback from the battery.

The charger is designed to charge AA NiMH, AAA NiCad, Li-Ion batteries with constant voltage and constant current modes, depending on each battery’s physical characteristics and ideal charge profile. Each battery’s charging process is broken up into distinct stages, in which the charge rate and the type of charge are varied. The charger takes 220V AC input that is converted to a constant current or constant voltage DC output.

The device consists of rectifier, filter, and regulator circuits, which will remain unchanged for each different charging process. For each given stage, the PIC will generate a PWM signal based on a calculated duty cycle value, which will then control the level of the voltage and current outputted to the battery by adjusting the duty cycle of the buck converter.

1.1 Purpose

Many battery chargers on the market today use very simple, unregulated charging techniques without intelligent control, which can dramatically decrease battery performance. This brute method of charging can lead to overcharging or overheating of the battery, which is not good for the battery. Other chargers use intelligent design, but have their functionality limited to NiMH/NiCad dual charging, which means that the average consumer must have multiple chargers for his multiple rechargeable batteries. Through this project, we hope to design an intelligent charger that is capable of charging several kinds of batteries with care, which will improve battery life and result in increased consumer convenience from the possession of a more universal charger. We also believe that this design will result in improved energy efficiency during the charging process.

1.2 Specifications

The project was split up into modules as seen below:

Battery Charger Block Diagram

Page 1

Page 5: Intelligent battery charger

For individual module specifications, refer to section 1.3.

The battery charger meets the following specifications: 220 V AC input Charges at 0 V-5 V DC output Charges at 0 A-5 A DC output Less than 5% output voltage and current ripple

The desired values for the DC output were determined by deciding the maximum current and voltage required to charge our different batteries. Our requirement of 5% output ripple is decided in a more qualitative and experimental fashion, as we chose a value that seemed acceptable and realistic, given our design.

1.3 Subprojects

The design is broken up into modules, each of which is designed to perform specific tasks and interface with other modules. The modules that were implemented in our project were:

1.3.1 AC-DC

The role of the AC-DC module is to convert a 220 V AC waveform from the wall into a lower voltage, low-ripple DC waveform. We stepped the voltage down by using a 7:1 transformer, which allows us to operate in a voltage range more suitable for charging household batteries. We implemented a full-wave bridge rectifier with individual diodes and selected a filter capacitor that would lead to lower ripple in the final DC waveform. The DC waveform was used as an input to both our buck converter and the 5 V supply rail.

Page 2

Page 6: Intelligent battery charger

1.3.2 Buck Converter

The role of the buck converter module is to supply constant current or constant voltage to the battery at varying voltages and currents, when controlled by a PWM output from the PIC. This PIC signal is connected to the converter via the gate of the NMOS, which operates as a switch. An inductor and a capacitor will be used to store charge, which will be released while the PWM signal is low and the switch is opened. While this occurred, the diode ensures that the current only flowes in one direction.

1.3.3 5 V Supply Rail

We wanted our circuit to only utilize the 220 V AC supply as an input, which mean that a module needs to create a 5 V supply for our digital logic-level components. The 5 V supply provided power to our PIC, LCD, and crystal oscillator. The module mainly consisted of a +5 V linear regulator, although we did utilize a voltage divider to lower the input voltage of the regulator to a value within its specifications.

1.3.4 PIC

The main control of our battery charger is the PIC 16F877A. It has 40-pins of which 6 are analog pins for the Analog-to-Digital conversion of the battery voltage. The PIC also has a built-in PWM, essential for our design. However, it does not have a clock, so the 20 MHz FOX 1100E clock is used as the external clock. The power needed to supply it is +5V DC, which we get from the voltage regulator. The PIC is responsible for calculating the duty cycle of the PWM signal provided to the MOSFET gate drivers, based on battery voltage and current readings. It also interfaces with the LCD and displays the battery’s current voltage, as well as the type of battery selected by the user.

1.3.5 LCD

The LCD interfaces with the PIC, as explained above. It is used to provide relevant information to the user while the battery is charging.

Page 3

Page 7: Intelligent battery charger

2. DESIGN PROCEDURE

2.1 AC-DC Design

The schematic for our AC-DC converter is shown below:

Figure 2.1 AC-DC Converter

We chose the initial circuit input to be a 220 V AC input from the electrical outlet, simply for its convenience. Our project is intended to be used by the average consumer and, therefore, needs to use an input that the average consumer has access to.

Since this 220 V AC input is outside the range of voltage needed for charging household batteries, we utilized a 7:1 transformer to step down the voltage to approximately 30 V AC. We chose not to utilize the center tap of our transformer because we are planning to charge lead-acid car batteries, which require a higher voltage. however, our project does not feature lead-acid compatibility. If we were to leave out this compatibility permanently, we would probably switch to using only the center-tap, which would have led to lower ripple.

For our full-wave rectifier, we chose to use 1N4002 diodes. Our RMS voltage would be in the range of 30 V-40 V, which was far below the maximum reverse RMS voltage of 70 V allowed by the 1N4002. The only drawback to the full-wave bridge over the half-wave rectifier is the extra diodes required, but the minimal cost and size of diodes makes this essentially a non-factor.

The value of the filter capacitor used in AC-DC converters is usually calculated using equations that assume a simple resistive load, which the battery is not. The buck converter also complicated this assumption. Therefore, we have to experiment with different-sized capacitors but for now we decided to choose filter capacitor of 470uF.

Page 4

Page 8: Intelligent battery charger

2.2 Buck Converter Design

The general schematic for our buck converter is shown below:

Figure 2.2 Buck Converter

Buck converter is simply a voltage step down and current riser at the same time. Maybe we will use it or just design a current circuit. We didn’t decide , we will leave it to the second part of the project when testing it .

Page 5

Page 9: Intelligent battery charger

2.3 5 V Supply Rail Design

The circuit for our 5 V supply is shown below:

5 V Supply Circuit

In designing the circuit for the 5 V supply, In order to supply the MC7805A with an acceptable input voltage, we have to use a voltage divider after the rectifier module to halve the voltage. using two 500 Ohm, 10 W resistors to achieve this. Assuming 21 V across each resistor, each resistor we need to be rated to 3.53 W (P= V^2/R). While our resistors are safely above this rating, The large value of the resistors also serves to limit the current that the linear regulator receives, since the PIC cannot handle high current levels.

2.4 PIC

Measuring the correct, stable voltage of the battery is essential for our PIC to be able to charge effectively and to not damage the batteries. Since the battery voltage is in analog format, we take that as input to the ADC of the PIC. The ADC converts the voltage to a number so that it can be processed by a digital system like the PIC microcontroller. The most important specification of the ADC is the resolution. The resolution specifies how accurately the ADC measures the analog input signal. The ADC built into the PIC16F877A is 10-bit. Another component of the ADC is the reference voltage. The reference voltage specifies the minimum and maximum voltage range of analog input. There are two reference voltages, one is the Vref- and one is Vref+. The V ref

−¿ ¿ specifies the minimum input voltage of analog input while the Vref+ specifies the maximum.

Diagram Illustrating PIC ADC Reference Voltage

If the input signal is connected to the V ref−¿ ¿ or Vre f +¿¿, then the result of the ADC conversion would be 0

or 1023 (10-bit), respectively. In our circuit, the Vre f +¿¿ is +5V and V ref−¿ ¿ is GND. The resolution of the

ADC would then be 0.00489 V/count. The equation to get the final converted voltage is:

Converted Battery Voltage=Raw Voltage ×( 5−01023 )=Raw Voltage ×0.00489 V (2.3)

Page 6

Page 10: Intelligent battery charger

The PWM is also very important in our design, as it will be the one to control to the actual current going through the battery in order to charge it. PWM is basically described as using a digital signal to generate an analog output signal. Since the PWM is built-in to the PIC, we can send the PWM output to the buck converter’s MOSFET gate via a gate driver. The way it works is by changing the average voltage level and this is done by generating a constant frequency signal but one where the pulse width is changed (or modulated). A buck converter is a step-down voltage converter, so the output voltage will be lower than the input voltage. We can program the PIC to change the pulse width or the duty cycle in order to vary the output voltage. This is because of the relation given in equation 2.4.

V out=V ¿× D (2.4)

Therefore changing the duty cycle of the PWM output to the MOSFET, we can directly change the output voltage. The PIC16F877A has two PWM outputs, which correspond to the CCP1 and CCP2 pins. The PIC is configured to use the CCP1 to output a 5 Vp-p, 20 kHz square wave. In PIC C Compiler, there is a built-in function for setting the PWM duty cycle. However, in order to set the value for the right duty cycle, equation 2.5 is used:

Value=Duty Cycle (% ) × 256100 (2.5)

This calculated value goes into the built-in function, set_pwm1_duty(Value).

The determination of the duty cycle within the PIC is integral to being able to implement an intelligent charging algorithm. In order to charge our batteries, we use the following algorithms:

Ni-MH:1. Constant 1C =2.3 A - Fast charge until V >1.1V2. Constant 0.1 C = 0.23 A for 30 minutes3. Trickle 1/30 C = 7mA indefinitely

Ni-Cd1. Constant 1C =0.35 A – fast charge until V >1.0 V2. Constant 0.1 C = 3.5 mA for 30 minutes3. Trickle 1/30 C = 1mA indefinitely

Li-ion1. If V<2.8 V, trickle charge at 0.1 C = 0.35 A2. Constant 1C = 3.5 A until V=4.23. Constant 4.2 V supplied until I< .25 A

Normally some of the voltage thresholds would be replaced with temperature thresholds, we will try to implement temperature sensing.

For constant voltage modes of operation, the PIC will output a constant duty cycle. This duty cycle is set to a predetermined value, heavily based on testing to output a set voltage.

For constant current modes of operation, we utilize a precision resistor that is placed in series with battery. We then measure the voltage across this resistor, which is compared to an expected voltage level. This value is determined by multiplying the expected constant current value by the known resistance of the precision resistor. For all measured voltages within 1% below the expected value, we keep duty cycle constant. This indicates that we are acceptably close to the required current, without

Page 7

Page 11: Intelligent battery charger

providing an overcurrent, which could be harmful to the battery. For more than 1% below the expected value, we increase the duty cycle by very small increments at each reading. This allows us to approach the expected current level, without surpassing it. While this means that it might take several voltage readings to reach the appropriate current, the time required is in the millisecond range, which is negligible when charging batteries for several hours. For voltages above the threshold, we drop the duty cycle by 10%, as this will only occur when transitioning to a lower current stage. This will often result in the PIC reaching the stage where it must incrementally increase the duty cycle, as we will intentionally overshoot the desired threshold.

Initially, we directly connected the PIC PWM output to the gate of the MOSFET. However, this approach does not work because the PWM signal of the PIC does not provide enough current to turn the MOSFET on. Therefore, a MOSFET gate driver is needed to turn the gate on. As we vary the duty cycle of the PIC PWM, it directly affects the voltage and current provided by the buck converter.

The MIC 4424CN is actually a low-side MOSFET driver that we utilize as a voltage stepper. In our initial design, the MOSFET was on the low-side, so we were only using this chip. However, when we changed our design so that we could measure the battery voltage accurately, we needed to use a high-side MOSFET driver. After connecting the PIC PWM signal directly to the high-side MOSFET driver, IR2117, once again, we couldn’t get the MOSFET to turn on. After reading through the data sheet, we discovered that the IR2117 doesn’t see a logic ‘1’ until a threshold of 9.5V is reached. Therefore, after researching online, found that the MIC4424CN can be used as a voltage stepper to amplify the PIC PWM 5 Vp-p to greater than 9.5 Vp-p, so the IR2117 could function properly. A comparison of the input and output of the MIC4424CN, used as a voltage stepper.

Page 8

Page 12: Intelligent battery charger

The PWM output from the PIC is fed into the MIC4424CN, which amplifies the signal and becomes an input to the IR2117, which then is connected to the gate of the IRF520A MOSFET. The MIC4424CN is powered using a +12 V and the IR2117 uses +15V. The values of the C1 and C2 used are 4.7 µF and 1 µF, respectively. The value of the resistor used is 15 Ω.

MOSFET Gate Driver Circuit

2.5 LCD

In order for us to be able to debug and see explicitly what the battery voltage is, we decided to use an LCD.

The LCD consists of 8 data, Enable (E), Read/Write (R/W) and Register Select (RS) bits which need to be connected to the PIC. The Enable bit allows access to the display. When the Enable bit is low, the LCD is disabled and ignores the signals from R/W and RS. When high, the LCD checks the state of the two bits and responds accordingly. The R/W bit determines the direction of data between the LCD and PIC. When low, the data is written to the LCD and read when high. The RS bit is used to interpret the type of data. When low, an instruction is written to the LCD and a character, when high. The LCD driver from the CCS forum uses only 4 data bits DB4-7 and the rest are not connected. only 7 (DB4-7, E, R/W, RS) pins are connected to the PIC. The power needed for the LCD is the same +5V DC that the PIC uses from the voltage regulator.

Page 9

Page 13: Intelligent battery charger

PIC-LCD Interface

Page 10

Page 14: Intelligent battery charger

3. Design Simulation

The simulating process done using the multisim 2011 as below :

Ac-Dc converter :This figuer after the transformer

Page 11

Page 15: Intelligent battery charger

This is the signal after adding the full wave rectifier

Page 12

Page 16: Intelligent battery charger

This figure is after the Zener diode :

Page 13

Page 17: Intelligent battery charger

This figure shows the output voltage of the regulator Vout = 5 V

This is needed for the pic to run

Page 14

Page 18: Intelligent battery charger

4.Conclusion

The difference between the normal charger and the smart charger is that, the smart charger can control the charging process according to the state of the battery. By this way, money can be saved by using one charger for different battery types. We hope next semester after connecting the parts to make the charging process faster

Page 15

Page 19: Intelligent battery charger

REFERENCES

[1] D. Schelle and J.Castorena, “Buck-Converter Design Demystified,” Buck-Converter Design Demystified Page of, Maxim Integrated Products, Jun 1, 2006, [Online] Available: http://powerelectronics.com/power_systems/dc_dc_converters/power_buckconverter_design_demystified/. [Accessed: October , 20, 2010].

[2] Krein, P.T..Elements of Power Electronics.New York: Oxford University Press, 1998.

[3] “Simple 8 Bit 16x2 LCD Interfacing with PIC 16F.” http://www.botskool.com/user-pages/tutorials/electronics/simple-8-bit-16x2-lcd-interfacing-pic-16f.[4] “PWM for the PIC Micro.”http://www.best-microcontroller-projects.com/pwm-pic.html.

[5] “ADC on a PIC.”http://www.tigoe.net/pcomp/pic/pic-analog.shtml.

Page 16

Page 20: Intelligent battery charger

Full Circuit Schematic

Rechargable batteries that our project will charge

Page 17

Page 21: Intelligent battery charger

Page 18