Light NeoPixel with 555 Timer IC (Part II)
To continue the discussion from Part I, the design goal is to generate BIT-1 for NeoPixel with 555 IC.
The following is another 555 astable circuit uses only one pair of RC, and it outputs equal high time and low time.
It can be analyzed using that RC step response equation (see Part I of this article).
Although VF, VT and V0 take different values for charging and discharging of the capacitor, the left hand side end up being the same value:
So the pulse width Δt = ln2 * R1*C1 = 0.69 * τ
With R=1.8k Ω and C= 330pF chosen, τ = 0.6μs and Δt = 0.4μs.
That 0.4μs matches the low time for a BIT-1 of the WS2812B NeoPixel controller.
So we just need to generate the 0.8μs high time, in order to send BIT-1 to NeoPixel and light it up.
One way to get a longer time pulse is to add another RC time constant τ, as Julian did. (discussed in Part I of this article)
But there is another way. That is to use the “control” pin of 555 to “modulate” the pulse width. The following circuit is simulated with a second voltage source V2 on the “control” (CV) pin of 555 IC.
Again the nice RC step response equation can be used to calculate its pulse high time and low time.
For the low time (i.e. capacitor discharge to 1/2Vc)
Vc is the voltage on the “CV” control pin. 1/2Vc is due to the internal resistive divider.
On the left hand side, Vc gets cancelled out. So the low time is independent of the control voltage, and the result is the same as before: Δt = ln2 * R1*C1 = 0.69 * τ = 0.4μs. Good news!
Now we can focus on adjusting for the high time. The high time, that is the capacitor gets charged from 1/2Vc to Vc, can be calculated as
VF is supply voltage that appears on Vout. This time, this voltage on the “control” pin Vc affects the left hand side of the equation, a lot.
In the LTspice simulation circuit above, VF = 5V and Vc = 4V, that gives a Δt = ln3 * R1 * C1 = 1.1 * τ = 0.65μs. We are designing for 1.4 τ, so we still need to move Vc closer to VF.
The plot above shows the ratio of Vc/VF vs. factor of τ. The closer Vc approaches VF, the longer the high time can be, e.g. 4* τ → 0.99 or higher ratio. We can see when Vc/VF = 0.8 = 4V/5V, it gives about 1.1τ.
To reach 1.4*τ for the 0.8μs, the ratio needs to be around 0.87. So Vc = 0.87 * 5V = 4.35V. That’s about a diode drop from VF = 5V.
As you can see in the title photo, a 555 IC with only one pair of RC and a diode is able to generate a different high time, low time pulse on Vout. The Vout signal can be fed into NeoPixel DIN pin, as BIT-1. That can successfully light up the NeoPixels, as long as you follow the BIT-1 streams with a “pause”.
In addition, if you have an oscilloscope and an extra power supply to tune “control” pin voltage of 555, you can observe the “conditioning” of the BIT-1 streams from DOUT pin of NeoPixels. That’s a good trick to see if NeoPixel takes your high time pulse as BIT-1.
Here is the scope plot of doing exactly that. The green trace is the Vout from 555, which is then fed into DIN pin of WS2812B. The purple trace is DOUT pin, the “conditioned” signal from WS2812B, feeding into the next NeoPixel in series.
As you can see, as Vc gets lower and lower, the high time gets shorter and shorter, until about 500ns, then the purple high time “flips” to a shorter pulse, for BIT-0.
So in fact, to send BIT-1 to NeoPixel, you don’t really need that diode either. Just a single pair RC, with high time 0.69*τ >0.5us.
We learned that from playing with the voltage on the “control” pin of 555. The high time doesn’t have to be 800ns, as stated in the datasheet.
After all, you can call this an interesting electrical engineering design exercise, simply a hack. But we went from calculating to designing, to simulation and finally bench testing.
More importantly, it shows that hardware behaves rarely according to SPICE simulations, or datasheets. There remains a lot of corner cases …(to be explored)
So don’t give your oscilloscope away yet.