Wiring a WS2801 String - is it a ground problem?

Yet another topic about WS2801 LED Strings, right? I'm trying to run 2x50 strings of these WS2801-controlled LEDs. But I just can't get it to run code properly. I'm trying to run the basic FastSPI/FastLED programs (blink.hex and cylon.hex, for example).

I'm running a Teensy 3.1; it's powered from the USB. The LED strips are connected in the middle, and powered by a 10A 5V wall power supply. I've hardwired a switch so that I can turn on and off the LEDs for final installation. However, I'm pretty sure that the problem comes down to GND.

I've definitely wired up the string in the correct direction - there's an arrow on the mini PCB which matches what I've wired up, and I currently have all the LEDs lit, in a random and flickering fashion. When I disconnect the clock wire, this random flickering stops and they remain on solid colours - CLK seems to be working. When I disconnect the data wire, all the LEDs turn off - DATA seems to be being sent? I'm just not sure how to wire up the GNDs.

Bizarrely, I managed to get it working last night for about 5 minutes, by wiring the GND of the Teensy to the screw terminal of the power supply; I could run blink.hex, I could run cylon.hex and it worked (so I know that these strips worked at some point). However I can't recreate this now, as I cleaned up some of the wiring connections and it's back to square one.

There are three power connections - one at the start, one at the end, and one at half way. The halfway and end GND connections are spliced together and connect with the start GND to the power connection, but as soon as I try to tie in the GND from the Teensy, I get a random result usually in the measure of a few LED's lighting in a random position in the string. As soon as I remove the teensy GND connection, the LEDs go back to being randomly flickering and colourchanging.

I was wondering if you could hint as to what might the issue be. Happy to provide pictures and whatnot of the wiring.

http://i.imgur.com/IUlxP4g.jpg?1 Shows all the LEDs lit up.

http://i.imgur.com/4LFt3AJ.jpg?1 Shows the wiring breadboarded.

Blue is GND from power supply. Purple is GND for the start of the strip, and Brown is GND for the middle/end (which have been spliced together). Orange is the (disconnected) GND from the Teensy.

http://i.imgur.com/eW6nO2s.jpg Shows the various connectors and connections. Left is the midconnector, middle is the end connector, right is start connected to DATA/CLK too.

webm.land Here's a short video showing the change when I connect Teensy GND to Power GND.

The program that is running on the Teensy should be sending one red blip along the strip, which isn't shown in either case.

ws2801s run on five volts, the logic level of the teensy is 3.3v. you need a level shifter. the power supply ground should be connected to the teensy ground, and to the strip ground.

I think you might also be able to power the leds off of 3.3v instead of 5v, sacrificing brightness, though I'm not sure about that. you'd need a separate 3.3v supply though, the teensy can't power the leds (you probably knew that)

I've got a level shifter coming in the mail, but is it as simple as that? I've managed to get these to work off 3.3v CLK/DATA before, but I can't replicate the conditions now.

I've managed to get these to work off 3.3v CLK/DATA before, but I can't replicate the conditions now.

That is worrying. Driving a 5V system with 3V3 signals could be a problem if the 5V end is pulling up the inputs to 5V. That could lead to damage on the 3V3 system. It might work for a short time but then not. Fingers crossed for when the level shifters arrive.

Grabbed a fresh string and wired them up to the Teensy through a level shifter, now when I power, I only get the first seven or so LEDs on a bright white, nothing else. Seems to change each time I power up.

Honestly not 100% on whats going on.


http://i.imgur.com/xTAjGRK.jpg (breadboarded)
http://i.imgur.com/vWxmrWe.jpg (Rest of wiring)

Green is Teensy GND to LVGND, and also HVGND to the power supply GND. Yellow takes 3.3V from the Teensy, Brown takes 5V from power. White is CLK, Orange/grey is DATA.

Am I missing something obvious?

For interest, the code that's currently on the Teensy is as follows:

#include "FastLED.h"
#define NUM_LEDS 50
#define DATA_PIN 11
#define CLOCK_PIN 13
CRGB leds[NUM_LEDS];

void setup() {
       FastLED.addLeds<WS2801, RGB>(leds, NUM_LEDS);
}

void loop() { 
  // Turn the LED on, then pause
  leds[0] = CRGB::Red;
  FastLED.show();
  delay(500);
  // Now turn the LED off, then pause
  leds[0] = CRGB::Black;
  FastLED.show();
  delay(500);
}

Which should just turn on and off the first LED. No dice, though.

can you post a wiring schematic, hand drawn? I can't make heads or tails of those pictures, but to say you Seem to have a lot more wires than you should.

you should conect all the grounds to a single ground rail.

I would also use the default spi pins on the teensy, which are 11 (data) and 13 (clock)


That's it in its current form. Sorry the pen started smudging, did this quite quickly.

Is your level shifter a power supply too??? (How is the teensy powered)

What kind of level shifter are you using?

Also, is that two ends of one strip?


One very similar to that. I just wrote 5V CLK/DATA so that it was obvious what was going on; the 5V from the wall is plugged into the HV part of the level shifter.

Yes, its two ends of one strip of 50 just now. 5V/GND to both ends as advised by various guides online, as there's power loss through the strip.

Would I be better off using something beefier such as a 74HCT245?

Edit: The Teensy is powered from a USB cable connected to the PC, sorry I didn't make that clear on the diagram.

Hmm...

im not sure about that kind of shifter... Could you show us how you have it connected??

I think those shifters might not change from high to low fast enough for the ws2801 ic.

I used 74AHCT125 that you can get on adafruit. I got the ws2801s running no problems with that....

Aye, roger that. Seen a few posts saying that these shifters aren't strong enough to push LEDs consistently. Got a unit you reccommended coming now, hopefully this will solve it once and for all.

pigjosh:
Aye, roger that. Seen a few posts saying that these shifters aren't strong enough to push LEDs consistently.

It's not "strong enough", it is speed as they are intended for open-collector logic on I2C buses. They will probably work if you put 2k pull-ups to 5 V on the WS2801 clock and data lines and/ or slow down the protocol.

Many thanks for your help, got a 74AHCT125 in the mail this morning and everythings working now that its strapped into the breadboard.