Shop OBEX P1 Docs P2 Docs Learn Events
Stamp backup battery — Parallax Forums

Stamp backup battery

ionion Posts: 101
edited 2009-03-15 05:45 in BASIC Stamp
Hi,
I would like to know what battery , size and amps i should use to keep a stamp running and not loosing the data.
During the normal operation, a value is incremented eve 4 minutes. At this moment, i just write that value to the memory and in case of power failure i read it back at boot and use it again.
Writing is not a good solution due to the limitation of number of writes on the stamp memory.
I would like to know if it is possible to use something like a watch battery just to keep the variable on the stamp without writing it on memory. Something similar to the battery used on real time clocks.
I do not need to use any display at power off, just to keep the actual value and the stamp to keep running , but no collecting any new data, like a sleep mode.
Thanks
Ion
·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-03-14 04:08
    You could use 365 x 2 locations in EEPROM, one word for each day of the year, all initialized to zero by DATA statements when the program is downloaded. Each location would be written about 400 times a day. Since each location is good for about 100,000 writes, that's plenty of years. When the Stamp is powered up, the program simply searches for the highest number to start over with (and what location to use next).

    Although the Stamp doesn't use much power in sleep mode, this is probably a simpler solution since it doesn't require any backup power and you don't have to be able to switch off the display and other devices.
  • SRLMSRLM Posts: 5,045
    edited 2009-03-14 04:14
    You can use any of the battery backup circuits a quick google search will turn up. You'll probably want to power just the BS2 off the battery, and have your peripherals hook up to the main power supply so they automatically turn off when the main power is removed. You'll probably also want to add a direct line from the main power to the stamp so that your code can monitor the state of the power supply, and take appropriate action in the case of failure.
  • ionion Posts: 101
    edited 2009-03-14 04:19
    Thank you
    Mike, i got confused here. How i can make the stamp to change the location for each day / I do not have a real time clock
    Thanks
    SRLM,
    do you have any sugestion where to lstart looking ?
    When i google , just return UPS and this are to big and expensive.
    Thanks
  • Mike GreenMike Green Posts: 23,101
    edited 2009-03-14 04:33
    You don't really have to allocate the locations according to day. You can just set aside 256 words and cycle through those. Each time you increment the count, you take the least significant byte (8 bits), multiply that by 2 (because each entry is two bytes), and use that for the address to store the word-sized count (in two bytes ... one word). During your program's initialization, just search the table for the highest value entry and initialize your counter to that.
  • ionion Posts: 101
    edited 2009-03-14 05:06
    Thanks Mike
  • remmi870remmi870 Posts: 79
    edited 2009-03-14 08:26
    you could just run the stamp from a battery circuit and have one pin monitor the power(using a diode to avoid seeing the bat power) that would alow the stamp to write your data, then power down or go to standby, even just have it send a signal to a relay to disconnect the power from the battery then when power is restored, it would just power up again and resupply the battery connection.

    Post Edited (remmi870) : 3/14/2009 9:20:50 AM GMT
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2009-03-14 16:34
    ion,

    "and the stamp to keep running , but no collecting any new data, like a sleep mode."

    You do know that the Stamp does in fact have a SLEEP mode? In SLEEP the current drain of the Stamp drops to around 50 microamps, and if you have it hooked up with a sense and switchover circuit per other advice here, then something like a 4.8 volt NiMh phone battery on trickle charge could hold it for quite a while until the main power is restored. The Stamp won't reset until the voltage drops below about 4.2 volts.

    Another solution is to add external non-volatile memory such as a FR25040 (www.ramtron.com, Mouser), or a battery backed clock chip.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • ionion Posts: 101
    edited 2009-03-15 05:45
    THANK YOU VERY MUCH TO ALL OF YOU GUYS !!!
    I appreciate a lot all of your efforts to help me on this problem. I read all the support comments and i will try to implement the sleep mode in conjunction with one of the suggestions received or using an Intersil ICL7673 chip. It does the voltage monitoring and provide the switching signal.
    Once again Thank You
    Ion
Sign In or Register to comment.