How to design MOSFET as a switch?

Thread Starter

Guru_007

Joined Mar 24, 2021
13
Hi,
I trying understand the working of MOSFET as a switch. I came across a circuit that operates MOSFET as a switch. How to calculate the resistor values such as R1, R2, R3. What is the role of R2 and how to calculate the value of that resistor. Kindly help me to understand the circuit.

1709709551468.png

Thank You
 

Ian0

Joined Aug 7, 2020
13,097
R3=(Vpsu-Vled)/Iled
Vled is the forward voltage drop of the LED which will be in its datasheet, and varies from 1.2V for an Infrared type to 3.2V for a blue.
Iled is your choice, but choose something less than the maximum value in the datasheet.
R2 is large. Its only job is to make sure that the MOSFET stays off if the input signal is lost. Anywhere between 10k and 1M will work.
R1 is small. 10Ω to 100Ω. Its main purpose is to prevent parasitic oscillations. It will slow down the switching, but that is only important if you are switching at a high frequency, and then you might have to work it out based on the MOSFET gate charge, or gate-source capacitance.
 

Thread Starter

Guru_007

Joined Mar 24, 2021
13
R3=(Vpsu-Vled)/Iled
Vled is the forward voltage drop of the LED which will be in its datasheet, and varies from 1.2V for an Infrared type to 3.2V for a blue.
Iled is your choice, but choose something less than the maximum value in the datasheet.
R2 is large. Its only job is to make sure that the MOSFET stays off if the input signal is lost. Anywhere between 10k and 1M will work.
R1 is small. 10Ω to 100Ω. Its main purpose is to prevent parasitic oscillations. It will slow down the switching, but that is only important if you are switching at a high frequency, and then you might have to work it out based on the MOSFET gate charge, or gate-source capacitance.
Thanks a lot @Ian0. But is there any theoretical calculation for R2?
 

Ian0

Joined Aug 7, 2020
13,097
Thanks a lot @Ian0. But is there any theoretical calculation for R2?
Not really.
10k feels about right, because a much lower value (100Ω) would attenuate the gate drive voltage, and a much higher value (1M) would probably allow it to pick up some interference.
 

MrSoftware

Joined Oct 29, 2013
2,273
R3 is simply so the LED doesn't over-current and kill itself. When the transistor is fully-on, it's resistance will be insignificantly low for this particular circuit. This is listed as "Rds on" in the transistor datasheet and will be a fraction of an ohm for most parts. More info here (click).

You would pick R1 and R2 based on how fast you need to be able to turn it on and off. The gate has capacitance, so your R1 needs to be small enough that the gate can fully charge within the required turn-on time, and R2 must be small enough that the gate can be discharged within the required turn-off time.

If this is just an example for fun then the turn-on time really doesn't matter, just choose R1 and R2 such that the gate can full turn on and off without wasting too much current. For example if R1 was 1 and R2 was 100, it would operate just the same, except you would be wasting a ton of power (and heat). Or you could make R1 10k and R2 1M. It would still function, but this might actually be a high enough R2 that you may be able to see the turn-off delay with your eyes, it would be a cool thing to try on the bench.

Imagine that you need to turn it on and off at 1MHz. Now all of a sudden the capacitance of the gate is very significant, and your choices for R1 and R2 become much more important. So if we need it to turn on super fast, why have an R1 at all? R1 helps dampen any oscillations, so you don't get ringing on the gate. Here's a read on it by Toshiba (pdf).
 
Last edited:

eetech00

Joined Jun 8, 2013
4,704
Thanks a lot @Ian0. But is there any theoretical calculation for R2?
Actually, a mosfet is a voltage driven device. R1 and R2 together form a voltage divider. The voltage at the junction of R1/R2 (and therefore, the mosfet gate) should not be less than the mosfet's VGS(th), or the mosfet will never turn on.
 

Thread Starter

Guru_007

Joined Mar 24, 2021
13
R3 is simply so the LED doesn't over-current and kill itself. When the transistor is fully-on, it's resistance will be insignificantly low for this particular circuit. This is listed as "Rds on" in the transistor datasheet and will be a fraction of an ohm for most parts. More info here (click).

You would pick R1 and R2 based on how fast you need to be able to turn it on and off. The gate has capacitance, so your R1 needs to be small enough that the gate can fully charge within the required turn-on time, and R2 must be small enough that the gate can be discharged within the required turn-off time.

If this is just an example for fun then the turn-on time really doesn't matter, just choose R1 and R2 such that the gate can full turn on and off without wasting too much current. For example if R1 was 1 and R2 was 100, it would operate just the same, except you would be wasting a ton of power (and heat). Or you could make R1 10k and R2 1M. It would still function, but this might actually be a high enough R2 that you may be able to see the turn-off delay with your eyes, it would be a cool thing to try on the bench.

Imagine that you need to turn it on and off at 1MHz. Now all of a sudden the capacitance of the gate is very significant, and your choices for R1 and R2 become much more important. So if we need it to turn on super fast, why have an R1 at all? R1 helps dampen any oscillations, so you don't get ringing on the gate. Here's a read on it by Toshiba (pdf).
Thank You so much... This is a valuable info..
 

Thread Starter

Guru_007

Joined Mar 24, 2021
13
Actually, a mosfet is a voltage driven device. R1 and R2 together form a voltage divider. The voltage at the junction of R1/R2 (and therefore, the mosfet gate) should not be less than the mosfet's VGS(th), or the mosfet will never turn on.
Thank You.
 

Ian0

Joined Aug 7, 2020
13,097
@MrSoftware and I are both right about R1.
I'm assuming that CNTRL-MOSFET is a voltage source with a low impedance output, such as a low-side MOSFET driver.
It would seem that @MrSoftware assumes it is a switch to the positive supply, so that it cannot pull the gate voltage down to zero when the MOSFET should be off. In which case, you have to rely on R2 to switch the MOSFET off, requiring a much lower value and more accurate calculation.
In real life, both situations can occur, use my explanation when you have a low-impedance drive, and his when you have a switch (or transistor) to a positive voltage.
 
Top