I'm making an external power supply but I want the device being powered to have a power switch on it that turns the external power on and off.

What do you think about the following circuit?

enter image description here

The idea is to use one wire of the remote power cable to provide a 5V control voltage which if grounded using a conventional toggle switch will trigger the SSR and turn on the external supply.

So what do you think? Is there an easier way to do this sort of thing? I don't do a lot of logic and power stuff so I would appreciate comments from someone with experience in this area.


Here is another version using pmos as discussed below.

enter image description here

It also uses a very similar circuit for turning on the optocouplers that uses very little current over the control wire and remote toggle. I will need to actually turn on / off up to 4 voltages together and for some reason running 10-15mA over the control wire to power the optocouplers does not give me a warm and fuzzy fealing inside.

  • \$\begingroup\$ The 5 V supply is active even when the 16 V is disconnected? \$\endgroup\$
    – The Photon
    Commented Jul 24, 2015 at 1:37
  • \$\begingroup\$ You should probably use a PMOS instead of NMOS for a high-side switch. See this question from yesterday for a discussion of why your configuration only delivers 13 or 14 V to the load and consumes a lot of power in the FET. \$\endgroup\$
    – The Photon
    Commented Jul 24, 2015 at 1:39
  • \$\begingroup\$ Please see my edited answer as well. \$\endgroup\$ Commented Jul 24, 2015 at 12:37

1 Answer 1


The simplest circuit would be


simulate this circuit – Schematic created using CircuitLab

where the LED is the input to your optocoupler.

Note that I've reduced your limiting resistor, thereby increasing your LED current. I don't see any reason to run your optocoupler at such low current levels.

Because of the optical isolation between input and output of your optocoupler, there is no need to keep the LED at a fixed voltage as you did on your original. It can float perfectly well.

Also, your use of a p-type MOSFET for driving your load is only necessary if you need to keep the load grounded. If the load can float, you'll get somewhat better price/performance by switching to an n-type with the obvious circuit changes to accomodate it.

EDIT - More importantly, your simulation trace fooled me into not looking closely at the output section. Your simulation is clearly not accurate. With the values shown you will only get about 12 - 14 volts across your load. If you wish to keep your present output configuration, with a grounded load, and you want something like full voltage across the load, you MUST replace your MOSFET with a p-type. Since you've used an IRF510 in your simulation, you can use its "twin" the IRF9510, although there are plenty of cheaper, newer part that will do the job. Then your output will look like


simulate this circuit

and this will give you full voltage across your load.

Note that I've left out your gate capacitor, since I suspect you don't need it given the intrinsic gate capacitance of the MOSFET and the large gate resistances you've specified. If for some reason you need a very slow turn-on of your load, by all means put it back in.

  • \$\begingroup\$ "Also, your use of a p-type MOSFET" - MOSFETs have the arrow pointing the opposite way. OPs MOSFET is N. \$\endgroup\$
    – ilkhd
    Commented Jul 24, 2015 at 6:32
  • \$\begingroup\$ @ilkhd - Yeah, he fooled me with his simulation trace. I've edited. \$\endgroup\$ Commented Jul 24, 2015 at 12:36
  • \$\begingroup\$ Nice answer. Aside from eliminating the 2-4V drop, using pmos is also good because it's off when the SSR is open so the output will be off on power-up. With nmos I would have had to use a "normally closed" SSR which is a slightly unusual part. The only negative is that the pmos orientation does not filter the output. With nmos, it makes a simple capcitance multiplier filter. But the two circuits are so close that I suppose I could make the PCB flexible to either orientation. So I can have low-dropout or 2-4V drop with filtering. \$\endgroup\$
    – squarewav
    Commented Jul 25, 2015 at 5:42
  • \$\begingroup\$ Regarding the input, there are actually going to be up to 4 voltages that all switch on or off together. So if I have all 4 optocouplers powered through the control wire and toggle, that would probably be 10mA or more and that just doesn't give me a warm fuzzy feeling inside. \$\endgroup\$
    – squarewav
    Commented Jul 25, 2015 at 5:50
  • \$\begingroup\$ @ioplex - What's wrong with 10 mA? Your switch is certainly rated for it, and a wire too small to handle 10 mA would be about the thickness of a hair. \$\endgroup\$ Commented Jul 25, 2015 at 13:29

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.