Custom Uninterruptable Power Supply: Full Design With Prototypes

by Akiyama in Circuits > Electronics

2583 Views, 29 Favorites, 0 Comments

Custom Uninterruptable Power Supply: Full Design With Prototypes

3d 2.PNG
IMG_20221222_224728_052 edit.jpg

Hello. In this instructable, I would like to share with you the joy (and a little bit of struggle) of designing my own uninterruptible power supply. I will try to present you the whole design process, my thoughts, mistakes, and results.

Supplies

For the design, you will need any software that allows you to create electronic schematics and layouts.

For prototypes, you need a soldering iron, cuprextit boards, wires, solder, flux, and the components listed later.

For measurement, you need a multimeter, an oscilloscope, and a thermometer (or thermal camera).

What Is an Uninterruptible Power Supply?

whatisUPS.png

An uninterruptible power supply (UPS) is a device that ensures that the load stays powered even if the grid blacks out. On a very simplified diagram, you can see how the direct current standby UPS works.

When there is power on a grid, current flows first via an ACDC converter and then via a DCDC converter to the output. The battery is charged to its full capacity and is prepared for a power outage.

When a power outage occurs, the battery replaces the ACDC converter and powers up the rest of the circuitry.

The device must also have some kind of detection circuit implemented, as well as protections and charging management.

Lead-Acid or Li-Ion Battery?

Lead vs Li-ion.png

I needed a specific type of UPS that would fit on the maximum 13x17 cm printed circuit board and would be max. 4.5 cm high to fit into my modular system. I also needed it to provide two selectable voltage rails: 12V and 5V. Both should handle 2 Amps, and the battery should provide this power for at least 1.5 hours.

Since the beginning, I knew that the lead-acid batteries would not be usable in this project. They have a low power density compared to lithium-ion batteries and are sold in quite large dimensions, which won't fit into my system.

Let's assume that UPS will have 80% power efficiency. 2 Amps at 12 V per hour make 24 watt-hours. With 80% efficiency, at least a 30 Wh battery is needed. If I use four 18650 types of cells, this should provide me with around 40 Wh total with a good reserve, accounting for the battery degradation over time. A lead-acid battery with equal energy would be much heavier and larger in volume.

Schematics

schematics.png
1.PNG
2.PNG
3.PNG
4.PNG
5.PNG
6.PNG

The schematic shown here is final, but it went through multiple edits and adjustments. I will briefly explain each section (block) and what they do.

1: Input protection and 24V ACDC adapter: UPS can be powered either from the grid or from an external DC supply. In the case of grid power, there is a fuse and varistor, which protect the system from overvoltage or short circuit. Power is converted via the isolated converter AMEL45-24SJZ, which can provide 45 W and has a peak efficiency of 86%. Switch SW1 is a toggle switch that can enable or disable the whole UPS system, including the battery. Q6 and additional components serve as reverse-polarity protection.

2: Battery charger, battery pack, and battery management system (BMS): The battery pack consists of four 18650 batteries (BT1–BT4), connected in series (4s configuration). There is an external BMS system that must be connected via a connector. The battery pack is protected via a 3.15-A fuse.

When designing the charger, I wanted to avoid specialized integrated circuit chargers. Due to component shortages, it might be a problem in future designs. Therefore, I designed a simple one-stage constant-current charger with analog control. It works as follows: Battery voltage is sensed via U5A and U5B, which are configured as comparators. If the battery pack voltage is below 15.8V, the U5A output goes high and sets the CD4043 latch, which enables the linear charger U10. When the battery pack voltage is higher than 16.8 volts (4.2 volts per cell), the latch is reset via the U5B comparator, and charging is stopped. This circuit is simple and reliable. Since there is no need for very fast charging, the pack is charged only with 120 to 240 mA, and there is no need for the CC-CV phase.

3: Control logic: Control logic makes sure that the switching from the grid to the battery happens as fast as possible. U1 is constantly sensing the scaled input voltage, which is compared to the stable voltage generated by the 5V regulator. When the ACDC converter voltage falls below a certain threshold, a pass transistor Q5 is shut down and a bidirectional switch Q10–Q11 is enabled. BZ1 is a simple buzzer that, with a short beep, lets the user know that a power outage has occurred.

4: 12V, 2A DCDC Converter: This is the DCDC converter, which provides my primary output power. I used the IC AP1501-12-K5G, which is quite available and a very simple converter. L1 and D4 were selected to handle 2A of continuous current, and the output is protected by a PTC fuse and a transient voltage suppressor. SW2 is a toggle switch that will enable either a 12V or 5V converter.

5: 5V/2A DCDC Converter with USB Output: The 5V converter is topologically the same as the 12V one, but it uses a different control IC (AP1501-50K5G-13). The input capacitors of both converters were selected to obtain a low output ripple voltage. Both converters also have the minimal load needed for regulation (R17 and R18).

6: 12V and 5V linear regulators: linear regulators provide power for control circuitry and also the reference voltages for comparators. I originally wanted to use only a single 5V regulator, but battery charger circuitry needed a higher voltage for proper operation.

Laminate Prototypes

IMG_3620 - Copy.JPG
IMG_20230216_180440_450 edited.jpg
IMG_3622 edit.jpg

To verify the functionality of my schematics, I made a few laminated prototypes.

I made the boards with chizel and one-sided cuprextit laminate board. This technique is relatively fast, allows you to modify circuits easily, and provides a lot of space for oscilloscope probing. There is also a big ground plane, which helps when designing high-frequency stuff.

First, I make a layout using a marker, and then I cut it out by making very shallow grooves. Copper is thin—only 35 mm thick—so it can be easily removed. After the layout is done, I usually clean the board with alcohol and lightly polish it with an iron sponge.

Oscilloscope Measurements

pic_59_6 edit.bmp
pic_59_4 edit.bmp
pic_59_5 edit.bmp

There are a few parameters or events that must be measured with an oscilloscope in order to verify the design. At first, I measured the output regulator ripple at a 12V rail and a 2A load. Peak-to-peak ripple was less than 50 mV, which is a little bit higher than I want. Increased output capacitance should fix this.

I also measured the bidirectional switch in action. Upon a power outage, voltage after switch (this voltage coming into the DCDC converters) measured a minimum voltage of 12.4 volts for a short period of time. This is sufficient, and it should be no problem for the converter output capacitors to hold the output voltage during the switch transition.

On the last oscillograph, there is a plot of the input and output rails. During the power outage, the output rail (12 V, 2 A) holds voltage nicely, and there is only a small drop in voltage of 160 mV. This is good for my purposes, and it won't be a problem for the load. However, if there was a need to reduce that drop, I think the only way would be to replace the converter IC chip.

Thermal Management

flir_20230612T125151 edit.jpg
flir_20230612T125345.jpg
flir_20230612T125526.jpg
flir_20230612T124841.jpg

Temperature measurements can tell a lot about the safety of the design and its overall reliability. Especially for UPS, it is expected to have a quite long lifetime and should be robust.

By measuring the output regulator temperature, I decided to add a heatsink to it, which reduced the temperature by almost 10 degrees, from 52.4 to 42.0. The second regulator did not need a heatsink since I don't plan to load the USB line with the full 2 amps.

The battery charger temperature was around 33 °C, and I used power resistors in the design.

Bidirectional switch temperature is crucial since it provides a direct path from the battery pack to the load. I used two transistors in the SOT23 package, but they have quite small on-state resistance, which resulted in a temperature of 32 °C.

PCB Design

layout.PNG
layout - Copy.PNG

During the layout design, I started with the PCB constraints—dimensions and placement of connectors and switches. The narrow side should contain the main on/off switch, status and charge indicators, and also the output connectors. On the opposite side, there should be a place for the input AC connector and the optional DC connector.

I began with the placement of the AC voltage connector and the mains voltage rails. This should be on the corner, since then it is easier to isolate it from the low-voltage circuitry and for safety. The ACDC converter is quite big, so I placed it next.

A system contains four battery cells, which are placed in individual holders. The only way to start the board was with a placement of 2x2. After that, I was left with a narrow space in the top area and also some space at the bottom right corner. On the right, I placed output connectors, switches, and indicators.

On the image, you can see the block sections placed on the board. I tried to route in such a way that I minimized the power rails going between converters and output connectors.

PCB and Assembly

IMG_3648.jpg
IMG_3623.jpg
IMG_3646.JPG

I ordered the first version of the PCB and assembled it. At first, I tried to use solder paste, but it was a lot of work without a proper soldering hot station. Later, I decided to hand-solder the board manually. It took quite a lot of time, and during the process, I already found a lot of design mistakes.

First Version Errors and Mistakes

IMG_3626 edit.jpg
IMG_3628 edit.jpg
IMG_3630 edit.jpg
IMG_3632.jpg
IMG_3639.jpg

Design is an iterative process. This is something I always repeat to myself when I find a new problem. I will share some of them:

  • I messed up when creating a footprint for the ACDC converter. It has two output pins, and of course I swapped them (I had to test it from the second board via wires).
  • Multiple transistors had the wrong pinout combination. I was lucky that this could be fixed by rotating them.
  • Made the wrong connection during testing and burned a trace. Oops
  • I forgot some pullups for charging.
  • Some components were placed too tightly.

Redesign, Finish, and Future Modifications

IMG_20221222_224728_052 edit.jpg
3d.PNG

Thank you for reading this instructable. I wanted to simply share my design and maybe get some criticism in order to improve. I also want to encourage you (and myself) to never stop designing if you like it, and do not be afraid to fail or face the never-ending iterative process of improving.

Some future improvements and potential modifications I am aware of:

  • Use a single adjustable converter for both output rails (reducing the overall cost and part count).
  • Use an e-fuse IC for better protection and slew rate control.
  • Figure out a way to simply interconnect a BMS with the main board (to avoid cables and the connector).
  • Replace the control circuitry with parallel diodes and a passive bypass relay.
  • Use an integrated circuit for battery charging or a microcontroller.
  • Reduce the total part count (every part counts when it comes to manual assembly).
  • Reduce the number of LDOs (the secondary one is needed only for charging control).

Please let me know if you have any questions and what are your suggestions for improvements. Thank you.