I want to keep an DCcduino clone of arduino uno ON where there is no electricity for 5-10 minutes with a 9 volt battery. Is there any way to do it without ups because it costs too much?

Edit 1: I can't power all modules from arduino. I have 12V power supply and 12V 7ah lead acid battery backup (instead of 9V low capacitance) to power arduino and external modules. Will this design work safe? I added 2 diodes to make enough voltage drop. How to decrease the "leakage" and how to calculate it? enter image description here

  • \$\begingroup\$ Yes this can be done. \$\endgroup\$ – Andy aka May 6 '16 at 15:27
  • \$\begingroup\$ @Andyaka How, with transistors? \$\endgroup\$ – Jim May 6 '16 at 15:29
  • \$\begingroup\$ Use a couple of diodes to form a linear power OR gate. \$\endgroup\$ – Andy aka May 6 '16 at 15:33

You didn't say which Arduino you are using, these instructions are based on an Arduino Uno, but should work for most if not all Arduinos.

Connect a 9v battery to the Vin pin of the Arduino through two 1N4001 diodes or similar. The PWRIN jack is already connected to VIN via a diode, so the two diodes will provide isolation between the two, and the 9v battery should not draw any current when the main power is supplied since its voltage will be slightly less because of the two diodes.

Passerby helpfully supplied a schematic of this approach:


simulate this circuit – Schematic created using CircuitLab

Another option would be to connect a P-channel MOSFET in series with the battery voltage, instead of the diode, and connect the gate to the PWRIN jack. When the main power goes out, the gate will go to ground turning on the MOSFET. This solution avoids the extra voltage drop of the two diodes, which is not a factor in this case since the Arduino should work fine with 7.5V or so on its input, but may be a factor in other applications.

enter image description here

The Arduino takes about 50 mA with no load, so a typical 9v battery, with a capacity of 500 mAh, should last may be 8 hours. The maximum leakage current of the MOSFET is 100 µA at room temperature. If the battery voltage started out higher than the power in voltage minus the diode drop (9V - 0.7V), then the battery could lose some power until the battery dropped below 8.3V, but at this point the battery should not lose any more power.

  • \$\begingroup\$ Thank you for the solution. The Vin needs 9 volt? Will battery last for months if there is no power outage because of MOSFET's resistance? \$\endgroup\$ – Jim May 6 '16 at 15:55
  • \$\begingroup\$ @Dimitris yes, the battery should last quite a long time since the battery won't draw any current (µA probably) with the main power present. \$\endgroup\$ – tcrosley May 6 '16 at 15:57
  • \$\begingroup\$ Why the mosfet way is better from 2 diodes? \$\endgroup\$ – Jim May 6 '16 at 16:08
  • 1
    \$\begingroup\$ @Passerby yup, just added it. \$\endgroup\$ – tcrosley May 6 '16 at 16:45
  • \$\begingroup\$ @Dimitris Actually the two diode solution appears to be better, upon investigation. The leakage current through the MOSFET (~ 500 µA) is greater than the reverse current through the diodes (~ 50 µA). With either solution, the 9V battery should last its shelf life if it's never used. \$\endgroup\$ – tcrosley May 6 '16 at 16:49

You could use a 9V Battery, with either of @tcrosley's suggestions.

Alternatively, just use a USB power bank, a 5V rechargeable supply. The Uno R3, and any compatible clones, already implement a comparator and mosfet solution. If VIN is powered, then the comparator U5A drives the PNP mosfet T1 high, disabling it, and 5V is provided by the linear regulator. If VIN is not powered, the comparator drives T1 low, enabling 5V power through the mosfet.

The benefits of this is that there isn't any power loss from the regulator, which is inefficient from a 9V battery. 60% at best, and most power banks have much higher capacity than a 9V. Also rechargeable. And you can use the usb port instead of a loose cable in a header. AND you can find them for 5~10 bucks or less.

enter image description hereenter image description here

  • \$\begingroup\$ Can I use one power bank with usb and PWRIN instead of Vin? \$\endgroup\$ – Jim May 6 '16 at 18:34
  • \$\begingroup\$ Yes, that's the idea. Power jack for main power, USB power back for backup \$\endgroup\$ – Passerby May 6 '16 at 18:49
  • \$\begingroup\$ Just one power jack and one portable, because you said Vin (pin) that is different from power jack. Also you say that the method with 2 diode there is power loss from battery when there is electricity from power jack?? \$\endgroup\$ – Jim May 6 '16 at 18:56
  • 1
    \$\begingroup\$ If you get a power pack that can charge while also being drained (which is pretty much all of them), you could just provide power to the power bank, instead. Then, in essence your power bank becomes a UPS. If the wall power cuts out, the Arduino draws from the power bank. As soon as wall power comes back, it recharges the power bank, while also providing power to the Arduino. I hope that's clear, I used 'power' a lot in there. \$\endgroup\$ – ambitiose_sed_ineptum Oct 6 '16 at 19:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.