A simple question, will it work as described?


Circuit is intended to immediately power on both a 5v and 3.3v supply to an embedded computer and other peripheral devices regulated with LM317 adjustable voltage regulators. Once the computer is powered on, it can switch from the constant supply input power over to the 'UPS' or 'Buffered' power by high-side switching the 12V incoming power with a 3.3V output (see transistors Q1 and Q2).

At that point the device maintains operation with that power and if incoming power is lost all the peripheral devices lose power AND an input to the embedded computer goes low signaling that it needs to finish writing files and begin shutting down. At this point it is operating off of capacitor C1. Once it gets far enough in the shutdown process, it drops out it's output and then power to the device is killed. This is necessary so that if power is re-applied the computer knows to startup, otherwise it would need to drain the capacitor down and would have a required minimum "drain down" time that would be undesirable.

My biggest 3 questions with this circuit are:

1) Is the transistor switching correct? I had to look into how to high-side switch a higher voltage by using the PNP and NPN transistors in together.

2) Is R12 necessary? This is a 'precharge' resistor. I deal a lot with 480V drives for work all of them have pre-charge resistors to reduce inrush current. The idea is in the first 30 seconds while the computer is booting up before it turns on the GPO, the capacitor can be pre-charged at a low current before it is supplied full 12V.

3) The size of capacitor is definitely questionable because it's not clear at all how much time I need and what the current draw is going to be. I figure I need a minimum of 2-3 seconds above 5V to finish writing the files, and current draw is going to be around ~500mA @ 5V. But right now until I've got some measurements I'm taking just a shot in the dark with 500uF.


Thanks for the feedback. You're right about the typo, I meant R13, not R12. But I disagree it was only an inline resistor, there is definitely a clear path to the top of Q2 through D9. However, you're totally right that the diagram was hard to read, so here's a simpler version (I hope):

Also, you did answer my question about the necessity of the precharge resistor. Due to the low voltage, I was hoping it wasn't necessary. In that case we can make things much prettier, like so:

Now, regarding the use of N3904/6 transistors, would the 2N2222 and 2N2907 be more appropriate?


  • \$\begingroup\$ LM317 should have some decoupling caps to make the supply cleaner. Typically 100nF on the input and 1uF on the output. The values aren't critical. \$\endgroup\$
    – Lundin
    Aug 16, 2016 at 13:58

1 Answer 1


Unfortunately there's no time for me to work through the solutions to the issues, so I'm just going to list the issues and leave fixing them to someone else, or your own googling and I'll focus just on the capacitor.

  • You can't use NPN's to switch a positive rail like you do on the left, this will not work properly.
  • You cannot use 390x types to work with half amperes or more.
  • You cannot just put an LED (D8) in series with a heavy load, that will kill the LED or quench the load.
  • A linear voltage regulator, especially an old-fashioned one like the LM317 or LM78xx, needs not just "more than 5V (output voltage)", it needs 2 to 3 volts more than the ouput voltage. So you need more than 7V, possibly for full stability more than 8V.
  • Whether or not you want a resistor depends on the power you will let yourself have as inrush, but more than a few Ohms hardly ever happens in low voltage applications.
  • There's nothing bypassing your pre-charge resistor (which is R13 it seems, not R12), so it's actually just an in-line one.
  • Quite frankly, your schematic is very messy, which makes it hard for anyone to read, and that much less likely for them to try in their free time. Half the time I had for this was spent trying to make sense of it.

Lastly, and separately:
Assuming a perfectly constant current drain (dangerous assumption, but good enough for ball-parking), capacitance required is given by the linear derivation of the time-integrand, this derivation is: dV = (i * dt) / C (anyone is allowed to mathjax that for me for edit-points).

This means that at 0.5 A your capacitor, rating 5*10^-4, will create a voltage drop of:

dV = (0.5 A * 1 s) / 5*10^-4 F = 1000V

For each second.

Or put differently, for 3 seconds, with a drop of no more than 13V - 8V = 5V:

5V = (0.5A * 3s) / C ==> C = (0.5A * 3s) / 5V = 0.3F

And that needs to be 300mF that is also capable of supplying the high currents, not some run-of-the-mill super-cap made to support a 1mA load, with an internal resistance of tens or hundreds of ohms at a specified voltage of 16V.

  • 1
    \$\begingroup\$ Couldn't agree more, this circuit is a crock. +1 \$\endgroup\$ Jul 31, 2016 at 10:10
  • \$\begingroup\$ Also, I was trying to follow the example below: link of high side switching with a higher voltage. Did have I misunderstood or implemented the example incorrectly? \$\endgroup\$
    – DrTarr
    Jul 31, 2016 at 11:21
  • \$\begingroup\$ Also, regarding capacitor size, the math works out, I'm just surprised. 0.3F is a pretty big cap for what I am trying to accomplish. Do you think that it's an unreasonable task or I should be considering a battery instead? \$\endgroup\$
    – DrTarr
    Jul 31, 2016 at 11:38

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.