1 pin controlling multiple lights, is it possible?

Hello,

i created a little notification board using a D1 mini pro and ws2812b. I used D1-to-D6, making each pin a seperate light.

My question is, is it possible to use 1 pin to drive all 6 leds at once in diffrent states of on/off/color/function?
When they are wired together they share 1 dataline (like a led strip).
I think its possible in arduino but i dont know about it in Esphome.

The reason being that then i could use 36 led instead of 6 if possible.
Please share your thoughts and knowledge.

Thank you

Yeah, theres a so called light partition. That splits the strip in multiple light entities up, each containing only the specified led´s.

1 Like

If you’re using ws2812b pixel LEDs, then you could (and should) drive all 36 LEDs from a single pin rather than from multiple pins. The pins on ESP8266 controllers aren’t created equal and when controlling pixel LEDs some are better than others. I’ve personally had the most success using GPIO1 (TX) with neopixelbus.

For example if you wanted to create 6 partitions of 6 lights each:

light:
  - platform: neopixelbus
    id: all_leds
    name: "All LEDs"
    pin: GPIO1
    variant: WS2812X
    type: GRB
    method: ESP8266_UART0
    num_leds: 36
    restore_mode: ALWAYS_OFF
    
  - platform: partition
    id: segment_1
    name: "Segment 1"
    segments:
      - id: all_leds
        from: 0
        to: 5
    
  - platform: partition
    id: segment_2
    name: "Segment 2"
    segments:
      - id: all_leds
        from: 6
        to: 11
    
    ...etc
1 Like

Thank you so much !
i will give it a go.