Arduino Forum

Using Arduino => LEDs and Multiplexing => Topic started by: poodull on Nov 16, 2012, 12:25 am

Title: Looking for an RGB LED addressable strip 1 LED per segment
Post by: poodull on Nov 16, 2012, 12:25 am
Hello,

I've been looking for a led strip that can be cut down to 1 led per segment.  Most I've seen are 3 per segment.  I need this because the leds will backlight holes that aren't perfectly spaced and a ribbon solution is easier to implement that some kind of xxxplexing or home run.

I found this:  http://www.amazon.com/Addressable-Waterproof-WS2801-Connectors-Included/dp/B008F05N54/ref=pd_rhf_se_p_t_3

which is okay and a good price, but I have no idea what the lumens are on that LED.

Then there's Pololu's solution which is bit-bang:
http://www.pololu.com/catalog/product/2540

But my controller is using interrupts and a bunch of other things and I don't want to get into a situation where timing will be an issue.  I'd rather clock and latch or SPI (if I can ever figure that out).

Right now I'm using ShiftBrites but they're pretty expensive (~$5/ea compared to <$1/ea).  They are really bright, though.

So that's where I am.. is the Amazon unit (no name x) A) bright *enough* and B) actually a good price?

Further info:  I'm driving about 80~90 LEDs, hopefully updating every 30~50ms.
I scoured Ebay looking for this product but all I found was 5050s, which are 3/segment.

Thanks

fc
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: KirAsh4 on Nov 16, 2012, 10:10 pm
That Amazon link is for a strip with 5050's on it.  That's the LED name.  The difference is that, as you noticed, they come in different versions, some are able to be cut every pixel and others every 3.  Most of the individually addressed ones are single pixels.  Those things are very bright, I buy entire reels straight from China though.  One 5 meter reel for $60-$70, plus shipping.

Here's the same strip on eBay: http://r.ebay.com/usJlg2
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: poodull on Nov 16, 2012, 10:28 pm
Hey, awesome!  Thanks.  I learned 2 things today.

So you've had success cutting and rewiring these up?  and length limitations?  sample code or pitfalls to look out for/advice?

Taking another look at the Amazon one, they do have a clock (4 pins, not 3).  The Pololu one's are like yours where it's a single wire.  Other than that I don't know the difference.  In fact, I'm not sure how to drive either one of them.  It seems like the bit-banged ones require knowing the ns timing and making sure its hit accurately.  I guess the one with a clock only requires the clock to be driven high.  Honestly I have no idea how to drive these things and it seems to me like every led strip has it's own library and hardware requirements.  I feel like it's not as steep a learning curve as I'm making it out to be, but the infinite hardware combinations are making it complex.

Thanks again.

fc
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: KirAsh4 on Nov 16, 2012, 10:56 pm
I have cut them to whatever length I need them to be, no issues there.  The only issues with length is that at some point you need to add some pull-downs to the data and clock lines at the END of the string, to avoid reflection of the signal.  And I use FastSPI to drive these.  Adding the necessary dataRate line to the code, you can clock those things pretty dang fast.
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: poodull on Nov 16, 2012, 11:31 pm
So I guess the ones with a clock you just drive the clock high instead of waiting 50us?  Since I have interrupts I'm guessing that I would need the clock version, even though it's 2x the cost.

fc
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: KirAsh4 on Nov 17, 2012, 01:36 am
You clock the data in, the waiting period is to latch it in and thus the lights react.  You can clock data in all day long if you want, but it's not till you wait the 500uS that the data you clocked in will actually get latched in and the IC does something with the LEDs.

The FastSPI library takes care of all of that for you.
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: poodull on Nov 19, 2012, 04:53 pm
So reading this thread has me wondering:
http://arduino.cc/forum/index.php/topic,80567.0.html

why would you suggest WS2811 LEDs on an Arduino forum?  I would need a newer clocked arduino (uno, leo, teensy3, etc) to just keep up with >50 LEDs.  Specifically, something off-brand 'duino compatible with a honking processor.

Nobody on that thread mentioned fastSPI, though.  Is fastSPI fast enough to handle a 2811 on an 16MHz arduino?  32?  32 with interrupts? 

Your last post says 500us to latch, but the code says 50us... which the other thread says is impossible/flakey for more than a few leds.

I just seems to me like a pretty significant detail to skip, no?

fc
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: KirAsh4 on Nov 19, 2012, 06:36 pm

So reading this thread has me wondering:
http://arduino.cc/forum/index.php/topic,80567.0.html

why would you suggest WS2811 LEDs on an Arduino forum?  I would need a newer clocked arduino (uno, leo, teensy3, etc) to just keep up with >50 LEDs.  Specifically, something off-brand 'duino compatible with a honking processor.

Nobody on that thread mentioned fastSPI, though.  Is fastSPI fast enough to handle a 2811 on an 16MHz arduino?  32?  32 with interrupts? 

Your last post says 500us to latch, but the code says 50us... which the other thread says is impossible/flakey for more than a few leds.

I just seems to me like a pretty significant detail to skip, no?


Go back and re-read it.  The original OP wanted to try the 2811, which is very different from the 2801 (and 2803 for that matter), and I suggested they experiment.  I wouldn't suggest the 2811 unless I've tried using them myself, and I have not.  As it turned out, you do need a faster processor to work with those.  A stock 16MHz/20MHz Arduino won't cut it.  The newer Leonardo might, but I have no bench test to prove that.  Nor do I have any interest in using the 2811s any time in the near future.  I'm quite happy with the 2801 and 2803, I've also ventured into the LPD1101 series (which is the next generation LPD6803).  They all work with FastSPI on a stock Arduino or clone.

You, on the other hand, are asking about the 2801, and you can drive those just fine with any stock or clone Arduino with a 16MHz processor, or even at 8MHz.  I have several strings that I made of 50 pixels, running on an 8MHz with no problems.  And I've bit-banged them, which is much slower than FastSPI.  I'm working on a custom design that has a 90 pixel string, running at 16MHz with FastSPI, no issues what so ever.

As for the latch/reset timing, read the datasheet, specifically page 11, under 'Gray Scale Data Word Format and Timing', very first sentence.  If you're using FastSPI, you don't need to do any of the latching yourself, just send it the necessary commands and the library does it all.  And those saying it's flakey, that's merely because they neglect to add the dataRate needed in the FastSPI code for this specific IC.
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: poodull on Nov 19, 2012, 07:47 pm
Okay, got it.  And let me start by first saying thanks for your help.  I really do appreciate it.

My only point of confusion (and the reason I posted my last post) was because the link you sent me to the led strip in Ebay states that it uses 2811s

http://www.ebay.com/itm/60-LEDs-m-1M-WS2811-RGB-LED-strip-IP67-Waterproof-Individually-Addressable-/160896346789

That's all.  I was confused because I think you found a similar strip to my link to Amazon, but with the different (faster) clock.

Or am I missing something bigger?

Thanks again,

fc
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: KirAsh4 on Nov 19, 2012, 09:06 pm
Sorry, that's my bad.  I had multiple windows open.  What I meant to link was the 2801 version:

http://r.ebay.com/HUVgak

Note that the same vendor also sells a full reel, 5m, for a little over $144.  Buying it straight from China will be a little under $90 including shipping.  Just saying.
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: poldim on Nov 26, 2012, 05:09 am

The only issues with length is that at some point you need to add some pull-downs to the data and clock lines at the END of the string, to avoid reflection of the signal.  


Do you have any more info on this?

More specifically, I purchased a similar 5m led digital strip,WS2801IC 32pcs IC+32pcs 5050 SMD RGB/meter (http://www.ebay.com/itm/120997188462) with a total of 160 (32*5) LEDs.  I've paired this up with a duemillanove and a 5V 5A PS.  On the arduino, I've ran the fastSPI test leds PDE and the adafruit WS2801 strand test PDE, with consistent errors after exceeding about 60 LEDs.  The failure that occurs are the first led pixel being off color and some leds toward the end of the string or all leds begin to behave erratically. Any thoughts?  Maybe throw in a pull down resistor after the 50th?
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: KirAsh4 on Nov 26, 2012, 10:56 am
Read the data sheet on the WS2801.  It tells you when/where you need to add the resistors.

However, I have run the FastSPI testled sketch on a full 5m reel straight out of the box with no problems what so ever.  The only change I made to the sketch was to add the proper dataRate line, which is missing from the sketch.  No resistors added, just hook up the four wires, make sure the 4 wires at the end aren't touching anything metal, and turn it on.  In fact, I just grabbed two reels, hooked them up in parallel to my Uno, using FastSPI.  I only ran one sequence, which is the single color down the whole strip, because it's not hooked up to a high amp power supply:

(the freezing that you're seeing, if any, is just the way YouTube processed the video - the chase is smooth with no hiccups.)
http://www.youtube.com/watch?v=1XhF-0Tlg_U
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: poldim on Nov 26, 2012, 06:16 pm

Read the data sheet on the WS2801.  It tells you when/where you need to add the resistors.

However, I have run the FastSPI testled sketch on a full 5m reel straight out of the box with no problems what so ever.  The only change I made to the sketch was to add the proper dataRate line, which is missing from the sketch.  No resistors added, just hook up the four wires, make sure the 4 wires at the end aren't touching anything metal, and turn it on.  In fact, I just grabbed two reels, hooked them up in parallel to my Uno, using FastSPI.  I only ran one sequence, which is the single color down the whole strip, because it's not hooked up to a high amp power supply:

(the freezing that you're seeing, if any, is just the way YouTube processed the video - the chase is smooth with no hiccups.)
http://www.youtube.com/watch?v=1XhF-0Tlg_U


Thanks for posting this up. I looked in the spec sheet and it only states what's below.  I changed the pull up resistors from 10K to 50 with no positive effect.
Quote
The Connection and Driving of Cascading Operation
The transmit the data over long distance by cascading, the WS2801 integrates push-pull output stage with strong driving capability which enables the data and clock can be transmitted up to 6 meters at 2MHz clock frequency.
To prevent the reflection, it is necessary to connect a 50? resistor at the data input or output port for impedance match.



Any thoughts on what the problem could be?  A bad/faulty strip?  This wouldn't surprise me because the quality does not look top notch...
This afternoon I will try swapping out to a spare arduino to see if that changes anything.
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: KirAsh4 on Nov 26, 2012, 07:10 pm
Maybe post your sketch so I can see what you're doing ...
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: poldim on Nov 27, 2012, 02:25 am

Maybe post your sketch so I can see what you're doing ...



FastSPI: http://code.google.com/p/fastspi/
Adalight: https://github.com/adafruit/Adalight

I've found that the adalight package fails almost immediately.  However, with FastSPI, if I set the data rate to 7 (the slowest), and increase all of the delay times, it more or less works but eventually fails.
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: KirAsh4 on Nov 27, 2012, 10:04 pm
You don't need the PIN definition nor the .setPin call() for the WS2801, you can safely comment those out (or just delete them since you'll never use them with the WS2801 anyway.)  Same for the other .setChipset() lines.  They become clutter anyway.

The WAIT_TIME definition is for ....?  It's not used anywhere.

However, neither of those are affecting what the rest of the program is doing anyway.  I don't see why you're having problems.  A full reel has 160 LEDs on it and I can run that with a dataRate of 2 with no issues what so ever.  This is with the strip still on the reel, no resistors, nothing.  This is how I test the reels before I start using them, right out of the box.

I'll do some more testing when I get home tonight, maybe there's something I'm missing.
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: fungus on Nov 28, 2012, 01:42 am
You definitely shouldn't need termination resistors with WS2801s. They buffer the data from chip to chip - there's no continuous wire along the strip.

I just bought one of these, I guess I'll find out in the next couple of days.

Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: KirAsh4 on Nov 28, 2012, 06:52 am
Eventually you need to add the resistors to prevent reflection, but that's only on long runs *between* each IC.  When they're this close together, it's not needed.  There's something else going on with his setup ...  I'm about to do some testing on a string of 224 pixels, see what happens.
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: KirAsh4 on Nov 28, 2012, 08:16 am
Here you go poldim.  Brand new 5m reel, just opened the package today.  I connected the VCC and GND wires to an external 5V/30A supply.  Connected an Uno to my computer and connected a wire from the PSU GND to the Uno's GND.  Connected the remaining two wires to CLK and MOSI.  Then, for good measure, I downloaded the latest FastSPI which as of tonight was 20121014.  After installing the library and launching Arduino IDE 1.0.1, I loaded the testleds sketch and made the following changes:



As soon as the sequence started I noticed discoloration towards the last 20-25% of the string.  Ah, I need to inject power!  So I connected the end of the string's power wires to the PSU also (only the power wires, the data and clock lines weren't touched.)

And the result is this:
http://www.youtube.com/watch?v=icVtCBbk0Vk
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: KirAsh4 on Nov 28, 2012, 08:22 am
Honestly, I don't know what could be going wrong with your setup besides perhaps a lack of current.  If you are driving these only from USB power, that may be the issue, but I don't know.  It should still run at the very least the first sequence or a single pixel being lit, chasing from the beginning of the string to the end.  The others will start to draw more current.  90 pixels at 20mA is 1.8A - something your USB connection will *not* provide.  But the single chase should work because it's only drawing 20mA at a time.

So your next step is to try and run it with an external power supply like I do.  Run the UNO from your computer (so you can keep uploading sketches to it without having to reconnect/disconnect each time.)  But connect the string's power wires to an external power supply.  An old computer PSU works great.  Mine provides 30A on the 5V line which is plenty to drive a full 5 meter string at full power, 60mA each (9.6A total.)  Make sure you connect the PSU's ground to the UNO's ground.  Let it rip.  Report back.
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: Donziboy2 on Nov 28, 2012, 05:53 pm
The max draw for the ws2801 strips from GreeLED is 2A per meter, that's full white all led's on.
The ws2801 strips you posted from Ebay are from GreeLED as far as i can tell and they are about $12.5 per meter. 
Wish i knew that before i spent $90 on 3 meters about 2 months ago on ebay.  Found the manufacturer after I bought mine.

Also, I ran into an issue powering my Mega boards from my Laptop.  The led's would be erratic and not function properly, as soon as i changed USB to another device, a desktop monitor with USB it worked just fine.
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: poldim on Nov 29, 2012, 03:25 am

Honestly, I don't know what could be going wrong with your setup besides perhaps a lack of current.  If you are driving these only from USB power, that may be the issue, but I don't know.  It should still run at the very least the first sequence or a single pixel being lit, chasing from the beginning of the string to the end.  The others will start to draw more current.  90 pixels at 20mA is 1.8A - something your USB connection will *not* provide.  But the single chase should work because it's only drawing 20mA at a time.

So your next step is to try and run it with an external power supply like I do.  Run the UNO from your computer (so you can keep uploading sketches to it without having to reconnect/disconnect each time.)  But connect the string's power wires to an external power supply.  An old computer PSU works great.  Mine provides 30A on the 5V line which is plenty to drive a full 5 meter string at full power, 60mA each (9.6A total.)  Make sure you connect the PSU's ground to the UNO's ground.  Let it rip.  Report back.


Thanks a ton for the help KirAsh4!  I should have posted a video of my problem from the get go and you probably would have figured it out sooner.  

Below is the PS I've been using the whole time.  I have estimated that I would be using somewhere between 115 and 134 LED for this project.  And being that its an ambilight, I better not need a 30A PS.... :)

http://www.youtube.com/watch?v=geNMKzv3Dws

Also attached the code I used in the video.
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: KirAsh4 on Nov 29, 2012, 05:56 am
Yeah, it had to be something fairly simple because you were doing everything else correct, and I should've picked up on that early on but didn't.  As far as amperage, what you need to calculate is the maximum amp you might be pulling.  So, on 115 LEDs, that 115 * 60mA = 6.9A and on 134 that's 134 * 60mA = 8.04A.  So no, you won't need a 30A power supply.  And this is assuming a full 100% duty cycle on all three channels.

In my case, I create installations with quite a few more.  The 30A PSU allows me to put a maximum of 500 of those LEDs.  But, I always keep it below that with no more than 15 meters (3 reels), or 480 LEDs.  That runs about 28.8A ... I have 1.2A left to run a controller with whatever peripherals ...  :)  As for power injections, I try to inject power every 3 to 5 meters, depending on the total length of the string.

Glad to see things working now.
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: poldim on Nov 29, 2012, 08:19 am
I've now gotten to a working LED strip for my ambilight, now just need to get lightpack working...
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: contecavour on May 17, 2013, 02:46 pm
I had my lstrip from China.
I want to test if all works
Someone has a source code example for FastSPI library and ws2801 to test if all works

Thanks
Nic
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: KirAsh4 on May 17, 2013, 06:32 pm

I had my lstrip from China.
I want to test if all works
Someone has a source code example for FastSPI library and ws2801 to test if all works

Thanks
Nic


Yep, it's all written for you already.  Download the library, install it, and run the testled sketch that comes with it.
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: contecavour on May 17, 2013, 10:36 pm
Thanks.
It's clear how to wire the pin to Arduino?
<N
Title: Re: Looking for an RGB LED addressable strip 1 LED per segment
Post by: contecavour on May 18, 2013, 07:37 pm
How i connect the strip to Arduino.
In the strip i have 5v, ck, sI and GND.

N