arduino working 7/24

Hi, i have a question. Think an arduino which is working 7/24 and i want when electricity(9V power adapter) is gone, arduino uses 9v battery automatically so arduino never stops. I dont have much experiment with arduino, so can you advice me easy solution for this question?

Connect the + of the 9volt battery to Vin via a diode (1N4004). Cathode (ring) to Vin. -batt to ground ofcourse. Leo..

Feed a 10 volt wallwart and a 9 volt battery to the power jack. Use diodes to isolate the two power sources from each other.

The 'top' diode, between DC jack and Vin, is already there on most Arduino boards (Uno, Mega). So only a diode between battery and Vin is needed (assuming the 9volt adapter is plugged into the DC jack). Leo..

Yes you are correct.

Doing it with two external diodes might make it more obvious.
Also, having two diodes in series may reduce some heat as there is an extra .7 volt drop, may not be an issue.
Wallwart must be > the battery voltage.

.

LarryD: Wallwart must be > the battery voltage.

Yes, very important. Forgot to add that. Leo..

Wawa:

LarryD:

thank you,but important one for me is current never come from battery while arduino uses adapter. Does this circuit provides this ? Can occur any problem with arduino while working 7/24?

tonystark96: Can occur any problem with arduino while working 7/24?

Yes, every system has failure modes. It's just a question of how likely and under what circumstances. You can design in failures, using a measure of ignorance or stupidity. But as much as you try to design for reliability, there are always things you didn't consider. I had a friend whose computer overheated and bricked. It used convection cooling, and his cat cuddled up on top because it was nice and warm, and blocked the vents.

But, I have a Mega web client that has been running in a basement environment for about half a year now. It may have seen one or two power outages that caused it to reset. But it's never exhibited any other failure modes.

Okey, got it. That problems are not important for me, it is okay. I am afraid like fire in the home because of arduino overheat and burning.

tonystark96: Okey, got it. That problems are not important for me, it is okay. I am afraid like fire in the home because of arduino overheat and burning.

With relatively low power devices like the Mega, a current limited power supply (such as a switching mode power adapter) mostly eliminates that risk. But a good housing is also a good safeguard. If something starts to burn, it will at least be contained.

Wallwart voltage must be higher than the battery voltage. ex: Battery = 9V Wallwart = 10V

What sort of 9v battery?

The little PP3 style batteries are useless.

If I wanted an uninterruptible power supply I would use a trickle charger to charge a 12v lead acid battery continuously and run the Arduino off the battery. If the power to the charger fails the Arduino would not know.

If desired you could have the Arduino monitor the voltage between the charger and the battery (put a diode at the battery to prevent it back-feeding) and then the Arduino could tell when the mains power fails.

...R