PolyPixels: Driving WS2812B addressable LEDs using 2 wires
Tubular
Posts: 4,656
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.
cheers
Lachlan
Edit: There's some demo code attached to the traffic light demo below
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.
cheers
Lachlan
Edit: There's some demo code attached to the traffic light demo below
Comments
This example is the simplest one to understand. The rectifying diode and capacitor are soldered directly onto the back of the WS2812B led, and two leads are connected, so its somewhat like your standard 5mm LED, but able to light up any color
This explains how to extend the concept to an arbitrary of leds. By alternating led orientation 90 degrees, a PCB isn't strictly necessary, though it sure would be a bit neater.
Because only 2 lights are on at any time, this one works really nicely, with the lights satisfyingly bright
I've put all the leds on in one photo just for photo purposes
The leds get a bit dimmer when trying to drive all 8 at once, but it still works, especially if only one of two are on at a time (eg Kitt Scanner)
The Adafruit NeoPixel 8 example above enables a "guy wire" formation. This might be useful for suspecting multiple strips from ceiling to floor in an art installation, for instance. This circuit board has 1/8" holes for ready connection of guywire eyelets
(I'll upload an example using this technique later)
(reserved for experiments using external P fet to really boost the available current...)
Wondering what favourite logic level P-fets people like using with the Prop (or other micros)
Just received some LED strips for building a POV Globe.
Which leds does your strip use?
144/meter
I haven't tried harvesting energy from 2 pins yet, should work better, will find out soon
SK9822 144LED/m RGB NW 1m strip
US$26 from AliExpress - King Green