Can someone explain why do I need a MOSFET and a resistor to change the brightness of a strip led?

Hi!
I have been researching about the circuit I would have to do in order to change a strip led's brightness, and I've found that most circuit use a MOSFET and a resistor. I understand what these components do separately, but not in a circuit like this. Could someone explain their use in such circuit?

I would appreciate your help!

Thanks,

Laura

So the mosfet is used as a high-power quick switch. The resistor is used as a pull-down to make sure the gate doesn't open when the Arduino's GPIO pin is not in an output state (like during boot) preventing the mosfet from being open (or closed, without the resistor it could be in either state depending on static)
The PWM is switching the mosfet on & off. opening the GND connection of the strip.

Imagine if you will that you can see a light from 1K away. Now the light blinks at 1 time a second and is only one for 1/16th of a second. Image how bright that light will appear. Same light same distance but now blink the light 4 times a second for 1/16th of a second, will the light appear brighter or dimmer?

I take it the LED strip is not a programmable LED strip?

Next the Uno can only supply X amount of current. Each LED added draws more current. With the addition of a few LED's the current capacity of the GPIO pin will be exceeded. In order to drive more LED's a device is needed to allow the GPIO pin to supply the current demanded by the LED's.

If the LEDs are flashing on and off fast enough that they don't appear to flicker, then the eye will perceive changes in duty cycle as changes in brightness.

Of course you could just control the gate to produce higher or lower current through the mosfet, with no PWM switching, but then a good bit of voltage would be dropped across the mosfet, which would cause it to overheat. But the mosfet will not heat up if it is either fully on, or fully off, and if it transitions between the two states very rapidly. So that's what your PWM drive out of the Uno does. The "averaging" is done by human visual perception.

You probably should insert a resistor of perhaps 100 to 470 ohms into the PWM line going to the gate. Without it, and depending on the frequency, you may get some ringing on that line.

Edit: One other thing about your circuit. It looks like you have a mains-powered 5V supply plugged into the barrel jack of the Uno. I've never actually used an Uno, but I think the barrel jack needs to be 7V or higher. Others here will know for sure.

That is true. With a voltage less than 7V to Vin or to the power plug the regulator will not regulate properly.

In different words.....

LED strips cannot be dimmed successfully by reducing the voltage. The strip will dim a little then you will see brightness of each LED strip will be different.

The solution to this problem is to turn the LED strip ON and OFF at a rate the eye cannot perceive. Theater movies (when film was used) changed the picture 24 times a second.

The processor can created a fast enough signal but cannot provide enough current to light the LED's.
A MosFet requires very little current to control (voltage at the gate) and can provide a lot of current for the LED's.

So using the processor to control the MosFet which powers the LED's is a common configuration.

The resistor is just a little bit of safety so if the MosFet fails the processor won't be damaged.

and if the processor doesn't put anything out, the mosfet will close leaving the strip fully off. (rather than whatever )

Yeah, I put it wrong in the schematics it is powered by 12 V.

There are three main failure modes for power MOSFETS: #1. They become shorted between drain and source and so they will conduct as lumps of silicon in both directions. #2. They become shorted between drain and gate so they are always biased ON and will conduct in both directions. #3. They explode and cease to conduct.

with the USB plugged in do you even need it powered via the barrel jack ?

that is the maximum voltage rating, check how much the PSU is actually providing.

hehe, i know overheating will break them (above 305 deg C, mainly if you are using SMT parts where you solder the heatsink) and static electricity can break them. Those 3 ways are new to me.

A programmable LED strip dimming.

Whats 255,0,0?
Red

What 4,0,0?
Red

What's the difference? Brightness.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.