NMOS as a switch design calculations.

Thread Starter

hoyyoth

Joined Mar 21, 2020
528
I am desiging a relay circuit using MOSFET.The MOSFET is controlled by a microcontroller.Most probably it will be STM32.It's gpio output voltage is 3.3V and can provide 15mA of current.

The relay coil voltage is 12V and coil current is 150mA. Typical circuit is shown below.I know how to design this circuit with BJT.The mosfet I am planning to use is AOSS32334C. The Vgs(th) of this mosfet is 1.8V

1743622838130.png
GPIO voltage is 3.3V it can provide 15mA maximum.I set Rlimit such that MOSFET will draw current less than 15mA.
I want to draw only 5mA.

Rlimit = 3.3/5mA = 660 Ohm. I will set R1=10times of Rlimit

May I know is this approach correct or not.
 

sghioto

Joined Dec 31, 2017
8,633
That 1.8 volt is at a current of only 250ua.
Meaning the mosfet is just starting to conduct.
3.3 volts will probably work.
Would set R1 at 10K and Rlimit at 100 ohms.
How much current does the relay require?
 

Thread Starter

hoyyoth

Joined Mar 21, 2020
528
That 1.8 volt is at a current of only 250ua.
Meaning the mosfet is just starting to conduct.
3.3 volts will probably work.
Would set R1 at 10K and Rlimit at 100 ohms.
How much current does the relay require?
Coil current is 150mA
 

dl324

Joined Mar 30, 2015
18,219
GPIO voltage is 3.3V it can provide 15mA maximum.I set Rlimit such that MOSFET will draw current less than 15mA.
I want to draw only 5mA.
I'd eliminate Rlimit and not worry about the gate charging current as gate cap isn't excessive. The value of R1 isn't critical - 10k or larger will be fine.
 

vanderghast

Joined Jun 14, 2018
70
I'd eliminate Rlimit and not worry about the gate charging current as gate cap isn't excessive. The value of R1 isn't critical - 10k or larger will be fine.
Is it not wise to keep Rlimit to protect the gpio pin against possible transient (from inductive load or otherwise) voltage passing through the capacitive gate? (And if so, should it be larger than R1?)
 

vanderghast

Joined Jun 14, 2018
70
Why you think Rlimit should be larger than R1.
While it would become tricky to get a reasonable voltage at the gate from the GPIO, and that is why another option should be considered than what is used as it is now, to protect against a possible transient surge, the same voltage divider is the first (and only) line of defense against short pulse, in the proposed circuit.

I admit that it is not a clever idea to just incread Rlimit though. In the end, it creates more problems than the hypothetical one it tries to avoid.
 
Last edited:
Top