Controlling LED Light Intensity with ESP32

Hi everyone

I’m trying to make a lamp smart. Exactly I want to control the light state (on/off) and the intensity (0-100%).

The lamp has a controller attached to it with which I can adjust said things. The controller has a regular on/off Switch, rotary knob with fixed stages and two RJ11 ports.

When I turn the rotary knob completely to the right, the lamp then goes into “external” mode and 100% light intensity. I know that I could hook up a second lamp over these RJ11 ports. While in external mode it acts as “slave” of the other lamp.

I was thinking if I could not kinda imitate the second lamp with an ESP32. And send signals to the connected lamp. At the end, I would like to integrate the ESP with ESPhome and HA.

Has anyone an idea or tips on how to achieve this?

I’ve put some pictures of the controller from the lamp to the post.

Thanks for any support <3

Pictures:

How you know that?

I would expect Vaux is just external low amp 12V source. You need to find out what dimming method your driver uses. 0-10V? Or current control? Or something else…

Hi Karosm. Thanks for your reply.

I know it because I’ve seen many videos about those lamps. Even from other manufacturers, they use the same setup like mine in the pictures.

My friend also has a lamp like this and he can controll the lamp in external mode with his other lamp hooked up via RJ11 cable.

Here is also a video showing what mean. Although the lamp in the video is from spiderfarmer but it technically uses the same setup as my lamp

Additionally, I’ve checked the RJ11 ports on my lamp and they are internally connected with a cable to the big black transformator in the background. So I guess they are functional.

I didn’t have doubts about controlling. I meant if you had additional info for the control method. I expect it uses the same method that your dimmer uses, but can’t be sure.
If you have multimeter and know how to use it, you can experiment with the dimming.

Hi, thanks for the information.
I’ve ordered a multimeter. When I have it, I will try to get a measurement and update this post. Have a great day.

Look up the model of the led transformer(black box) not the light, it will tell you what type of signal it expects. It’s some times listed on the label of the transformer.

1 Like

Hi Mikefila. Thanks for your input! I will check out the transformer for such label.

I think this contains some valuable information.

Google Photos

Not really.
Did you get your multimeter?

I found the spec sheet for the led driver. You can use 0-10v, pwm, or resistive. I personally use 0-10v for my lights.

The driver has a 12v aux power supply, you would use this source to power the converter board posted above. Bring a pwm signal and ground from the esp to control the unit.

2 Likes

Hi Mikefila

Thank you for your time searching up the documentation!

I think with this information, I should be able to achieve my goal. My knowledge in electronics isn’t very great but I’ll try my best :slight_smile:

Have a nice day.

One additional question:

Would you suggest using 0-10v or PWM for dimming? What is easier to achieve?

For 0-10v dimming, I’ve found this documentation online.

Thank you for your response.

0-10V is analog voltage control, pwm can only imitate it. There is no guarantee that pwm works. There are ready made smart dimmers with 0-10 output, like Shelly Plus 0-10

1 Like

I use 0-10v because it is easily measured with a multimeter, similar to the documentation you posted. Your transformer has a 12v accessory supply. So the 12 - 30v connection shown in your link can come from the .

Cut a phone cord in half, strip and separate the cut end, then stick it in the output jack. With the light power off/unattached, the MM in continuity mode, find your 2 neg connections. blue/white is the 12v neg. Put one probe where the blue/white wire attaches to the board and match it to the phone line wire. Do the same with the pink, that is the 10v neg.

Power up the light keeping all the phone wires separated. Us the MM in DC volts. One probe to 12v neg wire, then one of the phone lines with the other probe will give you 12v. That powers the converter board.

1 Like

Hi everyone. So I have some updates. I ordered a few things to make this possible and now I’ve created a scheme on how I would connect everything together.

Since my electronic competences are not very high, and want to minimize the risk of cooking my parts, I would like to ask if someone could have a look at it. Image is in the attachments.

Thank you for your support <3

Few things to be aware of.
Your driver aux 12V output is max 200mA. I might be sufficient to power PWM converter and buck converter+Esp32. Or not.
If you have the “commonly available” $2 PWM converter, the PWM voltage min is 4.5V, so ESP32 PWM might work, or not.
Also the input voltage 12V is on the border line, you might not get full 10V out of it.

Since it has optocoupler onboard, the safest way to try your setup would be Esp32 powered from separate power supply (no shared ground) for example USB. If it works like you expect, then try with the buck from 12V aux.

1 Like

Hi Karosm. Thanks for your support.

I’ve followed your recommendation on powering the ESP32 from an external power supply first, to try if it’s working.

I’ve connected everything like in my new scheme:

I’ve also managed to connect the ESP32 to my WiFi and ESPhome on HA. My config is also attached:

esphome:
  name: lumii-black-led
  friendly_name: Lumii Black LED

esp32:
  board: esp32dev
  framework:
    type: Arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "******"

ota:
  - platform: esphome
    password: "******"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Lumii-Black-Led Fallback Hotspot"
    password: "******"

captive_portal:

# Example configuration entry
output:
  - platform: ledc
    pin: GPIO18
    id: gpio_18

# Example usage in a light
light:
  - platform: monochromatic
    output: gpio_18
    name: "Lumii Black LED"

However it’s not working like expected, when I trigger the “light on” entity in HA, the light doesn’t turn on.

Do you see what I might doing wrong? Thanks for your help <3

Connect the GND of the esp to the common GND

It’s missing GND between Esp and Pwm converter. Just Gpio18 alone can’t close the optocoupler circuit. That GND is separate from common GND (optoisolated).

Yeah boy! Thanks for your support! I’ve connected the GND from the ESP32 to the common ground and now it’s working. Here is my updated schema:

However, I’ve noticed a strange behavior. The LED Light turns on only if the dimmer in HA is set to 40% or higher. Dimming is possible yes but as soon as I go under 40%, the light turns off completely.

Is this normal or do I have to make some changes on the ESP32 config?