maanantai 27. kesäkuuta 2016

Basics: FET as switch, part 2


Last time I showed simple example where NFET was used to switch a load at negative (ground) side. Sometimes this won't do, and you'll want to switch something - like, say, external radio that uses lots of current but is needed for just a few seconds every hour or so - on positive supply side. In that case you'll need to use P-channel FET, like below.
 

Here I'm using a P-channel FET (Q1), for example BSH203. Like before, all FETs mentioned here refer to enchantment mode N- and P-channel FETs exclusively.

So what happens here? Without any control (control line floating) R2 pulls gate voltage up to VCC, making gate-source voltage (Vgs) zero and turning FET off. When control pulls gate down, Vgs grows and FET is turned on, allowing current to be passed to controlled chip.

R1 again is there to limit gate current somewhat (why? well, gate forms a small capacitor, and switching FET on or off involves either charging or discharging said capacitor, which may involve momentary high currents if not limited by gate resistor), and R2 is mainly there to make sure that gate is always in controlled state - i.e. high (off) when MCU isn't actively driving control. Again, you'll always want to have a pull-up or pull-down when using FETs to make sure it's always in well-defined state, be it off (like here) or on (with pull-down instead of pull-up in above circuit).

This works nicely when you only have one voltage to your circuit - i.e. when driven VCC is same as MCU's VCC. If voltage you want to drive is higher, however, a bit more complex circuit is needed as R2 (in off state) pulls gate voltage (and thus MCU pin) above MCU's operating voltage, which in worst case may even damage your MCU. So in that case you'll neeed something like this:

(yes, I'm mixing different FET symbols here, sorry about that - I just picked some suitable parts from the library quickly)
Here I'm using a PFET (Q2) to control the voltage to the load, and NFET (Q3) to control the PFET's gate. When control is low or floating the NFET is in OFF state, allowing R12 to pull PFET's gate high, turning it off. When NFET's gate is driven high, NFET turns on, pulling the gate of PFET down, turning in turn it on and allowing current to pass through.

Here also the size of PFET's pull-up starts to matter; since you can't drive the gate of PFET high directly (only via pull-up) the pull-up is absolutely required. Also large value of pull-up makes switcing PFET off slower, limiting maximum frequency you can achieve. In this case a value of 10kohm or so might be better, but my example load here is controlled slowly enough for 1Mohm to easily suffice.

In addition of ratings mentioned in last post you'll need to pay attention to following;
-maximum gate-source voltage of PFET: this must be at least maximum voltage in circuit, in this case 12v, preferably more.
-maximum drain-source voltage of NFET: when NFET is off, this is same as maximum voltage of circuit, 12v.

When working with relatively low voltages, like 12v here, these aren't that critical, but if you need to control higher voltages, past 25 volts or so, you'll find out that many (cheaper) FETs can't handle that high Vgs voltages, so you'll need to get more expensive parts or design circuit to limit maximum stresses. But those are topic for another time.












Ei kommentteja:

Lähetä kommentti