Will my circuit work for the following goal?

  • When INPUT_N is HIGH (i.e. micro is not driving it and it is pulled up to 3.3V), VCC pin on device will have 24V.
  • When the microcontroller drives INPUT_N to be LOW, VCC pin is at 0V (so device is off).

Should circuit below work as intended?

schematic diagram

  • \$\begingroup\$ Are you using a P-channel mosfet here? \$\endgroup\$ – Hair_of_the_Dog Dec 17 '12 at 19:27
  • \$\begingroup\$ Yes P-Channel. Want to keep device VCC pin at 24V powered when Gate is at 3.3V (using the PU). \$\endgroup\$ – user1406716 Dec 17 '12 at 19:31
  • 1
    \$\begingroup\$ Are you sure you want to power your 24V device through a resistor? See @helloworld922's answer below about using the PMOS transistor as a high-side switch. \$\endgroup\$ – Dave Tweed Dec 17 '12 at 19:42
  • 1
    \$\begingroup\$ +1 for the effort of doing the schematic in MS Visio; Next time you might want to use a proper schematic tool (free, online) e.g. circuitlab.com || partsim.com \$\endgroup\$ – m.Alin Dec 17 '12 at 19:51
  • 1
    \$\begingroup\$ In this application it would be much simpler to use an NFET and switch on the low side. You have two problems here (1) control and (2) level-translation. So to switch on the high side you will need two active elements (more or less). As @helloworld992 covered in his answer, switching on the low side eliminates (2) so you can use only one NFET and you're all done. Do you have a specific reason to be on the high side? There are, of course, many good ones, just curious if you had a specific rationale in mind. \$\endgroup\$ – DrFriedParts Dec 19 '12 at 9:00

No, that won't work. P-channel mosfets require the Gate voltage to be lower than the source voltage by some threshold in order to "turn on".

The Mosfet will still conduct through the body diode so the device will receive a small voltage, not the 0V/24V of an on/off switch.

However, even if you did get the mosfet to act like a "short circuit", you're shorting the device VCC to ground which is wasting a good amount of power to turn off the device.

A better way would be to put the P-channel mosfet in directly inline with the device closer to the 24V source.

This would require the pullup voltage to go up to ~24V (minus the turn on threshold) to turn the mosfet off, so you'll most likely have to add some other circuitry to the MCU pin so it doesn't fry. A potential solution might be to use a second N-Channel mosfet to drive the P-channel mosfet gate pin to ground, then use a pullup resistor to the 24V rail.

Something like this:

enter image description here

VG1 is directly driven by the microcontroller (high voltage is on, low voltage is off). R2 is the load circuitry. T1 is a P-channel mosfet and T2 is an N-channel mosfet. R1 is a pull-up resistor to the 24V rail.

There might be a simpler way to do it, this was just the first thing I thought of.


If you can have a low-side switch, the switching circuitry will be much simpler: just a single N-channel mosfet with the drain tied to the load, the source tied to ground, and the gate tied to the microcontroller with high voltage being on and low voltage being off.

  • \$\begingroup\$ Technically, a P-channel MOSFET needs the gate to be lower than the source terminal to turn on. But in the OP's circuit, the body diode will be conducting anyway (it points from drain to source), so the load will only see a fraction of a volt, regardless of the state of the gate. \$\endgroup\$ – Dave Tweed Dec 17 '12 at 19:39
  • \$\begingroup\$ updated the answer, does that look better? \$\endgroup\$ – helloworld922 Dec 17 '12 at 19:48
  • \$\begingroup\$ Shorting out the load to keep it from seeing power is not the correct way to solve this problem. The MOSFET should be N-channel and in series with the load on the low-side (the source of the MOSFET goes to ground). \$\endgroup\$ – Adam Lawrence Dec 17 '12 at 19:57
  • \$\begingroup\$ @Madmanguruman I take it you're commenting on the OP's circuit, not mine? \$\endgroup\$ – helloworld922 Dec 17 '12 at 20:00
  • \$\begingroup\$ @Madmanguruman - Is this what you are recommending? Circuit: postimage.org/image/s4fp7rlyp \$\endgroup\$ – user1406716 Dec 17 '12 at 20:53

Usually a P-Channel mosfet is used as what is refered to as a " highside " switch. That is the Source is tied to VCC, and the drain is connected to a resistor to gnd. Your load is connected between the drain and the resistor to gnd.

This allows you to pull up VGS to vcc when the unit is off.

This allows you to drive VGS negative by appling 0V on the gate to turn the FET on

The more negative VGS becomes, the lower the internal resistance of the FET and the more current passes through the FET and into your device!


You are using the transistor in a wrong polarity. You could better use ULN2003 series IC to drive this kind of load. You might need a level translator to drive from 3.3v.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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