1
\$\begingroup\$

I have a device that runs off of three D batteries. I would like to be able to add a power cord so that I can plug it into the wall and run it off of that instead. I would also like to still be able to automatically run it off the batteries on the off chance that the power goes out or I need to move it, but that is secondary and not as important. What would I need to get to do this?

In my case, the device has an input of "DC4.5V 500mA" and the cord that I am planning on using is from an old phone charger and it has an output of "5.1V ⎓ 0.7A".

enter image description here

I would imagine that if I just wanted to power it from the cord, I could just cut the wires from the battery case and solder the red to red and the black to the black. But, because the cord outputs 5.1V, would that short out the 4.5V input? If I put in a resistor, could that prevent it from happening? How many ohms would it need to be?

That would still not help me with the lesser issue of the power going out. How could I wire it so that I would still have the batteries but not run off the batteries until needed. I think I would need a logic gate, but I don't know enough to know what to use and then how I would need to wire it up.

Any advice for a novice would be greatly appreciated.

\$\endgroup\$
1
\$\begingroup\$

Assuming the batteries will lower in voltage during use and the powered device will still accept it (so, the required 4.5V isn't a very strong demand) , I would use ORing diodes.

The diodes prevent one source is charging/feeding the other. And if you use the same diodes, the source that provides the highest voltage will "win", hence OR-ing. Either that OR that diode will conduct.
Benefit of using ORing diodes is there will be no switching gap like when using relays/switches.

In some cases (with power sources having about equal voltages) you want the wall adapter to 'win', so you pick a Schottky diode (with lower forward voltage drop) connected to the wall adapter.
However, the come closer to the requested 4.5V I'd suggest using a normal diode with 0.6V - 0.7V voltage drop. Maybe you want even to use a Schottky diode connected to the batteries to not lower the battery voltage too much.

Note the forward voltage of a (Schottky) diode is current dependent: if the device can draw less than 500mA you should check whether the configuration still works as expected. Read the datasheets for typical voltage drops for the choosen (Schottky) diodes.

enter image description here

\$\endgroup\$
1
\$\begingroup\$

Broadly speaking there are two options. The simplest is to use a jack with a switch in it. When you plug it in, it disconnects the batteries. The downside of that is that it doesn't provide automatic changeover. If the mains power fails your device remains off until the plug is removed.

Secondly, you could use logic of some kind. Since your AC adapter is higher voltage than the batteries (about 1.65V per cell for fresh alkalines or 4.95V total) , you could use two diodes. Schottky diodes (eg. 1N5817) would be preferable to minimize the drop. That will give you automatic changeover.

schematic

simulate this circuit – Schematic created using CircuitLab

You can also do something like this with a 5V relay and a flyback diode. (add a series switch on the battery or on the output depending on what you want, the relay will consume power when the mains is present regardless): (the voltage drop is very low compared to the diodes).

schematic

simulate this circuit

The device being powered is left "off" for a brief time while the relay switches (a few milliseconds typically). If that's a problem then you might be able to add some capacitance to the output. Many devices won't even notice.

\$\endgroup\$
  • \$\begingroup\$ I would like to point out that the AC adapter is a higher voltage than the batteries, so two diodes could potentially be used. \$\endgroup\$ – Redja Apr 22 at 21:09
  • \$\begingroup\$ @Redja Good point! Thanks, answer modified! \$\endgroup\$ – Spehro Pefhany Apr 22 at 21:16
  • \$\begingroup\$ So with the shocky diodes, when plugged in, the batteries won't get drained at all? \$\endgroup\$ – MakPo Apr 22 at 22:37
  • \$\begingroup\$ If the voltage at the unit, under load, is more than about 5.0V it should be fine, even a bit of leakage back into the batteries. \$\endgroup\$ – Spehro Pefhany Apr 23 at 0:34
0
\$\begingroup\$

I would recommend just buying an AC adapter that outputs 4.5V (Example). If you cannot do this then you would need a voltage regulator to convert the 5.1V to 4.5V. You can then use a barrel power connector with an internal switch to determine whether it should run off battery or AC.

\$\endgroup\$
  • \$\begingroup\$ Would a barrel power connector automatically switch to battery if the power goes out? Is that what the internal switch does? \$\endgroup\$ – MakPo Apr 22 at 18:59
  • \$\begingroup\$ @MakPo Typically they are mechanical switches that identify when the barrel plug is inserted. \$\endgroup\$ – W5VO Apr 22 at 19:23

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.