0

Connecting multiple dotStar strips to a single Raspberry Pi
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Connecting multiple dotStar strips to a single Raspberry Pi

by abhi3188 on Wed Nov 08, 2017 5:31 pm

Hi,

Is it possible to connect multiple DotStar strips to a single raspberry pi? Normally I would just try this out but since they are a little expensive I wanted to find out before making a purchase.

Essentially if I have 4 strips, can I plug all 4 strips into my raspberry pi(each having its own data and clock pin) and then control each of them independently? I would ofcourse power each of the strips separately.

I'm imagining the code would look something like this:

Code: Select all | TOGGLE FULL SIZE
strip1 = Adafruit_DotStar(numpixels, datapin1, clockpin1);
strip2 = Adafruit_DotStar(numpixels, datapin2, clockpin2);
strip3 = Adafruit_DotStar(numpixels, datapin3, clockpin3);
strip4 = Adafruit_DotStar(numpixels, datapin4, clockpin4);

strip1.setPixelColor(10, color);
strip2.setPixelColor(11, color2);

strip1.show();
strip2.show();


Thanks

abhi3188
 
Posts: 33
Joined: Tue Sep 09, 2014 9:49 pm

Re: Connecting multiple dotStar strips to a single Raspberry

by adafruit_support_rick on Thu Nov 09, 2017 11:51 am

Yeah, that will work. But do you really need to have the strips separate? Why not just connect them as a single strip and control the pixel segments individually?

adafruit_support_rick
 
Posts: 34841
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: Connecting multiple dotStar strips to a single Raspberry

by abhi3188 on Thu Nov 09, 2017 12:03 pm

I guess I'm trying to split it into modular chunks so each strip is easily replaceable if something goes wrong. Also the layout is such that there would be breaks in the strips and it wouldn't be possible to lay it out as one long strip.

However when you suggested that I control each segment individually, would the implementation you imagine be something like storing the start pixel and end pixel value of each segment and then only triggering animations between those two values of the strip you are addressing?

Also, are you aware of a node library that would let me control the strips over any gpio pins, like the python library? The dotstar library I found requires SPI which basically would restrict usage to only the MOSI & SCLK on the pi, which would mean one strip per pi.

Thanks

abhi3188
 
Posts: 33
Joined: Tue Sep 09, 2014 9:49 pm

Re: Connecting multiple dotStar strips to a single Raspberry

by adafruit_support_rick on Thu Nov 09, 2017 4:10 pm

The adafruit dotstar python library can use any pins - you're not limited to SPI:
https://github.com/adafruit/Adafruit_DotStar_Pi

Be aware that this software control of the pins is a quite a bit slower than hardware (SPI) control.

abhi3188 wrote:However when you suggested that I control each segment individually, would the implementation you imagine be something like storing the start pixel and end pixel value of each segment and then only triggering animations between those two values of the strip you are addressing?

Yes, that's it exactly.

abhi3188 wrote:I guess I'm trying to split it into modular chunks so each strip is easily replaceable if something goes wrong. Also the layout is such that there would be breaks in the strips and it wouldn't be possible to lay it out as one long strip.

well, you can have up to around 2 meters of wires between strip segments. Would that work? If you need longer distances, you can actually use individual dotstars as repeaters - that is, you can have up to 2 meters between individual dotstars. Just write 0,0,0 to the repeaters, and they'll stay dark.

adafruit_support_rick
 
Posts: 34841
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Please be positive and constructive with your questions and comments.