Halloween Themed Mini Light Show
by iamrachelle in Circuits > LEDs
539 Views, 7 Favorites, 0 Comments
Halloween Themed Mini Light Show
Here's a Halloween themed light show decoration. It lights up while the skulls moves around.
Supplies
Here's the materials I used:
- WS2812B
- WIRES
- 2 PC SG90 servo
- PCB
- WEMOS
- 2 pc Skulls from Daiso
- 3D Printed parts
Tools used
- 3D Printer
- Glue Gun
- Mini Drill
- Cable Tie
- Micro USB Cable
Make the 3D Printed Materials
Here are The Files For the 3d printed Materials. Made it using black, yellow, white and gray PLA filament.
The Files can be found at thingiverse. It can also be found here!
Prepare the Lights
- Cut 3 strips of WS2812B as shown.
- Solder the wires on the WS2812B to be used later.
- Mount the strips on the 3D printed parts by peeling the tape on the led strip's back.
Prepare the Skulls
The skulls are from Daiso. Its made using soft plastic and it came on a pack of 4, so just in case you made a mistake, there would still be chances. ;)
How To Prepare
- Make a hole on the back of the skulls for the servo horn, wires and for mounting it.
- Secure the servos with 2 cable ties on each sides
- Put the led strip holder on the back of the skull as show on the picture.
Assemble It All
Use M2 and M3 Screws for assembling it as shown in the picture.
- Assemble the coffin with 6 pieces M2 screws.
- Place the Web inside.
- Using a Mini Drill, Make a hole to assemble the moon, skulls and their respective wires.
- Mount the moon and skulls using M3 screw.
- Solder the electronics according to the circuit diagram.
Upload the Code.
Here's the code I used with commented explanation. Copy this to your Arduino IDE, upload and let the spook-tacular Halloween begin! 👻
//initalize the following to control the WS2812B RGB Led strips
#include <FastLED.h>
#define NUM_LEDS 10
#define DATA_PIN 4
CRGB leds[15];
//Initialixe the follwing to control the Servos
#include <Servo.h>
Servo SERVO2;
Servo SERVO1;
int pos;
void setup() {
FastLED.addLeds<WS2812B, 4>(leds, 0, 3); //SERVO2_RGB is attached on pin 4 with 3 leds
FastLED.addLeds<WS2812B, 13>(leds,3,3);//SERVO1_RGB is attached on pin 13 with 3 leds
FastLED.addLeds<WS2812B, 12>(leds,6,9);//MOON is attached on pin 12 with 9 leds
SERVO2.attach(5);//SERVO2 is attached on pin 14
SERVO1.attach(14);//SERVO1 is attached on pin 14
}
//For Pretty transitioning of colors
void fadeall() { for(int i = 0; i < 15; i++) { leds[i].nscale8(250); } }
void loop() {
static uint8_t hue = 0; //initailize current color of strip
// First slide the led in one direction
for(int i = 0; i < 15; i++) {
// Makes the moon's light brighter than the others by 50%
if(i < 6){
leds[i] = CHSV(hue++, 255, 128);
}else{
uint8_t nexthue = hue+29;
leds[i] = CHSV(nexthue, 255, 255); // Set the i'th led to a different color.
}
FastLED.show(); // Show the leds
fadeall();
delay(10); // Wait a little bit before we loop around and do it again
}
// Now go in the other direction.
for(int i = (15)-1; i >= 0; i--) {
if(i < 6){
leds[i] = CHSV(hue++, 255, 128);
}else{
uint8_t nexthue = hue+29;
leds[i] = CHSV(nexthue, 255, 255); // Set the i'th led to a different color.
}
FastLED.show();// Show the leds
fadeall();
delay(10);// Wait a little bit before we loop around and do it again
}
//Moves the servo around
for (pos = 15; pos <= 85; pos += 1) { // goes from 0 degrees to 85 degrees
SERVO2.write(pos); // tell servo2 to go to position in variable 'pos'
SERVO1.write(85-pos); // tell servo1 to move oppositely
delay(15); // waits 15ms for the servo to reach the position
}
delay(1000);
for (pos = 85; pos >= 15; pos -= 1) { // goes from 180 degrees to 0 degrees
SERVO2.write(pos); // tell servo2 to go to position in variable 'pos'
SERVO1.write(85-pos); // tell servo1 to move oppositely
delay(15); // waits 15ms for the servo to reach the position
}
}
Wishing You a Creepy Night of Halloween Fun!
Here's a Demo! Found it as captivating as a cozy fireplace, and it's remarkably entertaining as well! 💕