0
\$\begingroup\$

I am trying to run an RGB LED strip using an ESP32 but I cannot get it to full brightness. Here is what I've done:

I started with a diffused RGB LED and a simple ESP32 sketch. This worked how it should. I was able to send a hex color code and varied the color of the LED correctly.

I then bought the REG LED strip above and some T220 mosfets (Datasheet) along with a 12V 6A power supply. I followed this example wiring. My ESP32 is powered by micro USB and the LED is powered by the 12+ from the power supply. The ground is tied to each MOSFET and the ground on the ESP32.

So using the same sketch I can vary the color correctly but they never get near full brightness. I.e. if I ground R, G, or B directly I get a nice bright pure color. However using the schematic I get maybe 10% light output? So I can send it FF0000 and get just the red but its barely lit, 00FF00 and just green dimly lit, 0000FF blue same thing.

What could be wrong or where can I test? I have a good multimeter but I'm not sure what I should be looking for. I pulled it all apart and went back to the diffused RGB LED and it is full brightness how it should be running off the ESP32 directly so I'm assuming the addition of the MOSFET's are the issue...like they are not being told to go full open (drain?). Or they can't react fast enough to the PWM on the ESP32?

Oh, and they do vary between 00 and FF so if I send #400040 I get a little blue and red. If I send #FF00FF I get more blue and red but still maybe 10 - 15% total instead of 100%.

\$\endgroup\$
1
\$\begingroup\$

The threshold voltage of the FET you linked is typically 3V, and can get up to 4V:

enter image description here

Which means that with the ESP32s GPIO you are not guaranteed to fully turn them on.

Try connecting the gate of a FET to 5V and see if the strips light up correctly (disconnect the ESP32s GPIO first).

If that solves the problem then you have 2 options:

1 - get a FET that is guaranteed to fully turn on at 3.3V (try looking for a Threshold voltage of around 2V)

2 - use something to drive the FETs gate to a proper voltage. A level shifter or a discrete transistor setup to drive the FETs gate, for example.

If that doesn't solve the problem, then the issue is something else.

p.s.: GND is not -12V

\$\endgroup\$
  • \$\begingroup\$ Wesley - Thank you! I saw that line in the PDF, min = 2 and max = 4, but didn't know enough to understand it. Adafruit recommends adafruit.com/product/355 and its datasheet shows min = 1.35v and max = 2.35 so I'm assuming that means somewhere between there is full on and it can vary between chips? I connected one of the MOSFET's to 3.3v off the ESP32 and it was the exact same brightness as the GPIO full on. So then I put it on the ESP32's 5v output and the LED went full on, same as if it was connected directly to +12v. So it looks like I just need some new MOSFET's. \$\endgroup\$ – Allan Oct 6 '17 at 3:08
  • \$\begingroup\$ @Allan - Glad to be of help. The range is just something that happens due to variances in production. Also, even if the threshold on the datasheet says 2Volts, you can probably get a better(lower) RdsOn with higher drive voltage (i.e.: your FET will heat less). So the Gate Threshold rating its not necessarily "full on", just something the mf thinks is "on enough" for a given spec. Depending on how critical your application is you'd want much, much more than 1V higher than the threshold (and/or) devices with less variance. \$\endgroup\$ – Wesley Lee Oct 6 '17 at 3:15
  • 1
    \$\begingroup\$ Rule of thumb is chose part with a threshold of Vgs(th) max approx <=1/3 Vgs applied or use a open collector with pull up to make use of 12V. R pullup depends on rise time needed. Use smallest possible like 1k or less which is about 50k x RdsOn, so it will not be superfast. \$\endgroup\$ – Sunnyskyguy EE75 Oct 6 '17 at 3:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.