LEDs Using Monochromatic Platform No Longer Gets to Max Brightness

Hey All -

I set up an ESPHome / HA integration to control lighting on a project I made. Full setup & code at end of the post. Initially, it worked great. Recently, I found that even when set at 100% brightness in HA, the LEDs seemed much more dim. I broke out the multimeter and found that at 100%, only a bit over 3V was being delivered to each strand of LEDs instead of the full 12V.

I thought it may be due to the IRF520 MOSFet I was using, so swapped it out with an RFP30N06LE 30A 60V N-Channel but got the same results. I’m almost certain the issue has to be software as I have the same hardware config + code (except using 12V LED strip instead of sets) for another project and it works great. BTW - I’ve obviously restarted the Wemos + have updated the firmware to the latest.

Any suggestions? Thanks!

Hardware / Wiring

  • Wemos D1 Mini
  • RFP30N06LE 30A 60V N-Channel Power Mosfet
  • x24 3.0V 20mA LEDs
  • LM2596 Buck Converter
  • 12V 1.5A Power Supply
  • Couple of resistors

Code

esphome:
  name: terminatorarm
  platform: ESP8266
  board: d1_mini

wifi:
  ssid: "xxxxx"
  password: "xxxxx"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Blah Fallback Hotspot"
    password: "xxxxx"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "xxxxxx"

ota:
  password: "xxxxxx"

light:
  - platform: monochromatic
    name: "Blah"
    output: output_component1

output:
  - platform: esp8266_pwm
    id: output_component1
    pin: D7

Is it possible to put a scope on the LEDs to see if the dimness/voltage is due to PWM, or something else like a DC-current problem?
A voltmeter will tend to read the average of a PWM signal, so you can’t really tell by just voltage.
You might also not need those resistors, as this is not like a conventional transistor. The logic level from the ESP is all it should need at the gate. Having a 1K pull-down on there may be overcoming the logic signal from the ESP, preventing the gate from fully opening.

1 Like

Thanks for the reply -

Sorry, but what do you mean about a scope on the LEDs? Perhaps I can try a different power source as well. Doubt its due to resistors since had same results with an IRF520 + have same setup on that other project without issue.

Thanks

I was referring to an oscilloscope, which would reveal if the dimness is due to the ESP time-slicing the on-time signal, or not. That’s something an ordinary voltmeter can’t reveal.
But an easy way to rule that out would be to temporarily unhook from the ESP’s GPIO pin and pull that gate resistor to +V (or to gnd, depending on the polarity of the MOSFET. one will turn it on, the other off). The LEDs should come on to full-brightness.
Also, you might consider inserting a gate driver on the ESP-to-gate line. At high PWM rates, the inherent capacitance in the gate (even a logic-level one) can look like almost a dead-short to the ESP, drawing currents from the ESP that might be over-stressing that GPIO line and causing it to misbehave.

Thinking further at this, and thinking about the gate capacitance, those resistors become my “Suspect #1” as they will slow down the rise/fall time at the gate. That is, the gate acts like a capacitor, and a capacitor’s charge/discharge time is slowed down by resistance. That may be enough to keep the light from being on as long as the PWM is asking it to. Try just wiring the gate direct to D7, with no inline or pulldown resistor.

2 Likes

They could also lower the PWM frequency and see if that makes a difference as there will be a longer charge/discharge period available.

2 Likes

Guys -

OK, so below are the tests I conducted and their results…

  • Bypassed the resistor between gate & GPIO: When turned up to 100%, it was still dim - no difference at all in brightness level
  • Connected Gate to V+: I tried both 5V & 12V +, but both yielded the same result of the brightness level still being dim
  • Changed power supply: Swapped the power supply with one from another project which produces a few more (4.35) amps even though shouldn’t be needed - no change :frowning:

Odd - any suggestions? Thanks!

If all else fail, try another GPIO, I say.

I’ve had a similar weirdness that changing GPIO’s (and in one case the whole ESP2866) has fixed , for reasons unknown.

This causes your MOSFET to be driven at a guaranteed 100% duty cycle. If the LEDs are still dim then there are only a few causes:

  1. your MOSFET has a high Rds ON value.
  2. your cabling to the LEDs has a high resistance…

Speaking of resistance, where are the current limiting resistors for your LEDs?

None are shown in your circuit above.

You have 8 groups of 4 series LEDs in parallel. If one of those groups has a lower on voltage than the rest it will prevent the other groups from lighting fully. Each group should have a low value series resistor to prevent this.

I don’t have any resistors. Each LED is 3V and voltage is 12V which is why I have them in groups of 4. I guess its possible that a lower voltage LED got mixed in. Will check and see.

Each LED is nominally 3V. Not exactly 3V. And they as they are diodes they are very non linear around the turn on voltage, small differences in voltage have big effects in luminosity.

Not only that but their voltage changes with temperature. As they heat up the voltage lowers, allowing more current, which heats more which allows more current… etc until smoke comes out.

Understood, but I still measured 3V being sent to each group of 4 when at 100% though. Here’s a link to the exact LEDs for reference. I’ll guess I’ll test with individual groups of 4 to see what happens unless someone has another suggestion.

Check the very first specification:

PARAMETERS - Voltage: DC 3.0V-3.2V

If you are only measuring 3V across the LEDS (and they are in strings of 4) there must be 9V somewhere else (12-3 = 9). Where is it?

Across the MOSFETT?

What happens if you try with just one string of LEDs connected?

Try all 8 strings seperately.

OK, Guys - Finally got it figured out…

I disassembled and tested each strand of 4. One of them (last one I checked of course) wasn’t nearly as bright as the rest. Everything was soldered well and obviously current could pass through. Did notice that they occasionally blinked on/of so going to assume its a bad LED somewhere. Replaced entire strand and all back to normal.

Occam’s razor… :slight_smile:

Thanks for your help!

Without per-string current limiting this will probably happen again. Thermal runaway in LEDs is a thing.

1 Like

tom_l -

You were right - it happened again. What do you mean by “per-string current limiting”, exactly? I’ve got 12V going to x4 3V LEDs so didn’t think I’d need resistors. Would adding a 10ohm resistor to each string be enough? Please explain.

Thanks!

Some good reading:

https://www.ledsmagazine.com/leds-ssl-design/driver-ics/article/16696028/led-design-forum-avoiding-thermal-runaway-when-driving-multiple-led-strings-magazine

https://www.st.com/resource/en/technical_note/tn0026-led-balancing-circuits-stmicroelectronics.pdf

Thanks -

Read the articles (plus others) and tried to do my homework, but can’t figure out what to use. Below are 3 schematics I drew up really quick. The one on the left is how it’s currently wired. The middle one is with resistors introduced, and the right one with a current mirror (I think). It’s my understanding that the middle one would work, but that the left one would be the ideal solution. If so and given that the power source is 12V 4.58A DC and LEDs are 3V 20ma, what resistors / transistors should I use?

Thanks for your help