Second Life UPS

Table of Contents

1. Design overview

I have decided to build a UPS that would power my home network equipment rack using lithium-ion 18650 cells.

thumb-rack.jpg

First let's lay out some basic design considerations

  • should fit the equipment rack in a 1U format
  • it should provide 12V DC, 5V DC as well as 230V for the switch

The current list of devices that need to be powered by the UPS together with their nameplate voltage and current consumption information:

Device Voltage [V] Current (max) [A] Power (max) [W] Notes
Router 19 2 38 A small form factor PC
16-port switch 230V AC 0.1 22.5 Rated at 22.5 W in the technical specs
AP 24 0.25 6.5 Rated at 6.5 W (see datasheet), passive 24V PoE Mode B (230V/0.02A)
Raspberry Pi 5 2.1 10  
GPON modem 12 0.5 6  
Total     83.  

As can be seen there is a large amount of different voltages required in order to power all of the devices, therefore some modifications and compromises will have to be made:

  • The UPS will provide stabilized 12 V and 5 V power rails
  • The 19V for the router will be provided by a dedicated step-up dc-dc converter based on the very popular XL6009 chip from aliexpress
  • The 230V AC will be temporarily provided by a small car 12V -> 230V inverter
  • The PoE injector is scheduled to be replaced by an PoE injector which can be powered from DC
  • The router will be replaced in the future with a Mikrotik Routerboard or a PFsense appliance from https://teklager.se/en/pfsense-hardware/ that both can be powered from DC
  • The switch will be modded to have a DC power supply

2. Component layout

The 1U case that I used for this project is a case from a ipTime ZC-SW2405 switch:

thumb-switch-case.jpg

I have removed everything from the switch case including the power supply as it was only providing 3.3V and did not have enough power. The case has 1U dimensions, to be exact 16 cm x 44 cm x 4.4 cm. I have also drilled out all of the studs holding the original PCBs to the case in order to fit the battery and AC PSU. This has proven to be a hindrance however as I had to remake some of them later to mount my custom boards.

The case size puts a limit on the size and shape of two biggest internal components - the battery pack and the 230V AC power supply. I have devised the following placement for these components.

thumb-basic-layout.jpg

From the basic layout the following elements are COTS components:

Brand Model Parameters Notes Link
KAYPW Switching Power Supply 24V 5A 120W max   https://www.aliexpress.com/item/33042313383.html
  40A 16.8V Balance REV 2.3 4S 40A   https://www.aliexpress.com/item/4000026248298.html
  XL4015-B CC/CV module 5A CC/CV, 75W max Li-Ion charger https://www.aliexpress.com/item/4000383898441.html
  XL4015 buck dc-dc converter 5A max Provides 5 V and 12 V outputs https://www.aliexpress.com/item/4000796650052.html

3. The battery

The battery for the UPS was built using 18650 Li-Ion cells recovered from hoverboard battery packs. These are cheap no-name cells with not a lot of capacity left in them (around 800 mAh) each but I figured that a UPS would be the perfect idea to utilise them. They will operate under low current load per cell so their internal resistance shouldn't be a problem. The UPS will be mostly sitting idle and charged so the cells won't get further capacity fade from cycling. The cells have been screened for self-discharge and excessive heat generation during operation. As the space in the case is pretty tight heat might be a problem therefore two thermal fuses tripping at 75 °C have been fitted in the battery as a safety feature. The battery will be protected with a 20A car fuse and paired with a 4S 40A BMS.

As a further step to increase the lifetime of the cells the top charging voltage will be limited to 4V per cell. This provides a battery with around 80% capacity while significantly increasing the number of cycles (see https://batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries).

The cells themselves were mounted in plastic cages recovered from the disassembled hoverboard battery packs. This type of cages are not the only ones that can be used, you could also use very popular DIY holders with brackets that can be assembled together in many shapes: https://www.aliexpress.com/item/32871111193.html. The cells were welded together with a spot welder using a 0.1 mm nickel strip, first the rows of the cells:

thumb-battery-pack1.jpg

Next, the cells are arranged with poles alternating between positive and negative. This makes it easy to weld horizontal strips forming series connections between cells on both sides. This can be seen on the two pictures below:

thumb-battery-pack2.jpg

thumb-battery-pack3.jpg

Next, the battery has the main leads soldered to the ends and balancing wires to each cell.

thumb-battery-pack4.jpg

thumb-battery-pack5.jpg

After applying insulating tape on both ends and also between the cells the battery connections are complete:

thumb-battery-pack6.jpg

Now two thermal fuses are attached with heat-conducting glue in order to trip a protection circuit if excessive heat is generated during charging or discharging of the battery.

thumb-battery-pack7.jpg

4. The output board

The output connectors board provides for the attachment points for all of the devices being powered by the UPS. Due to a "standard" developed in the Warsaw Hackerspace of using Tamiya connectors as universal DC power plugs I have opted to get 4 of those on the front as well as 4 screw terminals. These were divided in between the 12V and 5V outputs. As the 12V output is much more versatile there are 6 x 12V and 2 x 5V outputs.

The actual building process of the output connectors board was a multi-step process as I wanted to make sure that my connectors would perfectly fit the existing cutouts in the front panel of the switch. First, the baseboard was fitted and screwed in in front of the cutouts. A piece of double sided tape was glued to hold the connectors when they are positioned in place:

thumb-output-board1.jpg

Then the 4 Tamiya connector housings were glued in place held together with their corresponding plug housings in order to provide proper clearance for the entire pack. The screw terminals were mounted in a similar fashion:

thumb-output-board2.jpg

The screw terminals were additionally fixed with epoxy glue as the surface holding onto the doublesided tape was too small to ensure a good grip. After the connectors were mounted they were soldered to 12V (yellow wires) and 5V (red wires) power rails and a common ground rail.

thumb-output-board3.jpg

On the right you can see the fuse sockets, one is for the 12V rail, the second one is for the 5V rail and the third one is used for the auxillary rail connected directly to the battery without any DC-DC converters in between. This will not be available on the front but have a screw terminal inside where extra devices can be connected. The power rails and ground rail were reinforced with copper "busbars" from below:

thumb-output-board4.jpg

The DC-DC converters supplying the 12V and 5V rails are mounted on the side of the connector boards one on top of the other secured with distance posts and an isolating pad at the bottom. These have outputs on the right which will be connected with short wires to the connector board, you can also see the blue screw terminal on the connector board used to plug in into the auxillary battery connection. In the initial revision of the hardware, the 5V was supplied by an LM2596 module and 12V was sources from an XL4015. This can be seen on the picture below:

thumb-output-board5.jpg

I have found out however, that the LM1596 isn't capable enough to reliably power all of the 5V loads (a Raspberry Pi + a fan in the rack in my case). Therefore I decided to replace the LM2596 with another XL4015 board adjusted to provide 5.1V just in case to account for voltage drops on shitty wires. During the mounting of both boards I had to provide some distancing between the top and the bottom one as the bottom inductor was touching some solder joints on the top board. I used here small M3 screws with plastic insulating distance rings which were originally holding MOSFETs to a heatsink in a power supply. I knew they would come in handy some day ;)

thumb-distance-screw1.jpg

The plastic distance rings fit perfectly into the M3 holes of the module and provide an ideal amount of distancing:

thumb-distance-screw2.jpg

thumb-distance-screw3.jpg

5. The controller board

Even though the entire controller board has been manually wired on a breadboard I made a schematics of the connections in KiCad instead of paragraphs of text describing how everything is connected together:

control-circuit.svg

If your browser can't render SVGs oO, you can download the PDF version or the Kicad project itself. The controller board circuit was assembled on a breadboard with the time-proven technique of jumper wire:

thumb-controller-board1.jpg

You can also see a heatsink attached to the BMS and a long screw terminal used as a point to connect all of the ground wires. Two LEDs are plugged in and wired to the front panel to provide basic status information. The thermal fuses are not yet connected and their terminals are shorted with jumpers for testing purposes. The fan cooling the AC PSU is powered via a 7812 regulator wrapped in insulating tape as it was added as an afterthought and I didn't want to disassemble everything:

thumb-fan-power.jpg

The battery cutoff switch seen on the schematic acts as if a thermal fuse has been tripped cutting of power to both the charging relay and the power selection relay disconnecting the battery from both the charger and the loads.

6. AC power connection

The AC 230V cable has been attached using an electrical pipe fitting usually found in distribution boxes. It's very practical as it's pretty sturdy and provides a good amount of strain relief for the cable:

thumb-ac-cable1.jpg

7. Final device

The final result before the case is screwed on:

thumb-final-assembly1.jpg

The front panel contains two status LEDs as well as the battery cutoff switch.

thumb-final-assembly2.jpg

I have also added stickers to showcase maximum current ratings allowed and label the output voltages.

thumb-stickers1.jpg

Author: Maciej Grela <enki@fsck.pl>

Fediring