Pages: [1]   Go Down
Author Topic: Simple backup power  (Read 656 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 0
Posts: 111
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I was wondering if any of you guys have any simple back up power ideas
I don't like loosing all my settings when the power goes out, I was thinking like a 9v battery.
Guess I need diodes so it it wont get over charged, maybe there is a kit I don't know about.
Thanks
Logged

Global Moderator
Netherlands
Online Online
Shannon Member
*****
Karma: 223
Posts: 13896
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


places the settings in EEPROM and read them at startup?
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Full Member
***
Karma: 0
Posts: 111
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well I guess the settings I'm referring to, is the program runs various things 14 plus days, depending on how long some things take. Then the whole thing loops and starts over.I suppose I can store it at what point it was at, in eprom then on startup it can start at that point,  but that sure sounds super complicated.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 111
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh ya, then if you wanted to start it at the beginning instead of at your saved point wow more complicated stuff.
Logged

Global Moderator
Netherlands
Online Online
Shannon Member
*****
Karma: 223
Posts: 13896
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I can store it at what point it was at, in eprom then on startup it can start at that point,  but that sure sounds super complicated.

Depends on the complexity of the algorithm itself. If your program is essentially a loop that have e.g.  10 variables that change during one iteration of the loop you can simply add some logic to store those ten vars every 2 hour to eeprom. In setup they are read from EEPROM.

Code:

void setup()
{
  ...
  readStateFromEeprom(...);
}
void loop()
{
  if (millis() - lastStore > 2L * 60L * 60L *1000L)
  {
    lastStor = millis();
    saveStateToEeprom(.....);
  }
  // rest of your code

to make it really fail safe you need to have at least 2 sets of variables in EEPROM including timestamp and a checkbyte to see it the written set is not corrupted due to a blackout during the save.


Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Riga, Latvia
Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Just don't forget that EEPROM has limited write cycles. I would use RTC with nvram and 3v battery. This way you could store the values every time as they change. If you google you will find how-tos about hooking up RTC to arduino. And you also get the clock - how cool is that? smiley-wink
« Last Edit: December 21, 2012, 08:39:23 am by Arty » Logged

Temple, Texas
Offline Offline
Sr. Member
****
Karma: 14
Posts: 361
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have sometimes used a 12V lawnmower or motorcyle battery with a Harbor Freight trickle charger ($5).

Cheers,
John
Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 95
Posts: 4092
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What are the power requirements? Volts, amps ...
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Temple, Texas
Offline Offline
Sr. Member
****
Karma: 14
Posts: 361
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What are the power requirements? Volts, amps ...

In my case it was 7-12V and about 150ma.  Don't know about the OP.
Logged

Pages: [1]   Go Up
Jump to: