On DIY Battery Powered DC UPS, for Portable SFF and Off Grid

lhl

SFF Lingo Aficionado
Nov 16, 2015
121
143
Battery chemistry: currently the king of energy density, that is, watt-hour per kilogram is Li-ion. Li-Poly or LiFePO4 is actually Li-ion too with minor differences.

"Li-ion" and "Li-Poly" are both the same chemistry (LiCoO2) - the only difference between them is that lion typically refers to packaged round cells while lipos usually refer to flat pouches. LiFePO4 is literally a "lithium ion battery" (so is NMC) but has very different properties - energy density is almost half of the lithium-cobalt, but they are much safer and more durable and are used frequently for buses and for off-grid power.

Capacity means f**k all. According to www.batteryuniversity.com 18650 Li-ion cells started off 2200mAh in 2013, all the way to 3400mAh in 2017. BUT there was oversupply of batteries and this means a lot of older ones are in circulation atm plus a lot of 'counterfeits' cells that are just scavenged and then repackaged cells. So your 2600mAh 2015 cell can only have 500mAh left in it if your seller is dubious. PLUS, the story still doesn't end there...

Capacity is meaningful, but as you mention there's a lot of questionable claims and counterfeits. Also if you are using pulls, of course you need to do your own testing (the least safe part of what a lot of DIYers are doing). It's not that hard to get good batteries however. First, you make sure that you have a proper spec sheet, or barring/in addition to that, have thoroughly tested models. Then order from a reputable dealer that tests every batch of batteries they receive. Options might include BatteryBro, Liion Wholesale, or IMR Batteries. I've ordered batteries from the latter two. You'll still want to do your own testing.

DIYing them is not cheap either. A recommended way to assemble these cells is spot welding, and a proper home grade equipment will set you back 200$.

If you are brave you can DIY your own spot welder pretty cheap. SUNKKO S788H's are <$150 and will get the job done.


Now the real setback for a dream of laptop-like portable pc: software. As close this is to hardware, there is no open, common way of a battery pack to talk to a computer. The interface is there, but everything else is proprietary. This is changing, though, one recently started project by Eric S. Raymond, https://gitlab.com/esr/upside is aimed to create an open source ups platform. A battery, after all, is just a ups from OS viewpoint.

This is wrong on many levels. Firstly, if you want UPS software that is open source, NUTS has been around for years and can easily talk to many COTS UPSs.

If you are just building a battery powered PC and want battery reporting, all you need to do is to makes sure you are reporting voltage (all capacity is based on profiling voltage curves for batteries, all limits on battery health are based on battery voltage as well btw) into your computer. What you need is a simple ADC and resistive voltage divider. Here's a very good tutorial on how this works. For a more plug and play solution, you can use something like this and only worry about proper resistors to divide voltage.

One other note, when you are building your own battery packs you want to consider continuous amperage, which is a separate rating/characteristic of a cell from capacity (you typically trade one for the other). There are other considerations like ESR/internal resistance but not as big a deal for batteries.


So IF what I really wanted is a diy battery pack so that I can place the cells inside the case the way I want, not confined in a cuboid shape, with 3d printed enclosure, thermally insulated, capable of driving average of 100W pc usage (browsing/video) for 2.5 hours, and maybe 150W peak while gaming for 1 hour, which wattage also includes a monitor

Your easiest solution is to use a $20 Y-PWR board and 2 x $80 5S1P 8000mAh lipos. If you're lazy, pick up some low voltage alarms and call it a day, otherwise you can find some tutorials on building ways to communicate voltage via (see above) GPIO (if you don't have access to GPIO on your system, I've used this Numato USB GPIO module before that works pretty well).

As far as charging, if you aren't using a BMS (you probably should) then you can use something like this Q6 Plus, although you might want a dual charger if you're going to have two of those lipos.

If you're up for doing a little more work, you can build your own battery out of standard cells w/o spot welding with something like the Vruzend system. Makes it dead simple to build any size of battery you want. Since it's not very high amperage, you can use really any random cheapie BMS board if you want to simplify your charging requirements.
 

Choidebu

"Banned"
Aug 16, 2017
1,196
1,204
Thank you @lhl ! Looks like you gave me a lot of homework to do. I am newbie at this but eager to learn, and all I researched so far is only to judge the feasibility of diy-ing it.
 

Choidebu

"Banned"
Aug 16, 2017
1,196
1,204
If you are brave you can DIY your own spot welder pretty cheap. SUNKKO S788H's are <$150 and will get the job done.

I found some resellers on AliExpress selling cells with prewelded nickel strips. If I'm going through with rolling my own pack that's the road I'll take.

This is wrong on many levels. Firstly, if you want UPS software that is open source, NUTS has been around for years and can easily talk to many COTS UPSs.

If you are just building a battery powered PC and want battery reporting, all you need to do is to makes sure you are reporting voltage (all capacity is based on profiling voltage curves for batteries, all limits on battery health are based on battery voltage as well btw) into your computer. What you need is a simple ADC and resistive voltage divider. Here's a very good tutorial on how this works. For a more plug and play solution, you can use something like this and only worry about proper resistors to divide voltage.

I checked the links you provided; NUTS is a software running on the PC to talk to UPSs. What I'm after is actually more of the hardware side of thing: a ups controller board that report battery status to the PC. That's why I'm excited about the Upside project I mentioned several posts above, it aims to develop exactly that.

I'll have to look further if, battery reporting is as simple as you said, just voltage. Because I'd hate if it involves AHCI drivers....

Your easiest solution is to use a $20 Y-PWR board and 2 x $80 5S1P 8000mAh lipos. If you're lazy, pick up some low voltage alarms and call it a day, otherwise you can find some tutorials on building ways to communicate voltage via (see above) GPIO (if you don't have access to GPIO on your system, I've used this Numato USB GPIO module before that works pretty well).
I'm no stranger with Arduino, or FTDDI modules. So if it is as simple as that, I'll make my own. But making a charging module for 5S li-ion is beyond me atm. I can't seem to find off the shelf charging modules for more than 1S cell.

As far as charging, if you aren't using a BMS (you probably should) then you can use something like this Q6 Plus, although you might want a dual charger if you're going to have two of those lipos.

The problem with those Q6 or the ubiquitous iMax B6, is that it is a self contained unit. It's not a module you can put IN a case and wire up, and according to one video above it doesn't allow for charging with load, i.e no power path management like in a laptop: route supply to load while simultaneously charging the battery, and seamlessly fallback to battery when mains cut is detected.
 

lhl

SFF Lingo Aficionado
Nov 16, 2015
121
143
If you are looking for an all-in-one internal board that does everything (balancing, voltage regulation on both sides, charge control, reporting, and Windows (and NUT) support) the $120 OpenUPS board looks like it'd do the job. I'm not seeing the, errr, upside of Upside in light of something like OpenUPS that's been around for years.

If you're going to build your own though, there's no magic to any of it. ADC/resistors for monitoring ($5), a BMS board that will handle charge/discharge/balancing ($5), a DC-DC power supply to handle regulated voltage out ($30), and regular AC/DC charger ($10). You can do routing w/ the Y-PWR ($20) - it'll do routing as long as the wall voltage is greater than the battery voltage (it can handle seamless hot swap and switching via control pins as well). So just connect your wall DC into the Y-PWR and the BMS input (you may want to add extra constant current regulation to the charging circuit), and BMS output into the other Y-PWR input (and maybe some additional voltage/current regulation depending on how robust your DC-DC PS is). More work and less compact, but probably more educational and "fun" to do.
 
Last edited:
  • Like
Reactions: Choidebu

Choidebu

"Banned"
Aug 16, 2017
1,196
1,204
If you are looking for an all-in-one internal board that does everything (balancing, voltage regulation on both sides, charge control, reporting, and Windows (and NUT) support) the $120 OpenUPS board looks like it'd do the job. I'm not seeing the, errr, upside of Upside in light of something like OpenUPS that's been around for years.
By god how can I missed this board.. but the price is too hard a pill to swallow.

If you're going to build your own though, there's no magic to any of it. ADC/resistors for monitoring ($5), a BMS board that will handle charge/discharge/balancing ($5), a DC-DC power supply to handle regulated voltage out ($30), and regular AC/DC charger ($10). You can do routing w/ the Y-PWR ($20) - it'll do routing as long as the wall voltage is greater than the battery voltage (it can handle seamless hot swap and switching via control pins as well). So just connect your wall DC into the Y-PWR and the BMS input (you may want to add extra constant current regulation to the charging circuit), and BMS output into the other Y-PWR input (and maybe some additional voltage/current regulation depending on how robust your DC-DC PS is). More work and less compact, but probably more educational and "fun" to do.
Yes!!! Wow this sounds plausible.. thank you for this. I forgot that that Y-PWR also does hot swap.
 

jØrd

S̳C̳S̳I̳ ̳f̳o̳r̳ ̳l̳i̳f̳e̳
sudocide.dev
SFFn Staff
Gold Supporter
LOSIAS
Jul 19, 2015
818
1,359
This may or may not be of relevance but there is an existing open source effort w/ some momentum behind it, might be a reasonable stepping off point

https://gitlab.com/esr/upside
 
  • Like
Reactions: Phuncz

Choidebu

"Banned"
Aug 16, 2017
1,196
1,204
He just did a digital seppuku indeed.

Good news... I think I'm going forward with this. Slowly though, as financials permitting.. might just be end of the year.

Current scheme:

200W ac-dc brick 'brick'
Y-PWR 'Y'
Buck-boost step up '20Vup'
BMS+charge controller+balance board
from AliExpress 'BMS"
5s3p battery pack with ncr18650b (3400mAh, panasonic) 'pack'
Arduino to check SoC, temps and reporting to pc through usb, 'arduino'

So brick 19v rail is split into two: one to Y input and one to 20Vup -> BMS + pack -> output 18.5V to another input of Y. Output of Y to dynamo 160. Arduino will just be powered off mobo's usb header and provide additional temp readings (the bms have one unpopulated header for one thermistor), SoC and state of ac power to the os.

So the idea is to have the brick at 19V and battery backup at 18.5, so the brick is always prioritised.

All this should cost around 120AUD not including the arduino and the brick I already had.
 
Last edited:

lhl

SFF Lingo Aficionado
Nov 16, 2015
121
143
You may want to start a project log once you get started but I'm sure anything you find will be useful for people in the future so post away (no need to @ me though. :)

Looks like a neat little board although you'll still want a BMS since that won't handle keeping your cells balanced.
 

Choidebu

"Banned"
Aug 16, 2017
1,196
1,204
You may want to start a project log once you get started but I'm sure anything you find will be useful for people in the future so post away (no need to @ me though. :)

Looks like a neat little board although you'll still want a BMS since that won't handle keeping your cells balanced.

I sure will post the log. But yeah, I'll start slowly collecting the BOMs. Also most of my electrical hobbyist stuff is still back home, will have them brought over when family comes over around nov.

The UPS-0528-11 board I posted is only lacking undervoltage protection to shutoff discharging, and short circuit protection. But then again like you said, I'll be using a bms in the link above, and the feature is there.

Now my dynamo 160 can take 16 to 24V input, but the my target operation range (I'd like to run them 2.9 - 4.1V each cell) is 14.5 - 20.5V (so close..) and the ups board doesn't do output regulation on battery.

That means I'll need at least a boost converter on the output to up the output to at least 21V (most boost converter need to do at least 0.5V up)

Now if I stick with 5S3P topology, my brick's output still need to be upped to at least 20.5V so with one boost on the output I don't feel like adding another boost to the input as well (btw I realised I posted a wrong bms - the one above is for LiFePO4 hence charging voltage of 18V for 5S) ; Instead, I might consider doing 4S4P.

4S LiMnO cells puts us at (2.8*4)11.2 - (4.2*4)16.8V max operating range, so it's just buck from there and boost to 20V in the end.

Considering 6S, the output can actually be pretty close to dynamo's input if we're willing to do 2.8V to 4V (16.8 - 24V) which would be beneficial for cell life also, BUT...
  1. 6S bms is harder to find (I personally trust boards with dedicated bms ic than mosfets array)
  2. More cell is needed hence more space inside the case. 6S3P = 18 cells after all.

So for other people pursuing this, I think the first consideration would be your brick's output and your atx distribution board (dc-atx)'s input.
 

Choidebu

"Banned"
Aug 16, 2017
1,196
1,204
Fast forward one year+ after this thread that sparks my motivation to pursue exactly the vision @msystems stated,
I finally got to the proof-of-concept point of a portable battery powered rig.

This is it, an 6S3P battery pack, mains input, capable of charging on load simultaneously, seamless battery backup on power loss and vice versa, all in a 4.7L enclosure that is the S4 Mini Classic.

Special thanks to @lhl for teaching me the basics and not being dismissive. Your blog has helped me a lot.

I find it funny that after going back and re-read the original post, so many of the mistakes I made and solutions/conclusions I made along the way actually limes up so well with it.

but I foresee a scenario in the future when self-tracking VR/AR headsets improve in resolution to the point that they can replace external monitors for productivity applications
....(snip)
No external monitor would be necessary, you would just want what is essentially a suitcase with a beefy GPU and lots of battery life.

Essentially the same conclusion I came to realise. Here is my thoughts on it, where I envisioned 'terminals' tailored to each preferred method: a VR headset, a clamshell of monitor and keyboard, or a cintiq tablet for artists and designers.

However 5A or even 10A is not enough for such a rig, and we need more current, like about 30A @ 16v which would provide a hefty 480 watts

Unfortunately I think this would remain a pipe dream at least for the next 10 years. Definitely probable with LiPos, but battery life would take a hit. The problem is that people who need 400W+ actually needs it. Who? Gamers of course.

That's why I think sub 200W, realm of casual gamers and productivity workers (think CAD, video editing etc) is where it's at.

Even VR is possible here (barely, I know) with GTX 1650 (not _officially_) or you can push it with actually VR ready GTX 1660 and 35W cpu.

Unlike gaming, these use cases won't be using 100% all the time. This means better battery life and longer lifespan with acceptable energy per weight/volume.

This battery pack has a voltage range of 15v to 25.20v. By charging it to only 24v instead of 25.2v, and discharge at 16v instead of 15v, it should preserve the battery lifetime considerably.

Funny that this is where I finally settled at, having noticed my error by doing a 5S config first. Had to admit sometimes you'd need a hard lesson to understand a concept fully.

I know I'm reviving an old thread here, but I'd really like some feedback on my approach, especially from people here.

I'm at the point where I want to do more testing and benchmarking, to make sure that the concept does tick all the boxes on my given scope.
 
  • Like
Reactions: timginter

scope

Chassis Packer
Aug 6, 2019
19
1
Been thinking about something similar for a while. What I'd like to build is a power brick with UPS.
Though an UPS would make the most sense if it could power a display as well. Fortunately monitors with external power bricks are not scarce, and mostly 19V.

So it would be a open frame AC-DC 18V PSU built into a 160x160x45 mm or so extruded aluminum enclosure. It's kind of power brick size but wider. The PSU takes approx 1/2 of the volume the other half is for the battery and other circuitry.

I need about 200W peak power. 150W for the PC, which is way more than enough heat for the very small PC case. And 50W for the monitor.

There's very little space for battery. It looks like 2x 26650 cells could be sqeezed in.
The A123 systems 26650 LifePo4 cells have high surge current capability, like 40+ A. Then it needs a boost converter for 18V out and charger circuitry for 18V in.

5-10 minutes runtime that allows for a safe shutdown would be workable enough already.
But the cells need to be good with high temperature. There are PSUs in that form factor that are rated for 200W at 70C ambient, and if my estimationis is correct it will get 70C hot in that small unvented enclosure when the components inside produce 15W of heat loss.
 
Last edited:

JungleEd

Case Bender
New User
May 21, 2021
2
0
Has anyone made progress on this?

I'm looking into fanless NUCs with USB-C DP that I can wear under by shirt or as a back back.

With typing gloves, portable touch screens, AR headsets there are a lot of use cases for this.