Page 1 of 1

LED Brightness

Posted: Mon Jul 20, 2020 1:09 am
by greenzwiz
How do I go about controlling a meanwell driver LED brightness in homeassistant?

Re: LED Brightness

Posted: Mon Jul 20, 2020 3:56 am
by LEDG
Grab an optocoupler like a PC817 with an appropriate resistor, and an ESP32. Set up the ESP32 through ESPHome for PWM control and hook the PWM output and ground of the ESP32 into the optocoupler input side, then hook up the output of the optocoupler to the 2 dimmer leads on the mean well type B driver.

Re: LED Brightness

Posted: Wed Jul 22, 2020 7:58 pm
by greenzwiz
Thanks for the response. Do you have a schematic for the wiring? Also what size resistor would you recommend? Thanks!

Re: LED Brightness

Posted: Fri Jul 24, 2020 10:05 pm
by rdrake
greenzwiz wrote:
Wed Jul 22, 2020 7:58 pm
Thanks for the response. Do you have a schematic for the wiring? Also what size resistor would you recommend? Thanks!
I used a TLP185 and a 1k resistor.

Re: LED Brightness

Posted: Sat Jul 25, 2020 12:37 pm
by LEDG
Looks like the forward voltage of the IR LED in the PC817 is 1.2V and we want around 5mA flowing through it so 3.3V from the ESP minus 1.2V = 2.1V/.005mA = a resistor around 420 ohms. 470 ohm is a pretty common resistor so that’d work fine.

Re: LED Brightness

Posted: Wed Sep 02, 2020 3:52 am
by warmachine
I've been using the ShellyRGBW2 to control a 4ch all meanwell elg-240. They Dim to off so, you can you the brightness to shutoff the lights without a relay. Also, the signal is inverted so 0=100% and 100%=off.