Jonathan Thomson's web journal

Halloween 2018 – Lilliputian Alien Abduction October 31, 2018

Filed under: Electronics,Halloween — jethomson @ 9:48 pm

IMG_20181028_012209

ufo

 
 
Construction
I made a UFO out of a pie tin and lit it up with a strip of 52 WS2812 LEDs. A ring of 24 LEDs was used to create a tractor beam effect, and a disc 7 LEDs was used to create a control panel. I scavenged parts from a busted LED controller that took commands by an IR remote control. I reused its case, IR receiver, and remote control to create an new LED controller using an Arduino Nano that I wrote custom code for. To create a base for the controller and battery pack to sit on I made a disk out of poster board with aluminum foil glued to it. The dome at the top was half a two piece Christmas ornament globe. The LEDs running around the rim were simply attached with clear tape, since I had trouble getting glue to stick to the silicone sheath over the LEDs. The tractor beam is a ring of LEDs and a plastic drinking glass glued to the pie tin lid. I drilled two holes in the glass, and ran a shoelace through them so I could wear the UFO on my head.

remote control

 
 
Code
Since FastLED disables interrupts its not the best idea to use an IR remote with FastLED. However, I was able to make them work together reliably by not using delay() and creating animation functions that returned control to main() quickly. The code can create 22 different animations (referred to as patterns in the code) on the strip of LEDs that run around the rim of the UFO. Some of the patterns can be run in both directions and have variable speed. The pattern names are orbit, theater chase, running lights, shooting star, cylon, solid, juggle, mitosis, bubbles, sparkle, matrix, weave, starship race, pac man, bouncing balls, halloween colors fade, halloween colors orbit, sound ribbons, sound ripple, sound orbit, sound blocks, and dynamic rainbow. There are also effects (called overlays in the code) that can be added to a pattern to make it more dynamic. The overlays are breathing, flicker, glitter, and frozen decay. The color of a pattern can be set as a static color, a color that evolves, or a random color on every draw.

 
 

 
 
UFO LEDs controller code on GitHub
Simplified code to demonstrate all of the animations used by the UFO

Advertisements