Maker Pro
Maker Pro

Using 12v UPS battery for Arduino testbed

Graham

Nov 10, 2009
30
Joined
Nov 10, 2009
Messages
30
Hi all - I'm relatively new to messing about with electronics, but very enthusiastic :)
I've just ordered myself an Arduino (well, a cheap Chinese knock-off anyway), with a breadboard and 20x4 LCD, to build myself a little testbed to start playing with some basic projects.
I know that the Arduino has a built in voltage regulator and have read that it can cope with an input of up to 20v (though that's probably going to generate a substantial amount of heat...!), so I have a couple of mains supplies (a 9v 1A, and a 12v 1A) that I can use for it, but I also have access to a number of 12v UPS lead-acid batteries, and was thinking about using one of those as a 'free' supply. I imagine one of those would be able to run my little projects for weeks at a time before needing recharging, but was wondering about maybe linking it up to a solar panel to keep it trickle topped up - for free again (are you sensing a theme emerging here?)
Does anyone have any experience running small Arduino projects from high capacity batteries? Are there any 'gotchas' I should be aware of? I am wondering about the wisdom of having 12v with a potentially high amperage available on the Arduino board at Vin - should I use a separate regulator at the battery, to reduce it to 9v and a safer amperage before it even reaches the Arduino and the on-board regulator?
Also, can you point me at a beginners guide to trickle charging lead-acid batteries from solar panels? I've seen charge controllers advertised at anything from $20 to $200 but don't know what the differences are, and also read somewhere that for a low wattage panel, you don't even need one - so I'd be grateful for some insight into the matter.
Many thanks in advance
Graham
 

Bluejets

Oct 5, 2014
6,937
Joined
Oct 5, 2014
Messages
6,937
Battery capacity is not an issue. Arduino and associated circuitry will draw only what they require under normal operation. Introduce a fault into the equation and it becomes another story so protect outgoing with perhaps a 1 or 2 amp fuse. Charging the battery will require some form of controller as open circuit or unregulated solar can get rather high output voltage and you need around 14v to do so. Gel cells need overcharge and undervolt protection just the same as other types of batteries to avoid damage internally.
 

Graham

Nov 10, 2009
30
Joined
Nov 10, 2009
Messages
30
protect outgoing with perhaps a 1 or 2 amp fuse : Charging the battery will require some form of controller : need overcharge and undervolt protection just the same as other types of batteries to avoid damage internally.
Thanks Bluejets. Had never considered needing a fused supply - good idea. Looks like a small 10W panel and 10A controller are all I would need for the solar side - do ALL controllers have overvolt and undercharge protection, or is that something I need to specifically check for (could that be the difference between the $20 controllers and the vastly more expensive ones - or is it mainly a question of their capacity)?
 

Bluejets

Oct 5, 2014
6,937
Joined
Oct 5, 2014
Messages
6,937
Over and under protection is something specific to your battery and associated circuitry.
An Arduino project would be able to cover all possibilities but you will need to study up on that.
Plenty of similar applications out there on the web.
Perhaps even try a search in their forums.
 

mike wax

Oct 10, 2016
34
Joined
Oct 10, 2016
Messages
34
i can't imagine needing 10A to charge the battery unless you're pushing some pretty narly shit out of you weenie output pins. and running it for quite some time every day. in that case the first thing you do is find the weenie's regulator. it's usually right next to the 12v socket where you connect the Vin. just touch the top of the regulator or the underside of the board beneath it. you'll know if it's loaded too much.
 

Graham

Nov 10, 2009
30
Joined
Nov 10, 2009
Messages
30
i can't imagine needing 10A to charge the battery...
You're right Mike - I did a few calcs and I think the 10W solar panel will produce only 0.83A into the battery under even the most ideal conditions - so a 10A charge controller is really overkill - but it was the smallest option I found in my brief search.
One of my first projects will be a max/min thermometer linked to an LCD for immediate feedback (backlight OFF unless held on by a button press), and logging average readings to an SD card once every 5 mins for later external analysis. So this will be running 24/7 and using a 7.1Ah 12V battery for its supply. I am estimating an overall consumption of about 100mA by the hardware (still waiting on all the components to arrive, so it will be interesting to compare my prediction with reality). According to my math (which may well be flawed), this works out at 2.4Ah per day (should be well within the battery's capacity). Even assuming the solar panel runs at only 50% efficiency (say 0.4A), then it should replenish the battery in 6 hours... Do these figures look reasonable or can you see a flaw in my assumptions/logic?
 

mike wax

Oct 10, 2016
34
Joined
Oct 10, 2016
Messages
34
I am estimating an overall consumption of about 100mA by the hardware
naw... ur not gonna drink anywhere near that much juice. i dunno how much power the LCD takes but the weenie (assuming ya got a atmega328 chip) will be fine with that kinda diet. in fact a battery that size should be plenty even if ya keep it running at full speed.
but u probably don't wanna do that since the 328 has half a dozen power modes and u can just set a 5 minute timer and put it to sleep.
as for charging the battery they got solar charge controllers on ebay for <$5.
but hell u may not even need one u might just get a buck convertor depending on the solar voltage supply. u could just read the solar voltage with the weenie and have it turn the charge current on and off. like every 5 minutes u could charge up a capacitor n go back to sleep. the cap could gate a mosfet that would switch on the charge current and keep it switched on until u wake up again. $2 bucks, but then it takes forever to get it from china.
 

Graham

Nov 10, 2009
30
Joined
Nov 10, 2009
Messages
30
Mike - sorry, but a lot of what you said went straight over my head - remember I'm fairly new to all this stuff. However, the thought of programming the Arduino to act as the charge controller as well as the actual project itself, is quite intriguing...
Noting that you are in the US, I checked ebay .com and found the cheap controllers you mentioned - ironically, they come from China and I can get the same ones on ebay.com.au but at roughly double the price! Postage from the US to Aus makes most purchases from the US non-viable. Yes - it takes anything up to 6 weeks for stuff to get here from China as well (including my Arduino which still hasn't arrived) - very frustrating.
By the way, I couldn't use the sleep modes for this project - though I am only writing to the SD card every 5 minutes, the LCD is showing an almost real-time display, and the 5 minute average is calculated on 5 second intervals...
 

mike wax

Oct 10, 2016
34
Joined
Oct 10, 2016
Messages
34
By the way, I couldn't use the sleep modes for this project - though I am only writing to the SD card every 5 minutes, the LCD is showing an almost real-time display, and the 5 minute average is calculated on 5 second intervals...
well there are numerous ways to save power, keep in mind that 5 seconds is an eternity to the weenie. so it depends on exactly what your code is doing and how long it takes to do it.
so for example if you're just doing a measurement every 5 seconds, and it takes 5 microseconds to do it, then ur wasting a lot of time. u could measure a sensor, save the reading in ram, and yeah just sleep for 4.999995 seconds.
but if you're continually writing to an LCD that's another thing to calculate. from the weenie's point of view a "real time display" is one that is changing at megahertz frequency. you could be updating the display every millisecond and ur still wasting a lot of time.
so it depends on two things: what precisely is your code doing and how much current does the LCD consume?
 

Doug3004

Sep 5, 2014
119
Joined
Sep 5, 2014
Messages
119
I am far from an expert, but anyway--

...I don't like running arduinos right off 12v, the regulator still can get pretty hot. I get an adjustable DC-DC buck and turn that down to 7 volts and run the arduino board off that, and the arduino's regulator never even warms up.
I don't know why arduino.cc says it's okay to go as high as 20 volts, maybe that is the datasheet spec and they just want to be honest. 12v is a lot more reasonable, and more common anyway.
I hooked one up to 17 volts once (for a minute!) and there was little "heat waves" in the air above the regulator. I would wonder how long the thing would last at 20 volts. There's cheap DC bucks from China-land. Letting the regulator run blazing hot all the time might be within specs, but it seems like poor practice to me when a DC buck only costs 40 cents.​

...I don't like using arduinos as power supplies. As you approach the current limit of the regulator, you tend to see mysterious untraceable functioning problems, especially when you have a number of other "stuff" attached. It's a lot easier to have [a big 12v power supply] and have the arduino with its own buck set to 7v, and then one or more other bucks to get as much 5v or 3.3v power as you need.
 

mike wax

Oct 10, 2016
34
Joined
Oct 10, 2016
Messages
34
...I don't like running arduinos right off 12v, the regulator still can get pretty hot.
yeah 20v is really pushin it. i bet it wouldn't take much current draw to fry the VR. always do an extended test and check it for overheat.
 

Graham

Nov 10, 2009
30
Joined
Nov 10, 2009
Messages
30
Ha ha - thanks both for your input. I must admit, the thought of running it at 20v brings to mind the image of a guy frying an egg on the engine casing of his car... not really something I'd like to try. Stepping the battery's 12v down to 7v before it hits the Arduino regulator (or similarly, my breadboard PSU's regulator) sounds like a reasonable precaution to safeguard the circuitry, then if I need to drive anything with 12v, I'll do it via some form of relay direct from the battery. That also reduces the risk of an accidental connection of something to 12v via the Vin pin.

Is THIS the kind of thing you mean? It is about the size of my small fingernail!!

@Mike - I take your point about tiny human periods of time that actually seem a lifetime to an Arduino that lives in the micro-second world. You are absolutely correct - my design only takes a reading once every 5 seconds and updates the display once in that period. I haven't looked into them seriously yet, but are there any sleep modes that will let the Arduino sleep (as it is pulling about 50mA... or so I read somewhere - not actually having mine yet means it is difficult to confirm ;)) for 4.9 of those seconds, while still maintaining the LCD display (which only takes 1 or 2 mA while the backlight is off), or would the LCD be blinking on and off every 5 seconds too? If the display only comes on for a few milliseconds once every 5 seconds, then that is somewhat less practical :D
 
Last edited:

mike wax

Oct 10, 2016
34
Joined
Oct 10, 2016
Messages
34
Is THIS the kind of thing you mean?
yeah that's perfect. you could get one from the solar panel to the battery and maybe one between the battery and the weenie.
you wanna set the first one to 13.5v and check the V at different temperatures. long as it is <= 13.5 it won't overcharge and you just leave it connected.
same goes for the LCD. the weenie has an extra 5v and 3.3v pins for that specific purpose that are always on and can't be switched off. so the LCD stays powered while the CPU sleeps.
i can tell you the details when you get the thing it's simple. ;)
 

Graham

Nov 10, 2009
30
Joined
Nov 10, 2009
Messages
30
Many thanks Mike.
Checking the post box every day...! So frustrating.
 
Top