Battery backup

ArnieW

Senior Member
I am wondering if someone has a nice simple solution for a battery backup picaxe.

What I'm after is a picaxe controller that runs of a mains power supply (ie. not running batteries flat), but if mains fails the controller will retain a set point and just simply resume as normal if the mains returns. I'm guessing the battery backup could be rechargables, but might also be a watch type battery that provides a failsafe. It doesn't need to be too complex, just be capable of maintaining a setpoint for a few hours as a worst case.

Any ideas?

thanks, Arnie
 

manuka

Senior Member
Arnie - in theory simple, BUT just what is the Picaxe doing & what load? Even an LED (drawing ~10mA) may alter the backup design, & if you're running something grunty like a motor then a LARGE SLA Gel Cell may be called for.

By "set point" do you want it to keep working normally, or wait at that program step until mains power resumes? If the later then a program loop will be needed to "READ" the absence of the mains too.

Typical Picaxe idle currents ~3mA, & SLEEP ~.1mA so even a nice (& reliable) "SuperCap" will hold things for some time. I'm sure you know the formula Q=VC & Q=It , which blend to say time ("constant") t = VC/I. Hence 1 Farad @ 5V will supply 3mA (.003A) for 5x1/.003 =5000/3 = ~1660 seconds =~ 25 minutes as the Voltage falls to a level ~3V where Picaxes shut down.

Not long enough? Consider "scavenging" sunlight via a solar garden lamp PV panel that'll trickle charge a few cheapie NiCds. You'd hold up a 3mA Picaxe for 600mAh/3mA = 200 HOURS = ~weeks! Even use the entire garden lamp ?! I'm penning a few words for this in a SiChip article - April? Stan
 

Michael 2727

Senior Member
Use a small relay to self latch the mains
supply ON. A small bridge with minimal capacitors to supply the relay so it will
drop out completely at reduced voltages.
Use a double pole relay, the second contact
set used to switch the backup supply ON.
The backup supply could be NmHi, NiCad etc
with a trickle charge circuit from the main
supply, with diodes to prevent reverse current
if the main fails. Use large capacitors on
the picaxe part of the circuit to hold the
voltage steady if any switching occurs.
 

BeanieBots

Moderator
As pointed out by Stan, a lot depends on exactly what it is that you wish to keep going.
In my controller, I do litterally what you say. Namely, simply backup setpoints and data. This is done with nothing more than the battery backed RTC chip and its 57 bytes of RAM which also backed by the battery. Thus, time and the controller state pickup from where they left off.
The pumps are also battery backed but that is done by a commercial UPS.
 

ArnieW

Senior Member
Hi and thanks for the ideas so far.

What I had in mind was simply to store a variable that can be used again as a temperature set point when mains restores.

I have some fermenter controllers, and if I was to go away in the middle of summer for a week or two, should the mains fail, the set point would also reset to something other than ideal.

Because different yeasts demand different temps, I don't want to hard code this but want to save it as a variable. When mains fails, the fridge (or heater) does not need to operate, so no demand for a large UPS. But when mains restores, I want the controller to retrieve the setpoint reliably. For one batch it might be 8 deg C, for another 18 deg.

I'll have a think about the supercap idea, as that sounds nice and simple, but the other ideas are also good.

thanks again.
 

BeanieBots

Moderator
It sounds like you could get away with simply writing your setpoint to non-valitile EEPROM.
Lookup the commands read/write.
The only caution is that EEPROM has limited write cycles. ~100,000 so not a problem unless you write to it every second.

Edited by - beaniebots on 2/6/2006 6:44:15 AM
 

KMoffett

Senior Member
I saw a slick way to store variables, just on a power failures. There was a voltage divider from the main DC power source (8-12v, ahead of the 5V regulator) to an ADC input on the uC. The divider was scaled so that the uC could watch the regulator's input voltage and determine when it was about to drop to a point that would indicate an impending power failure. The uC then immediately stores the variable, prior to its dying. Thus, you don't have to use up the EEProm's finite life. I think it was in one of the "Ideas for Design" columns in one of the commercial electronics magazines.
 

ArnieW

Senior Member
Basically I'm after a set and forget value - it won't change for at least a week. So it sounds like non-volatile EPROM will be more robust than a supercap.

thanks again, Arnie
 
Top