Having trouble with WS2801 - Only first LED lights.

I am trying my first Arduino project and I am running into problems. I want to run a strand of WS2801's. I can't get the strand to do anything other than the first LED light up. I plan on having 50 total so I have 2 strands and both strands do the same thing so I think it might be something with my setup.

I have Arduino Duemilanove, 25 strand of WS2801 LEDs, 5V 10A power supply.

I have double checked that I have the power correctly wired and think I have them correct. I have also double checked the wiring. I am using the Adafruit library and am using the standard pins they have set of 2 and 3. I have also double checked that my Clock and Data wires are correct.

The very odd thing which makes me think I've done something silly is that when I plug power in to the strand, when I put my hand/fingers next to the wires, the first LED changes colors. That makes me think that it is some sort of wiring issue? Maybe a grounding issue? Both strands do this same thing. I just have no ideas at all...

Any help/suggestions would be appreciated.

(I will get some pictures taken and a video of me touching the wires and having it change colors.)

Thanks,
Zeustopher

First off are you sure that the LED strip you have is 5V? Most are 12V.

when I put my hand/fingers next to the wires, the first LED changes colors. That makes me think that it is some sort of wiring issue?

Yes.

Maybe a grounding issue?

No but make sure the ground of the power supply is connected to the ground of the Arduino.

It sounds like one of the two inputs are floating, that is not connected to anything.
What software are you running?

Grumpy_Mike:
First off are you sure that the LED strip you have is 5V? Most are 12V.

when I put my hand/fingers next to the wires, the first LED changes colors. That makes me think that it is some sort of wiring issue?

Yes.

Maybe a grounding issue?

No but make sure the ground of the power supply is connected to the ground of the Arduino.

It sounds like one of the two inputs are floating, that is not connected to anything.
What software are you running?

Thanks for the quick reply.

Yes - at least as far as I can tell. These: 50pc 12mm Diffused RGB LED Pixels 5V WS2801 Drivers Waterproof Addressable Color | eBay - According to its description and several tutorials and other projects I have looked at for the same strands, such as Power | 12mm LED Pixels | Adafruit Learning System, are 5V.

I'm not sure what "floating" means. How do I ensure that the ground of the power supply is connected to the ground of the Arduino? Should I run another wire directly from the adapter to the Grnd pin on the Arduino?

I'm not sure what "floating" means

It means an input not connected to anything.

How do I ensure that the ground of the power supply is connected to the ground of the Arduino?

You connect them together with a wire.

Should I run another wire directly from the adapter to the Grnd pin on the Arduino?

Yes.
see:-
http://www.thebox.myzen.co.uk/Tutorial/Power_Supplies.html

Here are a few pictures. (I took a video as well but need to get it uploaded somewhere)

First one shows the entire setup. 5V going into LED strand. Thats connected to Arduino. Then Arduino is powered by 9V power adapter of its own.

Second is the pins I'm using. I've now used a breadboard to make sure connections are better for each of the pins. The ground pulled out when I shifted it for the picture.

You also asked what code I was using. I am using this code exactly without any edits: http://learn.adafruit.com/12mm-led-pixels/code

Thanks,
Zeustopher

Those images are too large to see. Have you read the advice on images in how to use this forum sticky post?

Can you confirm that the ground on the LEDs is connected to the ground on the arduino?
Also does the LED respond to the code or is the first one always on. Test that by putting a delay in the start up function before any data is sent to the strip. Then is there a delay when you power everything up before the LED comes on?
I am assuming that you are not making connections with the power on.

I can only see code fragments in that link so I don't know if you have put them together correctly.

However the technique of just stuffing wires into an arduino header strip is not very reliable, you need to solder onto a strip of header pins and plug that into the arduino.

Grumpy_Mike:
Those images are too large to see. Have you read the advice on images in how to use this forum sticky post?

Thanks - I didn't realize these boards didn't provide a nice way of automatically resizing the images. I have adjusted them in the original post.

Grumpy_Mike:
Can you confirm that the ground on the LEDs is connected to the ground on the arduino?

As far as I can tell, it was making a connection. Using the breadboard I had a much nicer setup and more likelihood of making a proper connection. I will work on this again and try and ensure that I am making a good connection.

Grumpy_Mike:
Also does the LED respond to the code or is the first one always on. Test that by putting a delay in the start up function before any data is sent to the strip. Then is there a delay when you power everything up before the LED comes on?
I am assuming that you are not making connections with the power on.

The LED doesn't respond to the code at all. As soon as I connect the power to everything it turns on and stays on. I did add a delay of 3 seconds before executing the first bit of code and still had the same results.

As an additional 'sanity check' I actually disconnected all the wires from the Arduino and the LED still lights up when I touch the edge of the wires almost like it reacting to the small bit of electricity going through my finger... Very strange in my mind. I would have expected it to either light up right away or not light up at all..

Grumpy_Mike:
I can only see code fragments in that link so I don't know if you have put them together correctly.

They have a download link which gives the entire source instead of just the chunks. But because of the above answer, I don't think it is a code problem.

Grumpy_Mike:
However the technique of just stuffing wires into an arduino header strip is not very reliable, you need to solder onto a strip of header pins and plug that into the arduino.

I do plan to get all the connections much nicer. The header pins haven't come yet and I wanted to make sure all the pieces worked so that I could try and get replacements if anything was bad.

The LED doesn't respond to the code at all.

So it sounds like faulty wiring or a faulty LED string.

Grumpy_Mike:

The LED doesn't respond to the code at all.

So it sounds like faulty wiring or a faulty LED string.

I have 2 strands though and both exhibit the same symptoms. I know it isn't outside the realm of possibilities that I got 2 bad strands, but it seems less likely than something I'm doing with wiring.

I'll work on your suggestions and hopefully I'll figure out where I went wrong and be able to get it working.

Thanks for the help so far.
Zeustopher

WS2801 LED strips are directional. Are you sure you have it the right way around?

arduinodlb:
WS2801 LED strips are directional. Are you sure you have it the right way around?

Yes - I am sending the signal in on the side with the chip on it. According to what I can see in most places, that is the input. As a sanity check I also tried connecting everything up on the other end and same results.

It's hard to make out from your image, but it looks like the power supply ground may not be connected to the arduino ground.

These two grounds have to be connected together to make sure one is not floating with respect to the other.

Here is a (rough) diagram and images of my latest attempt of how I have it set up. I still haven't had much success. I had once where it turned on the entire strand and flickered all of the LEDs, but it only happened once and didn't have any reason to it. It did give me at least a little confidence that at least all the LEDs work...

I am trying to model it after this tutorial and diagram here Arduino Wiring | 12mm LED Pixels | Adafruit Learning System but I am just not getting it I think.

I am not confident at all in how I currently have it set up. Can someone please 'set me in my place' on what I am doing wrong here?

Your wiring looks like it should be OK.

Have you tried powering it off the Arduino directly instead of using a separate power supply?

I'd try that. It's not clear from your links what skecth you are running (perhaps you could post the code directly here, inside [ code] [ /code] tags), but try modifying the sketch to limit it to 5 LEDs to ensure you don't try to suck too much current from the Arduino 5V line while powering the leds directly from the arduino.

arduinodlb:
Your wiring looks like it should be OK.

Have you tried powering it off the Arduino directly instead of using a separate power supply?

I'd try that. It's not clear from your links what skecth you are running (perhaps you could post the code directly here, inside [ code] [ /code] tags), but try modifying the sketch to limit it to 5 LEDs to ensure you don't try to suck too much current from the Arduino 5V line while powering the leds directly from the arduino.

I haven't thought of this. I'll give it a try when I get home from work tonight.

Here is the code I'm running. It is a trimmed down version (taking out as many possible variables as I could) of the code available here: http://learn.adafruit.com/12mm-led-pixels/code

#include "SPI.h"
#include "Adafruit_WS2801.h"

uint8_t dataPin  = 2;    // Yellow wire on Adafruit Pixels
uint8_t clockPin = 3;    // Green wire on Adafruit Pixels

// Set the first variable to the NUMBER of pixels. 25 = 25 pixels in a row
Adafruit_WS2801 strip = Adafruit_WS2801(25, dataPin, clockPin);

void setup() {    
  strip.begin();
  strip.show();
}

void loop() {
  colorWipe(Color(255, 0, 0), 50);
}

// fill the dots one after the other with said color
// good for testing purposes
void colorWipe(uint32_t c, uint8_t wait) {
  int i;
  
  for (i=0; i < strip.numPixels(); i++) {
      strip.setPixelColor(i, c);
      strip.show();
      delay(wait);
  }
}

/* Helper functions */

// Create a 24 bit color value from R,G,B
uint32_t Color(byte r, byte g, byte b)
{
  uint32_t c;
  c = r;
  c <<= 8;
  c |= g;
  c <<= 8;
  c |= b;
  return c;
}

Thanks,
-- Zeustopher

I am having the exact same problem.
I got the LED's cheap through ebay from china and I am thinking they might be busted.
You manage to fix the problem?

As far as I could tell, my strands were defective. I worked with the company I bought them from and I sent them back and got a refund.

Since I was trying to get this project done for Christmas, I haven't had a chance to buy new strands since it isn't a 'top priority' any longer. I'll be picking up a few strands again in the coming months. So, sorry but I'm no help.

Zeustopher:
As far as I could tell, my strands were defective. I worked with the company I bought them from and I sent them back and got a refund.

I believe I have some rather bad news for you.

Your posting has provoked me into setting up a chain of these "pixels" that I purchased a few months back, which having wrangled the libraries - an educational experience in itself encountering some less than helpful instructions on the Adafruit pages confusing upper and lower case - I now have joyfully chasing and surging up (and down) my bookcase. Well, bully for me, but clearly pleasing. (OK, they have started to worry me - now turning them off!)

The point is - the behaviour you describe, of the first pixel turning on when you apply power, and changing colour when you touch the wiring, is entirely normal and in fact demonstrates that the pixels are in perfect order.

I have to conclude then that in your case, the control input lines were simply not connected to the Arduino. They are high impedance (CMOS) inputs and will readily pick up random interference, even radio signals in some cases.

How this could have happened is then the question. If you connect the data outputs instead to the Arduino, then the input wires at the other end would be sensitive to this interference. (The data output wire is buffered, so holding it down does not affect the input.) You apparently did try swapping end for end.

I have checked various cases of the pin behaviour on the Arduino. With the Arduino off (no power), all ports are necessarily pulled down to ground and cannot float. While they do float in reset, and with an alternate sketch that does not define the pins to which you have connected the pixels, I am unable to generate any interference to "spook" the pixels when they are turned on under these circumstances.

I have to conclude therefore that the behaviour you describe indicates no code fault, normally functional pixels, but that the connections of the pixel chain control inputs (possibly including the ground) were simply not made however that may have happened.

(And I trust just in case, that you did try swapping the green and yellow wires as a test.)

I got my first arduino and 3 pcs WS2801 pixels last week.

I was following this guide however only the LED at the output side of the string glows white.
while running the colorswirl program posted on above link sometimes the led does flash between the colors but only if i start wiggling the cable at the LED side a bit.

I already changed the cables between the led strip and the arduino, and tried a other LED strip but it has the same issue.

When i connect the led strip to power only it also only glows 1 led.

matt79:
I got my first Arduino and 3 pcs WS2801 pixels last week.

Looks like a reasonably reputable site.

matt79:
I was following this guide however only the LED at the output side of the string glows white.

The output side? The end opposite the connection to the Arduino?

matt79:
while running the colorswirl program posted on above link sometimes the led does flash between the colours but only if i start wiggling the cable at the LED side a bit.

What do you mean by "LED side"? This clearly suggests a faulty connection, or wrong connection.

matt79:
I already changed the cables between the led strip and the Arduino, and tried another LED strip but it has the same issue.

And of course you have ensured that the Arduino ports you have connected match those specified in the code, and just in case, tried exchanging clock and data?

matt79:
When I connect the led strip to power only it also only glows 1 led.

At the "input" end. Normal - in fact correct - behaviour for an unconnected input.

If you have tried two or three strips, I would be virtually certain that either the connections you are using or the code are wrong. (Ground rule of this forum. :D)