Pages: [1]   Go Down
Author Topic: MOSFET not switching 8 LED layer?  (Read 1049 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi I'm using a IRFS630B (power MOSFET) rated at 200V and 9A max.  Vth is 2~4 V.  I'm trying to sink the current of 8 common cathode LEDs and I'm having some troubling getting my code to switch the transistor on/off.  I have the gate connected to the Arduino Mega on pin 8 and when I configure the pin as an input and activate the pull up resistor it's on and when I deactivate the pull up resistor, it's still on.  However, the transistor works properly when the pin is an output which is confusing to me.  If anyone can explain why this is that would be great.  

Essentially here is my goal:
8x8 LED layer (not yet built, I'm just tasting on one row of the 8x8 layer) switched by the above MOSFET and the Arduino Mega sinking the current from the layer (the layer is interfaced to the Arduino through the MOSFET).  I was under the impression that the only way to do this is to configure the pin that sinks current as input.  I've tried this and it doesn't work, or sometimes the LED's slowly fade and eventually turn off.
Logged

Northern Ireland
Offline Offline
Newbie
*
Karma: 0
Posts: 45
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is the pin not meant to be set to OUTPUT when controlling a FET, meaning its working properly?
« Last Edit: April 27, 2012, 05:35:18 pm by Wazzled » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I was under the impression it was supposed to be configured as an input.  If I can control the transistor using a pin configured as output, is the Arduino still sinking current on that pin?
Logged

Offline Offline
Faraday Member
**
Karma: 65
Posts: 2523
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Go with the arduino pin as an output, it can sink or source.

When you use the pulllup, the gate is at +5, fine.
But when you take away the pullup, the gate keeps a charge, and the pin is floating, and the MOSFET stays on.
Logged

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Awesome that makes sense. Thanks.
Logged

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 47
Posts: 2892
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

2 things,,, It is good practice to put a 10K resistor from gate to ground, it will be a 500 uA load... and second the Mosfet is a Voltage operated device and it is wise in a 5V system to use Logic Level Mostefs. Vgth is the Gate Threshold Potential... the point at which the device just begins to conduct "Threshold" A mosfet with a 4V vgth would be conducting less than it's full current rating at rated load, where the gate drive is 5 volts or les as you must remember that the output of a '328 is Guaranteed to be 2/3rd's Vcc High and less than 1/3rd Vcc low (off) voltages can be 500 mv to a vol deepening on the port load.  Mosfets with Vgth in the range of 2 - 3 V would work better as a high current switch than a device with a 4V Vgth as there is a significant chance of the gate not being properly enhanced. This isn't much of an issue at low currents but for some devices at a HIGH or High current pulse (motor start or solenoid) the low entrancement would force the transistor to be a current limiter. If Vgth is (for example 4V them about 6 to 8 volts would be Required for "Full Enhancment" of the gate. As to the gate pull down it is there in the case that for any reason the gate drive circuit becomes open,  "high impedance",... like switching the Proc pin from  ouput to an input. Mosfet gates are Extremely High impedance and Very Prone to electrical and electrostatic fields very delicate too (input impedance's of 1000 Mohms are typical) a 2n7000, vnk10m, BS170 would make a great great electrometer with a 500 Mohm gate load and a 1 m resistor from drain to PSU source grounded. A meter from drain to ground and 6" of wire on the gate as a sensor makes a very effective static electricity sensor. The large resistor is necessary for a drain on the antenna ( to reduce response time to the 500 ms range. I made one for my lab electronics bench and the numbers of Cmos devices failed dropped quickly... one last thought... Diode protected gate devices are much more robust than non protected devices (they make poor electrometers.

Doc
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Pages: [1]   Go Up
Jump to: