Maker Pro
Maker Pro

Easiest/cheapest UPS for an arduino

mikgol

Jul 6, 2013
87
Joined
Jul 6, 2013
Messages
87
Hi there,

I want an Arduino to run 24/7. It will be powered via a 5v or 12v power adapter plugged into mains, but the mains power will be cut periodically - I want my Arduino to run off a battery when this happens, until the mains is back on.

What's the cheapest/easiest way to go about this? I'm thinking of having 4 energizer rechargable batteries constantly charging in the charge controller, and the arduino wired up to the batteries themselves, so it will always have electricity even when the charge controller looses power. Will this work? Or is there a better way to go about this without spending money on an actual UPS?

Thanks
 

BitHead

Mar 2, 2012
34
Joined
Mar 2, 2012
Messages
34
Hi. Short answer is 'Yes, that will work.'. What will work better is to use six batteries (AA?) so you have some headroom for the voltage to drop before getting to less than the 5.2V (including drop-out voltage) of Arduino's on-board V.Reg.
 

BGB

Nov 30, 2014
154
Joined
Nov 30, 2014
Messages
154
will add that you may want to use a few diodes to isolate the power supplies.

for example, if you have batteries connected directly in parallel with a power-brick or similar, then the power-brick will try to charge the batteries. there is a risk of them overcharging and rupturing in this case.

if using NiMH batteries, it may be possible to have a recharge function by having a few resistors, say, for 6 NiMH AAs you will have 7.2v nominal, and maybe a voltage divider tuned to around 9v to charge the batteries from the brick (say, divider is 1kOhm and 3kOhm). this "should" be safe (it should be able to trickle charge the batteries at around 7mA).

some other tweaks, and a few extra diodes (or an LED), could make sure the circuit can't also discharge the battery.
 

Greg J.

Oct 8, 2013
24
Joined
Oct 8, 2013
Messages
24
Presumably, adding a transistor will give you an LED that turns off when the voltage drops below a certain amount. Useful if the power has been out a long time. Not really relevant if your Arduino would run for days off the batteries. Regardless, I do not think you will be able to detect when the batteries are getting really old without taking them out of the charger to test them.

Signed,
Actively Creative Brain that doesn't know much about electronics
 

funman1

Aug 15, 2010
55
Joined
Aug 15, 2010
Messages
55
This is BY FAR the cheapest and easiest way to do this.
https://www.adafruit.com/products/2124
$5 bucks (plus battery) and does exactly what you want except uses LiPo.
You don't have to use it on a trinket, you can connect the the "USB power" pin to your 5V source and when the power drops out it will kick in automatically and will switch over and begin recharging when power is restored...
 

Old Steve

Jul 23, 2015
734
Joined
Jul 23, 2015
Messages
734
A low-voltage cutout is a good idea in this situation, for when the power is down for an extended period and you aren't watching it yourself to disconnect the battery.
Does the backpack do this automatically, or would that need to be implemented separately?
It's not stated in the page linked to.

I needed to do the same thing a few weeks ago, and used a 9V Ni-Cd for backup, on permanent trickle-charge, with a small relay switching between battery and plugpack power. The drawback is that even when the power is down for a long time and the low-volts cutout disconnects the battery from the main circuit, the battery-monitoring circuit still draws a little over 1mA and continues to slowly discharge the battery, albeit very slowly, unless I eventually manually isolate the battery (with a switch I put in-circuit for the purpose).

Despite that drawback, I could post a copy of the schematic if it's of any use.

Edit: I just noticed, this thread is actually a month old and mikgol, (the OP), has never responded to any of the suggestions, so it's probably a moot point.
 
Top