Switching MOSFET from MCU with VDS of +12v

In summary: MOSFET is being driven by a 5V signal. When you are using a MOSFET as a switch, you need to drive it with a signal that has a much higher Vds, like 12V or even more.
  • #1
NVergunst
1
0
Hi all,

I have been trying to get a MCU to send a +5v signal and in turn switch a N channel MOSFET with a VDS of +12v.

I used a P channel BJT, tied the gate to +12v through a resistor, the top to +12v straight, and the output to the gate of the MOSFET. Then by grounding the gate, the pchannel sourced the +12v needed and the MOSFET turned on. However this only worked for some of the p channel transistors I had (even if they were both the same), so something must not be right.

What is the best way to accomplish this? It has to be a common problem, and I have tried about 5 solutions with varying degrees of success from sparatically to some of the time working, but never consistant.
 
Engineering news on Phys.org
  • #2
I'd welcome you to PhysicsForums, but it looks as if you may already have left!

Regardless, for this sort of application, I typically use an NPN BJT (say, a 2N4401) and an N-Channel MOSFET (say, a 2n7000 for low-power applications, or a IRFZ34N for higher-power). The objective here is to have your BJT operate in saturation, and drive your NMOS in linear mode.

zl7nz6.jpg


Analyzing the above / attached circuit, you can see that when you have 0V at the input, the BJT is off, and both the BJT collector and the NMOS are at 12V. When this happens, the NMOS turns on, and goes into linear mode: what you see at the drain of the MOSFET is approximately ground, and thus, 12V appears across your load, and it turns on.

When you have 5V, the BJT saturates, the collector goes to the saturation voltage (roughly 0.2V) and the NMOS turns off, thus disrupting the ground path for the load and turning it off.

Since this is somewhat inverted, you can add in a second BJT stage to get non-inverted output. Or just accept it. Assuming you can maintain linearity of the MOSFET [itex]V_{DS} < (V_{GS} - V_{th})[/itex]), you can sometimes omit the BJT stage and drive it directly from the 5V. [itex]V_{DS}[/itex] can be roughly approximated by multiplying the nominal on-resistance (see the datasheet) with the operating current of the device.

That's what this circuit does (found from a search of MOSFET as switch, to try to avoid having to draw out the circuit I actually did):
http://www.electronics-tutorials.ws/transistor/tran_7.html
 

Attachments

  • BJT-MOSFET Switch.GIF
    BJT-MOSFET Switch.GIF
    1.7 KB · Views: 1,560
Last edited:
  • #3
Thanks for sharing that. I always appreciate posts like these, because it means I can add another schematic to my spice library to play with or for future reference!

Regarding this:
MATLABdude said:
The objective here is to have your BJT operate in saturation, and drive your NMOS in linear mode.

I wasn't all that clear to me what the OP was trying to accomplish, but could you shed some light on why you'd want to operate the mosfet in the linear region (vs the saturation region). The circuit you provided seems well suited as a simple ON/OFF switch -- in which case, wouldn't it be desirable to operate the mosfet in saturation mode to minimize dissipation during the "ON" period?
 
  • #4
If your switching frequency is at or above the audio range, use a mosfet driver. These parts are cheap and are optimized for exactly what you are after. Every electronic components distributor carries them in all kinds of packages.
 
  • #5
gnurf said:
Thanks for sharing that. I always appreciate posts like these, because it means I can add another schematic to my spice library to play with or for future reference!

Regarding this:I wasn't all that clear to me what the OP was trying to accomplish, but could you shed some light on why you'd want to operate the mosfet in the linear region (vs the saturation region). The circuit you provided seems well suited as a simple ON/OFF switch -- in which case, wouldn't it be desirable to operate the mosfet in saturation mode to minimize dissipation during the "ON" period?

That's exactly what it is: a simple, usually-works (within limits of device operation) on-off switcher, which is usually good enough for low speed operation.

My understanding of this circuit is that it achieves the lowest Vds, and hence, the lowest power dissipation (Power dissipated = Id * Vds)--I think you can show that the same MOSFET in linear/triode mode has a lower Vds than when it's in saturation mode, as a consequence of the definitions (Vds related to Vgs and Vthreshold).

I remarked that everything seemed backwards for MOSFETs compared to BJTs: majority carriers do the current transport, you use linear mode for switching, and saturation mode for amplifiers!

EDIT: The OP was attempting to switch a 12V load on and off using a 5V signal, and asking how to do this. I think the problem was that he was attempting to have the MOSFET output the 12V instead of allowing for a path to ground. Which is fine when you have a PMOS, but doesn't work so well (at least, not with simple configurations) when using an NMOS. However, you can use an NPN power BJT in this fashion (common collector) as long as you can supply something like 5% of the current:
http://en.wikipedia.org/wiki/Common_collector
 
Last edited:
  • #6
Yes, you're right. The power dissipated in a mosfet is Vds * Id, so increasing Vds in the saturation region where the current is constant, increases dissipation without the benefit of increased current to the load. Thus it is in the linear region that dissipation is minimized for a given drain current.

The OP's original problem statement
I have been trying to get a MCU to send a +5v signal and in turn switch a N channel MOSFET with a VDS of +12v.

is not possible, because in the "ON" state when Vds=12V, Vgs - Vth < Vds for a gate drive of 5V, and thus violates the requirement for turning on the mosfet. Your solution circuit was meant as a way to use a NMOS as a low-side switch, instead of as a high-side switch (as I think you think he was trying to do) because the latter would require an additional charge-pump/bootstrap type of circuit in order to satisfy Vgs - Vth > Vds.

I hope I got it right this time :)
 
  • #7
gnurf said:
Yes, you're right. The power dissipated in a mosfet is Vds * Id, so increasing Vds in the saturation region where the current is constant, increases dissipation without the benefit of increased current to the load. Thus it is in the linear region that dissipation is minimized for a given drain current.

The OP's original problem statement


is not possible, because in the "ON" state when Vds=12V, Vgs - Vth < Vds for a gate drive of 5V, and thus violates the requirement for turning on the mosfet. Your solution circuit was meant as a way to use a NMOS as a low-side switch, instead of as a high-side switch (as I think you think he was trying to do) because the latter would require an additional charge-pump/bootstrap type of circuit in order to satisfy Vgs - Vth > Vds.

I hope I got it right this time :)

That's correct! The BJT just helps to ensure linearity of the MOSFET (by delivering the full 12V to the gate), but if you choose the right MOSFET, and have low enough current through the MOSFET, you can skip it--that or if you don't mind the Vds getting a little high.
 

1. How do I switch a MOSFET from an MCU with VDS of +12v?

The process of switching a MOSFET from an MCU with a VDS of +12v involves the following steps:

  • Choose a MOSFET with a suitable VDS rating for the +12v supply voltage.
  • Connect the gate of the MOSFET to a digital output pin on the MCU.
  • Connect the source of the MOSFET to ground.
  • Connect the drain of the MOSFET to the load that you want to switch.
  • Write code to toggle the digital output pin on the MCU to turn the MOSFET on and off.

2. Can I use any MOSFET to switch from an MCU with VDS of +12v?

No, it is important to choose a MOSFET with a VDS rating that can handle the +12v supply voltage. Using a MOSFET with a lower VDS rating can cause damage to the MOSFET and/or the MCU.

3. Can I control the switching speed of the MOSFET from an MCU with VDS of +12v?

Yes, the switching speed of the MOSFET can be controlled by the code written for the MCU. By adjusting the timing of the digital output signal, the switching speed of the MOSFET can be changed.

4. Are there any precautions I should take when switching a MOSFET from an MCU with VDS of +12v?

Yes, it is important to make sure the gate of the MOSFET is not left floating and is properly connected to a digital output pin on the MCU. It is also recommended to use a flyback diode in parallel with the load to protect the MOSFET from voltage spikes.

5. Can I switch multiple MOSFETs from an MCU with VDS of +12v?

Yes, you can switch multiple MOSFETs from an MCU with VDS of +12v by using separate digital output pins for each MOSFET. It is important to make sure that the combined load of all the MOSFETs does not exceed the maximum output current of the MCU.

Similar threads

Replies
39
Views
3K
  • Electrical Engineering
Replies
1
Views
813
Replies
8
Views
867
  • Electrical Engineering
2
Replies
49
Views
2K
Replies
25
Views
4K
  • Electrical Engineering
Replies
28
Views
3K
  • Electrical Engineering
Replies
6
Views
1K
  • Electrical Engineering
Replies
21
Views
5K
  • Electrical Engineering
Replies
11
Views
3K
  • Electrical Engineering
Replies
8
Views
2K
Back
Top