danjperron
Posts: 3393
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Resistors and MOSFETs and fire-prevention, oh my

Fri Feb 08, 2019 11:48 am

@tlfong01

There is a huge difference in Vgs versus current at the drain between the IFR540 and the RFP30N06LE.

At 3.3V it's like comparing apple and orange. Any decision you take with a IFR540 can't be directly use with the RFP30N06LE.

The RFP30N06Le is made to be use with a gate at 3.3V. The minimum for the IFR540 is 4V befroe it starts to conduct.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Resistors and MOSFETs and fire-prevention, oh my

Fri Feb 08, 2019 1:47 pm

danjperron wrote:
Fri Feb 08, 2019 11:48 am
1. There is a huge difference in Vgs versus current at the drain between the IFR540 and the RFP30N06LE.
2. At 3.3V it's like comparing apple and orange. Any decision you take with a IFR540 can't be directly use with the RFP30N06LE.
3. The RFP30N06Le is made to be use with a gate at 3.3V. The minimum for the IFR540 is 4V before it starts to conduct.

IFR540N vs RFP30N06

Ah, let me see. I agree with your points 1 and 2.

I strongly disagree with your point 3.

I would suggest that we look at the data sheets, and skim the tutorial by IR. (I am a fan of IR. If case you don't like IR you can suggest a tutorial by FairChild. :mrgreen:)

Fighting between IR and FairChild
https://penzu.com/p/147348b3

Then let us look at the Ids vs Vgs charts below.

You may like to let me know first if you agree with the following:

To pass a current of 20A, IR needs Vgs 5V, FairChild only 3V.

Kung Fu Fighting - Carl Douglas 18,534,654 views
https://www.youtube.com/watch?v=jhUkGIsKvn0

...
Attachments
irf_vs_rfp_2019feb0802.jpg
irf_vs_rfp_2019feb0802.jpg (113.7 KiB) Viewed 1225 times
I am an electronics and smart home hobbyist.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12124
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Resistors and MOSFETs and fire-prevention, oh my

Fri Feb 08, 2019 3:01 pm

Brandon92 wrote:
Sat Feb 02, 2019 8:55 pm
I would also add a diode across the solenoid to protect the MOSFET. And a gate resistor is also not a bad idea.
Actually its absolutely necessary... :mrgreen:

Brandon92
Posts: 773
Joined: Wed Jul 25, 2018 9:29 pm
Location: Netherlands

Re: Resistors and MOSFETs and fire-prevention, oh my

Fri Feb 08, 2019 4:24 pm

PeterO wrote:
Sun Feb 03, 2019 9:42 pm
Your analysis is flawed.

That's only true for an unloaded GPIO pin. Assuming the GPIO is ideal is nonsense, and leads to nonsense results like it supplying 2.8A to charge the 1350pf to 3.3V in 1.6nS. That just isn't going to happen ! :roll:
The GPIO pin is a voltage source which has a maximum source current as well, so you can easily workout a realistic rise time (it will be much longer that 1.6nS).

If sufficient resistance is added between the GPIO pin and the gate, such that the peak current is less than the upper limit, then the GPIO pin can be modelled as a simple voltage source making rise/fall time calculations even easier as it's a simple RC circuit driven from a voltage source.

PeterO
BSc. Electronic Engineering.
I know that this simulation is not 100% correct. And I only wanted to demonstrate that the gate current could be higher than you would expect when you switch a MOSFET. And that the MOSFET driver needs to be able to deliver this current. And if this is not the case, you need to limit the current with a gate resistor. And yes, the Rpi will never deliver that current that I wrote. But the GPIO output could be damaged if the output pulse current is to high.
mahjongg wrote:
Fri Feb 08, 2019 3:01 pm
Brandon92 wrote:
Sat Feb 02, 2019 8:55 pm
I would also add a diode across the solenoid to protect the MOSFET. And a gate resistor is also not a bad idea.
Actually its absolutely necessary... :mrgreen:
Correct. If he is lucky he can switch the MOSFET a couple of times without the diode. But it will eventually die.

By the way, when a MOSFET fails. The connection between the drain and source are in the most cases shorted. This means that the MOSFET is always "on". And then there could also be connected to that. This means that the gate has a low resistance pad to ground. And that the voltage at that point will be close to 0v.
However if the MOSFET is the only part that failed in this case. Them the current will be limited by the solenoid. So, the gate voltage is still close to 0v.
If the situation occurs when the MOSFET is across the power supply his output. The gate voltage is also low, because the power supply is shorted out. And it depants on the power supply if he will stays on or it will shutdown itself or a hiccup mode. But if this is not the case. The power supply could get hot and potential to hot.

danjperron
Posts: 3393
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Resistors and MOSFETs and fire-prevention, oh my

Fri Feb 08, 2019 5:53 pm

@tlfong01
3. The RFP30N06Le is made to be use with a gate at 3.3V. The minimum for the IFR540 is 4V before it starts to conduct.

IFR540N vs RFP30N06



I strongly disagree with your point 3.
So you disagree on what exactly ? Specification on IFR540 doen't go below 4V but at 3V the RFP30N06LE coudl already drive near 20A. So at 3.3v is a little more.

The IFR540 will never toggle directly on 3.3V without and voltage upgrade interface.

The RFP30N06LE will.

theitguyfromny already figure out his error and it is working.

B.T.W. the valve needs less than 1.5A. We know that because it is the power supply specification. Not 20A but less than 1.5A.

I just wonder what the IFR540 has to do with this post.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Resistors and MOSFETs and fire-prevention, oh my

Sat Feb 09, 2019 2:32 am

tlfong01 wrote:
Fri Feb 08, 2019 1:47 pm
You may like to let me know first if you agree with the following:
To pass a current of 20A, IR needs Vgs 5V, FairChild only 3V.
Reference - https://penzu.com/p/147348b3

IRF540N - The Twilight Zone

If you agree the statement above, you may like to comment the picture below.

TheTwilight Zone - Scottish National Orchestra
https://www.youtube.com/watch?v=Q5bWiFeBq3Q
...
Attachments
irf540n_twilight_zone_2019feb0902.jpg
irf540n_twilight_zone_2019feb0902.jpg (62.83 KiB) Viewed 1183 times
I am an electronics and smart home hobbyist.

danjperron
Posts: 3393
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Resistors and MOSFETs and fire-prevention, oh my

Sat Feb 09, 2019 3:04 am

@tlfong01 The Valve (coil) which he needs to activate is less than 1.5A so why checking the 20A???


And has you said is the twilight zone. This mean that it is not 100% of the parts which will work.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Resistors and MOSFETs and fire-prevention, oh my

Sat Feb 09, 2019 5:43 am

danjperron wrote:
Sat Feb 09, 2019 3:04 am
@tlfong01 The Valve (coil) which he needs to activate is less than 1.5A so why checking the 20A???
And has you said is the twilight zone. This mean that it is not 100% of the parts which will work.

Why (1) check 20A for 1.5A coil and (2) work in the Twilight Zone?

1. Well, a short reply is that this is only the leading question. A couple of questions are to follow.

BTW, OP's power MOSFET is a big overkill, I would in the first place suggest something similar to the following small current, low gate trigger guy.

...https://penzu.com/p/1c297c11

2. I agree Rpi would not 100% work for my 4V Vgs(th) device. But Rpi with Voh < 2.40 ~ 2.90V won't 100% work with OP's 3V Vgs(th) either.

The point is how many percents do we want then?
I am an electronics and smart home hobbyist.

danjperron
Posts: 3393
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Resistors and MOSFETs and fire-prevention, oh my

Sat Feb 09, 2019 6:01 am

1- surface mount chip are not good for beginners . Did you see the picture on this post!
2 - Yes you have to be sure that the mosfet works on all conditions. Temperature is a big problem! Here in canada it goes down to -40 celsius , and even lower. If you have something outside it needs to work. Lower the temperature higher the Vgs is on a mosfet.

For the GPIO to be sure that 3.3V is output you just need to add a pullup and it will go to 3.3V. Then is not a problem.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Resistors and MOSFETs and fire-prevention, oh my

Sat Feb 09, 2019 7:56 am

Brandon92 wrote:
Sat Feb 02, 2019 8:55 pm
@Burngate
What for kind of program are you using for those diagram?

Free Rpi StackExchange Schematic Drawing Tool

If you ask your question in Rpi StackExchange, you can use their free, built in schematic drawing tool, and perhaps also copy the schematic here for reference, ... :mrgreen:

I am giving an example below.

https://penzu.com/p/01a491d7 (penzu)


Power MOSFET IFR540N Testing - Rpi StackExchange Question2019feb09htk1547
https://raspberrypi.stackexchange.com/q ... 4032#94032

I am using the power MOSFET IRF504N. I am not sure if my Rpi's GPIO 3V3 signal can directly input to the gate of the MOSFET which requires 4V minimum.

I guess that I don't need a gate driver to shift up the Rpi's 3V3 signal. So I am now experimenting, ...

...
Attachments
rpi_stackexchange_drawing_tool_2019feb0902.jpg
rpi_stackexchange_drawing_tool_2019feb0902.jpg (187.93 KiB) Viewed 1132 times
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Resistors and MOSFETs and fire-prevention, oh my

Sat Feb 09, 2019 9:27 am

danjperron wrote:
Sat Feb 09, 2019 6:01 am
1- surface mount chip are not good for beginners . Did you see the picture on this post!

OK. So I googled the through hole alternative below for the beginners.

Actually I "drew" the picture. I did hesitate a second to suggest a SMD, so I qualified the suggestion with the word "similar". I also hesitated a second whether to add the comment that 6 pin SMD is a good exercise for newbies (actually there are only 3 pins to take care, because the D pin is forked to 4 pins, perhaps for the trembling hand newbie to mess up), if they dream to become a warrior in the cruel embedded systems war.

You remind me once I ordered 10 pieces of cheapy 2 yuen 8pin SMDs from a TaoBao Shop and I told the sales lady that I worried that I could not handle the soldering. The lady told me they offer SMD to 0.1" adapter board service, for just 1 yuen extra.

The competition up above is tough, so for potential large quantities (100+) customers, I have little double that they would express delivery 10 free soldered samples to your Hong Kong door from ShenZhen (not my poor hobbyist door, mind you) in 24 hours. They exploit IT slaves who worked happily 7x24x365! :mrgreen: .


CSD18511KCS 40-V N-Channel NexFET Power MOSFET
http://www.ti.com/lit/ds/symlink/csd185 ... r.co.uk%2F

VDS 40V, VGS(th) 1.8V, RDS(on) 3.2mΩ,TO-220

TaoBao ShenZhen SF Express Delivery Time
https://www.raspberrypi.org/forums/view ... s#p1366571

The Cruel War - Peter Paul And Mary
https://www.youtube.com/watch?v=peHyfT5YrNw
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Resistors and MOSFETs and fire-prevention, oh my

Sun Feb 10, 2019 5:13 am

theitguyfromny wrote:
Thu Feb 07, 2019 5:08 pm
1. I see you have something (small orange box-ish thing...a Mylar capacitor??) on the gate of the NPN connected to your motor.

2. I'm guessing w/o it, you'd have the same problem as me. Although a stepper has different electrical input properties than a solenoid, of course. (I have one of those and actually solved all my problems with a HAT from Adafruit. love it, works great.

3. In another post... https://electronics.stackexchange.com/q ... t-turn-off

4. ...somebody has the same problem as me. Even when I use 9V batteries for all this (no Rpi...taking it back to simple for debugging), the solenoid turns on just once. I have to remove power source from it to reset everything back.

5. And then the recommendation comes out to add a capacitor...and I'm going to buy some immediately, because I only have a 10uF available to me (and that example, person is recommending a "large electrolyte capacitor (at least 220uF-470uF) near the motor's terminal from Vcc to GND and in parallel ceramic SMD as much higher you can find." <-- honestly not even sure if that means 1 cap. or 2??

6. ...I'm not sure where to even look in spec sheets/etc to find out what size I'd need to "handle" this scenario...but

7. it makes sense that the solenoid is "holding" power on purpose (to keep it in a position that is NOT its' unpowered position.)

8. Anybody have any educated guesses on the size capacitor I'd need, or if that's not even the problem here.

9. ..and, without a huge debate [please..pretty-please], should I buy ceramic/aluminium/mylar/?other? capacitors? I'm seriously immediately going to buy a box from Amazon to deliver tomorrow as soon as I get a response. Is this ok?...

10. https://www.amazon.com/Hilitchi-Metalli ... itor&psc=1

Power MOSFET Refusing to Turn Off Puzzle

1. small orange box-ish thing...a Mylar capacitor?? on the gate of the NPN, ...
I don't see any orange box. There is no capacitor or resister in my test setup. It is a yellow heat shrinking tube on the Source pin, not Gate, And it is not NPN BJT, but an N Channel MOSFET (BJT is not MOS).

2. a stepper ... actually solved all my problems with a HAT from Adafruita . love it, works great.
Actually my motor is a DC motor, not stepping motor. I never used any Rpi shield, hat, or bonnet, from AdFruit or TaoBao, because they are for rich hobbyist, not a poor hobbyist like me. :mrgreen:

3. The Mosfet does not turn off Q&A you mentioned is very good. I also googled a similar one:

Mosfet does not turn off (N Channel MOSFET) - 2017may30
https://electronics.stackexchange.com/q ... t-turn-off

Mosfet-not-turning-off (P channel MOSFET) - 2016jul29
https://electronics.stackexchange.com/q ... urning-off

/ to continue, ...

Appendix - References

DC Motors
https://www.electronics-tutorials.ws/io/io_7.html

Bipolar Transistor as Switch
https://www.electronics-tutorials.ws/tr ... ran_4.html

MOSFET as a Switch
https://www.electronics-tutorials.ws/tr ... ran_7.html

Relay Switch Circuit
https://www.electronics-tutorials.ws/bl ... rcuit.html

Gear Motor Aslong JB37-520
https://penzu.com/p/a25b1076

TIP120 Data Sheet
https://www.onsemi.com/pub/Collateral/TIP120-D.PDF

IRF540N Data Sheet
https://www.infineon.com/dgdl/irf540n.p ... e396cb199f

IRF540N/TIP120 Project Examples
https://www.raspberrypi.org/forums/view ... 4#p1415943
https://www.raspberrypi.org/forums/view ... 4#p1416412
https://www.raspberrypi.org/forums/view ... 4#p1416619

Power Geared DC Motor
https://www.raspberrypi.org/forums/view ... 0#p1425384
https://www.raspberrypi.org/forums/view ... 0#p1425495
Last edited by tlfong01 on Sun Feb 10, 2019 12:26 pm, edited 1 time in total.
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Resistors and MOSFETs and fire-prevention, oh my

Sun Feb 10, 2019 10:09 am

tlfong01 wrote:
Sun Feb 10, 2019 5:13 am
theitguyfromny wrote:
Thu Feb 07, 2019 5:08 pm
4. ...somebody has the same problem as me. Even when I use 9V batteries for all this (no Rpi...taking it back to simple for debugging), the solenoid turns on just once. I have to remove power source from it to reset everything back.
5. And then the recommendation comes out to add a capacitor...and I'm going to buy some immediately, because I only have a 10uF available to me (and that example, person is recommending a "large electrolyte capacitor (at least 220uF-470uF) near the motor's terminal from Vcc to GND and in parallel ceramic SMD as much higher you can find." <-- honestly not even sure if that means 1 cap. or 2??
6. ...I'm not sure where to even look in spec sheets/etc to find out what size I'd need to "handle" this scenario...but
7. it makes sense that the solenoid is "holding" power on purpose (to keep it in a position that is NOT its' unpowered position.)
8. Anybody have any educated guesses on the size capacitor I'd need, or if that's not even the problem here.
9. ..and, without a huge debate [please..pretty-please], should I buy ceramic/aluminium/mylar/?other? capacitors? I'm seriously immediately going to buy a box from Amazon to deliver tomorrow as soon as I get a response. Is this ok?...
10. https://www.amazon.com/Hilitchi-Metalli ... itor&psc=1

IRF540N Test Circuit

IRF540N Test Circuit - With Rg and Rgs added
https://penzu.com/p/087c1ca8

/ to continue, ...
...
Attachments
ifr540n_test_2019feb1004s.jpg
ifr540n_test_2019feb1004s.jpg (123.07 KiB) Viewed 1085 times
I am an electronics and smart home hobbyist.

Brandon92
Posts: 773
Joined: Wed Jul 25, 2018 9:29 pm
Location: Netherlands

Re: Resistors and MOSFETs and fire-prevention, oh my

Sun Feb 10, 2019 10:41 am

tlfong01 wrote:
Sun Feb 10, 2019 10:09 am

IRF540N Test Circuit

IRF540N Test Circuit - With Rg and Rgs added
https://penzu.com/p/087c1ca8
...
Your R2 (1k) has a to low value in comparison to your R1. So, you have made a voltage divider instead. And that is not what you want here. So, you need a higher value of R2. I have used values of 50k as a pull down resistor at that point. But, it need to be stronger that the internal pull up of the Rpi pin. So, that it will not turn on the MOSFET or when the GPIO pin is set as a input.

And that pull down resistor also ensures at start up that the MOSFET is turned off. And that it will not turn on by itself. That could let to a dangerous situations. So, at start up the MOSFET is in a defined state.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Resistors and MOSFETs and fire-prevention, oh my

Sun Feb 10, 2019 12:22 pm

Brandon92 wrote:
Sun Feb 10, 2019 10:41 am
tlfong01 wrote:
Sun Feb 10, 2019 10:09 am
IRF540N Test Circuit
IRF540N Test Circuit - With Rg and Rgs added
https://penzu.com/p/087c1ca8
Your R2 (1k) has a to low value in comparison to your R1. So, you have made a voltage divider instead. And that is not what you want here. So, you need a higher value of R2. I have used values of 50k as a pull down resistor at that point. But, it need to be stronger that the internal pull up of the Rpi pin. So, that it will not turn on the MOSFET or when the GPIO pin is set as a input.

And that pull down resistor also ensures at start up that the MOSFET is turned off. And that it will not turn on by itself. That could let to a dangerous situations. So, at start up the MOSFET is in a defined state.

N Channel Power MOSFET Input Series Resistor and Gate Source Register Calculation Notes

Thank you for your advice. I have too little MOSFET knowledge to understand you suggestion. I guess I need at least a couple of days googling and reading before I can reply.

Looking back, I am a bit surprised that I walked quite a long way in power electronics. It was almost 6 months ago I joined a discussion on how to detect 24VDC, and then how to drive a buzzer and solenoid, then solenoid valve, then EEG, and ECG, all of which has much to do with electricity and magnetism, which I learned in middle school physics.

The biggest surprise is that I now know that my little head all these years generates alpha/beta/gamma electrical pulses, and that my heart is actually a electromechancal pump with valves etc and controlled by electric pulses.

I have the feeling that I have diverted too far from my original plan of completing a smart home application. I think I need to do a long selfie brainstorming style walk through, before making up my mind which way to moving on, ...
:mrgreen:
I am an electronics and smart home hobbyist.

danjperron
Posts: 3393
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Resistors and MOSFETs and fire-prevention, oh my

Sun Feb 10, 2019 1:09 pm

B.T.W. I just tried an IFR540N and it doesn't work on the pi . It only works if I toggle it using the 5V.

So IFR540 is not a good part to be used on the Raspberry Pi directly. You need to add a stage to "uplevel" the gate.


I.M.O. It is still a good mosfet but I will add an optocoupler in between. This will protect the Raspberry Pi and you could put a way higher Voltage on the mosfet. A 6V to 12V power supply will put the mosfet to a good range of conduction.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Resistors and MOSFETs and fire-prevention, oh my

Mon Feb 11, 2019 2:17 am

danjperron wrote:
Sun Feb 10, 2019 1:09 pm
1. I just tried an IFR540N and it doesn't work on the pi . It only works if I toggle it using the 5V.
2. you could put a way higher Voltage on the mosfet. A 6V to 12V power supply will put the mosfet to a good range of conduction.

What is the best value of Vgs for IRF540N?

1. So you confirmed the following:
...(a) Rpi GPIO High level (2V4 ~ 3V3) direct does not work with IRF540N, and
...(b) 5V Vgs works.

2. And you think PSU's 6V to 12V range for Vgs should create a good conduction channel and therefore good.

I am still reading the below ElectronicsTutorials on FET for newbies. I need to think hard before I can reply.


12VDC Motor and Solenoid Valve Currents

In the mean time, I am also checking out if the currents taken by the motor and solenoid valve matches the specification. I found that motor spec says 35mA, but actually it is about 100mA. Also the solenoid valve takes about 300mA, but seems decreases as the coil becomes hot. The penzu picture below shows more accurate readings:

...https://penzu.com/p/56a223ce

Appendix A - ElectronicsTutorials on FET

[1] JFET
https://www.electronics-tutorials.ws/tr ... ran_5.html

[2] MOSFET
https://www.electronics-tutorials.ws/tr ... ran_6.html

[3] MOSFET Switch
https://www.electronics-tutorials.ws/tr ... ran_7.html

Appendix B - 12VDC Solenoid Current Spec

12VDC Solenoid Current Spec
https://www.raspberrypi.org/forums/view ... 5#p1417752
https://www.raspberrypi.org/forums/view ... 5#p1417772

1N = 0.4A
4N = 0.8A
8N = 1.5A
20N = 4.5A

I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Resistors and MOSFETs and fire-prevention, oh my

Mon Feb 11, 2019 6:45 am

tlfong01 wrote: I am still reading the below ElectronicsTutorials on FET for newbies.

Power MOSFET Eectronics Tutorials Reading Notes

I have just finished a first quick reading of the ElectronicsTutorials' introduction tutorials.
Now I am more knowledgeable to do some experiments.


https://penzu.com/p/1ffad2f9
Last edited by tlfong01 on Mon Feb 11, 2019 11:58 am, edited 1 time in total.
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Resistors and MOSFETs and fire-prevention, oh my

Mon Feb 11, 2019 9:04 am

danjperron wrote:
Sun Feb 10, 2019 1:09 pm
I just tried an IFR540N and it doesn't work on the pi . It only works if I toggle it using the 5V.

Can Rpi GPIO 3V3 signal turns on IRF540N?

But I did use Rpi 3V3 GPIO to turn on IRF540N and move the motor. See the old post below.

Just now I tried it again and used a bench power supply to feed 3V to IRF540N and indeed found motor turning. Perhaps I had entered the Twilight Zone! :mrgreen:

https://youtu.be/Y55JsFyEOyM

Old Post for Reference
RE: RESISTORS AND MOSFETS AND FIRE-PREVENTION - tlfong01 2019feb08
https://www.raspberrypi.org/forums/view ... 5#p1427198

My fact check yesterday

I applied Rpi GPIO Pin 11 3V/0V High/Low signal at 1Hz direct (no logical level up shifting, no Cgs, no Rin, no Rgs, no nothing) to the power MOSFET IRF540N gate.

At Vgs = 3V, IRF540N (Vth(gs) = 4V max) opened its gate a little bit, perhaps less than 10%, but more than enough for 30mA to flow from Vdd +12V to motor 37GB820-70, then to Drain, then passed through the barely opened Gate, then to Source, then hit Ground. The motor turned at 70 rpm full speed happily.
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Resistors and MOSFETs and fire-prevention, oh my

Mon Feb 11, 2019 12:11 pm

Brandon92 wrote:
Sun Feb 10, 2019 10:41 am
1. Your R2 (1k) has a to low value in comparison to your R1. So, you have made a voltage divider instead. And that is not what you want here.

2. So, you need a higher value of R2. I have used values of 50k as a pull down resistor at that point.

3. But, it need to be stronger that the internal pull up of the Rpi pin. So, that it will not turn on the MOSFET or when the GPIO pin is set as a input.

4. And that pull down resistor also ensures at start up that the MOSFET is turned off. And that it will not turn on by itself. That could let to a dangerous situations. So, at start up the MOSFET is in a defined state.

Power MOSFET Rin and Rgs Circuit Analysis

Thanks a lot for your advice. I agreed with all your 4 points above, though they are a bit advanced and professional for my casual Micky Mouse hobbyist exploring for fun projects. I need to do some calculations for the Rin and Rgs and let you know the results later.

I only drew the schematic, and too lazy to actually solder the resistors, not to mention the other mysterious capacitors suggested by the OP. :mrgreen:
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Resistors and MOSFETs and fire-prevention, oh my

Mon Feb 11, 2019 1:01 pm

Gavinmc42 wrote:
Fri Feb 08, 2019 1:24 am
If the fet is getting hot then it is probably in the analog region.
A higher gate voltage turns it on more and so the resistance goes lower and hence heat goes down.
Most fets will have a 10 V gate voltage so driving them with 3V3 does not turn them on enough.
There are chips called gate drivers designed just to turn on/off fets
A logic level fet is designed to go on at a lower voltages.

Logic Level MOSFET

Ah yes, logic level MOSFET is good for lazy hobbyist newbies like me. But actually for newbies playing with light load of say, <2A motor or solenoid, I think a NPN BJT Darlington power transistor such as TIP120 is easier.

CSD18511KCS 40-V N-Channel NexFET Power MOSFET (Vgs(th) = 1.8V)
http://www.ti.com/lit/ds/symlink/csd18511kcs.pdf

PSMN2R0-30PL N-channel 30 V 2.1 mΩ logic level MOSFET (Vgs(th) = 1.7V)
https://assets.nexperia.com/documents/d ... -30PL.pdf

TIP120 NPN Plastic Medium-Power Silicon BJT (5A, 65W)
https://www.onsemi.cn/PowerSolutions/do ... P120-D.PDF
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Resistors and MOSFETs and fire-prevention, oh my

Mon Feb 11, 2019 1:34 pm

tlfong01 wrote:
Fri Feb 08, 2019 1:47 pm
danjperron wrote:
Fri Feb 08, 2019 11:48 am
3. The minimum for the IFR540 is 4V before it starts to conduct.
I strongly disagree with your point 3.

IRF540N Ids vs Vgs in the 4V to 2V Range

At Vgs = 3V, IRF540N can still conduct 60mA, enough to drive a 12V DC motor.
...
Attachments
irf540n_ids_vs_vgs_2019feb1101.jpg
irf540n_ids_vs_vgs_2019feb1101.jpg (101.69 KiB) Viewed 976 times
I am an electronics and smart home hobbyist.

danjperron
Posts: 3393
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Resistors and MOSFETs and fire-prevention, oh my

Mon Feb 11, 2019 4:51 pm

@tlfong01 you are missing the point!

When I said that they start to conduct it is not literally but according to the official specification the minimum Vgs they listed is 4V.


Is the IFR540 will toggle the valve? This post is about to activate a valve which needs more than 300 ma to be ON.

This is why I point out that the IFR540 won't do the job.


Now about your table. I suppose that you create them yourself ?

How many IFR540 did you check? Did you take the worse one?
What was the ambiant temperature ? This has a big impact I'm in Canada and right now is around -12Celsius.

Could you recreate the table but put your IFR540 inside a freezer. I want to see what you will get around 4-5 Celsius.

The most important is that the design needs to work on all possible scenarios and all parts of the design should work 100% of the times with some margins above the minimum.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Resistors and MOSFETs and fire-prevention, oh my

Tue Feb 12, 2019 1:26 am

danjperron wrote:
Mon Feb 11, 2019 4:51 pm
@tlfong01 you are missing the point! ...

I confess I missed your point. My apologies.

Looking back, I realize I joined in the discussion at the wrong time, at least not first trying to see the big picture, before making too straight to the point comments.

I am aware other professionals often misunderstand me by the my casual way of commenting engineering things.

But I am very serious when trying to point out that many electronic product specifications are misleading customers, and Vgs(th) is a case in point.

This is a short reply. I will try to explain in more details why professionals often misunderstand me, but I have already warned them in my signature that I am just a friendly hobbyist! :mrgreen:
I am an electronics and smart home hobbyist.

danjperron
Posts: 3393
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Resistors and MOSFETs and fire-prevention, oh my

Tue Feb 12, 2019 3:43 am

I was curious about your chart and I test some of my IRF540N.

I used three IRF540N plus one IRF630 and one IRF640.


A 12V power supply was used with a 12V 2A lamp. This explains why the maximum current is 2A.

The ambiant temperature is around 20 celsius. Each Mosfet was attached to a huge heatsink to keep the TO-220 case at the ambiant temperature.
No heatsink on the mosfet and it heats up then your measurements are all wrong. Heat reduce the Vgs.

On 1 experiment I put the IRF540 mosfet #2 at near 0 celsius by putting the heatsink into a bath of snow. I just grab some snow from outside. I'm in Canada ;-)

All my mosfets need at least 3.2V minimum to get ~10 ma on the drain. The IRF540 #2 start to get 10 ma at Vgs=3.6V when the heatsink was near zero celsius.
mosfetVgs_vs_IDS.png
Vgs VS Ids
mosfetVgs_vs_IDS.png (84.85 KiB) Viewed 936 times

My chart is different than yours. Temperature, single mosfet measurements and variability between parts . This is why Vgs bellow 4 V is not there.
I'm sure all the diagrams in the official specifications are worst case scenario.

Return to “Beginners”