WS2801 and WS2811 based RGB LED Strips with Due?

Please forgive the noob question.

First, some background. The Due ARM chip runs on 3.3v, but it can provide 5v. There are, however, stern warnings about providing more than 3.3v current to any of the I/O pins, or this could burn out the board. Fair enough. Now, I have a series of addressable RGB LED strips that use either the WS2801 (https://www.sparkfun.com/products/11020?) or WS2811 (http://www.ebay.com/itm/150931961150) chipsets that I've been using very successfully with the Arduino Mega and Uno boards. These require 5v to run. These have either 3 or 4 wires. Two are always 5v and Ground, and the others are either separate Clock and Data lines (WS2801), or a combined Clock/Data line (WS2801).

So, to my noob question:

Would it burn out the board to connect the Clock/Data lines to Due I/O pins? Ostensibly, they are only supposed to be output, but ... ?? Am I going to kill my board? And if so, is there something I can do to make my lights work?

Thanks for your help!

The would only be providing clock & data to one chip, that chip buffers the 2 lines and passes it along, yes?
So power them from their own 5V source, connect all the grounds together.

At 5V, the WS2801 needs 0.8*Vcc = 4V minimum for Vih.
Run the signal lines thru a TXB0102 buffer. Only micro-amps of output current are needed.

Or, run the WS2801 from an external 3.3V. Still just need micro-amps of output current for the control pins.

WS2801.pdf (423 KB)

WS2803-preliminary-En.pdf (437 KB)

The would only be providing clock & data to one chip, that chip buffers the 2 lines and passes it along, yes?
So power them from their own 5V source, connect all the grounds together.

Do I actually need to do this, if the Arduino is providing 5v power? The fewer components, the better, I would think.

At 5V, the WS2801 needs 0.8*Vcc = 4V minimum for Vih.
Run the signal lines thru a TXB0102 buffer. Only micro-amps of output current are needed.

Or, run the WS2801 from an external 3.3V. Still just need micro-amps of output current for the control pins.

Ah! I see that the WS2801 can run from 3.3V natively. That is useful. Unfortunately (based on the WS2811 datasheet I found), the WS2811 requires 5v input voltage. So, for that one, a TXB0102 would be needed.

Thank you!

WS2811-preliminary-EN.pdf (321 KB)

I don't see that the WS2811 can't run from 3.3V - they only provide characterists at 4.5-5V. Give it a try, not gonna hurt anything.

Ah, good point. Will try it out. :)

Ok, it looks like the WS2811 does NOT respond to signals at 3.3v. So, I’m investing in some 74LVC245 ICs (https://www.adafruit.com/products/735) to convert my 3.3v to 5v.

Unfortunately, I’m not quite sure how to hook them up. The datasheet (http://www.adafruit.com/datasheets/sn74lvc245a.pdf) implies that there is a way to do it, but it seems to conflict with the description on the adafruit product page in a vaguely orthogonal way. Adafruit gives a description for going in the opposite direction (5v->3v3), and says hook up VCC to your target voltage (say, 3v3), OE to ground and DIR to VCC. In my case, the target voltage should be 5v, but the datasheet says it only takes VCC up to 3.6v. However, the datasheet says some very vague and confusing things about how to achieve the 5v input, and possibly involves switching the directions from B->A. This is all very confusing.

So to what voltages do I connect the various bits. I want to go from Due (3.3v) → Lights (5v)

VCC → ??v
Gnd → Gnd (obviously)
DIR → ??v
OE → ??v

and is A my input from the DUE, or is B my input?

Any help at all would be immensely appreciated.

Also, I want to add that it is entirely possible that it doesn't even go in that direction. At which point, sigh. :/

Use TXB0102, TXB0104, level translation in both directions, altho you only need 3.3V to 5V. www.ti.com TXB0101, 0102, 0104, 0106, 0108 depending on how many pins you need.

Axela: Ok, it looks like the WS2811 does NOT respond to signals at 3.3v. So, I'm investing in some 74LVC245 ICs (https://www.adafruit.com/products/735) to convert my 3.3v to 5v.

Looks like you've figured out the '245s won't work in that direction... what's interesting is that I've had good results so far driving WS2811 strips directly from a 3.3V I/O pin (bit-banged SPI) on the Arduino Due, while I had decidedly weird results when using a TXB0108-based level translator. I haven't scoped it yet, but it's definitely far noisier that way for some weird reasaon (I threw a pull-up resistor on the 5V output side and it got remarkably better, but I'm not quite sure why that helped... I'm driving some other things with this chip though, and they were also affected by the LED strip, so perhaps it's the higher frequency data stream here).

All that really matters is solid power and getting reliable data through the first LED... the rest take care of themselves (being, effectively, a long repeater chain). Maybe the LEDs themselves vary, or you've got a longer line between your board and the first LED (I'm within 18" of it, if that).

tl;dr - I can drive a WS2811 strip with the 3.3V output of an Arduino Due directly (from a short distance away), without pull-ups or anything else, and it works (strip being powered by a robust 5V supply). Beware of noise effects when using translators.

So having banged my head against the proverbial wall trying to get the TXB0108 working with this (works fine with other things but NOT for this, unaided), I decided to throw in a BSS138-based I2C-friendly level shifter (both from Adafruit btw). THAT seems to work normally.

As I scoped the signal in and out of the TXB0108, I noticed something: it got very, very noisy as soon as the LED strip was connected to the output. Inputs and outputs both get a high-frequency signal washing them out (on the order of 55.3 MHz, versus the roughly 800 kHz signal I'm sending).

I'm not sure where that's coming from, but I think it's the cause (or the effect of) the TXB switching directions rapidly. In short, it's pretty annoying. It could be that I need more signal conditioning and noise isolation on the output side, or it's just the wrong chip for this job.

So, in short, you will likely have better luck driving the WS2811 via something like a BSS138 FET circuit, or from 3.3v either directly (not terribly safe IMHO), or via a 74LVC245 or another '244/'245 that's got a Vcc of 3.3V (I've not tried it but a few places actually sell it in a DIP... though it'll only output 3.3V at least it isolates the input from the output and for a short data line that'd probably be fine). Using the TXB0108, however, just isn't cutting it.

(If anyone knows of an equivalent FET in a TO92 or TO220 case, I'm all ears... all the better to breadboard with.)

Edit: I stumbled upon a lengthy post on the BSS138 and level shifting here: http://electronics.stackexchange.com/questions/18457/is-my-mosfet-based-bidirectional-level-shifter-insane However, as the BSS138 circuit is working fine for me I'm not inclined to argue with it for this particular application.

Edit2: From what I can tell the 74LVC8T245 may be the perfect chip for 3.3v-5v level shifting when auto-direction switching is not needed (http://www.nxp.com/documents/data_sheet/74LVC_LVCH8T245.pdf). However, it's SMT and that means far more effort if you're breadboarding... that, and I can't find anyone who actually sells it... :-/

I've been working with driving WS2811s from Teensy 3.0, which has 3.3 volt I/O similar to Arduino Due.

There can be ringing and signal quality problems from the wiring between the board and WS2811, which are more serious at 3.3 volts because there is less noise margin. The short answer is to try adding a 100 or 200 ohm resistor, located between the board and the wire running to the WS2811 input.

Here's a post with more details and actual measured waveforms:

http://forum.pjrc.com/threads/15620-WS2811-on-Teensy-3-0-using-FastSPI_LED-library?p=20787&viewfull=1#post20787

Of course, converting the 3.3 volt signal to 5 volts with a 74HCT245 or similar chip is probably best. The WS2811 Vih input spec is technically 3.5 volts. However, I've tested many WS2811 LEDs and they all seem to work fine with 3.3 volt signals, when using a series resistor to lessen the ringing problems.

Also, if you're interested in driving a very large number of WS2811 LEDs, you might be interested in a new WS2811 library that I'm developing. It's currently in private beta testing. The first public release is expected in about a week.

Interesting... while I was seeing some slight ringing on the main data line in (sans TXB) it wasn't that bad, and the FET level-converter didn't seem to add much noise to it on the output. The TXB outputs were all over the map, and it was clearly something other than what you saw there (the noise was very pronounced and pretty constant).

I'm always eager to try new libraries... where will you announce / publish it?

(On a side-note, I'm finding the Due surprisingly frustrating so far, particularly when it comes to compiling sketches that used to work fine. I realize it's a different architecture but the information and libraries seem mighty thin right now.)

I'm using a Due and having some issues with the WS2811's as well. I'm using the adafruit neopixel library. Works okay with an Arduino Uno, but not with the Due. It appears to be a timing issue - the test 'color wipe' works about 20% of the time but then I get random flashing otherwise. Any advice?

Flickering problems might be timing related, or they might be voltage related.

If the strips are just barely able to recognize a 3.3V signal, flickering can happen when they draw enough current to cause small (or perhaps not-so-small) changes in their ground voltage, due to the resistance and inductance of the wires between the LEDs and power supply.

Some of the newest strips are having more trouble with 3.3V signals. I have one "grumpy" strip here that won't recognize any 3.3V signal, even under perfect power conditions. Most do work, but the margin for error in voltage is very small.

I'm making a little shield for Teensy 3.1 that has the 74HCT245 buffer, the 100 ohm resistors, and RJ-45 connectors. It'll be available in 2-3 weeks.

You might need to do something similar for Due. The 74HCT245 chip and resistors are cheap, so I'd suggest you do that before fiddling with the timing. If you do get into timing stuff, you really need an oscilloscope or logic analyzer to view the waveforms.

Thanks!

I’d be interested to see your Teensy project.

I don’t quite understand the 3.3V thing. I mean, I checked the voltage on the output from the Due and it is showing 5.05V. The voltage on the Uno output is 5.9V.

I have access to an oscilloscope. I’m not sure how to determine what’s going on, though.

I solved the problem by using the level converter approach documented in:

As shown in the attachment, I used a low-side pull-up resistor of 10k and found that I needed to use a high-side pull-up resistor of 1k in order to get the pulses on the 5Vdc side high enough to reliably feed the pixel string.

Hope this helps.

Cheers,
John

Pixel_LED_String_Logic_Converter.pdf (4.71 KB)