Design of NiMH battery fast charger based on ATmega16

Publisher:渤海湾Latest update time:2020-02-19 Source: eefocusKeywords:ATmega16 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Introduction: Nickel-metal hydride battery is a widely used rechargeable battery, widely used in various electronic devices, such as mobile phones, cameras, walkmans and MP3s.


Nickel-metal hydride batteries are widely used rechargeable batteries in various electronic devices, such as mobile phones, cameras, walkmans and MP3 players. There are also many types of chargers based on nickel-metal hydride batteries on the market. According to research, most of the existing charging systems on the market use a fixed mode to charge the battery, and the charging time is too long (slow charging is about 10 hours, and fast charging is about 5 hours). Fast charging must increase the charging current, but due to the lack of necessary detection methods, it is easy to cause the battery to overheat or overcharge, affecting the battery life [1]. Based on the above reasons, the author designed an intelligent fast charger. The charger is based on the ATmega16 microcontroller, uses a switching power supply and fuzzy control technology, adopts a pulse charging method, and detects the charging status online in real time, achieving good results.


1) Working principle


The system consists of a 5V switching power supply circuit, a DC-DC conversion circuit, a voltage, current, and temperature detection circuit, and a discharge circuit. The charging principle is shown in Figure 1. The 5V switching power supply circuit provides a stable 5V DC power for the microcontroller and the main charging circuit. Its working principle is as follows: The microcontroller collects the current, voltage, and temperature signals during charging in real time through the internal integrated A/D converter, adjusts the duty cycle of the PWM control signal, controls the opening and closing of the MOS tube, and thus adjusts the amplitude of the pulse voltage and the size of the charging current. The pulse voltage output by the MOS tube is filtered by DC and becomes a stable DC power added to the battery to charge the battery. The discharge control depolarizes and discharges the battery in a timely manner.

Charging circuit diagram_www.schuitron.com


Figure 1 Charging principle diagram


II) System hardware composition


The main charging circuit and detection circuit are shown in Figure 2. Due to space constraints, the 5V switching power supply circuit is not drawn, and only one circuit (this charger has two circuits and can charge two AA/AAA batteries at the same time) of the main charging circuit and detection circuit are drawn.


2.1AVR MCU


AVR microcontroller is an enhanced high-speed 8-bit microcontroller with a reduced instruction set and built-in Flash developed by ATMEL in 1997. Atmega16 microcontroller is a high-performance microcontroller in the AVR microcontroller series. It has 16kB in-system programmable Flash program memory, 512b EEPROM, 1kB on-chip SRAM; 32 programmable general-purpose I/O ports; 32 general-purpose working registers; real-time clock (RTC); two 8-bit timers. Counters, one 16-bit timer. Counter, with channel PWM function; 8-channel 10-bit ADC; optional programmable gain; on-chip oscillator and programmable watchdog timer. It is a microcontroller with high reliability, strong functions, high speed, low power consumption and low price.


2.2 Charging main circuit


The main charging circuit is actually a buck converter, which is driven by the AVR's PWM through the bipolar NPN transistor 8050 to drive the P-channel MOS tube IRF9540. The switch tube is connected to the inductor, diode and capacitor, and the diode D2 is used to prevent the battery from supplying power to the microprocessor when the power is off.

Charging main circuit—www.schuitron.com

Figure 2 Charging main circuit and detection circuit


2.3 Detection Circuit


2.3.1 Voltage Detection


In order to monitor the charging voltage between the positive and negative poles of the battery, an op amp is used in the design. The op amp circuit for measuring the battery voltage is a common differential op amp circuit. The measurement range of the analog-to-digital converter ADC (10-bit ADC, 1024 quantization units) integrated in the microcontroller is AGND~AREF, where AGND is the ground voltage and AREF is the reference voltage. Taking R8=R10=10k8, R9=R11=11k8, the voltage value corresponding to a certain quantization unit can be calculated: Umeasured=N×2193(mV), where N is the number collected and converted by the microcontroller ADC.


2.3.2 Current Detection


The charging current is obtained through the 0118 precision resistor R13. In order to improve the measurement accuracy, this voltage is amplified by the operational amplifier and then sent to the ADC of the microcontroller. Taking R12=1k8, R14=10k8, the current value corresponding to a certain quantitative unit can be calculated: Imeasured=N×2193(mA).


2.3.3 Temperature measurement


The battery temperature is measured by the negative temperature coefficient resistor R15, whose resistance is approximately 10k8 at 25℃. The NTC is part of the voltage divider and is powered by the reference voltage (AREF, 3.3V). From Figure 2, we can get:


Since the resistance of NTC is not linear, in practical applications, the table lookup method can be used to find the corresponding temperature.


2.4 Discharge control


The battery discharge is mainly carried out through the high-power resistor R5. The transistor D880 mainly acts as a switch. Usually, D880 is in the off state. When discharge is required, the microcontroller gives a discharge signal, D880 is turned on, and the battery starts to discharge.


3) Fuzzy control and software design


Research has shown that the charging current characteristic curve is related to the ambient temperature, the age of the battery, the depth of discharge of the battery, the battery charging capacity and the change of the load current. It is a nonlinear, time-varying system. Therefore, it is difficult to find an accurate mathematical model to describe the characteristic curve. The most effective way is to apply fuzzy mathematics theory to fuzzy control, establish fuzzy control rules based on the knowledge and experience of experts, complete the control decision-making process through fuzzy logic reasoning, and finally achieve regulation and control of the controlled object. From the charging characteristics of nickel-hydrogen batteries, it can be seen that the charging current that nickel-hydrogen batteries can accept is different in different charging stages. After the charging voltage reaches the peak value, the battery terminal voltage changes little and is relatively flat, with only a small increment. However, if the charging current is too large, the battery temperature will rise rapidly, seriously affecting the battery life and even causing the battery to explode [2]. Therefore, the end of charging becomes the key point of control. Based on the above reasons, the charging rules are formulated as follows: In the first stage, a preset small current (0.1C) is used for constant current charging (where C represents the capacity of the battery, such as 1800mAh, 0.1C represents charging with a current of 180mA), and when the battery voltage exceeds a certain threshold (1.0V), the second stage is reached, which can prevent the over-discharged battery from being damaged when charged with a large current; in the second stage, a preset large current (1C) is used for constant current pulse charging, and depolarization discharge is performed in a timely manner; in the third stage, when the battery voltage exceeds the second threshold (1.45V), the fuzzy control method is used to adaptively control the charging current, so that the charging current gradually decreases as the battery voltage increases, so as to achieve the best charging effect. When charging is terminated, the highest voltage detection and the temperature change rate △T/△t detection are used together, and the maximum charging time and the highest battery temperature are set at the same time.


3.1 Fuzzy Controller


The fuzzy controller takes the difference between the ideal voltage and the actual voltage △U and its change rate △Un-△Un-1 as input, and the charging current I as output, forming a two-dimensional fuzzy control system. During the charging process, the battery is depolarized and discharged in time. Both △U and △Un-△Un-1 have 5 language values, namely "NB(-2)", "NS(-1)", "Z(0)", "PS(+1)", and "PB(+2)". The fuzzy control table is shown in Table 1.


Table 1 Fuzzy control table (I)

In Table 1, "I" is 0, indicating that the charging current remains unchanged; "+1" indicates that the current increases by one level; "-1" indicates that the current decreases by one level; "+2", "-2" and so on. The rule table is pre-stored in the EEPROM of the microcontroller, and the program selects the corresponding control rule by looking up the table.


3.2 System Software Process


The system software flow chart is shown in Figure 3.

Flowchart_www.schuitron.com

Figure 3 System software flow chart


IV) Conclusion


(1) This system was used to conduct multiple fast charging experiments on AA Super NiMH batteries. By combining pulse charging with fuzzy control, the battery temperature rise was reduced by an average of about 5°C compared to constant current (1C) charging.


(2) Due to the use of advanced charging control strategies, the charging voltage and current are intelligently controlled, which greatly shortens the charging time (it can be fully charged in 1h to 2h), and the charging speed is increased by 3 to 5 times compared with conventional chargers.


(3) The charging process is safe and reliable and will not damage the battery or shorten the battery life, thus achieving better results.


references:


[1] Zhang Xing, Yang Weimin, Li Gangyuan. Research on intelligent battery charging device[J]. Journal of University of Shanghai for Science and Technology, 2004(4):3812384.


[2] Chang Jiang, Jing Zhanrong, Gao Tian. Design and application of fuzzy neural controller based on HGA[J]. Computer Engineering and Applications, 2006(14):2222224.

Keywords:ATmega16 Reference address:Design of NiMH battery fast charger based on ATmega16

Previous article:Anti-interference design of heating furnace based on AVR single chip microcomputer
Next article:Data storage issues in avr's flash and ram

Recommended ReadingLatest update time:2024-11-16 13:00

AVR microcontroller (learning) - (II), ATMEGA16 interrupt system - 01
2. ATMEGA16 interrupt system 2- (01) Two-way anti-theft system test As mentioned in the previous article, this microcontroller controls the so-called registers to control the related functions of the microcontroller (the reason why it is more powerful than 51 is that it combines these and several other buses, which wi
[Microcontroller]
AVR microcontroller (learning) - (II), ATMEGA16 interrupt system - 01
Programming of LCD display screen controlled by ATmega16 microcontroller
After mastering the control and display of LCD, we need to integrate LCD into the password safe to make it an independent working system. In the CD of this issue, there is the source program of using ATmega16 to control LCD screen in the previous issue. Copy ICd.c and lod.H to the directory of the routine psmanager in
[Microcontroller]
Programming of LCD display screen controlled by ATmega16 microcontroller
ATMEGA16 realizes the production of switching power supply
  A switching power supply is a power supply that uses modern power electronics technology to control the time ratio of the switch on and off to maintain a stable output voltage. With the ATMEGA16 microcontroller as the control core, a switching power supply with adjustable output voltage step was designed and manufac
[Microcontroller]
ATMEGA16 realizes the production of switching power supply
Design of vehicle side slip detection device based on ATmega16
Introduction: The safety of cars in the process of driving is a very important issue in daily life, and the harm caused by skidding is very great. A car skidding detection device based on ATmega16 is proposed. This system introduces the ATmega16 microcontroller as the core, as well as the positive and negative power s
[Microcontroller]
Design of vehicle side slip detection device based on ATmega16
AVR MCU Learning ATmega16 ADC
Conversion rate: The number of samples taken per second. Common units: SPS (times per second) KSPS (kilosamples per second) MSPS (millionsamples per second). The faster, the better. Conversion precision: The number of significant digits (in binary) of the conversion result. Unit: bit AVR's on-chip ADC: Maxim
[Microcontroller]
AVR MCU Learning ATmega16 ADC
ATmega16 read and write EEPROM AT25256 (ICC compilation) program
#include iom162v.h #define BAUD 9600 //Baud rate 4800  #define CRYSTAL 3686400 // Crystal 3M  #define BAUD_set (unsigned int)( (unsigned long)CRYSTAL/(16*(unsigned long)BAUD)-1 ) //Baud rate calculation  #define BAUD_H (unsigned char)(BAUD_set 8) //Baud rate register  #define BAUD_L (unsigned char)(BAUD_set) /*  // G
[Microcontroller]
A new intelligent air conditioner remote controller based on Atmega16 microcontroller
  1 Introduction   In recent years, computer technology, modern communication technology and automatic control technology have developed rapidly. With the development of new technologies, intelligent home systems have also entered thousands of households. Home systems such as air conditioners, televisions, lighting sy
[Power Management]
A new intelligent air conditioner remote controller based on Atmega16 microcontroller
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号