Electronic – Switch power supply

power supply

I'm software programmer taking the first steps into the electronics world.

I have a circuit that can be fed by a battery (9V) or by a external DC source (from the wall – I'm considering 12V). Ideally, the battery power should only be used when the external DC power is not available. Also, if the circuit is unplugged from the wall, the battery should assume immediately, because there's a microcontroller in the circuit and I suppose that a power drop would reset the microcontroller.

Both sources will pass though a regulator that'll lower the voltage to 5V.

I wonder if a circuit like the one below will do the trick. It seems really simple (maybe too simple) but it did work in the simulator. The resistor respresents the whole circuit, including the voltage regulator.

Power supply schematic

Best Answer

This will work, if there is no capacitor in parallel with that load resistor. Usually, your linear regulator would have an input capacitor. When the 12v supply is plugged in, it will experience a sudden current surge as it tries to charge the capacitor up to 12v.

To keep this current surge to an acceptable level, simply add a 20 ohm resistor in series with the 12v diode. This will limit the current to no more than 150mA (exact amount depends on the voltage drop from the diode).

Next question: This resistor will drop some voltage across it due to the current flowing. I'm assuming your current draw is 90mA (9v / 100ohms). So the 20 ohm resistor will drop 1.8v (90mA * 20ohms). This shouldn't be a problem, and the voltage from the 12 supply will still override the 90 battery.

Related Topic