Julien Darrah
Published © GPL3+

Easy Install NeoPixel Christmas Light System

Proposed solution for an easy installation system for outdoor Christmas lights.

IntermediateFull instructions provided20 hours1,495
Easy Install NeoPixel Christmas Light System

Story

Read more

Custom parts and enclosures

Gutter Hook

Shingle Roof Hook

ESP32 + DCDC Enclosure with 1/2in Female Thread

DCDC Carrier

Schematics

Basic ESP32 Circuit

String Connections

Code

Basic Test Code

Arduino
Load the NeoPixel LED strip with a static color pattern
// NeoPixelTest
// This example will cycle between showing four pixels as Red, Green, Blue, White
// and then showing those pixels as Black.
//
// Included but commented out are examples of configuring a NeoPixelBus for
// different color order including an extra white channel, different data speeds, and
// for Esp8266 different methods to send the data.
// NOTE: You will need to make sure to pick the one for your platform 
//
//
// There is serial output of the current state so you can confirm and follow along
//
#include <Arduino.h>
#include <NeoPixelBus.h>

const uint16_t PixelCount = 304; // this example assumes 4 pixels, making it smaller will cause a failure
const uint8_t PixelPin = 2;  // make sure to set this to the correct pin, ignored for Esp8266

#define colorSaturation 128

// three element pixels, in different order and speeds
NeoPixelBus<NeoGrbFeature, Neo800KbpsMethod> strip(PixelCount, PixelPin);
//NeoPixelBus<NeoRgbFeature, Neo400KbpsMethod> strip(PixelCount, PixelPin);

// For Esp8266, the Pin is omitted and it uses GPIO3 due to DMA hardware use.  
// There are other Esp8266 alternative methods that provide more pin options, but also have
// other side effects.
//NeoPixelBus<NeoGrbFeature, Neo800KbpsMethod> strip(PixelCount);
//
// NeoEsp8266Uart800KbpsMethod uses GPI02 instead

// You can also use one of these for Esp8266, 
// each having their own restrictions
//
// These two are the same as above as the DMA method is the default
// NOTE: These will ignore the PIN and use GPI03 pin
//NeoPixelBus<NeoGrbFeature, NeoEsp8266Dma800KbpsMethod> strip(PixelCount, PixelPin);
//NeoPixelBus<NeoRgbFeature, NeoEsp8266Dma400KbpsMethod> strip(PixelCount, PixelPin);

// Uart method is good for the Esp-01 or other pin restricted modules
// NOTE: These will ignore the PIN and use GPI02 pin
//NeoPixelBus<NeoGrbFeature, NeoEsp8266Uart800KbpsMethod> strip(PixelCount, PixelPin);
//NeoPixelBus<NeoRgbFeature, NeoEsp8266Uart400KbpsMethod> strip(PixelCount, PixelPin);

// The bitbang method is really only good if you are not using WiFi features of the ESP
// It works with all but pin 16
//NeoPixelBus<NeoGrbFeature, NeoEsp8266BitBang800KbpsMethod> strip(PixelCount, PixelPin);
//NeoPixelBus<NeoRgbFeature, NeoEsp8266BitBang400KbpsMethod> strip(PixelCount, PixelPin);

// four element pixels, RGBW
//NeoPixelBus<NeoRgbwFeature, Neo800KbpsMethod> strip(PixelCount, PixelPin);

RgbColor red(colorSaturation, 0, 0);
RgbColor green(0, colorSaturation, 0);
RgbColor blue(0, 0, colorSaturation);
RgbColor white(colorSaturation);
RgbColor black(0);

HslColor hslRed(red);
HslColor hslGreen(green);
HslColor hslBlue(blue);
HslColor hslWhite(white);
HslColor hslBlack(black);

// Counter
u_int i;


void setup()
{
    Serial.begin(115200);
    while (!Serial); // wait for serial attach

    Serial.println();
    Serial.println("Initializing...");
    Serial.flush();

    // this resets all the neopixels to an off state
    strip.Begin();
    strip.Show();

        // put your main code here, to run repeatedly:
    for( i = 0; i < 304; )
    {
        strip.SetPixelColor((i), RgbColor(255,0,0));
        i++;
        strip.SetPixelColor((i), RgbColor(255,0,0));
        i++;
        strip.SetPixelColor((i), RgbColor(0,255,0));
        i++;
        strip.SetPixelColor((i), RgbColor(0,255,0));
        i++;
        strip.SetPixelColor((i), RgbColor(255,140,0));
        i++;
        strip.SetPixelColor((i), RgbColor(255,140,0));
        i++;
        strip.SetPixelColor((i), RgbColor(0,0,255));
        i++;
        strip.SetPixelColor((i), RgbColor(0,0,255));
        i++;
        
    }

    strip.Show();



    Serial.println();
    Serial.println("Running...");
}

void loop() {

}

Credits

Julien Darrah

Julien Darrah

3 projects • 7 followers

Comments