How-to connect and run 3 parallel digital led strips

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
dkin
 
Posts: 19
Joined: Mon Jan 20, 2014 5:51 am

How-to connect and run 3 parallel digital led strips

Post by dkin »

Hi,

Based on my last post-Digital LED Belt using Arduino Uno R3 and a power supply (http://forums.adafruit.com/viewtopic.php?f=47&t=48620) I have a follow up question:

I wish to connect 3 parallel digital led strips (40cm each/Adafruit NeoPixel Digital RGB LED Weatherproof Strip 60 LED) to one Arduino Uno board and run the same “light sequence” program.

How can I do it? do I have power problems? How can I program this?

Thanks.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: How-to connect and run 3 parallel digital led strips

Post by adafruit_support_rick »

There are a couple of ways to approach this. You could daisy-chain the three strips together - that is, connect them end-to-end. In the code, it would still be treated as a single strip.
So, assuming there are 24 pixels in each strip, you would do something like this:

Code: Select all

void rainbow(uint8_t wait) {
  uint16_t i, j;

  for(j=0; j<256; j++) {
    for(i=0; i<24; i++) {
      strip.setPixelColor(i, Wheel((i+j) & 255));
      strip.setPixelColor(i + 24, Wheel((i+j) & 255));
      strip.setPixelColor(i + 48, Wheel((i+j) & 255));
    }
    strip.show();
    delay(wait);
  }
}
Or, you could have the three strips operated independently, connected to three different Arduino output pins. In that case, you would declare three instances of the NeoPixel object, and address each one separately.

Code: Select all

Adafruit_NeoPixel strip1 = Adafruit_NeoPixel(24, PIN, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip2 = Adafruit_NeoPixel(24, PIN, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip3 = Adafruit_NeoPixel(24, PIN, NEO_GRB + NEO_KHZ800);

void rainbow(uint8_t wait) {
  uint16_t i, j;

  for(j=0; j<256; j++) {
    for(i=0; i<24; i++) {
      strip1.setPixelColor(i, Wheel((i+j) & 255));
      strip2.setPixelColor(i, Wheel((i+j) & 255));
      strip3.setPixelColor(i, Wheel((i+j) & 255));
    }
    strip.show();
    delay(wait);
  }
}
As far as power is concerned, you would have to use a separate power supply for the strips. There's too many to run off of the Arduino's power supply. This tutorial talks about powering neopixels:
http://learn.adafruit.com/adafruit-neop ... uide/power

dkin
 
Posts: 19
Joined: Mon Jan 20, 2014 5:51 am

Re: How-to connect and run 3 parallel digital led strips

Post by dkin »

Hi,

I have questions regarding the three strips operated independently part:
1)In the code you wrote:

Code: Select all

Adafruit_NeoPixel strip1 = Adafruit_NeoPixel(24, PIN, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip2 = Adafruit_NeoPixel(24, PIN, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip3 = Adafruit_NeoPixel(24, PIN, NEO_GRB + NEO_KHZ800);
What do you mean by PIN. What I declare since If it was a row I would write:

Code: Select all

int dataPin = 2;
int clockPin = 3;
do I have to ad something like that:

Code: Select all

 int dataPin2 = 4; 
int clockPin2 = 5; 
int dataPin3 = 6;
int clockPin3 = 7;  

2) How do I connect each led strip to the ground as I have 3 strips?

Thanks.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: How-to connect and run 3 parallel digital led strips

Post by adafruit_support_rick »

Oops - sorry. I forgot about the PINs. You would assign three different pins, and connect the each data line of the three strips to one of those three pins.

NeoPixels don't have clock pins. Just the data line.

You're using a separate power supply, right? So all the power and ground lines from the strips go to that power supply. Just add another connection from that ground to the Arduino ground.

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”