logo elektroda
logo elektroda
X
logo elektroda

WS2813 LED Strip with ESP8266: First Diode Lighting Issue and Logic Level Concerns

marcingebus 3021 11
ADVERTISEMENT
This content has been translated flag-pl » flag-en View the original version here
  • #1 18511388
    marcingebus
    Level 11  
    I have an ESP8266 and a 5m WS2813 strip. All powered from a 20A 5V power supply. The first diode goes into such a strange state: it lights up either white/blue, once it paired properly after a reset. And now after plugging in it lights up red all the time. I know that the WS2813 should be operated with 5V logic, and the ESP gives 3.3V logic. However, it is probably the other diodes that should be the problem, but tests over longer distances show that the rest light up rather correctly.

    Is the first diode faulty, or should I dig out some 3.3V -> 5V buffer. The question is whether it can be unidirectional to WS2813, or whether it has to be bidirectional.

    And one more thing: the first examples use the ESP8266's DMA and connections only on GPIO3, which I did by connecting the DI inia. Whereas in t most of the examples, they say nothing about the CLOCK ini. So in my case it hangs around. There was only one example where both lines were defined (the example was on control from down pins). Any documentation on what to connect the CLOCK line from the WS2813 to?
  • ADVERTISEMENT
  • #2 18511421
    JanuszKornas
    Level 11  
    Maybe it is the case that the first diode, ingests the data in 3.3V logic and if its driver receives it, it gets all tangled up. If, on the other hand, it recognises that the command doesn't apply to it, it lets it go on in 5V logic, which every subsequent diode already understands without error? I wonder if I am right?
  • #3 18511427
    OliJot86
    User under supervision
    WS2813 do not have a CLOCK line.
  • ADVERTISEMENT
  • #4 18511550
    marcingebus
    Level 11  
    WS2813 LED Strip with ESP8266: First Diode Lighting Issue and Logic Level Concerns .

    The examples are universal and talk about one pin. I was connecting DI, I was interpreting it as Data.
    So the other one is Backup?
    How do we connect it?
    We clip together at the Bi and DI input ?

    Added after 2 [minutes]: .

    Oki, I found a drawing here that it is Backup:
    https://www.superlightingled.com/sp110e-bluet...-rgb-addressable-led-strip-lights-p-1367.html
  • #5 18511721
    JanuszKornas
    Level 11  
    Regarding the 3.3V logic control of the ws2812 ribbon, someone suggested a cool idea:
    https://www.youtube.com/watch?v=letCT3vq8V4

    Comments under this video suggest that the first diode can regenerate the signal, which would confirm that the first diode under 3.3V control can light up strangely.

    Added after 26 [minutes]:

    And here someone propose another conversion with the help of the "first diode" https://hackaday.com/2017/01/20/cheating-at-5v-ws2812-control-to-use-a-3-3v-data-line/
    But that requires cutting off the first diode from the rest of the strip so the "myk" with two diodes to feed the ESP seems cleverer.
  • #6 18513061
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #7 18513210
    marcingebus
    Level 11  
    khoam wrote:
    What library for WS support are you using?
    .
    So far I have fired up the ticker tape to see if it works. I used the library and examples from it "Neopixel by Makuna". I searched in the libraries: "ws2813".
  • #8 18513291
    OliJot86
    User under supervision
    Instead of combining, wouldn't it be better to give 74HCT1G08? One element smaller than the transistor + 2 resistors, certainly sharper edges especially rising.
  • #9 18513292
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #10 18525147
    krzbor
    Level 29  
    khoam wrote:
    @marcingebus Below is the wiring diagram for Wemos. The transistor acts as a unidirectional 5V/3V3 logic level converter and emitter secondary.
    Source: https://github.com/arendst/Tasmota/wiki/WS2812B-and-WS2813

    WS2813 LED Strip with ESP8266: First Diode Lighting Issue and Logic Level Concerns .

    What library for handling WS are you using?
    .
    Strange this schematic - when D4 is low - transistor Q1 conducts. When high - it also conducts (3.3V+0.7=4V, and the supply is 5V). Why not make a classic circuit on an NPN transistor with emitter to ground?
  • #11 18526173
    ekrzychoooo
    Level 17  
    krzbor wrote:
    Strange this schematic - when D4 is low - transistor Q1 conducts. When high - also conducts (3.3V+0.7=4V, and 5V supply)
    The schematic around 4V is the high state for WS2813 supplied from 5V. On a single NPN(phase inverter) you would have to do some reworking of the ready made libraries .
  • #12 18526630
    krzbor
    Level 29  
    ekrzychoooo wrote:
    krzbor wrote:
    Strange this schematic - when D4 is low - transistor Q1 conducts. When high - also conducts (3.3V+0.7=4V, and supply 5V)
    The schematic around 4V is the high state for WS2813 supplied from 5V. On a single NPN(phase inverter) you would have to do a bit of reworking of the ready-made libraries .
    As I wrote this, I also thought that someone did not want to improve the libraries. Otherwise this solution has no justification.

Topic summary

✨ The discussion revolves around issues encountered when using a WS2813 LED strip with an ESP8266 microcontroller. The user reports that the first diode on the strip exhibits erratic behavior, lighting up in unexpected colors, possibly due to logic level mismatches, as the WS2813 operates at 5V while the ESP8266 outputs 3.3V logic. Responses suggest that the first diode may not properly interpret the 3.3V signal, leading to incorrect operation. Various solutions are proposed, including the use of a unidirectional logic level converter, the FastLED library for better control, and the possibility of signal regeneration by the first diode. The discussion also clarifies that WS2813 does not utilize a CLOCK line and addresses wiring configurations for proper connections.
Generated by the language model.

FAQ

TL;DR: On ESP8266 + WS2813, a 20 A 5 V setup can still glitch the first LED; "WS2813 should be operated with 5V logic." Use a unidirectional level shifter, drive DI only, and ignore any clock pin. [Elektroda, marcingebus, post #18511388]

Why it matters: This FAQ helps ESP8266 makers fix first-LED misbehavior, wiring, and logic-level issues on WS2813 strips.

Quick Facts

Why does the first WS2813 LED light the wrong color on my ESP8266?

3.3 V logic sits near the WS2813 high threshold at 5 V, so the first pixel can misread. It may pass on a cleaned 5 V signal, so the rest look fine. Adding a 3.3 V → 5 V level shifter fixes this. Users reported the first LED “gets all tangled up,” matching this behavior. [Elektroda, JanuszKornas, post #18511421]

Do WS2813 strips have a clock line?

No. WS2813 uses a single-wire data protocol only. As one user put it, “WS2813 do not have a CLOCK line.” Connect only the data input (DI) and power. [Elektroda, OliJot86, post #18511427]

What is the BI pad on WS2813, and how should I connect it?

BI is the backup data line. Drive your strip from DI. Treat BI as the redundancy input used by some controllers. For simple ESP8266 control, leave BI alone. [Elektroda, marcingebus, post #18511550]

Do I need a bidirectional level shifter, or is unidirectional enough?

Unidirectional is enough because data only flows from MCU to strip. The Tasmota wiring uses a simple NPN level shifter to raise 3.3 V to WS2813-friendly levels. [Elektroda, khoam, post #18513061]

Is the Tasmota NPN circuit valid if the transistor seems always on?

Yes. “Around 4 V is the high state for WS2813 supplied from 5 V,” so the emitter output works. A single NPN inverter would flip logic and require library changes. Use the proven emitter follower arrangement. [Elektroda, ekrzychoooo, post #18526173]

Will a 74HCT1G08 work better than a transistor level shifter?

Yes. A 74HCT1G08 can shift 3.3 V to valid 5 V logic and sharpen edges. It also reduces component count versus a transistor and two resistors. [Elektroda, OliJot86, post #18513291]

Which Arduino library supports WS2813 on ESP8266 with examples?

FastLED supports ESP8266 and offers many effect examples. Users recommend trying it when debugging WS2813 behavior and timing on this MCU. [Elektroda, khoam, post #18513292]

Which library did the OP use initially for testing?

They used the “Neopixel by Makuna” library and searched examples for WS2813 support. That helped confirm the strip responded. [Elektroda, marcingebus, post #18513210]

Can the first WS2813 LED be used as a "signal booster"?

Yes, some approaches isolate the first LED to regenerate a clean 5 V signal for the rest. This method requires cutting the first LED from the strip segment. Others propose feeding data through two diodes to lift the drive level. [Elektroda, JanuszKornas, post #18511721]

How should I wire ESP8266 to WS2813 safely?

  1. Add a unidirectional 3.3 V → 5 V level shifter between ESP8266 GPIO and strip DI.
  2. Connect 5 V and GND to the strip; share GND with the ESP8266.
  3. Leave BI unconnected for basic control; no clock pin is required. [Elektroda, khoam, post #18513061]

Should I tie DI and BI together at the strip input?

No. BI is a backup line. Drive DI from the ESP8266 and let the strip handle redundancy internally. This matches typical guidance. [Elektroda, marcingebus, post #18511550]

Why does my strip power up solid red or white?

The first pixel can latch incorrect data or start in an undefined state when fed 3.3 V. Level shifting and clean power resolve this startup color lock. Users reported persistent red or random white/blue on first power. [Elektroda, marcingebus, post #18511388]

Can I drive WS2813 directly from 3.3 V without level shifting?

It’s unreliable at 5 V supply. The effective high-level is about 4 V, so 3.3 V can misread. Use a level shifter or lower VDD appropriately with care. [Elektroda, ekrzychoooo, post #18526173]

Which ESP8266 pin did users connect in DMA-based examples?

Examples often used GPIO3 with DMA, connecting it to the strip’s DI. This worked for basic tests and animations. [Elektroda, marcingebus, post #18511388]
Generated by the language model.
ADVERTISEMENT