4
\$\begingroup\$

I want to make a device that allows the user to switch between two different power sources (a wall mount and batteries).

I could perform this circuit using two DPDT switches, but I would need to switch the two switches each time I want to change sources. Is there a simpler way to perform this function without using relays?

Here's a schematic of my device as a reference:

Example for what's supposed to be done

\$\endgroup\$
5
  • 3
    \$\begingroup\$ There's not a reason I can see to switch ground in that circuit, so if you removed that you could just use a single DPDT switch. \$\endgroup\$
    – PeterJ
    Commented Jun 6, 2013 at 2:17
  • \$\begingroup\$ 6V is not enough to run a LM7805. To turn the 6V from the battery to 5V, you need a LDO: low drop-out regulator. \$\endgroup\$
    – Kaz
    Commented Jun 6, 2013 at 2:45
  • \$\begingroup\$ And your switch is wired wrong. You are either connected to one terminal of the battery and the ground, or the 5V rail and the other battery terminal. \$\endgroup\$ Commented Jun 6, 2013 at 3:00
  • \$\begingroup\$ @PeterJ you should submit that as an answer. \$\endgroup\$
    – Passerby
    Commented Jun 6, 2013 at 3:18
  • 1
    \$\begingroup\$ The Diodes would not be needed (or help) either. \$\endgroup\$
    – Passerby
    Commented Jun 6, 2013 at 3:23

2 Answers 2

4
\$\begingroup\$

The easiest solution (Initially suggested by @PeterJ) Would be to simply switch only the power connection:

schematic

simulate this circuit – Schematic created using CircuitLab


Alternatively, you can probably get away with just using some schottky diodes:

schematic

simulate this circuit

Wow, Circuitlab is a clumsy tool. It doesn't have entry/exit ports? Or Schottky Diodes? Really?

But if you're really loading your RPi or it's USB ports, the drop in the diodes could be large enough that you get brownouts, which would be a real pain in the ass to diagnose.

The best solution, I think, would be to put the diodes before the voltage regulator.
This would mean you would have to have a higher power supply voltage (>7V), but it would solve the problem with the diode Vf described above.

\$\endgroup\$
6
  • \$\begingroup\$ A 0.5v drop is too much for the RPI. It's spec'd for 4.75 to 5.25. And it pulls up to 700mA. So you would need a diode that can handle that, and still produce a small voltage drop. \$\endgroup\$
    – Passerby
    Commented Jun 6, 2013 at 3:16
  • \$\begingroup\$ @Passerby - As I said, they should be schottky. Circuitlab is just crap, and doesn't have schottky diodes. \$\endgroup\$ Commented Jun 6, 2013 at 3:17
  • \$\begingroup\$ Using mosfets instead of diodes would be better, but I didn't want to add that complexity. \$\endgroup\$ Commented Jun 6, 2013 at 3:20
  • \$\begingroup\$ I understand that. A schottky would still produce too much of drop with a 5v supply (1N5819 has a 0.6v drop at 1A), where the RPI would not work. \$\endgroup\$
    – Passerby
    Commented Jun 6, 2013 at 3:38
  • \$\begingroup\$ @Passerby - The nominal draw of a RPi is ~200-400 mA (at least from my measurements), so I think it would squeek by. Big devices on the USB ports could cause an issue, though. \$\endgroup\$ Commented Jun 6, 2013 at 3:40
7
\$\begingroup\$

The highest performance (most power efficient/coolest) method is to use a FET OR-ing setup. Their primary advantage is a near-zero voltage drop, limited only by the RDS(on) of the FET and current sense resistor (10 mΩ total resistance is fairly easy, but 1-2 mΩ if you really need).

Controllers for said systems typically use a low-value sense resistor and appropriately-sized FET to connect the power supply to the circuit. It measures the voltage across the sense resistor to ensure current is flowing in to the device from its supply, rather than being siphoned off from the other supply, then the FET does the switching. Some controllers don't use a sense resistor and just measure across the FET.

Here's an article on Digi-Key's site about ORing controllers.

Furthermore, if your system uses a mid- to low-current (<5 A), there are even controllers with integrated FETs, so your component count can be super low. But if you're in the low-current range and if you can get away with the voltage drop of some ORing diodes (0.3 V for some Schottkys), you're not going to beat them on price.

Anyways, several suppliers make these controllers (search for "power supply oring controller" on Google/DK/Mouser/etc.), to name a few: TI, Linear, Micrel, IR, Maxim, and Vicor.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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