0
\$\begingroup\$

I want to switch on/off a sensor which runs at 3.7V using a logic level P-Channel Mosfet. Unfortunately, the microcontroller which drives the P-Channel Gate is powered with a higher voltage (5V) compared to the PMOS Source voltage.

Please check the below circuit diagram. Let's assume, the diode is not in place. I assume current would "leak" from the higher potential (MCU PGIO Pin, when high) to the 3.7V voltage rail. I added the diode to fix current flowing to the 3.7V rail but I'm unsure, if this is a good practice.

My questions are: Is the diode enough or are there better practice how to control the PMOS with higher Gate voltage than the source voltage?

Thank you very much!

Circuit

\$\endgroup\$
  • 1
    \$\begingroup\$ pFETs generally tolerate having their gate driven mildly higher than their source with some speed limitations (discussion); are there any reasons why you need to clamp the voltage? \$\endgroup\$ – nanofarad Aug 11 at 16:43
  • 1
    \$\begingroup\$ Skip the Schottky, and use an NPN transistor instead. CPU drives the NPN's base. Let the 10k 'pullup' the collecter of the NPN which is tied to MOSFET gate. NPN emitter goes to GND. You can drive the NPN with much higher than 3.3V and no harm done. If you're unsure how to wire, post again and I'll draw a schematic. \$\endgroup\$ – Kyle B Aug 11 at 16:44
  • \$\begingroup\$ @nanofarad The 3.7V are sourced from a Li-Ion battery. I need to prevent it from being charged for example from the MCU GPIO. \$\endgroup\$ – John Aug 11 at 17:39
  • \$\begingroup\$ @KyleB I think I got your point. I have drawn the circuit, can you confirm it is correct? imgur.com/a/vFQCI2e \$\endgroup\$ – John Aug 11 at 17:45
  • 1
    \$\begingroup\$ Yes! Exactly like that. We put similar circuits in our products all the time. It works ;) \$\endgroup\$ – Kyle B Aug 11 at 17:48
5
\$\begingroup\$

You don't need either the 10K or the diode.

The gate is insulated and provided you stay within the Vgs voltage rating, driving it higher than the source will have no ill effects.

Some MOSFETs have gate protection zeners gate to source, but that's calculated into the maximum Vgs rating. Most are rated for at least 8V.

Just make sure your MOSFET is guaranteed to be turned on adequately with the minimum 3.7V rail voltage.


Edit: To cover situation with MCU not powered:

schematic

simulate this circuit – Schematic created using CircuitLab

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Thanks for your answer and sorry, but I forgot to mention, that the MCU may be not active/powered, therefore the Mosfet gate would be floating. I guess I need the pull-up resistor to make sure the Mosfet is turned off. \$\endgroup\$ – John Aug 11 at 17:54
  • 2
    \$\begingroup\$ Then you have an additional problem because the MOSFET will turn on due to the protection diodes in the MCU. You would be best to add another transistor to drive the MOSFET and have a pull-down resistor on the MCU output. Then MCU output HIGH = ON. And you need the pullup to 3.7V as you said. See edit above. \$\endgroup\$ – Spehro Pefhany Aug 11 at 17:59
  • \$\begingroup\$ Thanks again for your reply, one last question. The "another" transistor should be a NMOS according to your schematic, or is a NPN also possible - just for interest?. Would be the NPN base also insulated to its collector? Thanks!!! \$\endgroup\$ – John Aug 11 at 18:12
  • 1
    \$\begingroup\$ An NPN will work fine in that position with no changes. It will be slightly cheaper and consume slightly more current. \$\endgroup\$ – Spehro Pefhany Aug 11 at 18:19
1
\$\begingroup\$

Generally agree with Spehro answer.
Where multiple DC supplies are involved, consider what happens when one or other is not active. Since your schematic is incomplete, we cannot guess.

Also consider the turn-on condition of the PMOS driver. In most microcontrollers, GPIO pins default power-up condition is to be high-impedance input, not output. So the MOSfet's gate would "float" until microcontroller's code sets the GPIO condition to output.
If that GPIO pin floats low at power-up, your sensor may be momentarily activated. To ensure that the sensor only activates when the GPIO pin is both output and logic-low, the 10k pullup would be a good idea. If you don't care about the sensor's potential power-up activation, then Spehro's solution is fine: no pull-up is needed.

If you do use a pull-up, check out this scenario:
Suppose 3.7V is activated, but the 5V to microcontroller is not active. There will be current flowing through pullup + R? that attempts to power-up the microcontroller. This current can cause latch-up of the microcontroller - a situation that can cause hair-loss.

schematic

simulate this circuit – Schematic created using CircuitLab

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Thanks for your answer, indeed, my microcontroller may not be active at all times. I guess I need the pullup resistor. Thanks for your hint with "back-powering" the mcu through R1+R?. I have still two questions regarding your circuit: a) What about my issue mentioned, if the GPIO is high? Wouldn't current flow from 5V to the 3.7V rail? The 3.7V are directly coming from a Li-Ion battery, that could be harmful. b) How to prevent the MCU being reverse powered through R1+R? Using diodes? Thanks \$\endgroup\$ – John Aug 11 at 17:52
  • \$\begingroup\$ With R1=10k, "back-power" current is low (perhaps not enough to cause latch-up). R1=100k still keeps M1 off if GPIO is high-Z, and gives even lower current flowing from +3.7V to GPIO. While GPIO is logic high, small current does act to charge the Li-Ion battery (0.12mA)...quite small. If you don't like this, consider setting GPIO to input - to turn off your sensor, and GPIO to output, low when you want to activate your sensor. That way, there is no battery-charging current flow from GPIO to battery. \$\endgroup\$ – glen_geek Aug 11 at 19:58

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.