Battery (BACKUP) strategy


Rather than storing TSV on the BLE33 Sense I 've created shifting variables.

Instead of collecting data the analysis is on its head so I collect values that can be boolean defined. Instead of using a RTC clock or trying to find out an actual time I've started a constantly incrementing timestamp that I know approximately enough when I started it so it will be fine.

So all my data storage is now just 100 lines of code, BUT what if the power runs out!

After Easter I'll get a BLE33 IoT, connect it to the Sense and run MQTT but I need to get on with it. I have a 9V battery with leads, and?? I have a power bank I can/could plug in after removal of the data lead as a standby to the standby but have a few questions:

  1. Plugging in power banks // removal // plugging in data lead as a standby to the standby? If you do it will it crash? If yes then perhaps a battery option, temporary solder to the header.
  2. Reliability of this model does it crash often, if it does, does it have an automatic recovery system so it continues so long as the power was not lost? Like a buffer short term memory so it springs back to life?

Any experience you have with power monitoring over time much appreciated.

How many data points to be saved ?
For low update rates, and fairly low amounts of data, sense when power fails, and save your data toEEPROM..
or - buy/build a battery backup shield - if you’re only sustaining the processor states (and use sleep to extend the battery life)

If you need to keep more things alive - then you need to look into a more capable backup… I have a board with the bells and whistles… modem, relays etc, which stays up for a week when the lights go out.

1 Like

search term: Schottky diode. a low voltage loss diode. One on each power source, all anodes tied together and used as a feed source. each output is available as a power feed all the time. The diode isolates the regulators so nothing provides a false input to anything else.

1 Like

Ok, thanks for your replies. I will get get something with a reliable standby set up. Very interesting @Geek_Emeritus, useful to know about :))

@lastchancename, there are 100-200 lines of code that actually contain the data as variables that are updated upon events. I think there will be about 8 or 9 variables per day, or per 24 hours for between one and two weeks. I'll let you know how it goes.

Because date isn't easily available I will just use a perpetual counter that is incrementing by 1 every second and then as there are 86400 seconds in a day then any events that happen between 1 and 86400 will be prefixed as day1_ anything that happens between 86400 and 172800 will be prefixed as day_2. It gets around having to set and or maintain a date function and it gets around having to store any data anywhere.

As long as the power isn't lost or it doesn't crash then it will be okay, but I will have a backup solution for the power. When I get an IoT BLE33 then I can use it to run an MQTT system but realistically that might take me until the end of the month to get hold of and set it up.

Do it the inexpensive way, save it in FRAM 32K x 8 is in thee $5.00 US depending on source. This is NVRAM good for over a billion cycles and operates at memory speed, no delays. You can get it as I2C or SPI.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.