Register to reply

Switch MOSFET from MCU

by NVergunst
Tags: mosfet, switch
Share this thread:
NVergunst
#1
May12-10, 04:47 PM
P: 1
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.
Phys.Org News Partner Engineering news on Phys.org
DIY glove-based tutor indicates muscle-memory potential
Tricorder XPRIZE: 10 teams advance in global competition to develop consumer-focused diagnostic device
Study shows local seismic isolation and damping methods provide optimal protection for essential computing equipment
MATLABdude
#2
May13-10, 04:03 AM
Sci Advisor
P: 1,724
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.



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/...or/tran_7.html
Attached Thumbnails
BJT-MOSFET Switch.GIF  
gnurf
#3
May13-10, 07:02 AM
P: 330
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:
Quote Quote by MATLABdude View Post
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?

otto9K9otto
#4
May13-10, 10:12 AM
P: 19
Switch MOSFET from MCU

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.
MATLABdude
#5
May13-10, 12:48 PM
Sci Advisor
P: 1,724
Quote Quote by gnurf View Post
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
gnurf
#6
May13-10, 06:43 PM
P: 330
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 :)
MATLABdude
#7
May13-10, 07:29 PM
Sci Advisor
P: 1,724
Quote Quote by gnurf View Post
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.


Register to reply

Related Discussions
Switch 4 wires with a Momentary switch Electrical Engineering 3
Difference between mechanical switch and a transistor switch? Electrical Engineering 5
Using a MOSFET and comparator together as a switch Electrical Engineering 3
MOSFET Switch Electrical Engineering 5
Solid state switch vs. MOSFET Electrical Engineering 6