Aduino battery backup ( not rechargeable )

hi
I need some advice on a simple circuit. I want to build a cheep battery backup for my arduino stopwatch project. This circuit is to provide the arduino with power when the main power fails. I will detect this power failure and save the current stopwatch value to eeprom and put the arduino to sleep. So I want a backup power battery supply for few seconds. Battery recharging is not needed. power consumption is low, so i can change the batteries in few months.
I can do the programming part. what i need help with is the backup power circuit.
could you check the attached pic and tell me if such an arrangement work. any advice will be appreciated.
Thank you

Why a battery? If you just want enough power to do a graceful shutdown, just use a large enough capacitor that will keep your controller alive long enough to write the EEPROM on disconnect, and it'll get automatically refilled when you pulg power back in again. You don't need "a few seconds" just to write a small amount of stuff to EEPROM.

Well my first thought was a capacitor. But many posts showed that capacitor has a exponential decay. So it will discharge rapidly. It may mot give enough time to wright to eeprom. I power falls down too much before write cycle is completed data will get lost. Have you built circuit with a capacitor, does it work ??

I just want to be on the safe side. And the power consummation is few mA, so the battery will last for a long time, may be years.

Thanks for your reply, but you didn't comment on my circuit diagram. will it work ????

nipzMegaMind:
Well my first thought was a capacitor. But many posts showed that capacitor has a exponential decay.

Not a problem if the cap is on the input side of the regulator.
Leo…

Use a 5.5v supercap 1F or 0.5F .

If you still insist on batteries then go for 2x or 3x CR2016 coin cells.

CR2016 coins cells may not handle the current, they are good for a few mA or so - might hold up for a few seconds though, but I suspect the larger CR2032 would be more likely to cope.

3 LR44's (small alkaline button cells) give 4.5V with reasonable current continuously.

Thanks for your replies. But my main concern is with the circuit diagram. Is this a working arrangement ??? or a better circuit arrangement ?????

How are you going to [u]detect[/u] power loss?

Why are using a 7805 to get 5v when your Arduino already has a voltage regulator that will do the same job?

MarkT: 3 LR44's (small alkaline button cells) give 4.5V with reasonable current continuously.

An A23 cell would be convenient.

nipzMegaMind: Well my first thought was a capacitor. But many posts showed that capacitor has a exponential decay. So it will discharge rapidly.

So? You don't need a ton of time.

It may mot give enough time to wright to eeprom. I power falls down too much before write cycle is completed data will get lost.

The amount of time and current needed to write to EEPROM is in the datasheet. Combine those figures with the difference between your nominal running voltage and minimum operating voltage and you can calculate the minimum amount of capacitance needed to gracefully shut down. Multiply that by 2 or 3 to get a decent margin.

Have you built circuit with a capacitor, does it work ??

Not personally, but I've read about it being done and it's not impossible.

I just want to be on the safe side. And the power consummation is few mA, so the battery will last for a long time, may be years.

If you don't screw something up. Leave one thing on accidentally, and it can drain your battery flat. The capacitor will get drained too, but it also gets immediately refilled when the power comes back.

Thanks for your reply, but you didn't comment on my circuit diagram. will it work ????

Yes, but it's just unnecessary to have the battery.

Jiggy-Ninja: Yes, but it's just unnecessary to have the battery.

How is his circuit going to detect a power loss in the first place?

Noobian: How is his circuit going to detect a power loss in the first place?

Voltage divider at the input of the regulator.

With the two diodes its essential the battery voltage is less than 5V or otherwise the battery gets priority and its drained first, whether or not power is applied, so that the 3 alkaline cells solution would be OK (4.5V battery, only takes over when supply fails), but 2 lithium button cells could not work (6V, drains first).