Arduino controlled WS2812B multiple strips effects loaded from PC for Case light

Problem: Built gaming PC with my daughter. Aura sync, iCue, Jacknet all severely limited. Wish to control individual RGB devices' LEDs, but all seem to see all attached devices on a single argb header as a single strip

Goal: PC based software to assign/name individual devices as a single or multiple strips (for power and 128 led strand limits), which are controlled by arduino mounted inside case.

Expected criteria

  1. Arduino and PC interface USB 2.0 continuously

  2. PC Software visual and configured to identify individual devices (ie strip 1 #1-16 = Top Front Fan; strip 2 # 17-32 = Middle front fan, Strip 2 #1-16 = Case LED strip bottom etc)

  3. PC software used to create effects and apply to individual devices or groups of devices

  4. SATA power connector for strips

  5. Custom effects can be shared/loaded via config file (xml?) with others

Advice needed:

  1. Any tips :wink:

  2. Is there anything like this already on the market that can be purchased, or open source that can be included, reused, improved to achieve the goal?

We've made other small projects with arduino uno using WS2812B, but we're pretty new and slow.

Why? WS2812B quite easily addresses individual LEDs or groups of LEDs and multiple strips. However, the software solutions we've looked at completely ignore this capability with basic "apply to everything connected" effects.

If you know of something we can use or use to get started on a project, PLEASE post it up! Thanks!

1 Like

Not too sure what the first bit of the post means, full of words I have never come across. Also you text reads like a military telegram to me.

However I can commentate on this comment.

However, the software solutions we've looked at completely ignore this capability with basic "apply to everything connected" effects.

Are you aware that when using a single strip all the LEDs have to have data passed to them even if only one LED has changed its colour?

If you have multiple strips you can have multiple outputs and multiple buffers. As to why you have not found such examples I can’t tell. I have posted many examples of this myself. I can’t post one now as I am on an iPad but could post one when I get back on my lap top if you want.

1 Like

Here is an example of code for the Adafruit library

// using a state machine to drive two patterns on two strings at the same time
// By Mike Cook July 2017

#define PIN_FOR_1   6 // pin connected to the NeoPixels strip 1
#define PIN_FOR_2   7 // pin connected to the NeoPixels strip 2
#define NUMPIXELS1      5 // number of LEDs on first strip
#define NUMPIXELS2      6 // number of LEDs on second strip

#include <Adafruit_NeoPixel.h>

// how often each pattern updates
unsigned long pattern1Interval  = 400;
unsigned long pattern2Interval  = 900;
// for millis() when last update occurred
long lastUpdateP1 = 0;
long lastUpdateP2 = 0;  
// state variables for patterns
int p1State = 0 ; 
int p2State = 0 ; 

Adafruit_NeoPixel strip1 = Adafruit_NeoPixel(NUMPIXELS1, PIN_FOR_1, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip2 = Adafruit_NeoPixel(NUMPIXELS2, PIN_FOR_2, NEO_GRB + NEO_KHZ800);

void setup() {
   strip1.begin(); // This initializes the NeoPixel library for pattern 1.
   strip2.begin(); // This initializes the NeoPixel library for pattern 2.
   // wipes the LED buffers
   wipe1(0,0,0); 
   wipe2(0,0,0);
}

void loop(){
if(millis() - lastUpdateP1 > pattern1Interval) updatePattern1();
if(millis() - lastUpdateP2 > pattern2Interval) updatePattern2();
}

void updatePattern1(){ // update pattern 1 a walking red led
   strip1.setPixelColor(p1State, strip1.Color(128,0,0));
   int lastLed = p1State -1;
   if (lastLed < 0) { // wrap round count
      lastLed = NUMPIXELS1 -1;
   }
   strip1.setPixelColor(lastLed, strip1.Color(0,0,0)); // turn off last LED
   p1State ++; // move on state variable for the next time we enter this
   if(p1State >= NUMPIXELS1){ // wrap round the state
    p1State = 0;
   }
   strip1.show(); // update display
   lastUpdateP1 = millis(); // time for next update
}

void updatePattern2(){ // update pattern 2 a walking green LED
   strip2.setPixelColor(p2State, strip2.Color(0,128,0));
   int lastLed = p2State -1;
   if (lastLed < 0) { // wrap round count
      lastLed = NUMPIXELS2 -1;
   }
   strip2.setPixelColor(lastLed, strip2.Color(0,0,0)); // turn off last LED
   p2State ++; // move on state variable for the next time we enter this
   if(p2State >= NUMPIXELS2){ // wrap round the state
    p2State = 0;
   }
   strip2.show(); // update display
   lastUpdateP2 = millis(); // time for next update
}

void wipe1(byte r,byte g, byte b){
     for(int i=0;i<NUMPIXELS1;i++){
       strip1.setPixelColor(i, strip1.Color(r,g,b)); 
       }
}

void wipe2(byte r,byte g, byte b){
     for(int i=0;i<NUMPIXELS2;i++){
       strip2.setPixelColor(i, strip2.Color(r,g,b)); 
       }
}

For the Fast Led library I came up with this:-

// using a state machine to drive two patterns on two strings at the same time
// By Mike Cook Jan 2019
// see https://github.com/FastLED/FastLED/wiki/Multiple-Controller-Examples for full discussion

#include "FastLED.h"

#define PIN_FOR_1   6 // pin connected to NeoPixels strip 1
#define PIN_FOR_2   7 // pin connected to NeoPixels strip 2
#define NUM_LEDS1 5   // number of LEDs in strip 1
#define NUM_LEDS2 6   // number of LEDs in strip 1
#define NUM_STRIPS  2 // how many strips you have

CRGB strip1[NUM_LEDS1];
CRGB strip2[NUM_LEDS2];

CLEDController *controllers[NUM_STRIPS];

// how often each pattern updates
unsigned long pattern1Interval  = 400;
unsigned long pattern2Interval  = 900;
// for millis() when last update occurred
unsigned long lastUpdateP1 = 0;
unsigned long lastUpdateP2 = 0;  
// state variables for patterns
int p1State = 0 ; 
int p2State = 0 ;
uint8_t gBrightness = 255;

void setup() {
   controllers[0] = &FastLED.addLeds<WS2812,PIN_FOR_1>(strip1, NUM_LEDS1);
   controllers[1] = &FastLED.addLeds<WS2812,PIN_FOR_2>(strip2, NUM_LEDS2);
   // wipes the LED buffers
    wipe1(0,0,0); 
    wipe2(0,0,0);
}

void loop(){
if(millis() - lastUpdateP1 > pattern1Interval) updatePattern1();
if(millis() - lastUpdateP2 > pattern2Interval) updatePattern2();
}

// Note both patterns are essentially the same sort of display for simplicity - change to suite
void updatePattern1(){ // pattern 1 a walking red led
   strip2[p1State].setRGB(128,0,0); // turn on next led in pattern
   int lastLed = p1State -1;        // find LED to turn off
   if (lastLed < 0) {               // wrap round count
      lastLed = NUM_LEDS1 -1;
   }
   strip1[lastLed] = 0x00;     // turn off last LED we set
   p1State ++;                 // move on state variable for the next time we enter this
   if(p1State >= NUM_LEDS1){   // wrap round the state
    p1State = 0;
   }
   controllers[0]->showLeds(gBrightness); // update display
   lastUpdateP1 = millis();               // to calculate next update
}

void updatePattern2(){ // pattern 2 a walking green LED
   strip2[p2State].setRGB(0,128,0); // turn on next led in pattern  
   int lastLed = p2State -1;        // find LED to turn off
   if (lastLed < 0) {               // wrap round count if needed
      lastLed = NUM_LEDS2 -1;
   }
   strip2[lastLed] = 0x00;    // turn off last LED we set
   p2State ++;                // move on state variable for the next time we enter this
   if(p2State >= NUM_LEDS2){  // wrap round the state
    p2State = 0;
   }
   controllers[1]->showLeds(gBrightness);  // update display
   lastUpdateP2 = millis();                // to calculate next update
}

void wipe1(byte r,byte g, byte b){
     for(int i=0;i<NUM_LEDS1;i++){
       strip1[i].setRGB(r,g,b);
       }
}

void wipe2(byte r,byte g, byte b){
     for(int i=0;i<NUM_LEDS2;i++){
       strip2[i].setRGB(r,g,b);
       }
}

For this last example look up the documentation at Multiple Controller Examples for other ways to do this.

Grumpy_Mike:
Not too sure what the first bit of the post means, full of words I have never come across. Also you text reads like a military telegram to me.

Thank you for your reply. Those terms are each examples of mainstream PC-based motherboard(ASUS) and cooling systems (water cooled CPU cooler, etc).

If you google the names, you'll get a very good idea what we want to accomplish, along with "how great they are," and many youtube videos to see examples and such.

But they have severe limitations, which I've listed some.

Military telegram? That obvious, eh? LOL. Trying to be direct and clear. It's my first post here, though I've been here lots in the past.

Thank you for the examples. It's been a couple of years since I last worked with Arduino and I'm missing a lot of memories and such. Too much chemo. But often as I get familiar with stuff again, I can get a flood of them back at a time.

Or I could just as easily repeat the same work I've done, including mistakes, or work around in circles and get stuck.

So if things sound off once in a while, or I don't follow along when you post, be patient. I'll get there.

I've found some possible PC side programs: VixenLights, xLights, LOR. "Christmas Lights Arduino" was a golden search term :wink:

Here's a link to someone's opinions about them: https://youtu.be/TPonz21Wzfk

The sort of look like I could use that end. Now to the sketch.

I appreciate the examples you posted. I'll have to see if I can modify those to interface with one of the progs above.

If you feel like checking out those programs, I am leaning towards VL but really only due to opinions about usability at the moment, and if you have any suggestions or mods to your code to simplify interfacing, I'd be most appreciative.

I believe this is going to also end up as a Christmas Lights project as well. My long-retired engineering buddy, who is as forgetful as I am, is interested in that end, too.

Arduino is a hobby we'd like to be doing more of and be better at. Sure wish we had someone local to meet for coffee and help out once in a while :slight_smile:

Thank you for anything you can help with.

So if things sound off once in a while, or I don't follow along when you post, be patient. I'll get there.

No problem.

Those terms are each examples of mainstream PC-based motherboard(ASUS) and cooling systems (water cooled CPU cooler, etc)

Thanks, my guess was that they were some sorts of gaming things.

I've found some possible PC side programs: VixenLights, xLights, LOR.

So is the Arduino going to end up as a DMX light device controlled by these programs?
If so then you will have to put a DMX wrapper ( some code that handles the communications ) round the effects?

I don't know the ins and outs of such a thing but you will need to know what sort of data these controllers send. It might just be that it some sort of standard "turn this LED on to this brightness" type command or a more high level "do pattern number x" sort of command. But you might try searching for "Arduino DMX lights controller".

Sure wish we had someone local to meet for coffee and help out once in a while

Well this forum is a sort of virtual coffee shop, which is handy as I don't drink coffee ( or tea ), but water, beer and sprites, in that order.
Take care.

Grumpy_Mike:
Well this forum is a sort of virtual coffee shop, which is handy as I don't drink coffee ( or tea ), but water, beer and sprites, in that order.

Watch out for those sprites, they can be really tricky! :grinning:

I do not drink coffee or tea either. Nor beer or sprites. Really boring! :roll_eyes:

I am fortunate to live in a town (and state) where we actually have potable water, something I fear we will not always have with the current political mismanagement though Covid-19 has actually (temporarily I fear) improved that. :cold_sweat:

No coffee drinkers? I couldn't have coffee or caffeine for almost a year. I was barely hanging on, but I wonder if coffee and occasional beer would have helped instead. LOL

It's nice to have a virtual group to bounce ideas and share tips.

I sure appreciate the input so far. DMX lights controller? Not sure what DMX is, but I'll check out that search term, maybe find some more stuff.

Here's a VixenLights to arduino video. Bit long, but it seems it connects via "generic serial" and somehow works with multiple 'channels' (hoping these are devices, strips, etc).

Using Vixen to Control an Arduino Light or Animatronic Show

It seems that even using that setup that the Arduino would have to have some sketch on it for the communications, defining channels, compatible procedures/functions, etc.

I do have experience in several programming languages and have written some intense stuff in years gone by, but that is all a jumble some days. So I should be okay and can understand and work with code.

I guess the main thing with this project is I don't want to get bogged down worrying about writing a gui, a comms protocol, designing individual types of effects, and all in a proprietary way.

I'll buy a reasonable piece of software for the computer side. But replacing a motherboard to get more addressable headers isn't likely to happen. Why do we use arduino? So we don't have to compromise or settle for limited options :wink:

Have you guys used the browser based IDE yet? I was looking for the latest stuff to setup a new environment in a vm on her new computer and read about it. I generally don't like cloud stuff, as it often hiccups, slowdowns, version issues, etc. Just looking for some opinions, else I'll stick with the default arduino ide

Thanks. Cheers

Paul__B:
Watch out for those sprites, they can be really tricky! :grinning:

Yep, don't poke when you should peek. LOL.

:wink: yes indeed, as are the sprits. For dyslexics spell checkers don’t work with homophones.

Have you guys used the browser based IDE yet?

Not me, I like everything on my machine.

diskdoctor:
No coffee drinkers?
...

Have you guys used the browser based IDE yet? I was looking for the latest stuff to setup a new environment in a vm on her new computer and read about it. I generally don't like cloud stuff, as it often hiccups, slowdowns, version issues, etc. Just looking for some opinions, else I'll stick with the default arduino ide

I've never drunk coffee. It can be done. (But don't try to take away my Pepsi).

I tried the browser-based IDE, but none of my favorite boards are supported. So I only use the installed IDE.