Halloween-of-Things (HoT) And Your Little Internet Too
This project is a Halloween effects controller with video to capture the expressions of the trick-or-treaters and control some effects.
Things used in this project
Hand tools and fabrication machines
Hot glue gun (generic)
This was supposed to be a Google Android Things entry: https://www.hackster.io/contests/Google/projects
I found out, however, that I could finish the project in time for Halloween with just some Python code, so here it is. I found some inexpensive battery-operated motion sensing LED lights at the local hardware store.
I removed the circuit board from the housing, unsoldered the battery clips and replaced the LEDs with Molex headers.
I used a rather scary creepy clown mask to hide all the parts inside.
I glued two LEDs into the eye holes and ran the wires back to the motion detector.
I used a Styrofoam dummy head as a base and cut out material to fit in a webcam.
The finished head looks like this:
I found some scary Halloween sounds on the net to use for this project:
The motion detector is wired to a raspberry pi GPIO17 pin, and when the software detects a change, it captures a photo from the hidden webcam, then plays the maniacal witches laugh through a small amplifier. It will also send me an email with the photo attached if I choose. The software is based on one of the many raspberry pi doorbell projects found on the web. This is a good example:
All I have to do now is mount it on a chair and stuff some clothing with newspaper and wait for the Trick-or-Treaters.
Scary Clown Schematic
import RPi.GPIO as GPIO import time import os import pygame from shutil import copyfile IRinputPin = 17 GPIO.setmode(GPIO.BCM) GPIO.setup(IRinputPin,GPIO.IN, pull_up_down=GPIO.PUD_UP) count = 10 pygame.mixer.init() pygame.mixer.music.load("/home/pi/Music/Witch.mp3") print('System Reset') while (count>0): print(count) count-=1 time.sleep(1) print('System Armed') while True: print('Waiting for input') if (GPIO.input(IRinputPin)): time.sleep(1) else: print('IR input detected') os.system("fswebcam -r 960x720 -d /dev/video0 /home/pi/webcam.jpg") timestr = time.strftime("%Y%m%d-%H%M%S") filename2 = ('/home/pi/'+timestr+'.jpg') copyfile('/home/pi/webcam.jpg', filename2) print('Saving Picture') os.system("python /home/pi/sendnotify.py") print('Sending email') pygame.mixer.music.play() print('Resetting System') count = 30 while (count>0): print(count) count-=1 time.sleep(1) print('System Armed')