I Description
This blog introduces the design of a lithium battery backup power control board based on LM393, which is simple, stable, reliable, and low-cost. It can directly output the mains voltage when there is mains power, and continuously monitor the mains voltage.
Not only can this design automatically turn on the inverter within 10 ms after the mains power is off, but it also has a power management function: when the internal lithium battery voltage is lower than the set value, it will automatically charge.
This Vedio introduces How Does LM393 Works
Catalog
II Design and Working Principle
The details of LM393 based lithium battery backup circuit are as follows:
2.1 Design
2.1.1 Mains Power Failure
When there is no mains power input, the control panel will turn on the inverter and output 220V AC within 10 ms of the mains power failure.
2.1.2 Charging Management
Figure 1. Function Diagram
When there is mains input, the control board first shuts down the inverter output and switches to the mains output; then enters the charging management state (due to the feature of the lithium battery protection board, the protection board stops charging after overcharge protection. When the battery voltage When it drops to the overcharge recovery value or below, it will automatically resume charging. When there is mains input for a long time, the lithium battery charger will be repeatedly charged, which will affect the life of the lithium battery).
When the lithium battery is fully charged, it will stop charging. When it drops to a certain level (this parameter is lower than the overcharge recovery value of the lithium battery protection board, the specific parameter value is adjustable) and then resume charging until it is fully charged, and repeat the above process.
2.2 Working Principle
According to the design requirements, the principle design of this control board is divided into two parts: lithium battery voltage detection and control, and mains voltage detection and control.
The main voltage comparison part of the control board uses the dual voltage comparator integrated chip LM393. LM393 integrates 2 independent comparators, its operating power supply voltage range is wide, it can work for 2~36V when single power input, and ±1~±18V when dual power input. In addition, its current consumption is small, only 0.8mA.
And what is the pinout of LM393? We can take a look at Figure 2 below:
- Pins 3 ,5 are the non-inverting input terminals of the two comparators respectively;
- Pins 2, 6 are the inverting input terminals of the two comparators respectively;
- Pins 1,7 are the corresponding output terminals of the two comparators respectively.
Figure 2. LM393 Pinout
When used as a basic comparison circuit, if the voltage at the non-inverting input terminal is greater than the voltage at the inverting input terminal, the corresponding output terminal outputs a high level, and vice versa. For example, when U5>U6, U7 outputs high level; when U5<U6, U7 outputs low level.
2.2.1 Lithium Battery Voltage Detection and Control
Lithium battery voltage detection control is shown in Figure 3.
(1) Power Supply
The power supply of the control part is taken from the lithium battery of the backup power supply, and the voltage of the control board is 12V DC. Because the lithium battery in this design is 48V, its voltage range is 32V to 54.6V, which is higher than the large input voltage required by the stabilizer block 7812. Therefore, in order to protect the voltage regulator block 7812, we need to connect a 20 V voltage regulator tube in series at the input to step down. Here, diode D5 acts as reverse voltage protection
(2) Voltage Comparison
The power management adopts the comparator LM393, the sampling voltage of the lithium battery is divided by resistors R11 and R12, and then input to the non-inverting input of LM393. The reference voltage divides 12V through the resistor R4 and the potentiometer, and then enters the inverting input of LM393.
When the sampling voltage U1 is higher than the reference voltage U2, the output terminal corresponding to LM393 outputs a high level, the transistor 9012 is turned off, the relay does not operate, and the inverter stops working.
When the sampling voltage U1 is lower than the reference voltage U2, the output terminal corresponding to LM393 outputs a low level, the transistor 9012 is turned on, the relay acts, and the inverter is turned on. The reference voltage can be adjusted according to the actual parameters through the potentiometer R5.
Figure 3. LM393 Lithium Battery Voltage Detection and Control
(3) Hysteresis Comparator Circuit
In a single-limit comparator, if the input signal Uin has a slight interference near the threshold, the output voltage will produce corresponding jitter (fluctuation). For example, in the design of lithium battery voltage detection, if the sampling voltage of the lithium battery fluctuates near the target voltage (see Figure 3), the voltage of U1 is higher than the voltage of U2, and the output of the comparator should output a high level. However, if the U1 voltage or U2 voltage fluctuates slightly at this time, the transistor 9012 is likely to be turned on and off frequently at this time, and the control output will be very unstable.
Then how to overcome this shortcoming? We can introduce positive feedback in the design (that is, the way of hardware to achieve return difference). If we need to fix a trip point at a certain reference voltage value, we can insert a non-linear element (such as a crystal diode) in the positive feedback circuit. By using the unidirectional conductivity of the diode (in Figure 2, D10 diode 1N4148), the above requirements can be achieved.
2.2.2 Mains Voltage Detection and Control
The description of the mains voltage detection control part is shown in Figure 4.
(1) Power Supply Part
The power supply part uses the same power supply DC 12 V as the lithium battery voltage detection and control part.
(2) Mains Voltage Detection
Taking into account the cost of the mains voltage detection part, this design abandons the traditional transformer or voltage transformer detection method, and uses two optocoupler chips PC817 to detect the mains. PC817 is a commonly used linear optocoupler, which is often used in functional circuits that require more precision. When an electrical signal is applied to the input end, the light emitter emits light and illuminates the light receiver. The light receiver is turned on after receiving the light, and generates a photocurrent output from the output end, thus realizing the "electricity-optical-electricity" conversion. This conversion is often applied to various civil industrial products such as switching power supplies, UPS, adapters, etc.
Figure 4. LM393 Mains Voltage Detection and Control
Take AC 220V as an example. In order to protect the optocoupler, we use a 1MΩ resistor in the design to limit the current of the optocoupler emitter. The optocoupler chips U1 and U2 are respectively turned on under the action of alternating current, and cooperate with the capacitor C6 to ensure that the voltage of the non-inverting input terminal U3 is greater than the inverting input terminal U4 under the condition of normal mains input. The optocoupler chip used in this design can also be used for electrical isolation between the control board and the mains.
When there is mains power:
- LM393's non-inverting input terminal U3 voltage is DC 12V
- Inverting input terminal U4 voltage is 9V (R2, R10 divided voltage)
- The corresponding output terminal is high
- The transistor 9014 is turned on
- The relay operates
- The normally closed point is open
- There is output between mains voltage
When there is no mains power:
- The voltage at the non-inverting input terminal U3 of LM393 is DC 0V
- The voltage at the inverting input terminal U4 is 9V
- The corresponding output terminal is low level
- The transistor 9014 is cut off
- The relay does not operate
- The normally closed point is closed
- The inverter outputs 220V.
III Test
After testing, this control circuit meets the design requirements: when there is mains power supply, it outputs mains voltage, and automatically converts to backup power supply within 10ms in the case of mains power failure, and has good charging management functions, as shown in Figure 5 and Figure 6.
Figure 5. Lithium Battery Voltage Detection Waveform
Figure 6. Mains Voltage Detection Waveform
In practical applications, MOS tubes and triacs can also be used to replace the relays in the voltage detection and control part of the lithium battery and the relays in the mains voltage detection and control part to achieve the control output.
IV Conclsion
This control board is designed according to the characteristics of the lithium battery backup power supply that is gradually popularized at present. It has the advantages of strong anti-interference and low cost, and has strong market promotion value.
In subsequent designs, we can also add protection functions such as battery under-voltage protection, short-circuit protection, overload protection, over-voltage protection, and over-temperature protection according to user requirements to continuously improve the product.
After reading the blog, have you better understand LM393?
Finally, if you have any questions about LM393, please do not hesitate to leave a message in the comment section below!