problems with arduino controlling fet

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
Alright, been a bit since i asked for help, but here goes
Im working on a project in which i have 12 strands of 3 ultrabright led's each, with resistor
These are powered by a 12 volt lead acid battery
Im trying to controll these leds with a pwm pin on an arduino to achieve a fading effect
Currently, i have the arduino powered off the 12 volt battery, with pwm pin 9 going to the gate of an irfs654b mosfet, which has its drain on the 12v+ and source at the positive end of all the led strands
it works, in that if i connect the gate of the mosfet directly to 12v or ground the lights turn on or off, and ive scoped the waveform at pin 9 and it behaves as expected, and when connected directly to an led it works fine, but when i hook the gate to pin 9, nothing happens. I cant figure out why.
Is the 5v output not enough to trigger the fet?
Does the fet need to be between the led strings and ground?
Any help appreciated, thanks guys
 

crutschow

Joined Mar 14, 2008
38,745
You have two problems:

First, you are connecting the MOSFET as a source follower so the output voltage is equal to the gate voltage minus the Vgs ON voltage of the transistor. With 12V on the gate you get enough source voltage to light the LEDs, but 5V is not enough to turn on the MOSFET and also give significant voltage at the source for the LEDs.

Since that MOSFET requires 10V Vgs to fully turn on (see Rds(on) in the data sheet) it won't work with 5V. You need a logic-level type MOSFET which can fully turn on with a 5V Vgs such as this.

Second, you also need to connect the MOSFET in a grounded source configuration with the LED plus lead connected to 12V and the minus lead connected to the transistor drain (with series resistor, of course). That way the 5V will fully turn on the transistor and apply 12V across the LED string.
 

strantor

Joined Oct 3, 2010
6,875
You're using a N-channel mosfet as a high side switch. Normally they are used as a low side switch. You can use it as a high side swich, but the catch is that the voltage on the gate must be at least 2V referenced to source. I don't know what voltage your LEDs are, but I'll use 2.2V as an example. You have 3 leds in series, so that's 6.6V, and an additional drop across the resistor. Your arduino only puts out 5V, when it needs to put out at least 8.6 min (LED drop + resistor drop + Vgs spec) to turn on. I recommend using it as a low side switch.
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
Thanks guys
would moving the FET to the low side and/or driving it with a logic level BJT work?
I don't have any logic FETs on hand
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
Open collector?
Won't that pull the FET gate to ground?
How does that help when my problem is lack of voltage at the gate?
EDIT
waaaiiiittt... im guessing you used a LARGE pull up resistor on the collector... gotcha
 
Last edited:

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
hang on, (I hate BJT's :p)
if I have a large resistor between the collector/FET gate and the +12V, then the arduino output pin is just going to short to ground through the bd junction and fry the pin :p
(glad I thought of that before I tried wiring it up :p)

Where do I need the resistors?
collector/base, or just 1 on the drain?
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
OR, I could do this the easy way, and rummage through my stack of IC tubes, find the one labeled MOSFET driver, and use that to buffer the signal:p
or an AND/NAND gate with the inputs tied together :p
 

strantor

Joined Oct 3, 2010
6,875
Open collector?
Won't that pull the FET gate to ground?
How does that help when my problem is lack of voltage at the gate?
EDIT
waaaiiiittt... im guessing you used a LARGE pull up resistor on the collector... gotcha
Yes, that will pull the FET to ground, when the BJT is ON, and when the BJT is OFF, the gate will be pulled high via the pullup resistor and will be ON. that's what I was saying about inverting the PWM duty cycle.
hang on, (I hate BJT's :p)
if I have a large resistor between the collector/FET gate and the +12V, then the arduino output pin is just going to short to ground through the bd junction and fry the pin :p
(glad I thought of that before I tried wiring it up :p)

Where do I need the resistors?
collector/base, or just 1 on the drain?
What? I don't think we'r on the same page.
 

Attachments

crutschow

Joined Mar 14, 2008
38,745
I see that, but I'm confused, down under the ON characteristics it list Vgs min 2V and Vgs max 4V. What gives?
What gives is that you didn't fully read what that parameter is. ;) It is the Gate Threshold Voltage where the transistor just starts to turn on (note that it's measured at a drain current (Id) of 250μA. If that's all the current you need then you can just apply that low voltage to the gate.

However, if you want to turn the transistor fully on as a switch then you need to look at the next parameter which is the Rds(on). That shows you need a Vgs of 10V for the minimum ON resistance.
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
Yes, that will pull the FET to ground, when the BJT is ON, and when the BJT is OFF, the gate will be pulled high via the pullup resistor and will be ON. that's what I was saying about inverting the PWM duty cycle.


What? I don't think we'r on the same page.
Yep, got the inversion part, its just that in my mind there was no limiting resistor between the arduino and the transistor, thanks :)

approximately what value should that resistor be?
 

strantor

Joined Oct 3, 2010
6,875
Yep, got the inversion part, its just that in my mind there was no limiting resistor between the arduino and the transistor, thanks :)

approximately what value should that resistor be?
I would size it to limit the current drawn from the micro to 40mA (125Ω) or to limit the base current of the chosen npn to whatever it's spec is, whichever is higher. As for the pullup resistor, I would size it as low as possible (max collector current of NPN) to reduce turn on time of the MOSFET, or if efficiency is the goal, then a little higher.

When I switch things with my arduino I almost always use a TIP120 darlington with 1.2kΩ base resistor.
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
Thanks, always good to learn something :)
Took the slightly easier route though and used a TC429CPA I had laying around
even still worked as a high side switch :)
 
Top