VideoLiam
Published © CC BY

Christmas Lash-up, Colour-Changing Bauble

This is just a quick bit of fun, grabbing a few parts that most hackers will have to hand and putting a bit of Christmas magic into a hack.

IntermediateShowcase (no instructions)4 hours38
Christmas Lash-up, Colour-Changing Bauble

Things used in this project

Hardware components

NeoPixel Ring: WS2812 5050 RGB LED
Adafruit NeoPixel Ring: WS2812 5050 RGB LED
Any 16 Pixel ring will do. I used a cheep copy I had to hand but anything with a 45mm diamter will be fine
×1
Photon
Particle Photon
Any functioning Particle G2 board will do, why not dig out and unloved core, dust it down and set it to work.
×1
Enamelled Copper Wire
You can use as discrete, wire as you like. I had some enamelled wire to hand and it makes its easy to hide the wires in the branch of the tree
×1
Large Photo Baubles
×1

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)
I've used a Formlabs Form1, but any 3D printer will do

Story

Read more

Custom parts and enclosures

STL file for the support ring

This is a support ring to keep the Neo Pixel ring centered in the plastic bauble.
Ballball2 oybtxdgxvf

STL file for the support ring

This was designed using Design Spark Mechanical, but you can edit it for your own needs

Schematics

Neo Ring

16 pixel Neo Rings are jolly handy. They don't need a resistor in line with the data pin, and if you keep the brightness setting down (below 250) will not need an additional power supply. They are jolly bright so that shouldn't be an issue
Neoring bb xgai6mhw3u

Code

Bauble Code

Arduino
This is a simple code to drive the Neo pixels, in the Bauble. It uses the particle time function to alter the colour of the bauble baised on the time of day. By using the hours, minutes and seconds it present a constantly changing color.
// Code for Christmass baubles. Takes the time of day from the particle cloud and maps the colour
// channels R, G & B with hours, minutes and seconds. This means the baubles is always showing a 
// slightly different color, with a significant change at the top of the hour.

#include "Particle.h"
#include "neopixel.h"

SYSTEM_MODE(AUTOMATIC);

// IMPORTANT: Set pixel COUNT, PIN and TYPE
#define PIXEL_PIN D4
#define PIXEL_COUNT 16
#define PIXEL_TYPE  WS2812B//SK6812RGBW // WS2811 // WS2812B

Adafruit_NeoPixel strip(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);

int Day = Time.day();

void setup() {
strip.begin();
strip.setBrightness(64); // To avoid using and external power supply keep this value below 250
strip.show(); // Initialize all pixels to 'off'

Time.zone(); // Use this value to set your local time zone. If you want
}


void loop() {
    clearall();
    display();
    strip.show();

    // Re-syncs the clock once each day
    if(Day!=Time.day()){
        Particle.syncTime();
        Day=Time.day();
    }
    //Serial.println("Hours = " + String(Hours) + " Minutes = " + String(Mins) + " Secs:- " + String(Secs));
    delay(1000);

}

void clearall(){
    int pixel = 0;
    while (pixel <= PIXEL_COUNT){
        strip.setPixelColor(pixel, 0, 0, 0); // Use this line when using WS2811 or WS2812B type Pixels
        //strip.setPixelColor(pixel, 0, 0, 0 ,0); // Use this line when using SK6812RGBW type Pixels
        pixel = pixel+1;
    }
}

void display(){
    int pixel = 0;
    int Red = map(Time.second(), 0, 59, 0, 255);
    int Blue = map(Time.minute(), 0, 59, 0, 255);
    int Green = map(Time.hourFormat12(), 1, 12, 0, 255);
   
    while (pixel <= PIXEL_COUNT){
        strip.setPixelColor(pixel, Red, Green, Blue);// Use this line when using WS2811 or WS2812B type Pixels
        //strip.setPixelColor(pixel, Red, Green, Blue, 0);// Use this line when using SK6812RGBW type Pixels
        pixel = pixel+1;
    }
}

Credits

VideoLiam

VideoLiam

1 project • 0 followers
I'm a Mechanical Engineer working the the Film and TV industry. Been experimenting with IOT for a few years.

Comments

Add projectSign up / Login