Charger PCBA hardware program design
This article mainly designs a low-cost smart charger for nickel-cadmium batteries. The charger has rich functions and will not reduce the actual cycle life of the mobile phone battery due to the long charging time of the battery. Therefore, the damage caused by unreasonable charger settings can be avoided, the service life of the battery can be extended, its performance can be improved, and its intelligent management can be enhanced, thereby reducing the fatigue and charging time of the charger during the charging process. This will not only reduce costs, but also improve its flexibility.
1. Basic principles of smart chargers
The key to battery charging is to achieve effective charging and stop charging in time to avoid damage to the battery caused by overcharging, and to display its power and voltage during charging, which is convenient for timely understanding of the charging status of the battery; it can also implement error checking, When an error is found during the charging process, the power should be automatically cut off immediately to protect the battery and charger from damage.
It mainly includes regulated power supply part, constant current source part, trickle charging part, voltage detection part, display part and control part, etc. The main function of the regulated power supply part is to convert the 220V household voltage into a DC voltage to supply power for other circuits. The constant current source circuit is a current source formed by a voltage regulator and a resistor, which provides a constant charging current for the entire circuit. The automatic power-off circuit is based on the automatic shut-off characteristic of the MOSFET, which mainly realizes the function of automatic power-off when the battery is fully charged. Finally, the charging status and the power status of the circuit are displayed by the light-emitting diode.
2.Analyze the battery charging process
The following points are analyzed for the smart charger in terms of speed and intelligence.
2.1 Voltage detection and microcontroller control part
The control circuit is shown in Figure 1. AT89C2051 has 20 pins, and the pins have strong pull-down drive capability. For example, the pull-down capability of pins P1 and P3 can reach 20mA. When the drive capability of AT89C2051 is enhanced, the LED digital tube can driven directly by it. And it also has two characteristics: one is low voltage; the other is high performance, with a built-in general-purpose 8-bit CPU and Flash unit. The internal structure of AT89C2051 is a simple analog signal comparator. If its P1.0 and P1.1 ports are connected to its input, the comparison result will be automatically stored in the corresponding register of P3.6. In this circuit, Vcc is connected to the power supply; the power-on reset circuit is connected to the RST port. When the oscillator is running, it will continuously give the RST pin a high level of two machine cycles to complete the circuit reset; the reverse output and input of the oscillator circuit They are respectively XTAL1 and XTAL2, connected with the crystal oscillator circuit, and then generate a clock signal; the interrupt communication is realized by the P3.3 port, and connected with the buzzer to form an alarm circuit; the constant and trickle conversion circuit is connected with the P1.6 port, After the battery is fully charged, it will automatically cut off the power supply and switch to trickle charging; the light-emitting diodes are connected to the P1.4 and P1.5 ports, and the main purpose is to display the working process of the entire circuit; the internal voltage comparator is connected to P1.0 and P1. 1 port connection, where the positive pole of the battery is connected to the P1.0 port, and the P1.1 port is connected to the external reference voltage. Then compare the reference voltage generated by TL431 with the battery voltage, and send the comparison result as a detection signal to the microcontroller; the GND port is grounded.
TL431 is a three-terminal adjustable shunt reference source with good thermal stability. Its output voltage range is wide from the reference voltage (Vref) 2.5V~36V interval, and two resistors can be used to take any value in this interval. The typical dynamic impedance of the device is 0.2Ω, and 2.5V is its internal reference voltage. The internal reference voltage is connected to the reverse output terminal of the operational amplifier circuit. After the feedback circuit is introduced from the REF terminal, the device can operate in a wide range Upper shunt control voltage output. After R1 and R2 determine the resistance value, add feedback. At this time, compare the standard voltage after being fully charged with the battery voltage. If the battery standard voltage is lower than the battery voltage, the circuit will control the circuit through the microcontroller. Convert yourself and keep working.
2.2 Constant current source charging circuit
LM317T integrates a three-terminal adjustable voltage regulator as the core device, and its voltage output can provide 1.5A current when it meets the voltage output between 1.2V~37V. This regulator is highly stable and can be connected with two external resistors to set the output voltage. Additionally, features such as its internal current limiting, thermal shutdown, and safe operating area compensation can be used to prevent blown fuses.
2.3 MOSFET drive circuit
The drive circuit is isolated from its pre-circuit by optocoupler to reduce the interference to the control circuit. The control signal is applied to the control end of the bridge arm drive circuit in turn by a complementary method. Since many MOS tubes are equipped with voltage regulator tubes to forcibly limit the amplitude of the gate voltage, this allows the MOS tubes to work safely at high gate voltages. In this case, if the voltage of the Zener tube is lower than the provided driving voltage, large static power consumption will be generated. In the same way, if we use a simple way to reduce the gate voltage, such as choosing the principle of resistive voltage division, then there will also be a situation where the input voltage is high, and the MOS tube works well, but when the input voltage is reduced, the gate voltage is insufficient, so Insufficient conduction is caused, resulting in increased power consumption. The following is the specific work of the circuit: first turn on the driver, the control signal will be converted from high level to low level, the transistor Q1 will be cut off, and then the power supply Vcc will be driven to turn on the transistor Q2, and the voltage regulator W1 will break down. When the circuit produces a constant current Ic. Ic flows through R5, so that the MOSFET of the bridge arm forms a gate-source voltage, and controls the turn-on current of the MOSFET.
3. Charger software design
The software program design for this circuit is as follows: The whole process of charging can be divided into two stages with cycles. The charging process is divided into the first stage. This process takes 900ms. This stage is mainly to realize the charging process of the circuit to the battery. During the charging process, the indicator light is always on. The self-inspection process of the circuit is the second stage, the time is 100ms, to detect whether the P3.6 port of the single chip microcomputer is 1, if it is detected to be 1, stop charging the battery and start the circuit alarm device, otherwise it will continue to charge, and then repeat the process. process. In order to ensure that the detection part of the circuit can be more accurate, we have added ten cycles of detection to the software design. Only when the results of the ten detections are all 1, the circuit will stop charging and switch to trickle charging. The cycle charging cycle is theoretically 0.9s, and the detection time is 0.1s, which is the time for a complete charging cycle to complete. The key to the whole program is the P3.6 pin.
Summarize
From the results, it can be seen that the indicator light controlled by the single-chip microcomputer charges the battery after the power is turned on. The green light is on, indicating that the charging is normal. When the red light is on and the green light is off, it means that the charging is over, and then the buzzer immediately sends out an alarm. If the charged battery is still not taken out after the alarm prompts, the circuit will automatically judge that it will be trickle charging, which can prevent the battery from being discharged and also protect the battery from being damaged. The design of the charger with a single-chip microcomputer can not only realize the charging of ordinary batteries, but also have corresponding overvoltage and temperature protection, so that the battery can prolong its service life and fully utilize the performance of the battery.
The above is the development example of the charger control board introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. for you. If you have a charger PCBA solution development demand, you can trust us. We represent a variety of single-chip microcomputers, voice chips, dual-mode Bluetooth ICs, and wifi chips. Brands include Songhan MCU, Yingguang MCU, Jerry Bluetooth, Ankai Bluetooth, Allwinner, and Realtek. Our technical services include: PCB design, microcontroller development, Bluetooth solutions, software and hardware custom development, APP development, small program development, WeChat official account development, etc. It can also undertake the design of intelligent electronic products, the development of living appliances, the research and development of beauty equipment, the application of Internet of things platform, the smart home control system, the development of TWS earphones, Bluetooth earphone speakers, the development of children's educational toys, the design of electronic education products, etc.
Proposal recommendation
- TOP