Go Down

Topic: WS2801 RGB String - Red Only - B & G Unlit (Read 6249 times) previous topic - next topic

Foxfur

Nov 07, 2013, 07:08 pm Last Edit: Nov 07, 2013, 07:23 pm by Foxfur Reason: 1
Hi gang,
I'm new to Arduinoland and am truly enjoying it.
I have a digital RGB LED string of 19 36mm modules that only show red. When blue or green should be lit, they stay off. My wife (and cat!) are enjoying the chasing of the string but it would be far better if all the colors could play together.

I'm using an edited portion of Adafruit's Stringtest to run them
( I ran the whole code but the pauses between colors were disruptive...)

Code: [Select]

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

/*****************************************************************************
Example sketch for driving Adafruit WS2801 pixels!


  Designed specifically to work with the Adafruit RGB Pixels!
  12mm Bullet shape ----> https://www.adafruit.com/products/322
  12mm Flat shape   ----> https://www.adafruit.com/products/738
  36mm Square shape ----> https://www.adafruit.com/products/683

  These pixels use SPI to transmit the color data, and have built in
  high speed PWM drivers for 24 bit color per pixel
  2 pins are required to interface

  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries. 
  BSD license, all text above must be included in any redistribution

*****************************************************************************/

// Choose which 2 pins you will use for output.
// Can be any valid output pins.
// The colors of the wires may be totally different so
// BE SURE TO CHECK YOUR PIXELS TO SEE WHICH WIRES TO USE!
uint8_t dataPin  = 2;    // Yellow wire on Adafruit Pixels
uint8_t clockPin = 3;    // Green wire on Adafruit Pixels

// Don't forget to connect the ground wire to Arduino ground,
// and the +5V wire to a +5V supply

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

// Optional: leave off pin numbers to use hardware SPI
// (pinout is then specific to each board and can't be changed)
//Adafruit_WS2801 strip = Adafruit_WS2801(25);

// For 36mm LED pixels: these pixels internally represent color in a
// different format.  Either of the above constructors can accept an
// optional extra parameter: WS2801_RGB is 'conventional' RGB order
// WS2801_GRB is the GRB order required by the 36mm pixels.  Other
// than this parameter, your code does not need to do anything different;
// the library will handle the format change.  Examples:
//Adafruit_WS2801 strip = Adafruit_WS2801(25, dataPin, clockPin, WS2801_GRB);
//Adafruit_WS2801 strip = Adafruit_WS2801(25, WS2801_GRB);

void setup() {
   
 strip.begin();

 // Update LED contents, to start they are all 'off'
 strip.show();
}


void loop() {
 // Some example procedures showing how to display to the pixels
 
 colorWipe(Color(0, 255, 0), 50);
 colorWipe(Color(0, 0, 255), 500); //red


}

// 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;
}



I've tried variations on the data and clock pins; default, new pair, and SPI. None have made any difference.
I have tried 3 separate 5 volt power supplies (1A, 2A, 3.5A) to make sure the LEDs weren't starving. No difference.
The wires are 16ga from the PS to the LEDs, more than adequate.
I have no idea who made the string. It was given to me after being used in an art project at Burning Man.

I am doubting that the modules are all bad, that they'd lose the two exact colors on every module. I'm thinking it's something I've done or not done...

Has anyone ever seen this behavior?

arduinodlb

You probably have, but you don't say, so have you tried changing this line

Code: [Select]

  colorWipe(Color(0, 0, 255), 500); //red


to

Code: [Select]

  colorWipe(Color(255, 0, 0), 500);


What happens?
Do not IM me. I will not respond. Ask questions in the forum.

Foxfur

Hi Arduinodlb!
All were dark :(
The original code has three lines, each shifting the 255 to pull the colors (where are you, colors?) so I snipped on out to reduce the delay in cycling.
It's actually rather neat. Fills all pixels slowly, then zips to dark. Reminds me of the old chaser signs at roadside motor lodges...


FinBot

You may wish to check the lights are actaully WS2801.

There are other chips that are loaded into the same looking housings such as LPD 6803, and WS2811.




If they are WS2801s, then I would start with running STRANDTEST, and also check that the board selected in Ardunino matches the board you have.

Foxfur

Hi Fin,
They indeed are WS2801s...
Strandtest was the base for the code above. I chopped it down quite a bit.

I neglected to mention that the reds are running rather dim. Can't see 'em when outside on an overcast day.
The 19 modules only draw 17mA with all of them on. I see 5.17v at both ends of the string, rock solid, no sagging.


arduinodlb

You haven't got your data and clock wires back to front have you?
Do not IM me. I will not respond. Ask questions in the forum.

Foxfur


arduinodlb

Well, it's certainly a mystery. I think the dim red lights is a big hint though. Hmmmmm
Do not IM me. I will not respond. Ask questions in the forum.

arduinodlb

When you say you checked the data and clock, did you use a DMM all the way to the 2801 pin, or just go by the color? It looks like on your LEDs, the Yellow might be Clock, and Green might be Data, which is the opposite of the adafruit ones according to your code comments.
Do not IM me. I will not respond. Ask questions in the forum.

Foxfur

A couple of days ago I wondered that too. I swapped them, flickering and twitching, swapped back and it was exactly as it was before.
I think I'm gonna put them into the junkish box for use where appropriate on a future project.
Found a 50 pc string of IP68 (in Chinese it's around IP56 :) ) digital RGB 12mm emitters for $25 delivered. I think I'll begin anew with that.

arduinodlb

Good Luck.

Be careful with the Chinese ones if they're from Amazon. The cheapest string they had there said WS2801 in the description, but in the photos there were only 3 wires to each LED, which makes them WS2811. That's why I'm guessing they were the cheapest, and not accurate to the description.
Do not IM me. I will not respond. Ask questions in the forum.

Paul__B


but in the photos there were only 3 wires to each LED, which makes them WS2811.


Don't you mean four wires?   Vcc, Ground, in and out.

fungus


I neglected to mention that the reds are running rather dim. Can't see 'em when outside on an overcast day.
The 19 modules only draw 17mA with all of them on. I see 5.17v at both ends of the string, rock solid, no sagging.


Looks to me like something bad happened to the strip at Burning Man...
Advanced Arduino

arduinodlb



but in the photos there were only 3 wires to each LED, which makes them WS2811.


Don't you mean four wires?   Vcc, Ground, in and out.



No. The WS2801 takes 4 wires to operate. VCC, GND, CLK, DATA. The WS2811 takes 3. VCC, GND, DATA/CLK.

I suppose you could describe that as 4 in and 4 out (being 8 total) or 3 in and 3 out (being 6 total), but because it's in a chain, I think it makes more sense to describe it as 4 and 3 respectively.
Do not IM me. I will not respond. Ask questions in the forum.

Foxfur

By brainstorming with you all we eliminated all kinds of possible problems from consideration.
I was at Goodwill yesterday digging through the bin of warts and bricks and found an old HP 12V 2A brick. I figured it'd come in handy sometime. On the way home I wondered about hooking the string up to 12V. I'd read somewhere that 2801s use 12V but kept seeing 5V in all the other places I've searched.

Got home, hooked up to 12V, and we're rockin'!

Now that the hardware side is done, I need to begin figuring out the daunting code. I have not done any programming since my VIC20, Apple II+,  and Atari 800  :smiley-eek-blue:
I'm able to cut up examples and rearrange things but not yet able to comprehend the odd (to me) operators and maths.

Thanks to all who posted!

Go Up