A 12V lead-acid battery is used to store electricity. When there is no external 12V input, the battery is switched to continue to supply power. MCU: 826612F, boost circuit chip XL6019E1, buck chip MP2236, battery charging chip CN3763, INA226 chip monitors current and voltage, and has integrated download circuit. At the same time, real-time data upload of WeChat applet and WeChat information alert of Buffa Cloud are carried out.
Design considerations:
1. The switching circuit uses a high-speed NMOS tube for circuit switching for the first time, but it is found in actual measurement that the voltage drop loss of the MOS switch tube is abnormally high and the device is seriously heated. By changing the control voltage, it is found that the control voltage needs to be higher than the circuit voltage by more than 3V to be fully turned on. To achieve the above requirements, a charge pump or DCDC boost circuit must be added to pull up the control voltage, but this also increases the material cost. Therefore, a relay is used to switch the circuit to avoid the voltage drop loss problem of the switching circuit.
2. There is burr interference at the moment of switching, and output capacitor suppression is added.
3. When designing PCB wiring, Kelvin connection is required as shown in Figure 11 to reduce the measurement error caused by different measurement circuits.
Switching time detection:
By adjusting the BX and AX positions of the Y axis, the circuit switching time interval is checked through the results of BX-AX to obtain the power switching waveform details. Figure 1 is a waveform diagram of the input power supply being disconnected and switching to battery power supply, where the lowest output voltage is 9V and the power switching takes 4.8 milliseconds. Figure 2 is a waveform diagram of the battery being disconnected and switching to external power supply, where the voltage slowly changes to the input voltage and the switching takes 1.7 milliseconds, which is faster than the 10 millisecond switching time of the conventional offline UPS.
Charging test:
The sampling resistor is set to 0.01 ohm. The charging power is trickle charged at 7W. When the voltage rises to 10.65V, constant current charging is performed at 40W. When the voltage reaches 12.55V, constant voltage charging mode is performed as the charging power decreases.
The highest temperature during charging: 55.2℃, and a heat sink can be added for more efficient heat dissipation.
The output ripple can be further optimized. Theoretically, the ripple of mp2236 can be as low as 50mV.
The test results of this work are shown in the figure below. The output voltage is 4.96V and the peak-to-peak value is 120mv, which meets the requirements of conventional equipment.
The code is not optimized and will be updated and shared later.