Wemos D1 Mini and WS2812B WS2813B Ledstrip - FengtianGu/Sonoff-Tasmota GitHub Wiki
WS2813B versus WS2812B
The newer version of ws2812b is the ws2813b, which has dual signal lines to prevent a led failure also consecutive leds fail.
Wemos D1 Mini - WS2813B schematic
Below the schematics to connect a Wemos to a WS2813B via a PNP emitter-follower.
"In order to prevent damage to the ESP GPIO pin. It’s very easy to isolate your ESP8266 from the WS2813 5v supply voltage and provide a low impedance drive for the WS2813 bus at the same time, using a cheap, PNP transistor in emitter-follower configuration. An emitter-follower is a non-inverting buffer, which provides a medium to high impedance on it’s input (so it doesn’t place any significant load on the GPIO pin) and presents a low impedance output (meaning it can drive more current than the ESP GPIO pin can alone). PNP Emitter Follower Unlike the more traditional common-emitter transistor circuit, the emitter follower doesn’t amplify the input signal at all; in this circuit it is acting as a switch, but while the output from the GPIO is switching between 0v and 3v3, the output of the emitter-follower is switching between 0v and 5v. Thus this simple circuit not only protects your ESP from damage, but also provides the correct voltage swing for the WS2812 data bus, too. Almost any common, small-signal PNP transistor (2N3906, BC560) will work in this configuration; specific type is not too critical." ~ source
note: connect the ledstrip from both sides to the power supply
Bill of materials
- Wemos D1 Mini
- WS2813B or WS2812B ledstrip
- PNP transistor (ie BC560C)
- 1k8 and 3k3 resistors
- 5V power supply : the power of the power supply depends on the number of leds. A pixel has 3 leds (RGB), each led drains a max of 20mA, so a pixel drains a max of 60mA (3 * 20mA). So the total current that the power supply must deliver is 60mA times the number of pixels. For example 80 pixels: 60mA * 80 = 4800mA = 4.8A. Also the Wemos is powered by the power supply so in this example a power supply of 6A (30W) will do.
- Electrolytic Capacitor 1000uf 16v place close to the circuit, to make sure the wemos and ledstrip are powered by a clean signal.
Tasmota Configuration
In the Configuration -> Configure Module page, select the following:
- D4 GPIO2 : 07 WS2812