# Driving a 3 W led with arduino

**URL:** <https://forum.arduino.cc/t/driving-a-3-w-led-with-arduino/1330675>\
**Category:** General Electronics\
**Created:** [December 9, 2024, 7:57pm UTC](https://forum.arduino.cc/t/driving-a-3-w-led-with-arduino/1330675 "2024-12-09T19:57:31Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![xcg584](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xcg584/32/1126465_2.png) [@xcg584](https://forum.arduino.cc/u/xcg584)\
**Post date:** [December 9, 2024, 7:57pm UTC](https://forum.arduino.cc/t/driving-a-3-w-led-with-arduino/1330675/1 "2024-12-09T19:57:31Z")

</div>

Hi all,

I have some 3W LEDs on the way, and I have a small project in mind which I want to do for a christmasy mood. It´s rather simple but I would still like to please ask for some help.  
According to the sellers description, the LEDs have a forward voltage of 3.2-3.4V, and a forward current of 700 mA. Now I want to controll one LED with a Mosfet, simply because I already have them at hand. Mosfet is the IRF540N, and according to the datasheed at Vgs = 5V the drain current is aready up to 30A. Which is overkill of course but since I have them..might as well use them.  
I would not use a dimming function for the LED (although curious if it´s possible with his mosfet), but I´m more interested to simply switching it on/off with some simple code.  
Now what I´m not sure of is, if this circuit will suffice..Is the resistor value OK? Should I need any more resistors, maybe a diode to protect the arduino etc...Any advice will be appreciated!

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/6/1/8/61818f84ed2196de96e13c1b2e146f25b37a46ea.png)

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/0/b/c/0bc1073e43f016865916f4c35a76722e5f3c5558.png)

Regards, X

---

<div class="post-metadata">

**Author:** ![build\_1971](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/build_1971/32/689930_2.png) [@build\_1971](https://forum.arduino.cc/u/build_1971)\
**Post date:** [December 9, 2024, 8:01pm UTC](https://forum.arduino.cc/t/driving-a-3-w-led-with-arduino/1330675/2 "2024-12-09T20:01:47Z")

</div>

You certainly need a current limiting resistor in series with your LED.  
Or some other constant current driver.  
Should be fat resistor as it will dissipate more than 1 watt (depending on value chosen).

---

<div class="post-metadata">

**Author:** ![anon94801460](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@anon94801460](https://forum.arduino.cc/u/anon94801460)\
**Post date:** [December 9, 2024, 8:03pm UTC](https://forum.arduino.cc/t/driving-a-3-w-led-with-arduino/1330675/3 "2024-12-09T20:03:32Z")

</div>

> [@xcg584](#):
>
> Mosfet is the IRF540N

Marginal, but it should work for one LED. As mentioned, a current limiting resistor is **required** for the LED.

You should also have a 150 Ohm current limiting resistor between the 10K pulldown resistor and the gate (not between the port pin and the 10K pulldown).

PWM dimming is certainly possible.

---

<div class="post-metadata">

**Author:** ![xcg584](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xcg584/32/1126465_2.png) [@xcg584](https://forum.arduino.cc/u/xcg584)\
**Post date:** [December 9, 2024, 8:23pm UTC](https://forum.arduino.cc/t/driving-a-3-w-led-with-arduino/1330675/4 "2024-12-09T20:23:30Z")

</div>

Thank you both for the help!

I think I have some 5W 1 ohm resistors somewhere...For the placement of the 150 Ohm resistor, did I draw it correctly?

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/9/d/2/9d2b0f425551a74876256769af73d96e3d54bf95.png)

---

<div class="post-metadata">

**Author:** ![build\_1971](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/build_1971/32/689930_2.png) [@build\_1971](https://forum.arduino.cc/u/build_1971)\
**Post date:** [December 9, 2024, 8:44pm UTC](https://forum.arduino.cc/t/driving-a-3-w-led-with-arduino/1330675/5 "2024-12-09T20:44:17Z")

</div>

1 ohm is not sufficient.  
5V-3.2V = 1.8V.  
500mA at 1.8V =3.6 ohm.  
So four 1 ohm resistors in series should do.

---

<div class="post-metadata">

**Author:** ![xcg584](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xcg584/32/1126465_2.png) [@xcg584](https://forum.arduino.cc/u/xcg584)\
**Post date:** [December 10, 2024, 6:28pm UTC](https://forum.arduino.cc/t/driving-a-3-w-led-with-arduino/1330675/6 "2024-12-10T18:28:08Z")

</div>

Thank you both very much for the help!

---

<div class="post-metadata">

**Author:** ![johnerrington](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/johnerrington/32/340106_2.png) [@johnerrington](https://forum.arduino.cc/u/johnerrington)\
**Post date:** [December 12, 2024, 8:03am UTC](https://forum.arduino.cc/t/driving-a-3-w-led-with-arduino/1330675/7 "2024-12-12T08:03:34Z")

</div>

How will you provide 5V to drive the LEDs? You will need .5A for each led.

---

<div class="post-metadata">

**Author:** ![jim-p](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jim-p/32/922840_2.png) [@jim-p](https://forum.arduino.cc/u/jim-p)\
**Post date:** [December 12, 2024, 1:40pm UTC](https://forum.arduino.cc/t/driving-a-3-w-led-with-arduino/1330675/8 "2024-12-12T13:40:32Z")

</div>

> [@xcg584](#):
>
> according to the datasheed at Vgs = 5V the drain current is aready up to 30A.

Only with a Vdd = 15V but you won't have a Vdd of 15V so the graph you are looking at tells you nothing about tht Rds(on) with a Vgs of 5V.

With a Vgs as high as 4V it may only be able to handle a few 10's of milliamps.

---

<div class="post-metadata">

**Author:** ![xcg584](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xcg584/32/1126465_2.png) [@xcg584](https://forum.arduino.cc/u/xcg584)\
**Post date:** [December 12, 2024, 9:08pm UTC](https://forum.arduino.cc/t/driving-a-3-w-led-with-arduino/1330675/9 "2024-12-12T21:08:43Z")

</div>

We´ll I was thinking of using a 5V 2A power supply for the LED (would be only one) and the arduino.  
But now Jim has got me thinking...then I would need at least a 9V 3A power supply, since I don´t need more than 1A from the mosfet, and I can use this to power the arduino as well through the Vin pin, and a LM7805 regulator for the LED. Can handel 1.5A of current accoriding to the datasheet, so having the current limited to 500mA with a 5W resistor throught the LED should be safe no?

---

<div class="post-metadata">

**Author:** ![rf\_tec](https://avatars.discourse-cdn.com/v4/letter/r/3ec8ea/32.png) [@rf\_tec](https://forum.arduino.cc/u/rf_tec)\
**Post date:** [December 12, 2024, 11:55pm UTC](https://forum.arduino.cc/t/driving-a-3-w-led-with-arduino/1330675/10 "2024-12-12T23:55:49Z")

</div>

> [@anon94801460](#):
>
> Marginal, but it should work for one LED. As mentioned, a current limiting resistor is **required** for the LED.
> 
> You should also have a 150 Ohm current limiting resistor between the 10K pulldown resistor and the gate (not between the port pin and the 10K pulldown).
> 
> PWM dimming is certainly possible.

Hi,

You could also added an activ pulldown driver to control the MOSFET.

Because for high-frequency PWM, the passive pull-up makes the turn-on speed is too slow. If you oscillate too fast, the MOSFET spends too much time in turn-on and wastes too much power.

If no, by adding a resistor in series this will effectively limit the gate current, and therefore your switching speed, so this resistance should not be greater than absolutely necessary.

Refer to datasheet.

---

<div class="post-metadata">

**Author:** ![xcg584](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xcg584/32/1126465_2.png) [@xcg584](https://forum.arduino.cc/u/xcg584)\
**Post date:** [December 13, 2024, 6:28pm UTC](https://forum.arduino.cc/t/driving-a-3-w-led-with-arduino/1330675/11 "2024-12-13T18:28:52Z")

</div>

Hi,  
I´m honestly not 100% sure what you mean by an active pulldown driver, do you have a schematics or example for reference?  
And for the resistor in series, I assume you mean the 150 Ohm one...How can I calcualte the perfect resistor for the optimal switching performance?

---

<div class="post-metadata">

**Author:** ![SurferTim](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/surfertim/32/1072341_2.png) [@SurferTim](https://forum.arduino.cc/u/SurferTim)\
**Post date:** [December 13, 2024, 6:47pm UTC](https://forum.arduino.cc/t/driving-a-3-w-led-with-arduino/1330675/12 "2024-12-13T18:47:41Z")

</div>

I use 3W LEDs but use a Mean Well LED driver.  
Variable input voltage, serial LEDs, PWM brightness and on/off digital line.  
I use the LDD-L series. No heat. Little wasted power.  
Not cheap. Just as an option.

---

<div class="post-metadata">

**Author:** ![DVDdoug](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/dvddoug/32/671533_2.png) [@DVDdoug](https://forum.arduino.cc/u/DVDdoug)\
**Post date:** [December 13, 2024, 7:30pm UTC](https://forum.arduino.cc/t/driving-a-3-w-led-with-arduino/1330675/13 "2024-12-13T19:30:09Z")

</div>

> [@xcg584](#):
>
> and a LM7805 regulator for the LED. Can handel 1.5A of current accoriding to the datasheet,

**I believe that's with an "infinite heatsink"** holding the case temperature to approximately room temperature.

It will get very hot without a heatsink and it might get too hot even with a heatsink.

They are thermally protected and they try to shut down if they overheat so it shouldn't burn-up and die but they usually don't shut-down cleanly... They tend to oscillate and behave strangely...

**The LED will also need a heatsink** if it didn't come with one.

---

<div class="post-metadata">

**Author:** ![DaveX](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/davex/32/751443_2.png) [@DaveX](https://forum.arduino.cc/u/DaveX)\
**Post date:** [December 13, 2024, 7:54pm UTC](https://forum.arduino.cc/t/driving-a-3-w-led-with-arduino/1330675/14 "2024-12-13T19:54:55Z")

</div>

> [@xcg584](#):
>
> Mosfet is the IRF540N, and according to the datasheed at Vgs = 5V the drain current is aready up to 30A.

From the [IRF540N datasheet](https://www.infineon.com/dgdl/Infineon-IRF540N-DataSheet-v01_01-EN.pdf?fileId=5546d462533600a4015355e39f0d19a1) look at this diagram:

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/8/7/c/87c608bf2c8fe315ec208f75a81b9bb0898ae140.png)

Work out where your circuit operates on it by extrapolating the `V_GS=5V` curve off the graph to `I_D=0.7A` and it will tell you info about the voltage drop across the MOSFET and its `I*V=P` wattage.

> [@xcg584](#):
>
> then I would need at least a 9V 3A power supply, since I don´t need more than 1A from the mosfet, and I can use this to power the arduino as well through the Vin pin, and a LM7805 regulator for the LED. Can handel 1.5A of current accoriding to the datasheet, so having the current limited to 500mA with a 5W resistor throught the LED should be safe no?

If you want to drive the LED at 500mA off of 9V, then you could skip the 7805 and do it directly with a different current limiting resistor: `(9V - 3.2V)/0.500A=11.6Ohm` at `I^2*R=0.5*0.5*11.6=2.9Watts` Maybe a 12ohm, 5W?

---

<div class="post-metadata">

**Author:** ![rf\_tec](https://avatars.discourse-cdn.com/v4/letter/r/3ec8ea/32.png) [@rf\_tec](https://forum.arduino.cc/u/rf_tec)\
**Post date:** [December 13, 2024, 8:04pm UTC](https://forum.arduino.cc/t/driving-a-3-w-led-with-arduino/1330675/15 "2024-12-13T20:04:29Z")

</div>

> [@xcg584](#):
>
> Hi,  
> I´m honestly not 100% sure what you mean by an active pulldown driver, do you have a schematics or example for reference?  
> And for the resistor in series, I assume you mean the 150 Ohm one...How can I calcualte the perfect resistor for the optimal switching performance?

The choice of the value of this current limiting resistor is often ampirical, but in theory, depending on the gate capacitance and resistance of the FET, and the current capability of the previous floor (MCU).

For driving a mosfet, it is a solution like any other, it all depends on the characteristics of components, the voltages and the currents applied.

Here for very classic exemple with P-Channel Mosfet :

![P-Channel FET](https://europe1.discourse-cdn.com/arduino/original/4X/4/1/d/41d7460a4d7bcbdbe2ab4ba0c0135066c634687f.gif)

---

<div class="post-metadata">

**Author:** ![Ron\_Blain](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ron_blain/32/1126393_2.png) [@Ron\_Blain](https://forum.arduino.cc/u/Ron_Blain)\
**Post date:** [December 13, 2024, 8:19pm UTC](https://forum.arduino.cc/t/driving-a-3-w-led-with-arduino/1330675/16 "2024-12-13T20:19:55Z")

</div>

While I can appreciate you have a pile of IRF540N MOSFETS I believe you would do much better using a N Channel logic level MOSFET like a FQP30N06L or similar.

Ron

---

<div class="post-metadata">

**Author:** ![jim-p](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jim-p/32/922840_2.png) [@jim-p](https://forum.arduino.cc/u/jim-p)\
**Post date:** [December 15, 2024, 8:32am UTC](https://forum.arduino.cc/t/driving-a-3-w-led-with-arduino/1330675/17 "2024-12-15T08:32:54Z")

</div>

> [@xcg584](#):
>
> so having the current limited to 500mA with a 5W resistor throught the LED should be safe no?

No it would not.  
Basically you need a different MOSFET. One that specifies an Rds(on) max at a Vgs=5V or less

---

<div class="post-metadata">

**Author:** ![xcg584](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xcg584/32/1126465_2.png) [@xcg584](https://forum.arduino.cc/u/xcg584)\
**Post date:** [December 15, 2024, 6:33pm UTC](https://forum.arduino.cc/t/driving-a-3-w-led-with-arduino/1330675/18 "2024-12-15T18:33:03Z")

</div>

Thank you all very much for the help...Guess I really need to get myself either a new MOSFET or a led driver, hope I can get something in a reasonable time...Heatsinks will of course be used anyway, wouldn´t want to risk destroying anything

---

<div class="post-metadata">

**Author:** ![DaveX](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/davex/32/751443_2.png) [@DaveX](https://forum.arduino.cc/u/DaveX)\
**Post date:** [December 15, 2024, 8:51pm UTC](https://forum.arduino.cc/t/driving-a-3-w-led-with-arduino/1330675/19 "2024-12-15T20:51:22Z")

</div>

> [@jim-p](#):
>
> Basically you need a different MOSFET. One that specifies an Rds(on) max at a Vgs=5V or less

Doesn't this IRF540 chart extrapolate to show about Rds(on)=0.04 for Vgs=5V in the 500mA operating region?

> [@DaveX](#):
>
> ![image](https://europe1.discourse-cdn.com/arduino/original/4X/8/7/c/87c608bf2c8fe315ec208f75a81b9bb0898ae140.png)

This [IRL540 chart](https://www.vishay.com/docs/91300/irl540.pdf) shows it linear up to much higher amps:

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/6/3/c/63cec0a519ddefc848f338fef541a693fc565cae.jpeg)

The 500mA operating point seems off the chart about the same way for both of these devices.

---

<div class="post-metadata">

**Author:** ![jim-p](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jim-p/32/922840_2.png) [@jim-p](https://forum.arduino.cc/u/jim-p)\
**Post date:** [December 16, 2024, 8:14am UTC](https://forum.arduino.cc/t/driving-a-3-w-led-with-arduino/1330675/20 "2024-12-16T08:14:55Z")

</div>

> [@DaveX](#):
>
> Doesn't this IRF540 chart extrapolate to show about Rds(on)=0.04 for Vgs=5V in the 500mA operating region?

Under the specific test conditions and it is only a typical value.  
You tell me what the max Rds(on) will be with Vgs=5V and with what degree of accuracy.

[Next page](https://forum.arduino.cc/t/driving-a-3-w-led-with-arduino/1330675.md?page=2)
