Shop Learn
PolyPixels: Driving WS2812B addressable LEDs using 2 wires — Parallax Forums

PolyPixels: Driving WS2812B addressable LEDs using 2 wires

TubularTubular Posts: 4,328
edited 2014-06-13 15:22 in Propeller 1
PolyPixels are small clusters of WS2812B addressable leds, that harvest their energy from the Propeller driving pin.

This means only two wires (combined Data & +ve, and VSS/GND) are required to connect to the led array. Cheap figure 8 cable / speaker twin works great.

Where a common metal chassis or frame is available this reduces to a single wire (plus chassis return).

Furthermore its possible to have a "two lead component" that looks a bit like your standard 5mm LED, but can light up almost any color, on command. It's trivial to extend to a multi-faceted 2 lead component with arbitrary number of faces. This can be done using discrete WS2812B's, or the commonly available led strip.

Another advantage is the ability to easily "power down" the strip/array when not in use. The LEDs consume ~0.5 to 1mA quiescent current each, under normal conditions (lower current at the lower rectified voltage)

A diode from the data pin (I call it 5D normally, as it effectively combines +ve supply and data) performs the rectification at the LED array. An SOD123 diode such as 1N4148 fits beautifully onto the back of the WS2812B

In most cases its advisable to add an extra bulk capacitor, eg 10~100uF, to smooth out voltage, although if omitted the resultant flickery effect is kind of organic and lively. The LEDs kind of compete for the available power, a bit like an auto gain control

While this "just works" with a basic setup, the tricks to making this work better include
* Having a bank of "phantom white pixels" after the physical pixels. The large number of 1's in the data helps boost the average voltage
* Modify the driver to have a longer '1' high time, and shorter 'reset' time, again to boost the average voltage
* Use a schottky diode if available, though standard 1n4148 or 1n914 work OK
* Consider running the Propeller from a higher supply. 3v6 is within normal operating range and regulators are available ready to go at 3v6 in TO92 or SMT. 4v0 is also available (the ABS max rating of the propeller)
* Parallel the driving pins
* Consider a fast external P fet if driving a larger array is required

I'll add a post for each example (form) and perhaps others can upload their examples if they make something interesting, too.


Edit: There's some demo code attached to the traffic light demo below


Sign In or Register to comment.