UPS design

Thread Starter

PsySc0rpi0n

Joined Mar 4, 2014
1,755
Hi.

I have a few 18650 batteries lying around and are probably losing charge over time.
I was thinking if I could use them to build a small UPS to use with a SBC (RockPro64) that could hold the device running for at leas t 10 minutes or so.

How hard is it to build such device and generically speaking, what components are needed?
I did some searches but what I could find were backup batteries. Not that device that can power a load when mains fails.

I don't need anything too fancy. Just a way of buying some time while we re-enable the electricity board and don't lose power on the SBC.

Thanks
Psy


Edited;
Would this be a decent canidate?
https://embeddedcomputing.com/techn...uninterruptible-power-supply-for-home-devices

Edited 1;
Once more, I think the above link is just a backup battery. Not sure it can instantly kick in case of a power shortage. I mean, to do this, it would have to have a mains voltage input, and I can't see none. I see only the car battery as input. What I want is a system where mains are connected and provideing power and then, in case mains fails, a backup battery kicks in and keeps providing power without any downtime!
 
Last edited:

LowQCab

Joined Nov 6, 2012
4,023
1)
Run the Computer on a Battery.
( there are also provisions for a Backup-Battery on the Board )

2)
Create a Battery-Charger that can supply more Current that the average Computer-Load-Current.

3)
Program-in an "Orderly-Shut-Down" when the Battery drops below a specified Voltage.

No "Switching" required.
.
.
.
 

Thread Starter

PsySc0rpi0n

Joined Mar 4, 2014
1,755
....

3)
Program-in an "Orderly-Shut-Down" when the Battery drops below a specified Voltage.

No "Switching" required.
The point is that I dont want it to shutdown. I have services running there that I don't want to stop.
I was looking for a solution where we connect the mains power (240V in my case) to the device and then, it powers the board, and this device is also connected to a battery and whenever mains power fails, the battery kicks in to power the RockPro64!
 

bassbindevil

Joined Jan 23, 2014
824
It looks like that board need 12V, 3 to 5 amps max. You could make it uninterruptible by diode-ORing together an AC power adapter and a 12 volt battery source. Maybe there's a clever MOSFET switch circuit that will give the AC source priority regardless of battery voltage. It would be helpful to know what range of input voltage the computer can handle; maybe it could be fed with 15V DC from an AC adapter, which would be comfortably higher than a "12V" battery (SLA could be floating at 14.4V) (3S Lithium-ion at 12.6V). Or, simplest could be just a couple of diodes in series with the 12.6V (max) 3S battery to drop it enough to allow a 12V power brick to supply power.
 

LowQCab

Joined Nov 6, 2012
4,023
The point is that I dont want it to shutdown.
.
So what do You think is going to happen if the AC-Power stays dead for maybe ~8-hours ?
That would require roughly 2 Full-Sized, Deep-Cycle, Lead-Acid-Batteries to last that long at full Voltage.

An "Orderly-Shut-Down" is always a good idea,
especially if You don't want the Computer to simply lock-up and crash at some point.
.
.
.
 

Thread Starter

PsySc0rpi0n

Joined Mar 4, 2014
1,755
.
So what do You think is going to happen if the AC-Power stays dead for maybe ~8-hours ?
That would require roughly 2 Full-Sized, Deep-Cycle, Lead-Acid-Batteries to last that long at full Voltage.

An "Orderly-Shut-Down" is always a good idea,
especially if You don't want the Computer to simply lock-up and crash at some point.
.
.
.
Well, if something like that happens, it's not only going to affect the SBC. Will affect other devices I have at home where I have frozen food supplies!

The point here is to build something simple just for the SBC to allow us to turn the electric board back again and not shutting down the SBC. This may take 5 minutes or even less. Usually there is always someone at home.
If a longer power outagge happens, then, yes, SBC will eventually shut down, but this is a longer shot! And having such an UPS would eliminate around 90% of the times the SBC goes down. This may be once or twice a month and usualy is our own fault because we turn on too many appliances at the same time at home, triggering the current limitations of the electricity contract, which in my case is the lowest possible 3.45kVA.
 

LowQCab

Joined Nov 6, 2012
4,023
The only difference is the Capacity of the Battery,
the scheme remains exactly the same otherwise,
1) Run the Computer on a Battery,
2) Continuously Charge the Battery.

If Your Computer draws ~5-Amps on average,
then You need a Battery-Charger that can comfortably supply substantially more than ~5-Amps.

How is Power currently supplied to your Computer and Peripherals ?
( An accurate and complete Schematic is much preferred over a verbal-explanation )

How long do You want the Computer to run without AC-Power ?

Do You need help with implementing this type of system ?
( It can be more efficient than a "store-bought-UPS" )
.
.
.
 

Thread Starter

PsySc0rpi0n

Joined Mar 4, 2014
1,755
It looks like that board need 12V, 3 to 5 amps max. You could make it uninterruptible by diode-ORing together an AC power adapter and a 12 volt battery source. Maybe there's a clever MOSFET switch circuit that will give the AC source priority regardless of battery voltage. It would be helpful to know what range of input voltage the computer can handle; maybe it could be fed with 15V DC from an AC adapter, which would be comfortably higher than a "12V" battery (SLA could be floating at 14.4V) (3S Lithium-ion at 12.6V). Or, simplest could be just a couple of diodes in series with the 12.6V (max) 3S battery to drop it enough to allow a 12V power brick to supply power.
Hum, those seems simple ideas, yes. Let me see what can I find about some of those terms you mentioned so that I get familiar with them!
An from what I see, this RockPro64 uses 2x buck converters SY8113B, and according to their datasheets, they can take up to 18V. But I need confirmation of this as I'm not expericenced enough to be 100% sure.
Schematics:
Page 3
SY8113B datasheet


How is Power currently supplied to your Computer and Peripherals ?
Hi.
Power is being supplied by a normal transformer just like those we use to charge our phones.

How long do You want the Computer to run without AC-Power ?
As I said earlier, at least 5 or 10 minutes would be suffice for most of the times I need the battery!
Do You need help with implementing this type of system ?
Most likelly I would! :)
 
Last edited:

LowQCab

Joined Nov 6, 2012
4,023
The System is protected with a Zener-Diode,
so the Input-Voltage should be Regulated to exactly 12-Volts.

The maximum Current demand is stated to be ~1.1xxx-Amps,
so having the capability to supply at least ~2-Amps would be a good idea.

A generic "Gel-Cell" SLA-Battery would be a good fit,
but a ~12-Volt "Life-Po" Battery would probably last longer.

I don't know off-hand the Charging-Voltage requirements of a Life-Po-Battery,
but they could easily be found.
But the Gel-Cell is a standard item, and should be Charged with ~13.6-Volts continuously.
Then, the Battery Power should be Regulated down to 12-Volts.
.
.
.
Lead-Acid Temp Graph .png.
Temp Compensated Maintenance Charger .png
.
2-Amp Battery Charger FLAT .png
 

Thread Starter

PsySc0rpi0n

Joined Mar 4, 2014
1,755
Ok, one step at a time. :)

The System is protected with a Zener-Diode,
so the Input-Voltage should be Regulated to exactly 12-Volts.
What system are you talking about? My RocPro64? If so, yes, after looking better for the shcematics, there is a TVS diode right after the 12V input jack. After that diode, there are 2 buck converters as I mentioned. But most important is the diode. This diode seems to be able to take up to 15V. I still think I'm on the safe side as the batteries I have, will sum up to 14.4V in a 4s2p configuration.

The maximum Current demand is stated to be ~1.1xxx-Amps,
so having the capability to supply at least ~2-Amps would be a good idea.
My RockPro64 can deliver up to 5A, so, in the worst case scenario, I would need a battery capable of that, but I'm not using the board at it's full potential, so, if it's lower, I think there will be no problem. I'm not even using it to stream any 4k videos or anything heavy like that. Not even a monitor is plugged to it. But 2A is probably enough.
My batteries are 18650 Li-Ion. Not sure how much they can deliver in a 4s2p setup!


You gave an example circuit for lead-acid batteries. Why? The battery I have will be made of Li-Ion.
 

LowQCab

Joined Nov 6, 2012
4,023
"" ....... My batteries are 18650 Li-Ion. Not sure how much they can deliver in a 4s2p setup! ..........
.......... You gave an example circuit for lead-acid batteries. Why ? ........... ""

Because Your run-time will probably be very short.
Do You know what condition your Batteries are in ?
Are they all equally matched ?
Will they actually provide the claimed mAh ?
How much Voltage-Sag will there be under Load ?

A 4S setup also requires a sophisticated Battery-Management-System
to keep the Batteries balanced, and to prevent Over-Discharge.
.
.
.
 

Thread Starter

PsySc0rpi0n

Joined Mar 4, 2014
1,755
Because Your run-time will probably be very short.
But I don't have a lea-acid battery. I will have to work with what I have.

Do You know what condition your Batteries are in ?
Yes, they seem good to me!

Are they all equally matched ?
Pretty much. I measured them all and the biggest difference is 0.03V. From 3.61V to 3.64V

Will they actually provide the claimed mAh ?
How much Voltage-Sag will there be under Load ?
How can I check for those 2?

A 4S setup also requires a sophisticated Battery-Management-System
to keep the Batteries balanced, and to prevent Over-Discharge.
Yes, I know. I am aware of a few BMS like this one, I think:
https://pt.aliexpress.com/item/32825327690.html
 
Last edited:

LowQCab

Joined Nov 6, 2012
4,023
"" LowQCab said:
Will they actually provide the claimed mAh ?
How much Voltage-Sag will there be under Load ?
How can I check for those 2? ....... ""
.
What is the ""claimed"" mAh printed on the Batteries ?
You should theoretically be able to get twice this Current rating with a 2-P setup.
( This will require 2 of the BMS Boards that You linked to )
This rating will supposedly be the Current that one Battery will supply for 1-hour.
You may be able to get twice this Current-Output for maybe ~20-minutes or so,
actually it would be 4-X because you're running 2 sets in parallel,
and 20-minutes is a reasonable run-time.

So, you'll need at least 1-Amp from each of the 8-Cells.
3.8-Volts X 1-Amp = 3.8-Ohms Load.
So get a 4-Ohm, 5-Watt Power Resistor and connect it across one of the
fully-Charged Batteries and watch the Voltage with a Meter.
Record the Time it takes for the Battery-Voltage to get down to ~2.8-Volts,
this will be roughly the amount of run-time You can expect,
of course this is assuming that all of the Batteries are in equally good condition.

Run the test on all 8-Batteries ( Cells ),
the run-time differences will demonstrate how well matched the Batteries are.
If they are not closely matched, You could potentially have some serious problems.
Li-Po Batteries can be dangerous,
if they're not closely matched,
don't use them in Series/Parallel, You could start a Fire.
.
.
.
 

Thread Starter

PsySc0rpi0n

Joined Mar 4, 2014
1,755
What is the ""claimed"" mAh printed on the Batteries ?
None. These batteries are from Aliexpress so they have no description. Back then when I bought them, I thought they were original, but I'm not sure anymore. They have written: NCR18650B Li-Ion MH12210

You should theoretically be able to get twice this Current rating with a 2-P setup.
Yes, theoretically. :)

( This will require 2 of the BMS Boards that You linked to )
Why 2? I searched Aiexpress and I couldn't find anything specific for 4s2p. Only 4s... No reference to the parallel part of the setup.
Another question I have is that I see Balanced and Enhanced versions of some of these BMSs. What is the difference between the 2 versions?

So, you'll need at least 1-Amp from each of the 8-Cells.
Why you say "at least 1A"???

3.8-Volts X 1-Amp = 3.8-Ohms Load.
Why 3.8V? My batteries are all around 3.61V~3.64V.
Sorry so many questions, but I want to make sure I'm aware of all the details of what you're telling me!

Li-Po Batteries can be dangerous,
Li-Po is the same as Li-Ion batteries?
 
Last edited:

bassbindevil

Joined Jan 23, 2014
824
The voltage of lithium-ion cells ranges from about 4.2 V when fully charged to 3.6 at half charge, to 3 when officially discharged. So your circuit needs to be OK with voltage varying from 12.6V down to 9V. The SY8113B can handle a wide range of input voltage, from 4.5V<VIN<18V ; but that is for 3.3V output. Since your board operates with 5V out, add 1.7V to the minimum, so 6.2V. It should be just fine with 9V in.

If you're working with doubtful or recycled 18650 cells, test them for capacity and internal resistance. Charge 'em up, discharge them to 3.0V at a current that reflects how they'll be used (and/or how they are rated by the manufacturer). A rough idea of internal resistance can be had by measuring the immediate drop in voltage when a load is applied or increased. There are various "smart" and "hobby" chargers that can test capacity, or you can buy cheaper modules that discharge and measure capacity (and maybe internal resistance) only.
https://www.aliexpress.com/item/1005005094104731.html
https://www.aliexpress.com/item/1005003199247528.html
https://www.aliexpress.com/item/1005004913553454.html
https://lygte-info.dk/review/Review Charger LiitoKala Lii-500 UK.html
I've been pleased with the Imax B6 clone that I got from ebay; the LiitoKala Engineer Lii-500 turned out to be more limited in discharge currents, and not too good at measuring internal resistance. I've no experience with the discharge tester modules yet, but I just ordered one of the cheap LED models to try.
 
Last edited:

LowQCab

Joined Nov 6, 2012
4,023
"" ........ These batteries are from Aliexpress so they have no description.
Back then when I bought them, I thought they were original, but I'm not sure anymore.
They have written: NCR18650B Li-Ion MH12210 ""
This is exactly why I recommended a small "Gel-Cell" Lead-Acid-Battery.
Li-Po, or Li-Ion, ( very similar, if not exactly the same ), Cells must be cared for
according to some pretty unforgiving rules if You expect them
to be safe and provide a reasonable Service-Life, ( number of recharge-cycles )
.
"" Why 2? (BMS-Boards).
I searched Aliexpress and I couldn't find anything specific for 4s2p, Only 4s.......
No reference to the parallel part of the setup.
Another question I have is that I see Balanced and Enhanced versions of some of these BMSs.

What is the difference between the 2 versions? ""
.
Just because You CAN do something, doesn't necessarily mean that it's a good idea.
Each Cell must be be treated as a special individual Cell.
That's why they came up with BMS-Boards in the first place.

You will be putting these Cells into a very special type of service,
where they will be continuously charged to a Voltage that is below the
accepted "Maximum" Charging-Voltage of 4.2-Volts, so that
the Life of the Cells won't be compromised by
the normal slight "Over-Charging",
which is acceptable for the usual "short-term", "heavy-cycling" usage.
.
"" What is the difference between the 2 versions? ""
.
There's no telling what you're going to get from China,
so trying to say that one is better than the other is nothing but a complete "shot-in-the-dark".
.
"" Why you say "at least 1A"??? ""
.
Because You need at least 2-Amps to keep your Computer running properly.
Some "Over-Head" is always necessary in a Power-Supply.
.
"" Why 3.8V? My batteries are all around 3.61V~3.64V. ""
.
3.6-Volts is the proper "long-term-storage" Voltage that the Cells should be discharged to
to ensure the longest possible Service-Life from the Cells.
The amount of Time that the Cells spend with more than around ~3.8-Volts,
will shorten the Service-Life of the Cells by "~approximately" the same amount of Time.
This is one of the reasons it's a bad-idea to leave Li-Pos on a 4.2-Volt charger continuously,
this will make them swell-up and possibly catch on Fire after an extended period of ~4.2-Volt Charging.
BUT, You need to make sure that your Cells are
ready to provide Full-Power after being ignored for a solid Month or more.
.
.
.
 

Thread Starter

PsySc0rpi0n

Joined Mar 4, 2014
1,755
This is exactly why I recommended a small "Gel-Cell" Lead-Acid-Battery.
Li-Po, or Li-Ion, ( very similar, if not exactly the same ), Cells must be cared for
according to some pretty unforgiving rules if You expect them
to be safe and provide a reasonable Service-Life, ( number of recharge-cycles )
Yes, I understand. But having these cells here, I'm not going to buy other cells or any other type of power supply and still leave these ones doing nothing. I want to put these to some job because when I bought them they were supposed to replace a laptop's dead batteries, but things didn't turn out how I expected to I didn't use these cells. So, I need to give them some use before they die too for long term no use.
Just because You CAN do something, doesn't necessarily mean that it's a good idea.
Each Cell must be be treated as a special individual Cell.
That's why they came up with BMS-Boards in the first place.

You will be putting these Cells into a very special type of service,
where they will be continuously charged to a Voltage that is below the
accepted "Maximum" Charging-Voltage of 4.2-Volts, so that
the Life of the Cells won't be compromised by
the normal slight "Over-Charging",
which is acceptable for the usual "short-term", "heavy-cycling" usage.
I'm lost. I was saying that I couldn't find an exact match for 4s2p setup BMSs. Only 4s. You said I would need two of these. But why if each set of parallel batteries are seen as one single battery double capacity by the electronics, no?
I am lost to your statement "Just because you can do soemthing, doesn't mean it's a good idea". :|

Abotu the charging voltage, I'm sorry but I'm lost again.
The BMSs has mid points that are supposed to measure voltage at the several stages of the series bateries, yes?
Being one at 0V(B-), another at 4.2V(B1), another at 8.4V(B2), another at 12.6V (B3) and 16.8V (B+).
You say that the cells will be continuously charged to a voltage that is below the accepted maximum charging-voltage of 4.2V. But in my case, the cells are only 3.6V. This is not making sense to me! :( I'm getting confused.

Then, there are some BMSs with mid poinst at 3.7V, 7.1V, 10.8V and 14.4V. These would fit better my cells, tut these are 3S arrangements. I'm not understanding anything of these BMSs.

There's no telling what you're going to get from China,
so trying to say that one is better than the other is nothing but a complete "shot-in-the-dark".
Ok, let's say I don't buy them from Aliexpress. Wich in fact is likely to happen. The "good" BMSs aren't divided in Balanced and Enhanced? Can you please link me an example of a BMS that would serve a 4s2p arrangement of 3.6V Li-Ion cells?
Because You need at least 2-Amps to keep your Computer running properly.
Some "Over-Head" is always necessary in a Power-Supply.
The board is capable of providing up to 5A, according to datasheet. I don't understand why you say I need at least 2A to run it properly and then you say 1A of each of the 8 cells? I mean, the current being provided to the board will go through all the cells, and at this moment I have no idea how much current is the board consuming! How do you know it's 2A?
 

LowQCab

Joined Nov 6, 2012
4,023
Li-Po / Li-Ion Cells are not as simple as You would like them to be.
Like I said previously, the RULES for using them are very unforgiving.

You have the intention to create a "UPS" ...........
Have You ever seen a UPS that uses Li-Po Cells ????
Of course not,
Li-Po Cells are not "Set-and-Forget" for ~3-years, like a Sealed-Lead-Acid/Gel-Cell Battery is.
A Gel-Cell Battery doesn't have the propensity to catch on FIRE and burn your house down.
A Gel-Cell Battery doesn't REQUIRE continuous Cell-Balancing.
A Gel-Cell Battery is almost guaranteed to provide reliable service for at least ~2-years.
Lithium-based Cells are "high-maintenance" items, Gel-Cells, generally, are zero-maintenance.
Lithium-based Cells generally like to be "pumped" or "cycled" frequently,
Gel-Cells are happy to just sit there quietly in a fully-Charged state.
Lithium-based Cells can not be left in a fully-Charged state for long periods,
they will eventually swell-up, and possibly catch on FIRE.

You, of course, can do anything You like,
but I will not tell You how to do something that
I am quite sure will be either disappointing, or possibly dangerous, or maybe even both.

A Lithium-Cell based UPS is certainly doable,
it's just not the best plan, for a huge variety of significant reasons.
.
.
.
 

Thread Starter

PsySc0rpi0n

Joined Mar 4, 2014
1,755
Ok, fair enough. However, laptop batteries also uses these same batteries and most of the times, people keep the charging cables plugged to their laptops, meaning that batteries will be at full charge for most of the time and we don't see laptopns burning that frequently. But I understand the dangers. I know these batteries are quite sensitive and need considerable amount of care and attention!
 
Top