Once you have and know all the part, this hack is pretty simple and cheap.
First, have a look at the WS2811 datasheet, there or there. It is written in "Chinglish" so you'll have to read between the lines. The WS2811 is mostly pin-compatible with other equivalent chips from other manufacturers, just check what you have on your strips.
Of particular interest is this "typical application" diagram for a 12V LED strip:
This controller is a 8-pins SOIC chip with some interesting features, it integrates a Zener regulator so you just need a series resistor (R3) and a filtering capacitor (100nF) for the power supply. All these parts can be de-soldered from the strip.
The pinout is rather simple:
- GND: 0V
- Vdd : 100nF - 3.3K resistor (for 12V)
- Din : serial data input,
- Dout : serial data output, chained to an eventual other controller.
- Set : left open to select 800KHz operation (beware : this pin has different functions with different manufacturers ! Always check the datasheet)
The remaining 3 pins are what is used in a "creative way": OUT[RGB] are current-limited open-collector outputs that can stand up to 12V. Usually there are LEDs there. But who said it was an absolute requirement ?
The current is limited to 18.5mA per output so you could power something that draws about 50mA at 5V to 12V (if you connect the outputs in parallel and drive the data correctly, you could even have about 768 steps instead of 256). A large capacitor is required because the switching frequency is not very high compared to typical switching regulators. Fortunately, since the current is limited, there is very little loss in the capacitor and the ripple losses are small so no need to over-qualify the capacitor (a 16V-rated capacitor will work smoothly at 12V).
My requirement is to drive a 12V fan that draws up to 200mA peak (during startup). Parallelling several WS2811 won't be practical. An amplifier is required.
My drawers contain some P-MOSFET and I chose the Si2301DS (Vishay Siliconix). It's small (SOT23-3) yet powerful enough (can drive 2.3A at 20V and -5Vgs).
It's not perfectly compatible, however. The Vgs is limited to -8V and the OUT[RGB] pins swing from 0 to 12V so it can't be connected directly.
Another aspect is the irregular rising and falling edges that drive the gate: the WS2811 will draw 18mA from the gate but the pull-up resistor (10K in my case) would pull maximum 12/10000=1.2mA. The on-edge will be 15 times faster than the off-edge.
These problems are solved by the same "trick": a balanced resistor divider. Instead of one pull-up resistor, there are two identical 10K resistors in series between the +12V and the OUT[R/G/B] pin. The gate is connected in the middle point.
- this halves the Vgs down to -6V
- (approximately) the same current goes in and out of the gate, which makes a symmetrical waveform.
The "smart" part of this system is in the choice of the resistors. The sharpness of the edges is controlled by the RC constant of the gate capacitance (could be 1/3nF) and the pull-up resistor. If t=R×C, that's about 3us (I should check with the 'scope). Increasing the resistors' value reduces the current losses and the ripple on the power supply rails, which also decreases the injected noise and the required decoupling capacitance.
OTOH if the resistance is too high, the MOSFET will not have time to fully switch on so it will be ineffective. A lower resistance will make it spend time in the "resistive" regime, making it dissipate power.
So it's a delicate balance to find. It was pretty easy for a relatively low power device like this fan. Larger loads will be hard to drive because the PWM frequency is not high enough and the necessary bulk capacitor could become ridiculously large. A proper DC/DC-like converter becomes necessary.
Use this hack with precautions and wisdom :-) You can also try with other types of P-MOSFETs, always check their characteristics and verify the waveforms with your oscilloscope ;-)
Note: the WS2801 (synchronous version) can output 3×50mA....
Read more »
hey looks very interesting.
i am using the ws2811 to control AC devices via TRIAC circuit.
i am noticing that the ws2811 has a PWM of about 400 HZ.
how have you worked around this constant on off signal?
do you happen to have a schematic of your setup?
thank a bunch.