WS2812B compatible with OctoWS2811 library?

Status
Not open for further replies.
Anyone know if the new WS2812B strips, from Ray Wu, are compatible with the WS2811 chipset? Meaning should they work out of the box with the brilliant OctoWS2811 library? Apparently this WS2812B chip is an upgraded version of the WS2811. Here are some comments I've found about what's changed with this new version...

http://doityourselfchristmas.com/fo...e-the-WS2812B-RGB-modules&p=270598#post270598
http://doityourselfchristmas.com/fo...e-the-WS2812B-RGB-modules&p=272611#post272611

Note: on this category page for WS2812B products, Ray Wu has four different listings for DMX to SPI products, two of which are listed as ws2801 compatible and two others for ws2811. This leads me to believe that the ws2812B chips are compatible, though I'm also confused as that seems to indicate that the ws2811 and ws2810 are not... so.. huh.

Side note: this is interesting -> http://www.aliexpress.com/store/pro...ze-17cm-17cm-DC5V-input/701799_825283258.html
 
Last edited:
It looks like the WS2812 is simply an LED with the WS2811 driver chip built right in(reference), also used in Adafruit's NeoPixel strips. The WS2812B is an upgraded version of the WS2812 LED. This pdf outlines the differences between the two: 4pin opposed to 6, reverse power protection and better overall design that yields higher brightness LEDs, better heat dissipation and better color uniformity. (ref: WS2812 datasheet / WS2812B datasheet)
 
Last edited:
TL;DR = Odds are good the WS2812B will "just work".


I've been told the WS2811 means a chip and WS2812 means the LED with the chip mounted inside the LED housing. So what I've normally been calling WS2811 LED strips are really WS2812. I actually heard this from Adafruit a few months ago, so it seems pretty reliable.

At first, from reading those descriptions, it seemed the WS2812 and WS2812B are exactly the same electronics, just a different LED package optimized for LED strip layout.

But then I compared the datasheets and noticed the timing parameters T0H, T1H, T0L and T1L are different.

However, my gut feeling is still these are very likely exactly the same electronics. I believe the WS2812 datasheet numbers are simply wrong. First of all, TH+TL is supposed to equal 1.25 us. However, T0L+T0H is 1.15 us, and T1L+T1H is 1.3 us. Sloppy!

In writing OctoWS2811, I did a LOT of experimenting with the timing. The waveforms OctoWS2811 actually outputs are actually pretty similar to the WS2812B datasheet. Someday I write a lengthy post about my thoughts on WS2811 timings, but right now I'm going to just focus on other work...
 
This is an old thread but I haven't seen anyone else respond so I thought I'd reply for posterity -- I've got an array of 8x48 WS2812Bs running through OctoWS2811 and everything is working as expected.
 
Hope all of us have a good day!

This is Spring from shenzhen Worldsemi Technology Co.,Ltd.Thank you for your suooprt!

Since you are familiar with our products.Hope we can have good cooperation in th future!

We are professional manufacturer of LED full color strip,LED point light,LED modules,LED control

system,DMX related products,LED driver IC of WS2801,WS2811,WS2812,WS2812B series,etc.

We have strong R&D team,can provide the full dimensional technical support with you,OEM&ODM are all welcome!
 
I have a few WS2812B strips (Thank you Ray Wu!). The Simple Red, Green Blue code works fine, I'm getting some flickering running in high-speed mode (800khz) It is more prominent later in my chain, usually at or after pixel 60 (120px in the chain), and more evident when I'm using blended colors like orange or pink in the demo sketch.

My strips are very smooth running at 400khz though. I do think there are subtle issues with timing, but I don't have access to an oscilloscope at the moment to debug the timings. I think that the 137hz that Is theoretically possible with the low speed mode (400khz) will work for my project 120pixels × 30µs + 50µs = 3.65ms = 274fps or 137fps

Also for reference the Adafruit NeoPixel library with an Arduino Uno works well at 800khz with my strips.



WS2811 (http://www.adafruit.com/datasheets/WS2811.pdf):
T0H 0 code,high voltage time 0.5 µs ±150ns
T1H 1 code,high voltage time 1.2 µs ±150ns
T0L 0 code,low voltage time 2.0 µs ±150ns
T1L 1 code,low voltage time 1.3 µs ±150ns
RES low voltage time Above 50µs

WS2811 high speed mode:
T0H 0 code,high voltage time 0.25 µs ±150ns
T1H 1 code,high voltage time 0.6 µs ±150ns
T0L 0 code,low voltage time 1.0 µs ±150ns
T1L 1 code,low voltage time 0.65 µs ±150ns
RES low voltage time Above 50µs


WS2812 (http://www.adafruit.com/datasheets/WS2812.pdf):
T0H 0 code ,high voltage time 0.35µs ±150ns
T1H 1 code ,high voltage time 0.7µs ±150ns
T0L 0 code , low voltage time 0.8µs ±150ns
T1L 1 code ,low voltage time 0.6µs ±150ns
RES low voltage time Above 50µs


WS2812B (http://www.mikrocontroller.net/attachment/180459/WS2812B_preliminary.pdf):
T0H 0 code ,high voltage time 0.4µs ±150ns
T1H 1 code ,high voltage time 0.8µs ±150ns
T0L 0 code , low voltage time 0.85µs ±150ns
T1L 1 code ,low voltage time 0.45µs ±150ns
RES low voltage time Above 50µs


I don't really understand it but this PDF (http://www.rgb-123.com/files/WS2812B_VS_WS2812.pdf) expands slightly on the 'internal signal reshaping aplification circuit'.

Anyone have some better settings that work better for the WS2812Bs at 800KHZ?
#define WS2811_TIMING_T0H 60
#define WS2811_TIMING_T1H 176

(BTW, good job on the Library!)
 
Are you sure it's a timing issue? I ask because after fixing a variety of flicker issues in my ~4500 LED setup, I still have a couple stubborn strips that flicker under certain circumstances, including the pinkish range of colors in the rainbow demo, just as you describe.

My experience (so far) has been that the primary sources of flicker have been:
  • grounding issues of many types:
    • I had better luck powering the teensies off USB but still grounding the teensy to the GND of the supply powering the strips
    • in some cases, grounding DOUT at the "far" end of the strips to the teensy GND helped. However, in just as many cases, it also made things much worse! In all cases, it turned out that something else was the actual root cause, and grounding DOUT was just changing which strips were exhibiting symptoms.
    • grounding was never an issue if I was only using one power supply
  • low voltage issues caused by distance between PSU and strips (the 2812B seems to tolerate MUCH lower voltages than 2811 and 2812, as over 1/3 of my strips are flicker-free even at 3.9V)
  • signal strength and quality (cleaned up by adding 74HCT245 transceiver and 100 Ohm resisters on its output pins)

My wife got me a Rigol scope as an early xmas gift and assuming I can figure out how to use it, I hope to do some deeper diagnosis this weekend. If I find anything I'll certainly post back and let you know. In the mean-time, you may find that
 
Anyone have some better settings that work better for the WS2812Bs at 800KHZ?
#define WS2811_TIMING_T0H 60
#define WS2811_TIMING_T1H 176

I played around with different values, I was able to get a little less flicker, but I haven't eliminated it yet :-/ Oh and it was easy to get more flickering too.

I'm guessing that configuring those timing pieces is only one piece of the puzzle.

I noted that the colors seemed to shift a little bit down the chain like the overall timing got misaligned.
 
I would not recommend changing the default timing. Of course, you probably won't damage anything. It's simply not a productive path to follow.

If you're getting intermittent problems part way down a long strip, and especially problems that change depending on the colors or number of LEDs on, you've almost certainly got a grounding problem, perhaps power supply issues too?

Part of the issue is the lower 3.3V signal. The WS2811 logic threshold can be close to 3 volts, so there's very little extra voltage margin for noise. If the ground shifts (and the delta in ground voltage changes with color/power), that shifts the voltages those WS2811's are seeing.

Arduino Uno outputs a 5 volt signal, so there's a lot more margin for voltage drops that cause the signal to be read differently. Uno also can only output a single signal, so cross coupling from the other 7 signals is not an issue.

Using a 74HCT245 buffer almost always helps. Getting the signal up to 5 volts buys you a lot of resilience to problems. Adding 100 ohm resistors between the '245 output pins and the wires also helps.

Bigger and shorter wires for power and ground also help. Of course, there's a point of diminishing returns. One simple test is to turn all your LEDs on fully white. Measure the DC voltage right at the power supply, then at the inputs to the LED strips, and then at the outputs. Each will be lower, because wires have finite resistance. A good goal is at least 4.9 volts at the power supply, at least 4.8 volts at the input to the LED strip, and no less than 4.6 volts at the output. If you measure less than 4.5 volts anywhere, you're technically running those WS2811 chips under their rated voltage for proper operation.

You may be tempted to increase the voltage. DO NOT. First, if you're using 3.3 volt signals, more voltage will scale up the WS2811's logic high threshold, giving you less noise margin. It also causes more heating in the LED packages, since the current remains the same. If you have the LEDs inside water-resistant silicone tubing, they can get very hot. Bigger & shorter wires are the solution to voltage loss issues.
 
I noted that the colors seemed to shift a little bit down the chain like the overall timing got misaligned.

Ahh.. if you're seeing color shift on later pixels I'm almost positive you've got power issues. If you display full-white and you see that later LEDs are a "warmer" color temperature, then that's because the red LED has lower power requirements than blue or green. The color shift is because the later LEDs are power-starved. This would also introduce flicker at the end of the strip.

At 120 LED's per chain, you'll definitely need to apply power at both ends if you aren't already.
 
Part of the issue is the lower 3.3V signal. The WS2811 logic threshold can be close to 3 volts, so there's very little extra voltage margin for noise. If the ground shifts (and the delta in ground voltage changes with color/power), that shifts the voltages those WS2811's are seeing.

Arduino Uno outputs a 5 volt signal, so there's a lot more margin for voltage drops that cause the signal to be read differently. Uno also can only output a single signal, so cross coupling from the other 7 signals is not an issue.

Using a 74HCT245 buffer almost always helps. Getting the signal up to 5 volts buys you a lot of resilience to problems. Adding 100 ohm resistors between the '245 output pins and the wires also helps.

I've actually picked up the buffer chip and am using it, also 220 ohm resistors.
Here are some pictures of my board: https://plus.google.com/+ColinHarrington/posts/4bzKkb6FYjJ


Bigger and shorter wires for power and ground also help. Of course, there's a point of diminishing returns. One simple test is to turn all your LEDs on fully white. Measure the DC voltage right at the power supply, then at the inputs to the LED strips, and then at the outputs. Each will be lower, because wires have finite resistance. A good goal is at least 4.9 volts at the power supply, at least 4.8 volts at the input to the LED strip, and no less than 4.6 volts at the output. If you measure less than 4.5 volts anywhere, you're technically running those WS2811 chips under their rated voltage for proper operation.

You may be tempted to increase the voltage. DO NOT. First, if you're using 3.3 volt signals, more voltage will scale up the WS2811's logic high threshold, giving you less noise margin. It also causes more heating in the LED packages, since the current remains the same. If you have the LEDs inside water-resistant silicone tubing, they can get very hot. Bigger & shorter wires are the solution to voltage loss issues.

I've picked up some heavier wire for the final mounting. I've acquired 2x 26a Meanwell 5v power supplies that I'm using. Thank you for the input/output threshold numbers!
 
The resistors go between the buffer chip and the long wires, not between the Teensy and buffer chip.

Thanks for the tip :) Putting the resistors after the buffer chip makes sense to me now. With my setup I've tried 220, 440 and 470 ohms. 440 seems to be the best at this point until I can get my hands on an Oscilloscope. I have a barely noticeable occasional flicker with the 470ohm resistors at 800khz (fast mode) and am still going to fine tune this.

Another source of flicker:
I bought the Silicone covered LED strips. In order to solder them I had to remove some of the silicone. I did this with an Xacto knife. A few of the strips I had scratched into the surface of the LED strip causing some apparent attenuation that flickered strangely on downstream pixels. This was made worse when I touched the Aluminum housing. I like the effect that I get with the silicone, but I think I'd get the covered or bare versions next time.
 
that's an old thread, I know. But I had lots of flickering at the end of my 240x WS2812B strip. The flickering disappeared completly by setting the frequency from 800000Hz to 740000Hz.
I recognized that FastLED with hardware SPI has lots of jitter, just like the OctoWS2811. They use shorter high-pulses, but copiing that to Octo just increased flickering. But FastLED takes about 1.35µs for every complete bit. Setting Octo to 740kHz will do the same and baam! flickering is gone.

The datasheet of WS2812(B) says it should be 800kHz(without mentioning a tolerance) and 1.25µs(+/-600ns). That would be 0.65...1.85µs. I can't belive that the negative tolerance is correct. When I add the minimum possible high pulse and low pulse (400ns-150ns + 850ns-150ns), I came up to 0.95µs. How should 0.65µs be possible? Maybe the tolerance should only be positive (1.25µs +600ns), than we are perfectly right with the 1.35µs.
Jitter is no problem, when it doesn't jitter below those 1.25µs for some kind of WS2812(B).

I used my modified OctoWS2811 for my tests, but I think the original OctoWS2811 will behave the same.
https://forum.pjrc.com/threads/31717-OctoWS2811-and-CAN-bus?p=89689&viewfull=1#post89689
 
I was wondering if, instead of having to add a 74HCT245 buffer, I could not just power the led from 3.7 V for example?

https://learn.adafruit.com/adafruit-neopixel-uberguide/power

"Increasingly, microcontrollers are running at 3.3 Volts instead of 5 Volts. That’s great news for efficiency, but can present a communication problem with 5V NeoPixels. The 3.3V signal from the microcontroller may not be “loud” enough to register with the higher-voltage device. The manufacturer recommends a minimum signal voltage of 70% of the NeoPixel voltage.

There are two ways this can be addressed:

-Lower the voltage to the NeoPixels so it’s closer (or equal) to that of the microcontroller. This is why we recommend LiPo batteries for FLORA projects: 3.7V is enough to run a short length of pixels, and the microcontroller is comfortable at that voltage as well.
-Use a logic level shifter to step up the signal from the microcontroller to the first pixel."


Can I just use a voltage divider right after the LM7805 (that powers the teensy) in order to supply the leds 3.7V and therefore skip the use of a logic level shifter?
 
A voltage divider after 7805 is not possible, because the current consumptions of the LEDs differs a lot. You can't get a constant voltage.
My dirty hack is to power the first LED with a 1N4001 from 5V. Therfore it will get about 4.5V, which is low enough to work directly with the 3.3V Teensy. And this first LED shifts the output to about 4.5V, which is enough to drive the second LED, which is connected to 5V.
If you have long strings of LEDs, 3.7V is not a good idea. The voltage drop on that string will stop LEDs working or change their colour.
The best way is still using a real level shifter (there are smaller ICs available that provide only 1 or 2 shifters)
 
Hi, I have been building a Christmas display since Feb 2016 and am now down to the wire.
I was using multiple arduinos when I discovered teensy3 and Octows2811.
I will get to the point. The Octo Library doesn't allow me to initialize my WS2811 pixels BRG.
As you know it will do RGB RBG GRB and GBR but not BRG or BGR.
I am using Vixen3 and if I have to change the Pixels in Vixen it will take me hours to change over 600 pixels. Any suggestions?
 
Any suggestions?

Probably the simplest hack to quickly solve your problem would be a minor edit in OctoWS2811.cpp. Look for this code near the end:

Code:
        switch (params & 7) {
          case WS2811_RBG:
                color = (color&0xFF0000) | ((color<<8)&0x00FF00) | ((color>>8)&0x0000FF);
                break;
          case WS2811_GRB:
                color = ((color<<8)&0xFF0000) | ((color>>8)&0x00FF00) | (color&0x0000FF);
                break;
          case WS2811_GBR:
                color = ((color<<8)&0xFFFF00) | ((color>>16)&0x0000FF);
                break;
          default:
                break;
        }

Just pick one of these and change its bit shits as needed. For example:

Code:
          case WS2811_GRB:  // actually now BRG
                color = ((color<<8)&0xFF0000) | ((color<<8)&0x00FF00) | ((color>>16)&0x0000FF);
                break;
 
Thanks Paul,
I looked at that code but had no idea what to change to get BRG.

Find the "case WS2811_GRB:" line.

The next line is an expression with changes the byte order. Delete the one that's in the code, and replace it with the new one I gave you in msg #20.

Of course, in your Arduino sketch, use WS2811_GRB. After you make this change, it will become BRG, even though the name is still "WS2811_GRB".
 
Find the "case WS2811_GRB:" line.

The next line is an expression with changes the byte order. Delete the one that's in the code, and replace it with the new one I gave you in msg #20.

Of course, in your Arduino sketch, use WS2811_GRB. After you make this change, it will become BRG, even though the name is still "WS2811_GRB".

Thanks Paul,
It worked great.

Please excuse my ignorance as this is the first time I have ever used a Forum.
I have searched them for years but they all seem to leave people hanging.
This one is great because most posts seem to get answered right away.

Thanks again,
 
Status
Not open for further replies.
Back
Top