Custom DC UPS, bypass AC-DC stage & Support Automatic safe shutdown

Random video i came across

1 Like

That is rubbish. To charge the batteries and discharge there is more loss than running from AC

1 Like

I think in the video the guy is having massive blackouts, so to extend the run time of the PC on the batteries he skipped AC-DC computer PSU.

I found it. It’s Meanwell DRS-240-12.


This one has all the features. 20A seems to be the max current. If you are running load of 10A, remaining 10A will be used for charging.

The charging current is also adjustable.

Has tons of features, can tell if load is running on battery or main power, custom charge curve (with external meanwell programmar) and stuff like that over ModBus/CanBus.

It has relay contacts that close and open ON following

  • AC Fail
  • DC Okay
  • Battery Low
  • Charger Fail


With the sweet sweet price including importing to India.

image


Totally unaffordable and way too industrial for us, back to DIY route.

2 Likes

Heisen, Inspired by this thread, I went ahead and completed a long pending set of projects which required somme minor DIY but minimal of “getting hands really dirty”

Most of the elements compiled below have been done after fair amount of research and validation and I won’t go into the deets right away but feel free to ask if needed..
Hopefully some of it may come in handy for others

Setup 1

  1. DC-DC : For my home server(s) : proxmox (20-25W) , NAS (20-25 W) and opnsense router (15-20W)

a) Stable max Load at 12V - approx 4A
b) Stable load at 19V (proxmox is a Lenovo p330) : 2A

Parts:

  1. Mean well 10A 12 V SMPS - 1500/-

  2. Industrial DC DC converters from genergy.in : 8-40V → 12V (10A) and 10-14V to 19V (6A) : Approx 3.5K

  3. 6AH 4S (12.8V) lifepo4 battery from robu: 1.5K

  4. low voltage cutoff module (XH-M609) : 200/-

  5. Blade fuse sockets, wiring and misc - 100/-

  • Meanwell unit is set to 14.2V output. I could have used a 15V SMPS set to 14.6-14.8V for 100% charge for the lifpo4 bms but I intentionally used this here as I had one spare and I don’t need 100% charge for this setup. 80-90% at 14.2V is more than enough
  • I intentionally did not add a relay changeover given the low loads and to minimize any chances of tripping

removing power at smps keeps the battery o/p stable at around 13.6-13.7V and a net draw of about 5-5.5A

Setup 2
This is for a unmanned house in another location where I need to keep a load balancer router, 2 ISP units (12v) plus 3X PoE APs and 3X PoE cameras (48V) plus a RPi and a network controller (5V) powered up . Max power failures are 1 hour but can have rare longer outages also.

setup is Same as above but with

  1. 15V Meanwell amps set to 14.6V for 100% charge (1500/-)
  2. 15AH lifepo4 pack (2.8K)
  3. 48 V and 5V DC DC SMPS (about 2K total)
  4. XH-M609, fuses and misc - 400/-

And since I was knee deep into it anyway, I decided to ask the lifepo4 supplier to send across 4x high star 100AH cells and a 100A Daly BMS with UART which will be used for an inverter when I can find the time

2 Likes

So around 1 hour runtime on this. Hopefully the power won’t be out any longer.

Cost of 100ah cells and bms?
Also isnt JK ones better than daly?

This one is for my current place where the max outage is 2 mins (dg backup)
Outages can be longer at the other place for which I got 15ah

Fwiw, it’s actually very straightforward to build own packs also.. although this time I chose to use prebuilt for the cylindricals (minimal price delta) and diy for the larger prismatic

1 Like

It’s not sufficient to measure the SoCh with the load removed. It needs some rest time for the electrolyte to stabilize to the final voltage. My UPS controller waits for about an hour before measuring the terminal voltage to guess the SoCh and recalibrate the next charging cycle.

Yeah I figured it out recently, it needs some time.

Do you have rough schematic of this by any chance? I am curious. :grinning_face_with_smiling_eyes:

I do make extensive drawing and notes but have to dig them up. However, I can tell you the key ideas which might just be sufficient. It’s a fairly simple project afterall.

Voltage switchover mechanism


You need a power supply voltage that’s higher than the lead-acid top-up charge voltage. It’s around 14VDC from what I remember, maybe it was 14v4. You’ll get this data from the battery datasheet (say Amaron Quanta AGM lead acid battery).

The kathodes of the diodes are tied together and connected to the input of a dc-dc converter module (say a buck regulator). The anode of D1 goes to the power supply and the one of the D2 goes to the battery (+). Grounds being common.

In this arrangement, when there is power supply, even while the battery charges, D2 will be reverse biased and block current from the battery or the charge circuit from going into the load.

When there is a power loss, D1 turns off and the battery powers the load via D2.

The charger


Now, coming to the charger. In the V2 design, I use a CC/CV dc-dc converter as the main charge unit. The max current is preset to limit the value in stage 1 (CC mode). The max voltage is set to the top-up charge voltage (stage2). This is fed to the battery via a relay. As the battery charges up, this arrangement will autmatically handle switchover from the CC (stage1) to CV (stage2). A smaller buck converter outputs a float voltage (~13v8 from what I remember). This is connected to the other terminal of the same relay.

The control logic


A microcontroller monitors the voltage, keeps track of how long it’s been running on battery to decide when to switchover from stage 2 to stage 3 (float voltage). The float voltage isn’t applied continuously but rather stopped after a dynamic delay. It then keeps monitoring the SoCh to cycle through the stage again.

2 Likes

Exact same setup here, basically reinventing the wheel. :grinning_face_with_smiling_eyes:

Diodes should offer close to 0ms switching time between battery and main power, no? I have not tested yet but that’s how I am thinking, if there is a tiny delay in microseconds (us), the buck converter should be able to take care of it, i hope.


Another problem we need to take care of is we need at minimum 2 outputs

  1. 12V - for router and stuff
  2. 5V - for IOT devices like RPi
  3. 19V - this is optional, but will be awesome to have, so people can run their Mini PCs.

The output from the ORing diodes goes into this @rsaeon favorite :grinning_face_with_smiling_eyes: buck/boost converter LTC3780

This has only 1 output, which we will set to 12V.

Good thing about this one is it has under voltage cut-off trim pot, so we can set if battery voltage drops below 12.2V it disconnects the load automatically.

But I hope the ORing diode work fast and do not create voltage drop big enough to trigger this under voltage cut off or restart our load.


For 5V, there is confusion whether to take it’s 12V output and feed it into small 5V DC-DC buck converter, like this.


or take the output from the ORing diodes and trigger the 5V DC-DC buck with logic signal from the output of this LTC3780. Like this.

The advantage of this we avoid double conversion and less stress on LTC3780. But it requires extra logic.


Another option is to create multiple power rails 12V, 5V, 19V we duplicate the circuit, right from the ORing diodes, 1 ORing diode pair for each voltage rail.


Charging

For charging, I plan to use an off the shelf 3 stage charger to avoid manual work, there are many solar type chargers available. Depending on the charger, it can draw power either from the main AC supply or from the already converted AC to DC power source, which outputs more than 15V to ensure proper operation of the OR-ing diodes.

1 Like

To further your OR-diode design, take a look at these ideal diodes you can now buy:

Summarized summary:

The video explains why normal diodes are inefficient due to their forward voltage drop, which causes power loss and heat. Ideal diodes solve this by using MOSFETs, which have very low resistance when on, greatly reducing voltage drop and losses.

Several ideal diode modules (mostly from AliExpress) are examined, using either P-channel or N-channel MOSFET controllers. Some require a ground reference, while others (like the TI LM74610) are two-terminal devices that power themselves from the MOSFET’s body diode.

Already got a pair. :grinning_face_with_smiling_eyes:

I figured out early normal diode or schottky diode will heat up like crazy.

1 Like

that converter board units seems to have fairly low current handling capacity - at least judging by the size of the heatsinks

I have in the past used several buck, boost and buck / boost modules for test bench projects and also for non critical use cases (eg RC car modding)
However for mission critical uses like powering a home server or NAS, would suggest spending a tiny bit more and getting an industrial grade converter with a 50% overage on current rating

Generic solid state onverters such as this are readly available and do not cost much:

1 Like

A bit off-topic, but sharing it here anyway since @rsaeon requested me to post photos of my DIY DC UPS. I had to bring it back up because the Energy Intelligence UPS unit just stopped working. Honestly, the Mean Well unit has been rock solid—zero downtime and way more reliable than the retail alternative. If you’re into DIY, this is definitely the way to go. Hope you all ignore the dust in those photos.

The top unit is an ADD-155A (13.5V) UPS module, and the bottom one is a Mean Well 12V stabilizer. It accepts a 10V–14V input and bucks/boosts it to a steady 12V. I used off-the-shelf XT60 connectors everywhere for modularity and quick swaps.

In the bottom-left photo, you’ll see the Energy Intelligence PoE UPS next to a 12V-19V (10A) boost module. That handles my Proxmox node on the Aoostar NAS I picked up from @aasimenator’s store. Since the society has DG backup, I didn’t technically need a 4-battery bank, but I had two spares lying around (decommissioned from some APC units), so I figured I’d put them to use!

The only thing missing in this setup is smart monitoring module, perhaps based on ESP32 that could monitor charge levels and gracefully shut down all systems in case of unforeseen outages.

5 Likes

@Heisen take a look at the datasheet for the Meanwell ADD-155A:

It looks like it trickle charges the battery at 0.5A through CH3?

And it looks like it has low-voltage cut-off!

Yes, it does.

image


Trickle charge term is widely confused with float charging, but they both are different. I am familiar with bulk, absorption and float. Trickle charging is a can of worms if you google it. I can’t find a standard definition for it.

The charger in ADD-155A is a basic CV/CC charger set at 13.3V @ 0.5A. This will always pump 0.5A into battery until the battery voltage reaches 13.3V and after that current drops automatically and settles around 50-100mA, to counter self discharge.


Think of it as ye olde single stage charging haha.

It’s what lanterns and torches did with those tiny 1Ah and 2Ah batteries.

These chargers typically charges the battery up to around 90-95%. To reach 100% a fine tuned three stage charger is needed.

Here is the interesting part, pushing a lead acid battery to 100% charge is actually very beneficial. The final stage acts as a kind of “deep clean” for the electrolyte solution, which can significantly extend the battery’s overall lifespan.

However, this isn’t as straightforward as it sounds. Achieving that final 5-10% requires precise control over specific parameters, such as the battery’s float charge and absorption charge voltage, which are provided in the battery’s datasheet.

Furthermore, these voltages are temperature dependent. In colder environments, the voltage needs to be slightly increased, while in hotter conditions, it should be reduced. The exact adjustments for temperature are also specified in the datasheet.

This means that measuring the ambient temperature is a crucial part of the charging process if we want to it be exactly right.

It is a delicate balance and a bit risky because we are operating right at the edge of 100% capacity.

This is why many UPS systems take a more conservative approach, they use a much lower, single stage charging voltage to avoid risks like gassing, and support any lead acid battery. Unfortunately, this results in a trade off, sacrificing long term battery life in exchange for safety.

1 Like