ESPHome ESP32 Led Strip Controller

Hi

My current wifi led controller (magic home) is dead and i would like to make one by myself.
I have esp32, But I cannot find correct schematics/configurations on esphome.io

I have 12v adapter, 10m RGBW led strip (not addressable).
Can anybody tell how to connect the led strip with external 12v power supply and how it should be configured?


image
image
Thanks!

Such a shame this resource of community is dead.
Zero reply over 2 weeks,
Same post on facebook 7 comments in first 2 minutes :frowning:

11 days is not over two weeks.

ESPs will die if they get 12 volt.
Iā€™m quite sure that is the reason for the silence.
Sure itā€™s doable, but why? The parts and labor will probably be as expensive or more expensive than buying a new controller.

1 Like

Appreciate your reply,
thanks for correcting me for the days count (that wasnā€™t the point),
regarding the esp, why not to use simple voltage step-down?
Anyway very unexpected suggesting for DIY topic to purchase ready productā€¦
fyi, magic home controllers based same esp32ā€¦

1 Like

Not at all in my opinion.
If the ā€œproductā€ is something that is not already on the market or has more or better bells and whistles then I see no problem with DIY.
But this is nothing new. I appreciate DIY most of the time, but this is like building your own toaster from scratch.
Whatā€™s the point?

You mean voltage divider resistors or buck converter?
Sureā€¦
Go ahead.

But honestly your question is nothing more than ā€œdo this for meā€.
Had you at least started of with ā€œI know I canā€™t put 12 volts in a ESP chip, I could do thisā€¦ is that the best solution?ā€
" I found this config from ESPHome is that correct?".

But all you did was post images of your parts and ask us to do the hard workā€¦ Mehā€¦

I just had a deja vu moment.

:smile:

1 Like

Learning, experimenting and practicing. ā€¦

Then why donā€™t you build a own LED strip? Or ESP circuit? Why do you buy a NodeMcu?

1 Like

oh, move on, I know those people who prefer to troll instead of helpā€¦ i wish you a good day, please donā€™t reply to me anymoreā€¦

2 Likes

@Akriss thank you for tagging me in this
@radinsky hello radinsky! I was struggling like you were a week ago and i got everything up and running perfectly, what do you need?

Looking for schematics how can I set the esp32 + rgbw led strip + adapter 12vā€¦

esphome:
  name: clear_lamp
  platform: ESP32
  board: esp32doit-devkit-v1
wifi:
  ssid: "*****"
  password: "******"
light:
  - platform: fastled_clockless
    chipset: WS2812
    pin: 25
    num_leds: 90
    rgb_order: GRB
    name: "Clear Lamp LEDs"
    effects:
      - random:
          name: Slow Random 
          transition_length: 15s
          update_interval: 35s
      - random:
          name: Fast Random 
          transition_length: 7s
          update_interval: 15s
      - addressable_rainbow:
          name: Rainbow 
          speed: 5
          width: 255

i have been using that setup and code for awhile now with 0 problems. the picture is from the Bruh Automation github. itā€™s for a esp8266, but ive been using it with the esp32 and it works great.

edit: depending on what type of LEDs you are using, you may have to tweak the esphome code. https://esphome.io/#light-components

1 Like

But this is an addressable LED strip.
OP does not have that.

ahh, i see.

well same setup applies, wouldnā€™t it? just wire in the extra pins. might not need the level shifter, though it probably wouldnā€™t hurt anything and the level shifter has 4 channels, 1 for each R G B & W.

iā€™ve only used the addressable strips (WS2811, WS2812, & SK6812) so itā€™s possible Iā€™m wrong about the simple rgbw strips, but seems to make sense to me.

and just use the code below (tweaked for your own needs) and hopefully you get your setup working how you want it.

# Example configuration entry
light:
  - platform: rgbw
    name: "Livingroom Lights"
    red: output_component1
    green: output_component2
    blue: output_component3
    white: output_component4

# Example output entry
output:
  - platform: esp8266_pwm
    id: output_component1
    pin: D1
    max_power: 80%

Short answer, No.
You need the controller to control 12 volts all of the sudden on the GPIO pins. Itā€™s doable but not as easy as with the addressable LED strips.

Was thinking it was like the ws2811, 12volt strip with 5v data line (i think thatā€™s how it works).

id have to agree with you then, OP should just purchase a ready made controller, or maybe invest in some addressable LEDs.

The traditional LED strips have one 12 volt and three (or more) ground connections that is controlled with a PWM.

And for the record. Iā€™m also building a toaster from scratch.

1 Like

Hi, I just found this question and thatā€™s exactly what I built after searching for a long while. Hope this helps @radinski or anyone else considering this.
In my case, I bought a ready made kit, but the controller and power supply were so under-dimensioned that they almost started a fire. Then I decided to build.

The components I used:
LED: RGB, non-addressable, 60 LEDs/m, 4W/m, SMD5050, 12V, waterproof
ESP32 WROOM
4-channel IRF540 MOSFET board
ATX computer power supply (12V power supply capable of powering all the LEDs you intend to use, I just happen to have this)

The connection is rather simple (diagram below)

The code in ESPHome:

# LedStrips - output pins
output:
  - platform: ledc
    pin: GPIO21
    id: gpio_21
    frequency: 100 Hz
    max_power: 100%
  - platform: ledc
    pin: GPIO19
    id: gpio_19
    frequency: 100 Hz
    max_power: 100%
  - platform: ledc
    pin: GPIO18
    id: gpio_18
    frequency: 100 Hz
    max_power: 100%

# Usage of ledc in lights
light:
  - platform: rgb
    red: gpio_4
    green: gpio_2
    blue: gpio_16
    name: "RGB strip porta"
    id: strip_porta
    effects:
      # Use default parameters:
      - random:
      # Customize parameters
      - random:
          name: "Slow Random Effect"
          transition_length: 30s
          update_interval: 30s
      - random:
          name: "Fast Random Effect"
          transition_length: 4s
          update_interval: 5s
      - strobe:
      - strobe:
          name: Strobe Effect With Custom Values
          colors:
            - state: True
              brightness: 100%
              red: 100%
              green: 90%
              blue: 0%
              duration: 500ms
            - state: False
              duration: 250ms
            - state: True
              brightness: 100%
              red: 0%
              green: 100%
              blue: 0%
              duration: 500ms
      - flicker:
      - flicker:
          name: Flicker Effect With Custom Values
          alpha: 95%
          intensity: 1.5%
      - lambda:
          name: My Custom Effect
          update_interval: 1s
          lambda: |-
            static int state = 0;
            auto call = id(strip_porta).turn_on();
            // Transtion of 1000ms = 1s
            call.set_transition_length(1000);
            if (state == 0) {
              call.set_rgb(1.0, 1.0, 1.0);
            } else if (state == 1) {
              call.set_rgb(1.0, 0.0, 1.0);
            } else if (state == 2) {
              call.set_rgb(0.0, 0.0, 1.0);
            } else {
              call.set_rgb(1.0, 0.0, 0.0);
            }
            call.perform();
            state += 1;
            if (state == 4)
              state = 0;

This has been working for over a year now (actually, a bit more complex project, with four strips, but this here started it all). Hope it helps

6 Likes

Hi , Given how clean and organized the project is, I want to do the same with a slight changes if you could help in modifying my existing circuit to add the MOSFET board . I am using the below circuit at the moment and it is working fine but i thought what you did is safer ( I hope this is correct )

The components I want to use :
LED: 256-300 WS2812B , 8x32 matrix or 5m strip , 60 LEDs/m,18W/m ESP32 and 5V12A PSU

My existing circuit below ( level shifter is not used )
WS2812B_ESP32

In any case I like what you did and I think it is a shame you are using it with regular leds given the efforts you invested in this . Might be you can upgrade to ws2815 if you want to keep the same circuit because the 12V is less headache when it comes to leds

Great work