Getting WS2801 led strip to work

I’m trying to get a WS2801 to work with ESPhome and my esp8266 d1 mini nodemcu.

This is my setup:

The power supply is 5V 2A, each of the 6 stripboards represents a part of a WS2801 led strip with 3 leds connected as shown.

This is my code:

esphome:
  name: esphome-leds
  friendly_name: leds

esp8266:
  # board: esp01_1m
  board: nodemcu

# Enable logging
logger:

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

ota:
  password: "xxx"

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

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

  manual_ip:
    static_ip: 192.168.2.124
    gateway: 192.168.2.1
    subnet: 255.255.255.0
    dns1: 192.168.2.254
    dns2: 1.0.0.1

captive_portal:

light:
  - platform: neopixelbus
    variant: ws2801
    data_pin: GPIO13
    clock_pin: GPIO14
    num_leds: 18
    name: "neopixel Light"
    type: RGB

When using neopixel, only the first 6 LEDs turn on but they are always the wrong color. I know about color correction but not all LEDs have the same color and when changing the color the result seems random.
I tried switching to spi_led_strip and that turns on all LEDs but also with wrong / random colors. I verified the cable connections multiple times so I don’t think thats the issue but I’m open to suggestions. I’ve controlled these LEDs with a Raspberry Pi before so I’m pretty sure they work.

I think it needs to be

    type: BRG

Also try using GPIO3 (RX) as the data pin and GPIO2 (D4) as the clock pin.

  - platform: neopixelbus
    variant: ws2801
    data_pin: GPIO3
    clock_pin: GPIO2
    num_leds: 18
    name: "neopixel Light"
    type: BRG

Are you sure that’s enough to power the ESP and 18 leds at the same time?

The fact that

seems to imply either voltage drop or incorrect wiring in some of your segments.

1 Like

His “schematic” shows the LED power connecting directly to the power source, so this isn’t an issue.
What is missing is how many LEDs in TOTAL? Only then can you determine the minimum power supply.

1 Like

Not gonna argue with you about electronics, but wouldn’t the 10W power provided by the power supply be shared by both the ESP and the leds?

Seems to be 18 total LEDs based on his 2 separate posts

I’m using an esp8266 and the docs say only GPIO13 for data and GPIO14 for clock can be used for two-wire chips. Also WS2801 are RGB as far as I know.

The leds draw 1080 mA at max power (18 * 60mA) so that should leave plenty of power for the ESP I think

I’m sorry for not being precise enough, I’m using 18 leds in total, split into 6 groups of 3. Each led could draw up to 60mA according to the datasheet.

If theres something wrong with my “schematic” or my wiring please let me know. I’m going to test with a different power supply and a different part of a WS2801 strip and see how that goes.

Which ESP development board are you using? The YAML file says NodeMCU, but your “schematic” shows a Wemos D1 Mini. It probably doesn’t matter because they both use the ESP8266

Oops, I see the number of LEDs in your code, but again your “schematic” is not clear how they are wired.

The number of LEDs in your YAML file is for consecutive LEDS, yet you indicate that they are wired in groups? Parallel?

True, if you’re using SPI (which is the recommended method with ws2801), however, if you’re not using SPI, GPIO3 and GPIO2 are the recommended pins.

Also, I’ve just found some ws2801 examples on the net and they all use type: BRG

Anyway, it won’t hurt to try it out… wrong colors does indicate wrong type specified.

Which docs?

This is what concerns me. Your “schematic” doesn’t show how the LEDs are wired. I can’t tell if it’s a single string of 18 LEDs or six parallel strings of three LEDs. If it’s the latter, then there is your problem. Normally, you don’t put LED strings in parallel.

I basically cut a WS2801 strip into 6 pieces with 3 leds each, then soldered wires between them so they still act as the original strip. The groups are wired in series, so each output from a group is the input of the next one. The ESP I’m using is a D1 Mini NodeMCU with an ESP8266-12F.

I was under the impression that I have to use SPI for two-wire chips when using neopixel, so I did. I’ll try specifying BRG as type and see what happens.

The docs for the neopixel platform: NeoPixelBus Light — ESPHome
Under methods for two-wire chips it says

On ESP8266 only GPIO13 can be used for data_pin and only GPIO14 can be used for clock_pin.

The NodeMCU and the Wemos D1 Mini are different development boards. They both use the ESP8266-12F module, so it shouldn’t be an issue.

So your “schematic” is wrong? Show how all 18 LEDS are connected and which ones are working. The colors can be sorted out later.

In this configuration?

All LEDs are connected in series, just like they are when you use the original strip. But it does not seem to be a problem with the wiring on these LEDs. I tested it with a different uncut WS2801 strip and its the same problem. Only the first 5 LEDs turn on at all, and when changing color, the result always changes even when I click the same color multiple times. I also switched out the power supply which also did not help at all.

Yes I did not change the LED wiring, only wanted to replace the RPi with an ESP
I’ll try switching the board for a different one of the same kind and see if that helps.

So I’ve tested another board and same results. With neopixel only the first 5 LEDs light up, all with wrong / random colors. WIth spi_led_strip all LEDs turn on but only the first 6 change when changing color. But also wrong / random color with no pattern. I’ve also tried connecting the data wire to GPIO3 but that did not help.

A test with a third WS2801 strip and different power supply was also unsuccessful.

Honestly I’m stumped, but do try the above suggestion to use the proper board type in your yaml.

It might still be an esp8266 at its core, but the way the chip is broken out to the pins might vary between one model and another

I’ve already tried every board that could fit mine (d1, all d1-mini variants and both nodemcu and nodemcuv2) but unfortunately that changes nothing.

Then I’m fresh out of ideas. Unless there’s something really weird going on with your hardware, I have no clue.

Might be time to give WLED a shot? It’s primarily designed for addressable LEDs & you can tweak everything in the interface.

Yes I probably have to something else than esphome in this specific case.

Thanks for trying to help

1 Like

I have never used addressable LEDs that have a clock pin. Is there a reason you aren’t using a more common LED like the WS2811?

But, installing WLED on the ESP is really easy and it does have support for clocked LEDs built-in.

I had the WS2801 already installed from when I used a Raspberry Pi with them and I didn’t want to replace them. Also these were my first LEDs when I began so I just went with it. I’m now only using LEDs with a single pin as they are much more common and easier to work with.

I installed WLED and it works like a charm. I didn’t even know there was an integration for HA, so thats even better.

1 Like

I actually have ws2801 on a wled setup i did a few years ago with an esp32. A few things I will pass along.

  • The 2 amp supply should be enough.
  • The ws2801 is definitely BRG not RGB.
  • You mentioned that this strip is made from multiple strip pieces you connected together with wire.
  • Make sure the connection between these pieces is good electrically and that the wire you used between these pieces is good.
    You did not say if the lights that don’t light up begin not to work immediately after a location where these pieces are connected.
  • If you have a multimeter check to ensure you are getting the 5vdc passed to each of these pieces.
  • lastly since the ws2801 is an addressable led strip, make sure that the orientation of the connected pieces is the same as if you have a piece that is backwards then this will prevent that piece and all other pieces from being addressed. Some addressable LED strips hav arrows on the back side that indicate the direction these LED units are addressed from.

Good luck and look forward to knowing what you find.

1 Like