Running multiple RGB LED strips from 1 logic pin

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
User avatar
tinkeringtech
 
Posts: 98
Joined: Wed Nov 23, 2011 10:08 pm

Running multiple RGB LED strips from 1 logic pin

Post by tinkeringtech »

Hello,
I wanted to find out if there is a maximum number of RGB LED strips that can be run in parallel from 1 Arduino logic pin. I currently have 4 x 20 LED strips, and concerned that I may be pushing the upper limits of what the Arduino pin can drive for a multi-strip scenario. I did some research in the forums and I found the post below without a clear answer. Other have referred to doing this as "voodoo" :lol: so any advice would be greatly appreciated? Thanks.

http://forums.adafruit.com/viewtopic.ph ... ps#p129121
http://forums.adafruit.com/viewtopic.ph ... ps#p191273

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

Re: Running multiple RGB LED strips from 1 logic pin

Post by adafruit_support_rick »

Have you tried it? Does it work? It's not a question of the number of LEDs, since the drive signal is chained from LED to LED. It's just a question of the current required to get the signal to the first pixel of each strip.
Don't worry about overloading the Arduino pin - if it works, you're good.

User avatar
tinkeringtech
 
Posts: 98
Joined: Wed Nov 23, 2011 10:08 pm

Re: Running multiple RGB LED strips from 1 logic pin

Post by tinkeringtech »

Yes I tried it, and it works fine.
However, I wanted to scale it up from 4 strips to about 13 and wanted to ask the question before I blue-smoke something. Was concerned about the current draw from the pin since I saw that the I/O pins can source about 40mA.

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

Re: Running multiple RGB LED strips from 1 logic pin

Post by adafruit_support_rick »

I doubt that 13 strips will work. You're going to want to use the Arduino pin to drive something that can source more current for the 13-way fanout, like a transistor.

User avatar
tinkeringtech
 
Posts: 98
Joined: Wed Nov 23, 2011 10:08 pm

Re: Running multiple RGB LED strips from 1 logic pin

Post by tinkeringtech »

Or use multiple digital pins on the arduino (1 pin for every 4 strips)? Thanks for your help.

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

Re: Running multiple RGB LED strips from 1 logic pin

Post by adafruit_support_rick »

tinkeringtech wrote:Or use multiple digital pins on the arduino (1 pin for every 4 strips)? Thanks for your help.
Mmmm... doubtful. There's a 120mA limit on the total draw from output pins.

User avatar
tinkeringtech
 
Posts: 98
Joined: Wed Nov 23, 2011 10:08 pm

Re: Running multiple RGB LED strips from 1 logic pin

Post by tinkeringtech »

I doubt that 13 strips will work. You're going to want to use the Arduino pin to drive something that can source more current for the 13-way fanout, like a transistor.
I tried to make something like what's described in this tutorial http://learn.adafruit.com/rgb-led-strips/usage with a TIP120 to drive the multi-strip set-up without any success. Is this the right way to do it? sorry, my analog background is a little lean :D
BTW I'm using strips of the neo-pixel 60 LED RGBs. Thanks.

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Running multiple RGB LED strips from 1 logic pin

Post by pburgess »

I think driving multiple pins would be easiest.

1. Use pinMode() to set up all of the pins that will be outputs. They need to all be on the same PORT register (most decent Arduino pinout diagrams will show the corresponding PORT and bit for each pin), and keep in mind some pins have other functions (e.g. serial port on the Uno on pins 0 & 1). So for example you could use pins 2-7 (the remainder of PORTD).

2. Modify the NeoPixel library to fire all of these bits at once. There were some recent changes to this code, so download the latest from Github, then look for this line (currently line 39, but that could change):

Code: Select all

   pinMask(digitalPinToBitMask(p))
Change the digitalPinToBitMask() call to a binary constant, with 1s for the output pins, e.g.:

Code: Select all

   pinMask(B11111100)
3. Distribute the wiring from the strips to those pins.

User avatar
tinkeringtech
 
Posts: 98
Joined: Wed Nov 23, 2011 10:08 pm

Re: Running multiple RGB LED strips from 1 logic pin

Post by tinkeringtech »

Phil,
Thanks for the reply.
I initially wanted to drive multiple pins, but what concerned me was the total current draw from the Arduino I/O pins when all the strips are fired at once.
Is this a concern as adafruit_support_rick had inidcated earlier? I did not get a chance to try your suggestion as yet (will do tonight).

The reason behind wanting to drive the individual strips from multiple pins, is to avoid the "ripple effect" when all come on at once (I want all the strips to come on at once without a delay). If the modification that you suggested to the neopixel library stops the "ripple", then perhaps I would not need to tap into each data port on the strips, I could just chain them together? My set-up is in the crude sketch below. Thanks.
1.JPG
1.JPG (20.08 KiB) Viewed 1003 times

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Running multiple RGB LED strips from 1 logic pin

Post by pburgess »

The suggested modification requires tapping into each strip. That's sort of the whole point...issue the same data to all of them. We're just spreading out the same signal to multiple Arduino pins.

I wouldn't worry about exceeding current limits on the PORT, we're not really driving any substantive load here.

User avatar
tinkeringtech
 
Posts: 98
Joined: Wed Nov 23, 2011 10:08 pm

Re: Running multiple RGB LED strips from 1 logic pin

Post by tinkeringtech »

Phil,
I already have my set-up as in the sketch in my previous email, just wanted to confirm that it was a feasible solution. Your confirmation that I can drive many strips using multiple pins on the Arduino without worrying about port current limits, is very helpful.

Thank you so much for your assistance! Really appreciate it! :D

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

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