Arduino timer that will not reset on power outage

Greetings to everyone!

I want to create a coin accepting box with timer and an outlet to control different devices such as washing machines, dryers, computer display, cellphone charger. People will be able to insert coins and see how much time left on the screen.

There are ready made boxes like that available, but all of them are not acceptable in my area because we have frequent power outages and those models just reset the timer every time when there is no power leaving unhappy customers. I would like to find a solution that I can use without UPS.

What will be the most effective approach to make the device as cheap as possible and long lasting?

Some ideas:

  • Somehow detect the outage and store the data in EEPROM using capacitors as a backup power source - if there will be an outage once or twice per day, the EEPROM life cycle will probably last long.
  • Store data on SD card every 5 minutes without any backup power
  • Do not store any data and add a recharchable battery that will last at least for one hour.

I'm wondering, how long will this 240 mah battery last with this kind of screen and a simple countdown fucntions on arduino nano (timer should stop obviously). If I make the screen to blink once in 5 second for 1 second, will it save power?

Or maybe there are better ways to achive what I need? Any ideas are welcome!

Thank you!

Easier than you think.

Go get a "RTC" - Real Time Clock module.

These are backed up with a lithium battery so they just keep track of the time when the main power is off.

The trick is - they also have CMOS memory backed up by the same battery that you can then use to store a modest number of bytes of information. And this is not EEPROM memory so there is no limit on how often and how many times it is written.

So you have a way of doing accurate timing, possibly logging actual times of usage (using the SD card or whatever), and "remembering" to the second (or better, if it was necessary) when the power went off.

If you want the screen to remain active, you might as well put the processor to sleep and just keep all your data in RAM while power is down. Battery back up the whole thing.

Paul__B:
Easier than you think.

Go get a "RTC" - Real Time Clock module.

These are backed up with a lithium battery so they just keep track of the time when the main power is off.

The trick is - they also have CMOS memory backed up by the same battery that you can then use to store a modest number of bytes of information. And this is not EEPROM memory so there is no limit on how often and how many times it is written.

So you have a way of doing accurate timing, possibly logging actual times of usage (using the SD card or whatever), and "remembering" to the second (or better, if it was necessary) when the power went off.

Wow, thanks! I actually ordered a bunch of them because sometimes I need to provide a discounted price at night time :slight_smile: Didn't know they had memory.

aarg:
If you want the screen to remain active, you might as well put the processor to sleep and just keep all your data in RAM while power is down. Battery back up the whole thing.

Thanks for the tip!

If you are talking about a device in a fixed location which usually (though not always) has mains power why not just use a 12v lead-acid battery as a UPS for the Arduino. It can be trickle-charged when the mains is on so it will normally always be fully charged.

That way the entire Arduino functionality will be available 24/7.

...R

Robin2:
If you are talking about a device in a fixed location which usually (though not always) has mains power why not just use a 12v lead-acid battery as a UPS for the Arduino. It can be trickle-charged when the mains is on so it will normally always be fully charged.

That way the entire Arduino functionality will be available 24/7.

...R

Yes, it can be considered.
In my main application there will be 8 washers and 8 dryers, each equiped with these coin acceptors. So I will have to power 16 arduinos from one lead acid battery with lots of wiring or make each of them have a separate battery which costs around 15-20 USD here (motorcycle sized battery). I will also need to implement some way to recharge all the batteries automatically when power is back.

Usually power outages are not longer than 1 hour in this area, so I was thinking about smaller batteries. I am expecting all the parts to be delivered, so I can measure power consuption in each configuration.

ajayver:
Yes, it can be considered.
In my main application there will be 8 washers and 8 dryers, each equiped with these coin acceptors. So I will have to power 16 arduinos

Wouldn't a single Arduino be able to do all that ?

Even if you need several Arduinos the wiring to a single battery would be very simple. You will need power wiring in any case - so just bring it from the battery.

...R