Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to switch a load, controlled by a microcontroller. (Actually, bypassing a load with a short-circuit.) My question is how to implement the switch.

The circuit will have available to it the following rails, in addition to the 2v-50v supply: +5v, +12v, -12v.


simulate this circuit – Schematic created using CircuitLab

I am struggling to simplify my design of the switch. The problem is interfacing the controller with the "switch".

The following is one idea I've had:


simulate this circuit

However it strikes me that 3 transistors for this one "switch" could be simplified.

I'm using a MOSFET so the on-resistance would be low, but a BJT would be ok. But either way, I can't see a simpler circuit that would allow the switch to be controlled by a microprocessor.

For example, to turn the P-channel MOSFET on, when the 2v-50v rail is at 2v, the gate would have to be pulled down to around -2v or lower. And the simplest way of interfacing that with a microprocessor would be to have one BJT pulling Vgate to -12, and another BJT sourcing current into the last one's base from +5v, which could then be controlled by the microprocessor.

Of course, if the constant current sink is programmed to sink a small current, and the 25-50v rail is at 50v, the MOSFET's Vgate would have to be taken to about +50v to turn it off. My circuit would do that by turning off the BJTs.

Is there a simpler way that I've missed?

share|improve this question
Without a gate voltage limiter your mosfer will soon be damaged, you can easily go higher than the max Vgs (usually 20v). I don't get the purpose of the mosfet, you say to bypass the load but in that case the mosfet will become the load and will have to dissipate the full power provided from the constant current driver, up to 3A according to the first schematic. – alexan_e Feb 11 '14 at 9:43
Thanks for pointing out the over-voltage on Vgs. And yes, the MOSFET will become the load. Basically the 2v-50v rail will be a PSU under test, for given currents. – Jodes Feb 11 '14 at 10:55
I can't find the name now, but I recall MOSFETS that are driven more or less by an internal light source that illuminates a solar cell - sort of opto-coupler and MOSFET in one (I don't mean a solid state relais). – Wouter van Ooijen Feb 11 '14 at 15:10
up vote 3 down vote accepted

Why not use a relay - it can be driven from the 5V logic, possibly with a transistor to help it and the relay contacts would just connect in parallel with the load. What you haven't said is how fast you need to do the load bypass switching (is there any PWM involved) and what the maximum load current is - this may drive you down the MOSFET route.

Here's the relay I'd consider if it is just to act as a dumb load on/shunt switch: -

enter image description here

BTW - in your 2nd circuit there is no gate over-voltage protection when the power supply is greater than 20V (most MOSFETs can deal with maybe 15 to 20V on their gate but not 50V).

share|improve this answer
Great, thank you - the switching frequency will be very slow, so a relay is a great idea – Jodes Feb 11 '14 at 10:56
Take a look at how you'll be switching, as a relay is a mechanical device, and won't give you infinite cycles. If you're switching millions of times, relays may fail. Look at the rated number of cycles. – Scott Seidman Feb 11 '14 at 11:23

You can use an optocoupler to drive the gate and a zener to limit the gate voltage.


simulate this circuit – Schematic created using CircuitLab

If your I/O pin can't provide enough current to drive the opto diode you may need to use a transistor or a small mosfet.

share|improve this answer
+1, thank you - the relay will probably be simpler but I expect this will have a lower monetary cost. Much appreciated! – Jodes Feb 11 '14 at 11:11
Quick question though - given that the zener will not break down without 1mA or so, would it still prevent damaging voltages across Vgs while Q3 is turning on? – Jodes Feb 11 '14 at 11:47
I've just realised that while Q3 is switching on, (current through D2 less than 1mA) the voltage across D2 would be lower than 15v so provide protection. – Jodes Feb 11 '14 at 11:57
@Jodes With an appropriate resistor used in the collector, as soon as the voltage rises a few volts above 12v the current will be enough for proper zener operation. The voltage range of 2-50v is quire high so at the extreme the current can become high and this may require the use of a 1W zenner. Maybe this could be optimized with the use of a lower voltage for the zener (like 8v) so that the resistor can be higher and the current at the extreme (50v) lower. This also depends on the mosfet used and the Vgs level needed to achieve a low Rds-ON – alexan_e Feb 11 '14 at 12:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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