The holiday season is the perfect time to blend tradition with creativity, and we’ve done just that with our Smart Christmas Star! Inspired by the iconic Christmas Star, we’ve taken this symbol of hope and turned it into a DIY project that combines timeless beauty with cutting-edge tech.
Powered by the Particle Photon 2, this star is packed with vibrant LEDs, Wi-Fi connectivity, and customizable features. You can control its lights, patterns, and effects through a smartphone app or the Particle Cloud. Whether it’s glowing warmly or dancing to holiday music, this project is fun to build and guaranteed to impress.
Want to light up your holidays in a whole new way? Let’s dive into the features and get building!
Lighting modes of the smart Christmas star
Dynamic lighting modes
We loaded the star with 55 pre-set patterns and holiday chimes to fit any festive vibe. From classic to playful, this mode makes your decorations pop.
Interactive messaging mode
Why not turn your star into a messenger? Using the app, friends and family can send holiday greetings that the star converts into blinking Morse code-inspired light shows. It’s fun, interactive, and seriously cool.
Music synchronization mode
This feature syncs the star’s lights with your favorite holiday tunes using a built-in microphone. It’s like a mini light show, perfect for parties or just setting the mood.
Motion glow mode
Add a touch of magic—this mode lights up whenever someone walks into the room. It’s adjustable, customizable, and a total crowd-pleaser (especially for kids).
Weather reactive mode
Tie your decorations to the real world! The star adapts its colors to current weather—cool cyan for snow, golden for sunny days, or whatever custom settings you choose.
We had a blast building this, and you can too! With just a little time and creativity, you’ll have a show-stopping decoration that’s sure to be the highlight of your holidays. Let’s make something awesome!
Hardware
Particle Photon 2
The Particle Photon 2 is the heart of this project. With built-in Wi-Fi, it enables remote control and updates, making it perfect for IoT projects.
WS2812B RGB LED Strip
This individually addressable LED strip lights up the star with vibrant, customizable colors and effects. It integrates seamlessly with the Photon 2 for dynamic animations.
DFPlayer Mini
The DFPlayer Mini adds audio playback, supporting MP3/WAV formats via a microSD card. It connects through a serial port, making it easy to control music in the star’s audio-reactive mode.
Speaker
A 0.4W, 8-ohm speaker delivers crisp audio for Christmas tunes, offering excellent sound quality while remaining compact and efficient.
Power Supply
A 5V 5A power supply ensures sufficient power for all components, especially the LED strip, even during full brightness.
PIR Motion Sensor
The MH-SR602 mini motion sensor detects nearby movement, enabling interactive features like motion-triggered lighting effects.
Sound Sensor
The Seeed Grove sound sensor detects sound intensity, allowing the star to react dynamically to music and ambient sounds.
Design
The star’s sharp, angular design was created in Fusion 360 with dimensions of 35 cm by 29 cm. Electronics are housed externally, leaving the interior clean for LED placement.
3D Printing
The star was 3D-printed in three sections for easy assembly within typical printer dimensions.
Diffusion Channel
A 2mm white acrylic sheet evenly diffuses LED light for a soft, appealing glow. The design was laser-cut using Fusion 360 files.
Controller Box
A separate 3D-printed case houses the electronics, keeping the setup neat and accessible.
Assembly
- Frame Assembly: Glue the star parts together to form the frame
- LED Placement: Cut the WS2812B LED strip into sections to fit the star, ensuring the data flow direction is consistent.
- Wiring: Route the LED wires out of the star and into the external controller box. Use a DC female jack for power input.
- Electronics: Mount the Photon 2 and DFPlayer Mini on a perf board for a secure setup.
- Diffuser Placement: Attach the white acrylic diffuser for smooth light distribution.
- Final Connections: Wire the LED strip, motion sensor, sound sensor, and speaker to complete the system.
Coding the star
The Full github repo of the star can be found here.
Step 1: Include Necessary Libraries
Add the required libraries for LED control and audio playback:
#include "WS2812FX.h"
#include <neopixel.h>
#include <DFRobotDFPlayerMini.h>
WS2812FX.h
: For controlling the WS2812B LED strip.neopixel.h
: For NeoPixel interfacing.DFRobotDFPlayerMini.h
: For managing audio playback.
Set the system mode to AUTOMATIC
for seamless Particle Cloud connectivity:
SYSTEM_MODE(AUTOMATIC);
Step 2: Define Pins and Components
Specify hardware configurations:
#define PIXEL_PIN SPI1
#define PIXEL_COUNT 75
#define PIXEL_TYPE WS2812B
#define PIR_PIN A2
#define MIC_PIN A1
- PIXEL_PIN: Pin connected to the LED strip.
- PIXEL_COUNT: Total number of LEDs in the strip.
- PIXEL_TYPE: WS2812B LED type.
- PIR_PIN: Pin for the motion sensor.
- MIC_PIN: Pin for the sound sensor.
Initialize LED effects and audio playback:
WS2812FX ws2812fx = WS2812FX(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);
DFRobotDFPlayerMini myDFPlayer;
Step 3: Add Interactive Mode Flags
Use flags to switch between different interactive modes:
bool demo_mode = true;
bool weatherResponsive = false;
bool musicResponsive = false;
bool motionResponsive = false;
Step 4: Control LED Effects
Create functions to set speed, brightness, and colors for the LED effects.
- Set Speed:
int setSpeed(String speed_str) {
uint16_t speed = atoi(speed_str);
if (speed < 0 || speed > 65535) return -1;
ws2812fx.setSpeed(speed);
return 0;
}
- Set Brightness:
int setBrightness(String brightness_str) {
uint16_t brightness = atoi(brightness_str);
if (brightness < 0 || brightness > 255) return -1;
ws2812fx.setBrightness(brightness);
return 0;
}
- Set Color:
#define RED 0xFF0000
#define GREEN 0x00FF00
int setColor(String color_str) {
if (color_str == "red") ws2812fx.setColor(RED);
else if (color_str == "green") ws2812fx.setColor(GREEN);
else return -1;
return 0;
}
Step 5: Add Interactive Features
- Motion-Reactive Mode: Adjust brightness based on motion detected by the PIR sensor.
int motionReactive(String msg) {
motionResponsive = true;
return 0;
}
void handleMotion() {
int pirState = analogRead(PIR_PIN);
if (pirState > 1000) ws2812fx.setBrightness(255);
else ws2812fx.setBrightness(0);
}
- Sound-Reactive Mode: Dynamically change brightness based on sound intensity.
void handleSoundReactiveMode() {
uint16_t audioSample = abs(analogRead(MIC_PIN));
uint8_t newBrightness = map(audioSample, THRESHOLD, 1023, MIN_BRIGHTNESS, MAX_BRIGHTNESS);
ws2812fx.setBrightness(newBrightness);
ws2812fx.service();
}
- Weather-Reactive Mode: Change LED colors based on weather data from OpenWeatherMap.
void weatherResponseHandler(const char *event, const char *data) {
if (String(data) == "Clouds") ws2812fx.setColor(0x00FFFF); // Cyan for clouds
else ws2812fx.setColor(0xFFFFFF); // White for clear skies
ws2812fx.service();
}
Step 6: Register Functions in setup()
Initialize components and register Particle functions for remote control:
void setup() {
Serial.begin(115200);
ws2812fx.init();
ws2812fx.setBrightness(255);
ws2812fx.start();
Particle.function("setSpeed", setSpeed);
Particle.function("setBright", setBrightness);
Particle.function("setColor", setColor);
Particle.function("motionReactive", motionReactive);
Particle.subscribe("hook-response/getWeather", weatherResponseHandler, MY_DEVICES);
}
Step 7: Add Main Logic in loop()
Implement the behavior for each mode:
void loop() {
if (motionResponsive) {
handleMotion();
} else if (musicResponsive) {
handleSoundReactiveMode();
} else if (weatherResponsive) {
String data = "{ \"lat\": \"40.7128\", \"lon\": \"-74.0060\" }";
Particle.publish("getWeather", data, PRIVATE);
}
ws2812fx.service();
}
This code allows your Smart Christmas Star to switch dynamically between interactive modes.
Integrating weather data
Using the OpenWeatherMap API, you can create weather-reactive effects for the star:
- Sign Up: Get an API key at OpenWeather.
- Create a Webhook: In the Particle Console, set up a webhook to fetch weather data.
- Configure Parameters: Use the API key to retrieve real-time weather details and pass them to the Photon 2 for lighting effects.
Web interface
We designed a user-friendly web interface to interact with the star:
- Login and MFA: Secure access using Particle’s OAuth 2.0 and multi-factor authentication.
- Device Control: Select devices and manage lighting modes like motion-sensitive, music-reactive, and weather-reactive.
- Real-Time Interaction: Commands like
setMode
andplayMorse
are sent viaparticle.callFunction()
, enabling responsive control.
Demo Video
Watch the demo to see the Smart Christmas Star in action!
Conclusion
Building the Smart Christmas Star was a fun way to combine technology and holiday spirit. From music-syncing lights to weather-reactive modes, this project adds an interactive, personalized touch to festive decor. Try it out and light up your holidays with something truly special.
Wishing you a Merry Christmas and a season full of joy, creativity, and innovation! Happy holidays!