Hey, is there a way to relay FastLED data through another AVR microcontroller so

Hey, is there a way to relay FastLED data through another AVR microcontroller so I can perform some intermediary logic along a strip of LEDs? Specifically I’m trying to implement a set up like…

Ardunio → Attiny → WS2812 → Attiny → WS2812 → … → Attiny → WS2812

The Arduino would be running the FastLED library as usual but the ATTiny’s would have some basic decision making and then need to just relay the data that the Ardunio sends along the chain from one LED to another with no modification. I’ve tried just using a simple SoftwareSerial example (pasted below) to relay the data from one pin to another to no avail. The function works for serial data, just its not compatible with FastLED data and I believe it’s not just a baud rate issue.

#include <SoftwareSerial.h>

const int pinRx = 3;
const int pinTx = 4;

SoftwareSerial relaySerial(rxPin, txPin);

void setup() {
pinMode(pinRx, INPUT);
pinMode(pinTx, OUTPUT);
relaySerial.begin(4800);
}

void loop() {
while (relaySerial.available() > 0) {
relaySerial.write(relaySerial.read());
}
}

The only other way I can think to achieve what I want (intermediary logic) is to write my own basic library that exists as serial data so I can pass this between the AVR microcontrollers and then each Attiny is responsible for firing up its own instance of the FastLED library and converting my serial data into a FastLED function then passing to its one led. Whilst I believe this would work it seems hugely overkill and vastly limits the functionality available through FastLED so I’d rather not go down this route. This set up would look like…

Ardunio → Attiny → Attiny → … → Attiny
| | |
V V V
WS2812 WS2812 WS2812

@Janny_K interesting concept and quite chanlenging to put in place. Indeed the serial communication relys on a protocal which is not the one used to lightup the ws2812.
in order to realize you first schema you would need a new library to decode the signal on the ws2812 which relys on specific timing to rather than a clock driven data transmission. => a specific line to synchronize your Attiny would be necessary.

This configuration would be easier with clock driven leds like ws2801. in that case your Atiny would just be consider as a ‘special led’ with clock and date signal coming in from the incoming strip and going out to the next one.

@Yves_BAZIN Hey, really appreciate the response. That makes a lot of sense, you’ve led me on the right path to do some more research.

@Janny_K no problem glad i could help
this would be a good way to start

Any more info about the project you can share, such as:
how many LEDs total,
how are the LEDs arranged/spaced out,
what sort of intermediary logic is happening?

Any reason why the Arduino can’t do the logic handling? Or could the attinys report directly back to the arduino?

The data sent to clockless LEDs has very specific timing requirements.

Going out on a limb here… each atiny runs instance of FastLED, slave I2C as a device and arduino masters DMA into atiny *RGB array…?

I’m curious - What logic would the intermediary Arduinos do that the master Arduino couldn’t do in the first place?

@Matthew_Shaylor none, the constraint would be more to do with wanting logic for each led whilst only using 1-2 data lines throughout the whole set of LED’s therefore having it easily scalable.

@marmil Initially only 10 but I wanted something that could scale to 1000+ without having to add multiplexers, additional data lines etc

@John_Sullivan Will have a look at this too, thanks for the suggestion. The clock/data method suggested earlier initially makes more sense to me but I’m anticipating sync issues with that.

So an Arduino has ~20 pins that it could use for outputs? I’m impressed if that’s not enough for your project! In such a situation I think having a microcontroller for each strand would be a lot easier to manage than trying to chain them. Also use the clock based chips so that you can fit more on each strand.

@Janny_K
I’m interested in this but still not understanding.

“+Matthew Shaylor none, the constraint would be more to do with wanting logic for each led whilst only using 1-2 data lines throughout the whole set of LED’s therefore having it easily scalable”

So running 1 arduino with fastled with one data line would be easily scaleable, that is add as many strips/leds on the end as you like but would get slower refresh rates as the number of leds grows.

Is it the refresh rate issue your trying to overcome or something else.