Wednesday 21 August 2019

led - Switching MOSFET from Raspberry Pi GPIO


I'm trying to drive a STP16FN06 from a Raspberry Pi GPIO pin but I'm a bit lost.


The schema below represent (I think) how it is currently wired, on the left the RPi pin + ground and on the right a 5V DC supply.


schematic


simulate this circuit – Schematic created using CircuitLab


If I remove the MOSFET and plug it directly to the 5V, it light up so this part is ok.


When I set the pin to high, I have 3.3 between it and the ground but nothing shows and from what I understand the MOSFET should be on between 2 and 4V.



I'm not really sure what I've missed but being a bit new to electronics there's probably some beginner mistakes in there.



Answer



You have to actually read the datasheet. Note that the gate threshold voltage can be up to 4 V, and that is only where it starts to conduct. This MOSFET is simply inappropriate for this application. It is also much larger and for much higher voltage and power than you need. Those by themselves don't hurt you except that other specs have been traded off to get those. MOSFETs that can handle more than 30 V usually can't be turned on very well by logic level signals, and this one is no exception.


Replace with a more suitable FET, like the IRLML2502, and your circuit should work as shown. Or, you can use a jellybean NPN transistor, like 2N4401, with a base resistor and maybe adjust R2 a bit.


The diagram in the MOSFETs datasheet that could (should?) have alerted you is on p.6:


enter image description here


This diagram shows that your MOSFET can handle no current with its gate at 3V, and it can handle the current it is rated for (16A) from ~ 5.5V. (Note that such diagrams are typical, not worst case, so you can't use them for accurate design calculations, but they still give good indication).


You should use a MOSFET has the vertical part of the curve below 3V. Such a MOSFET will be rated for much lower currents.


If you realy must use a MOSFET like this one you will need to amplify (convert) your Pi's output to a higher voltage, for instance using a MOSFET driver chip.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...