This project is a Halloween effects controller with video to capture the expressions of the trick-or-treaters and control some effects.
![projectImage](https://dfimg.dfrobot.com/60d184c4aa9508d63a4149e4/makelog/19bb63d7857dc3ebc184d86f0fc3047b.jpg)
Things used in this project
Hardware components
Hand tools and fabrication machines
Hot glue gun (generic)
Story
Part 1
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.
![projectImage](https://dfimg.dfrobot.com/60d184c4aa9508d63a4149e4/makelog/1fbb6c0aad50b454cd963aed0ed85f9c.jpg)
I removed the circuit board from the housing, unsoldered the battery clips and replaced the LEDs with Molex headers.
![projectImage](https://dfimg.dfrobot.com/60d184c4aa9508d63a4149e4/makelog/819f994ee7348038e552e1883adce29e.jpg)
I used a rather scary creepy clown mask to hide all the parts inside.
Part 2
![projectImage](https://dfimg.dfrobot.com/60d184c4aa9508d63a4149e4/makelog/6aefce1360942984387e68f7b008d37f.jpg)
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.
![projectImage](https://dfimg.dfrobot.com/60d184c4aa9508d63a4149e4/makelog/2ac21ce0ef2763742d87da2ad6552351.jpg)
The finished head looks like this:
![projectImage](https://dfimg.dfrobot.com/60d184c4aa9508d63a4149e4/makelog/aa11fd291e422266fbe923c9f2c04fa3.jpg)
I found some scary Halloween sounds on the net to use for this project:
http://soundbible.com/1129-Maniacal-Witches-Laugh.html
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.
![projectImage](https://dfimg.dfrobot.com/60d184c4aa9508d63a4149e4/makelog/be454bb4336fa3087c73826d5ac0c76a.jpg)
![projectImage](https://dfimg.dfrobot.com/60d184c4aa9508d63a4149e4/makelog/8d9cc51df2da00e648b7038d444aba59.jpg)
Schematics
Scary Clown Schematic
Simple wiring
![projectImage](https://dfimg.dfrobot.com/60d184c4aa9508d63a4149e4/makelog/96b3d70e33f67fd44a63e4cc4f020410.jpg)
Code
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')
The article was first published in hackster, October 27, 2017
cr: https://www.hackster.io/r-scott-coppersmith/halloween-of-things-hot-and-your-little-internet-too-3a2c7b
author: R. Scott Coppersmith
![licensBg](/images/license_bg.png)