Description

This uninterruptible power supply (UPS) can be powered using an external 12V DC power supply. It supplies 12V/48W (4A) and can briefly deliver up to 5A (60W). It can be used to protect small electronic equipments such as small servers (SBC based) or routers.

Overview

The UPS is enclosed in a 3D printed case. All power connectors are XT30 (male for input, female for output). A switcher circuit switches between external 12V DC and internal 12V DC. A down-converter converts the battery pack output voltage (typically 14.8V) down to 12V. A 4S charging circuit charges the battery pack when external 12V DC is available. It also monitors the battery's temperature and voltage: it stops charging if the battery's temperature gets too high and it shuts down the down-converter if the battery's voltage is too low. The charging circuit requires at least 17V to operate, therefore a boost-converter is used to convert the external 12V DC voltage to 20.1V DC. A thermal monitoring circuit is used to turn on the cooling fan if the down-converter gets too hot. All circuit boards can be steadily mounted in the PLA enclosure.

Wiring diagram
Overall wiring diagram between UPS components
(Upper left) Down-converter. (Lower left) Charger. (Upper right) Cooling fan controller. (Lower right) Switcher. The up-converter module is not shown as it is an off-the-shelf module that can be purchased anywhere

Switcher

The switcher module is built around the LTC4418  IC. This IC is used to connect an output to one of two input power sources, P1 and P2. P1 has a higher priority than P2. In our case, P1 is the external 12V DC power supply and P2 is the power source connected to the battery (through a 12V down-converter).

The IC constantly checks the validity of each power source Pi: UVi < Pi  <OVi, where UVi and OVi represent respectively the undervoltage limit and the overvoltage limit for power source i. Each source's validity is indicated by their respective LEDs (D1 and D2). These can be set through a precise choice of resistors. The undervoltage limit for P2 has been chosen as low as 4.85V to avoid power interruption when transitioning from P1 to P2 under heavy load. The large capacitor at the switcher's output ensures voltage stability during the transition. This design is much more efficient than the typical use of diodes, as it avoids the inherent diode voltage drop and resistance under load. A Python computation file for resistor values is provided to explain the resistors choice.

Battery pack

The battery is a li-ion 4S/2P pack of 18650 cells. Each cell's voltage was carefully measured and balanced to be fitted with another cell in parallel. Each cell has a capacity of 3500 mAh and a maximum output current of 10A.

18650 li-ion cell

The four parallel units were then assembled in series to form the final pack, using a 3D printed spacer. A 4S 10A BMS is used to balance the charge accross the different cells. A LMT85 temperature sensor is used to monitor the battery's temperature during charging. The sensor is connected to the charger module and is inserted between two cells with some thermal paste. Detailed operation of this temperature sensor is explained in the charger section.

Battery pack with a LMT85 temperature sensor
Batttery with BMS

Battery charger and up-converter

The battery charger module is built around a MP26124 IC. The charging current has been limited to 1.35A through a resistor choice to avoid excessive heat during charging and to prolong the battery's life. An inverted comparator with hysterisis (built using a LM393) is used to monitor the temperature sensor's voltage. The LMT85 has a negative slope near-linear ouput voltage. The comparator's output is low (enabling the charging IC) as long as the temperature sensor's output voltage Vtemp is higher than a low threshold Vlow. If the temperature gets too high, Vtemp decreases. The comparator's output gets high and shuts off charging. Only when the temperature drops and Vtemp goes higher than Vhigh (high threshold) can the charger be turned on again. Vlow and Vhigh have been chosen to correspond to a hysterisis window of 40°C - 43°C. A python script is provided to compute the corresponding resistor values.

Charger electrical diagram

Another inverted comparator with hysterisis is used to generate a shut down signal to the battery voltage down-converter. This turns off the UPS in case the battery has been excessively discharged. The battery's voltage is divided using R13 and R17: V'bat ~ Vbat/11 and compared to V'low. The down-converter is shut down when V'bat < V'low. It's only turned-on again when V'bat > V'high. V'low ~ 12.43/11 and V'high ~ 12.82/11. A python script is also provided to compute the corresponding resistor values.

Down-converter

The down-converter is used to convert the battery voltage (typically around 14.8V) down to 12V. It is a buck converter built around the XL4015. A couple of diodes are used to protect it against wrong battery polarity. L1 and L2 are two 47uH/3.5A inductors in parallel, to support an output current as high as 7A, even though the UPS should only be used up to 5A peak/4A full load. It can be shut down using an external high signal to the FB pin. This shut down mechanism is used to turn off the down-converter in case the battery's voltage is too low.

Down-converter electrical diagram

Since a lot of current could go through the converter and the inductors, it is better to add heat dissipators to each of these components.

Cooling fan controller

The cooling fan controller is an inverted hysterisis comparator, very similar to the one used to monitor the battery's temperature on the charging board. It uses the same TMT85 temperature sensor. The temperature sensor is powered using a 3.3V zener diode as it draws very low power. The hysterisis window is 37°C - 45°C. A python script is also provided to compute the corresponding resistor values.

Cooling fan controller electrical diagram

Enclosure

The enclosure was designed using FreeCAD to fit all boards using their exported 3D models from KiCAD.

3D model of the PLA enclosure. The down-converter and the charger boards are visible next to the battery pack. Since the up-converter is an off-the shelf module, it has been modeled using a box with roughly the same volume. It is visible on the lower right hand of the figure

Assembly relies heavily on the use of threaded metal inserts, as can be seen in the following figures. The box's lid uses 6 M3 screws whereas all boards use M2 screws. Assembly is quite delicate since space is quite limited inside the box. The assembly process is as follows:
1. Assemble the fan using M3 screws.

Fan assembly

2. Assemble the charging board

Charging board assembly

3. Put the battery pack inside the box, with the BMS facing the charging board. Connect the temperature sensor to the charging board. Connect the first end of the down-converter shut down signal wire.

Battery pack insertion

4. Assemble the up-converter and connect its output to the *CH In* connector on the charging board.

Up-converter assembly

5. Connect the down-converter's input to the *BAT OUT* connector on the charging board. Insert the cooling fan temperature sensor between the two inductors on the down-converter board. It is easier to screw the down-converter before placing the thermal dissipators on the buck converter and the two inductors. Connect the shut-down signal wire from the charging board.

Connecting and assembling the down-converter. The cooling fan temperature sensor has been inserted between the two inductors

6. Assemble the switcher and cooling fan controller boards on the lid. Connect the fan to the controller board and connect the power input of the controller board to the switcher's output. As the cooling fan controller was a *last minute add-on*, I have not added a dedicated connector on the switcher board. Soldering one side of the connector to the switcher's output was a quick and dirty solution, nevertheless, it works just fine.

Cooling fan controller and switcher boards assembly on enclosure lid

7. Connect the down-converter's output to the P2 input on the switcher board. Connect the battery to the charger board (BAT IN). The P2 LED should light up on the switcher board, if the battery is charged. Assemble the lid on top of the box. The UPS is thus assembled.

Connecting the battery lights up the P2 blue LED on the switcher board

Measurements

To make sure the UPS works as expected, a dummy load was connected to the output as shown in the following figures.

Load test on battery power only
Load test using a lab bench power supply. The power supply is giving out 5.34A which corresponds to the 4A load and the battery charging current.

Possible extensions and future work

It would be possible to add a small ESP32 chip that monitors and reports P1, P2 and all other important signals, such as the down-converter shut down signal, the cooling fan status etc. It could also be used to measure the battery's internal resistance to indicate it's charging percentage. The ESP32 could also be used to maintain the battery at 80% of its capacity to prolong its life.