Custom LED center pieces

So, I'm currently planning a project where I'm going to be making Center pieces for events that will have wireless controls.

The easiest way to explain it is that I'm going to mimic this project: https://www.instructables.com/id/WiFi-Controlled-LED-Wedding-Table-Pieces/

From what I've seen some people have had issues recreating that project due to changing libraries. I have a few issues.

What I hope to achieve.

My event is large (50 lights)
I'd like a user friendly interface for turning lights on and off
wireless - not sure if wifi is good as some venues are large spaces

I was considering having external antennas on all devices vs the on pcb trace antenna

I was initially thinking for the user interface to use an arduino with the 7" touch screen that adafruit has where i could see room layout and the lights and be able to have preset options to touch.

functions for user interface

  • live auction (click a table to show current active bid - light then acts accordingly)
  • rainbow, the lights cycle in-sync around the room in a rainbow pattern
  • theater chase
  • color change (fade from color to color - with speed setting)
  • 7 preset colors (color wheel for manual control)
  • brightness setting

Originally I was looking at the neopixels (sk6812 RGBWW) I know the one issue with neopixels and wireless control can be the interrupts that are needed to run neopixels can interfere with wireless control libraries.

I've already tried using nrf24l01 - I was using one to send data and 6 to receive all on the same channel, it tends to be very glitchy and has noticeable delay. (although i was thinking of testing having them daisy chained. (one receives then sends on another channel to the next)

currently for controllers I'm looking at the wemos D1 pro, and the adafruit feather (RFM69HCW), or pro mini / nano with some sort of wireless receiver

The other option I was thinking was to use mosfets / pca9685. and my own circuit board were I can have 505 RGB leds and add both warm white and cool white leds. (I do have my own soldering oven for PCB's so its not an issue to go custom for me.

I wanted to gauge what other people's thoughts were in terms of the best control method with what I've laid out. My coding skills are OK but this will definitely be a large scale project for me, especially the wireless part as I've only done point to point before. Plus my deadline for this project is mid April 2020

Thanks for the time, wisdom and guidance.

So I spend a good 20 hours the past few days with the NRF24 modules I have.

with the auto ack turned off I'm able to communicate with the modules quite well. (i send the data 3 times which has gotten rid of any accidental data missing) I have the radio set to send out the 32 bit color code which is then written straight to the neopixel. the sender handles the color, what pixel, and animations. which makes coding easier as if something isn't working it is an issue with the sender.

Too some time to program multiple modes, and animations as I find the combination of all that and a push button was having interference. not sure why but I did get it to work.

now that it works so far I'm going to move forward with buying more neopixels and arduinos and the nrf24 pa lna to ensure that I have more than enough range for any situation I could be in. the fun part will be coding the functions on a touch screen.

thanks for those who took the time to read my previous post. I just wanted follow up in case someone comes across this years later with similar issue. once the project is done I'll likely end up make an instructables about it.

Above my pay-grade but looks cool - glad you are making progress - good luck & maybe post a progress when you are done

saildude:
Above my pay-grade but looks cool - glad you are making progress - good luck & maybe post a progress when you are done

Thanks for the best wishes. and I'll try to post progress when i can. it will likely take a few months before I get more work some. (gotta save money and wait for ebay shipping)

ran a test using sanyo ga cells (3400mah) wired for 7.4v run time with 15 pixels, using an animated sequence (which will use the radio alot) (was using 340 mah) this condition gave a 10 hour run time.

The issue i had with the run test however was that the cheap 2 cell BMS i was using won't kick in for low voltage. (worked on short circuit though) tried using a TP5100 for charging, but my 13.6v power supply blew the chip out (ordered more to test on lower power supply)

One option I'm thinking of is to have a voltage divider and have the arduino go low power if the voltage is low. I have purchased a different BMS to see if the ones i had were duds.

For the controller I settled on using the 7 inch touch screen from adafruit. arduino mega will read the various potentiometers taht will control functions. I choose the touch screen as I wnat to be able to make a user friend interface for when I rent the system out for events.

inside the controller you have the display, display driver, and touch screen driver, 10 potentiometers, MSGEQ7 audio chip, pro mini to send the data out via nRF24L01+PA+INA. There's also an INA219 sensor to monitor and display the battery state, metal on off switch, and internally there is a mini switch which will be for isolating the arduino mega (allow for programming while assembled.

If anyone knows anything that could be helpful with making the battery packs or an electrical forum where that question might be more relevant thanks. Ill post pieces here and there as the project goes on and a like to the instructable when I make it.

parts for display:

So, i've finished paint the controller, and did a 2k clear coat on it that turned out nice. with it being painted i was able to do the wiring, 8 hours later it was done. and then too many hours to count I've build the GIU and have started to make it wireless.

The main control is the arduino mega. which handles the SPI control with the RA8875 TFT 7" screen, i did this because there's an issue with the chip that requires you to use an extra tri state chip in order to add other items to the SPI when using the TFT display. BUt I've seen posts about people using the TFT and NRF24 even with the tri state chip.

To combat this issue I added a pro mini 3.3v to communicate with the NRF24. I'm using the easy transfer library to make it easier to send the variables that I need to for the lights. as I'm using a structure array to send the values to the wireless lights. The pro mini and NRF24 +pa+lna are powered with a 3.3v regulator that can meet their energy requirements.

The issue I'm having is that I can make the pro mini send the data to the lights but the moment I add Serial.Begin(9600) (I've tried different baud rates as well). the code stops working. Although I used the serial as a debugger as well. the code is running and printing out on serial but there is no outgoing radio communication happening. The serial port has DIP switches wire between the pro mini and serial1 on the mega to allow for me to program the pro mini without any issues.

I've been able to recreate this problem on the pro mini + NRF24 pa ina, Pro mini + NRF24, and Nano + NRF24
all combinations have the same effect. I've also tried switching to the I2C easy transfer library with the same issue.

Any thoughts on how I could make this work are greatly appreciated.

Code of the lights (receivers) // this works fine no issues

#include "nRF24L01.h" // NRF24L01 library created by TMRh20 https://github.com/TMRh20/RF24
#include "RF24.h"
#include "SPI.h"
#include <Adafruit_NeoPixel.h>

#define NUM_LEDS 1 // Number of leds on stick
#define PIN 3 // Digital In (DI) of RGB Stick connected to pin 8 of the UNO

Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRBW + NEO_KHZ800);

RF24 radio(9,10); // NRF24L01 used SPI pins + Pin 9 and 10 on the UNO
const byte pipe  = "000001"; // Needs to be the same for communicating between 2 NRF24L01 

struct Data_Package {
  byte MODE_num;
  byte LED_num;
  uint32_t color;
  uint8_t music1;
  uint8_t music2;
  uint8_t music3;
  uint8_t music4;
  uint8_t music5;
};

Data_Package data;

int n;
uint32_t color_recieved = 0;


/////////////////////////////////////////////////////
//
// these variable need to be changed for each module
//
/////////////////////////////////////////////////////

#define module_num 5 // (between 1 - 50) // sets color channel
//#define music_num 4  // (between 1 - 5)  // sets music channel
 // set the music color
uint32_t music_color = strip.Color(0,0,data.music5,0);





void setup(void){
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'

radio.begin(); // Start the NRF24L01

radio.openReadingPipe(1,pipe); // Get NRF24L01 ready to receive
radio.setAutoAck(1,false);
radio.startListening(); // Listen to see if information received

  data.LED_num = 0;
  data.color = 0;

   strip.setPixelColor(0,0,0,0,50);
   strip.show();
   delay(500);
//   strip.setPixelColor(0,0,0,0,50);
//   strip.show();

}

void loop(void){

 while (radio.available()){
  radio.read(&data, sizeof(Data_Package)); // Read information from the NRF24L01

if (data.MODE_num == 0){
if (data.LED_num == module_num){
color_recieved = data.color;
}}
    
if (data.MODE_num == 1){ // activate music mode
  // uint32_t music_color = strip.Color(0,0,0,0);
    color_recieved = music_color;
} // end of music mode
 }

    strip.setPixelColor(0,color_recieved);
    strip.show();
 

} // end loop

//Pro mini sending Code
(currently set to send the color code itself so no communication from mega at this point)
leaving serial or I2C commented means the lights go green, red, blue no issues.
adding serial and the number println, it will show the numbers on the serial monitor but no action from the lights.

#include "nRF24L01.h" //NRF24L01 library created by TMRh20 https://github.com/TMRh20/RF24
#include "RF24.h"
#include "SPI.h"
#include <EasyTransferI2C.h>
#include <Adafruit_NeoPixel.h>

EasyTransferI2C ET;
#define I2C_SLAVE_ADDRESS 9

#define num_modules 5

Adafruit_NeoPixel strip = Adafruit_NeoPixel(num_modules, 5, NEO_GRBW + NEO_KHZ800);

int i = 0;
int v = 0;

RF24 radio(9,10); // NRF24L01 used SPI pins + Pin 9 and 10 on the NANO
const byte pipe  = "000001"; // Needs to be the same for communicating between 2 NRF24L01 

/////// data to be changed for sending and receiving

unsigned long patternInterval1 = 50 ; // time between steps in the pattern
unsigned long patternInterval2 = 75 ; // time between steps in the pattern
unsigned long lastUpdate = 0 ; // for millis() when last update occoured


struct Data_Package {
  byte MODE_num;
  byte LED_num;
  uint32_t color;
  uint8_t music1;
  uint8_t music2;
  uint8_t music3;
  uint8_t music4;
  uint8_t music5;
};

Data_Package data;

struct Data_income {
  uint32_t color1;           // color 1
  uint32_t dualcolor1;       // dual color 1
  uint32_t dualcolor2;       // dual color 2
  uint8_t patternspeed;      // animation speed
  uint8_t patternbrightness; // animation brightness
  uint8_t music1;    // music values
  uint8_t music2;    // music values
  uint8_t music3;    // music values
  uint8_t music4;    // music values
  uint8_t music5;    // music values
  uint8_t auction;   // what table number sellected for auction
  uint8_t animation; // what animation mode is selected
  uint8_t button;    // what mode is the controller in
};

Data_income income;


  
void setup() {
// put your setup code here, to run once:
//Serial.begin(9600);
//  ET.begin(details(income), &Serial);
//Wire.begin(I2C_SLAVE_ADDRESS);
//ET.begin(details(income), &Wire);
//Wire.onReceive(receive);

  strip.begin();
  strip.show(); // Initialize all pixels to 'off'

  radio.begin(); // Start the NRF24L01
  radio.openWritingPipe(pipe); // Get NRF24L01 ready to transmit
  radio.setAutoAck(false);

  data.MODE_num = 0;
  data.LED_num = 0;
  data.color = 0;


}

void loop() {
  // put your main code here, to run repeatedly:
//ET.receiveData(); // incoming data


colorSET(strip.Color(0,255,0,0));
delay(200);
//Serial.println("1");
colorSET(strip.Color(255,0,0,0));
delay(200);
//Serial.println("2");
colorSET(strip.Color(0,0,255,0));
delay(200);
//Serial.println("3");


}

void receive(int numBytes) {}

void updating(){
  radio.write(&data, sizeof(Data_Package));
  radio.write(&data, sizeof(Data_Package));
  radio.write(&data, sizeof(Data_Package));
}

void auctionSET(uint8_t c) {
    for(uint16_t i=1; i<num_modules; i++) {
     if (i == c){
      data.LED_num = c;
      data.color = (strip.Color(0,0,0,255));
     }else{
    data.LED_num = i;
    data.color = (strip.Color(150,0,0,0));
  } updating();
  }}
    
 
void colorSET(uint32_t c) {
  for(uint16_t i=1; i<num_modules; i++) {
    data.LED_num = i;
    data.color = c;
    updating();
  }}

void dualSET1(uint32_t c) {
  for(uint16_t v=2; v<num_modules; v=v+2) {
    data.LED_num = v;
    data.color = c;
    updating();
  }}

void dualSET2(uint32_t c) {
  for(uint16_t i=1; i<num_modules; i=i+2) {
    data.LED_num = i;
    data.color = c;
    updating();
  }}

void rainbow() { // modified from Adafruit example to make it a state machine
  static uint16_t j=0;
    for(int i=1; i<num_modules; i++) {
     uint32_t selected = (Wheel((i+j) & 255));
     data.color = selected;
     data.LED_num = i;
     updating();
    }
     j++;
  if(j >= 256) j=0;
  lastUpdate = millis(); // time for next change to the display
 
}
void rainbowCycle() { // modified from Adafruit example to make it a state machine
  static uint16_t j=0;
    for(int i=1; i<num_modules; i++) {
      uint32_t selected = (Wheel(((i * 256 / num_modules) + j) & 255));
      data.color = selected;
      data.LED_num = i;
      updating();
    }
  j++;
  if(j >= 256*5) j=0;
  lastUpdate = millis(); // time for next change to the display
}


uint32_t Wheel(byte WheelPos) {
  WheelPos = 255 - WheelPos;
  if(WheelPos < 85) {
    return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3,0);
  }
  if(WheelPos < 170) {
    WheelPos -= 85;
    return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3,0);
  }
  WheelPos -= 170;
  return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0,0);
}