r/FastLED • u/AntiqueYesterday2009 • Dec 13 '25
Support Adding a second strip to a separate output pin
Hi everyone. Appreciate you all being here. I'm just curious if it is possible to run 2 WS2812b strips each from a separate data pin. So, for example the simple code below fills a strip on pin 3 with the color RED. I want to add a second strip and fill that strip on pin 4 with the color BLUE.
Is an Arduino Mega 2560 capable of doing this task? And if so, what is the maximum number of individual strips you can run from separate pins off of a single Mega2560?
Where and what would I need to add to the code to achieve supplying 2 separate data signals to 2 separate strips? I tried just simply adding a #2 to some variables ex. DATA_PIN2, NUM_LEDS2, etc. But it couldn't be that simple...
I also have an unrelated question: How many strips are able to share a single data pin? I am able to run 2 strips off of the same data pin but not sure how much power is behind the data signal.
Thank you for reading and I appreciate any feedback.
Also, I have to say that this form of art is very addicting. I'll stay up all night just tweaking things to see what happens. Thank you all for being here, providing support, and for making this forum possible.
#include <FastLED.h>
#define NUM_LEDS 144
#define DATA_PIN 3
#define COLOR_ORDER GRB
#define CHIPSET WS2812B
#define BRIGHTNESS 5
#define VOLTS 5
#define MAX_AMPS 500 // In Milliamps
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<CHIPSET, DATA_PIN, COLOR_ORDER> (leds, NUM_LEDS);
FastLED.setMaxPowerInVoltsAndMilliamps (VOLTS, MAX_AMPS);
FastLED.setBrightness (BRIGHTNESS);
FastLED.clear();
FastLED.show();
}
void loop() {
fill_solid(leds, NUM_LEDS, CRGB::Red);
FastLED.show();
}
3
u/ZachVorhies Zach Vorhies Dec 13 '25
ArduinoMega? It will work but it won’t be faster. If you need parallel output use a newer board like the esp32
2
u/dedokta Dec 13 '25
Is there a reason you'd like to run the steps off of separate pins? Unless they are going to be far away from each other it's usually easy just to run them in series and then do the light changes in the code.
As for running multiple steps off the same pin, it's hard to know for sure, but you can usually run 3 or 4 without issue. After the first led receives the signal it amplifies it to send it to the next one.
2
u/Marmilicious [Marc Miller] Dec 13 '25
You'll need a separate addLeds line for each pin.
What are you wanting to do though? Mirroring of patterns? Separate patterns? A continuous pattern spread over multiple strips? Are the strips the same or different lengths?
Here's some examples so you can see some different options.
https://github.com/marmilicious/FastLED_examples/blob/master/multiple_animations_and_strips.ino
https://github.com/marmilicious/FastLED_examples/blob/master/multipleStripsInOneArrayDifferentLengths.ino
https://github.com/FastLED/FastLED/tree/master/examples/Multiple
1
u/AntiqueYesterday2009 Dec 13 '25 edited Dec 14 '25
Thank you everyone for the replies.
My idea is a little far-fetched because it's going to be used for a wearable that interacts with the led strips.
For simplicity, I'm trying to write a multi-button sketch where multiple buttons will trigger an effect on a separate strip based off of which button is pressed.
Example:
Button1 is pressed, strip 1 will flash a BLUE light using pin 3.
Button2 is pressed, strip 2 will flash a RED light using pin 4.
etc.
Below is a quick button sketch that works with a single strip with no issues.
This sketch flashes a blue light when the push button is pressed/HIGH. See below.