Interactive Halloween props are always fun and they are surprisingly easy to make. This year I designed a simple system that rotates a skull to face you and follows you movements as you walk by.

To accomplish this I used light sensors to detect a person's shadow. An Arduino microcontroller then calculates where they are standing and activates a servo that turns the skull to face them. When they move, the skull turns to follows them.

Step 1: Select a Halloween Prop to Use

The first thing that you need to do is select a Halloween prop that will turn and follow people walking by. Look for props that are both creepy and light weight. I chose to use a foam skull but there are a lot of other props that can also work. Use your imagination.
<p>hey, is there a certain min characteristics for the servo? I have this one:is it strong enough to rotate a paper prop?</p>
It all depends on your specific prop and servo. The best way to find out is to try it out.
awesome project. my six year old daughter and I had fun making this one.
<p>Awesome. Thanks for sharing.</p>
<p>Hi! Nice project :)</p><p>What happens if you close completly the lights?</p><p>thanks!</p><p>marC:)</p>
This project requires a direct light source in order to work. You could make something similar that would work in the dark, but that would require infrared LEDs and receivers.
<p>Hi! I would like to know if it's possible to do this project with an HC-SR04 ultrasonic proximity? I want to use that project on the Halloween day, outdoor at night, so the photoresistor should have some problems to detect the shadow! </p><p>Thanks! </p>
<p>It will probably work as long as the signal is 5 volts or less</p>
Nice! I'll try it!!! (When I will get my HC-SR04 from china! lol! Thanks Ebay!!<br><br><br>Thanks!! :)
<p>Hey really liked this project so much that i just finished making my own copy of it however it keeps spazzing out every time i plug it in, i use the original code but i don't know where exactly where to adjust it within the code (if that makes sense). I want it to just move slowly at a constant pace like the one in your youtube video . I also am using 5 sensors instead of 3. Here what it looks like </p>
<p>You can adjust the &quot;threshold&quot; variable. You may need to create a separate threshold variable for each sensor. You can also adjust the averaging speed. Another thing that will help is moving the sensors farther apart. You don't want the shadow to hit more than one sensor at a time. </p>
<p>So if i increase the threshold hold it should help?</p>
<p>This is a cheap solution, but if you want highly accurate positioning you could use a Kinect sensor.</p>
<p> Hi, I try made this project using Arduino promini and LDR. It reach at goal point 1, but it cannot back to goal point (or reset point) and cannot reach the other goal point.<br>Can you help me please? </p>
You may need to adjust the sensitivity of the light sensors in the code. Or you may need to change the values of the resistors.
<p> Hi, I try made this project using Arduino promini and LDR. It reach at goal point 1, but it cannot back to goal point (or reset point) and cannot reach the other goal point.<br>Can you help me please? </p>
Hi, I can't get the code to run! It says, error: expected constructor, destructor, or type conversion before 'int' <br>In function 'void loop()'; <br>error: 'PinOneCurrent' was not declared in this scope <br>Can you help please, thanks
I don't know, I just compiled it and it ran fine.
Hi, Thanks for your reply, got it sorted now, you were right, it didn't copy and paste properly.<br>Sorry for the trouble<br>Johnhr
Something must not have copied properly. Its no biggie, just make sure the following is declared before void setup() { <br>int PinOneCurrent; <br> <br>And after void loop() { <br>PinOneCurrent= analogRead(1); <br> <br>Good luck :-)
My Wife love's projects &amp; with Halloween coming up she'll love this stuff. I'm glad I stumbled across this page.,love it .
Great instructable! I tried this today and the servo just makes small motions back / forth (maybe 1/8&quot;) it doesn't seem to respond to covering up the CDS photosensors, any ideas?
Start by changing around the photoresistors to see if that does anything. Then try changing some of the values in the code like the averaging speed.
Creepy! Love it!
Very cool and simple. I Have been wanting to do something like this for a while. I want to place outside (for day and night use) and I'm thinking that the photoresistors will not work (tell me if I'm wrong). So I was wondering if a Parallax PIR Sensor would be a better option.
Photoresistors will not work at night without an external light source. PIR can work, but that is a little more expensive.
Thanks for this cool project as I have been trying to figure out how to get this done for a couple of weeks now :-(. I have tried to use 3 Parallax PIR's, and since I have to use delay(), the servo will not turn in real time as yours does. I tried to modify your code to work with the PIR's, but when I tested the output of the sensor using a multimeter, when the sensor turns off, for a moment the voltage jumps to 7V, and I don't want to fry my Uno :-p. Any suggestions would be great. Thanks
The trouble with a PIR is that the output is HIGH when there is motion or LOW when there is not motion. It doesn't give values relative to how much motion. The best that you can do is have the skull turn to face the sensor that most recently detected motion. Another option is to use just two sensors and have the center position be the default that it will turn to when the sides don't detect motion.
Thank you for the quick response. I will give that a shot tomorrow as I currently tried using 3 PIR sensors... I will also try to see if I can get it working with 2 or 3 Ping sensors, since I have the ones which have both an echo and a trigger output, and let u know...
ok, so maybe when I have more time to mess with the PIR's, I will... In the meantime, I modified your code to include 2 Led's that will go on when the light sensors are triggered... <br> <br>// Here is the Arduino code that I used. <br> // Open up the Arduino environment. Then copy and paste it into a new sketch. <br> // Then upload the code to the Arduino board. <br>// Based upon code from the following. Thank you <br>// http://www.instructables.com/id/Halloween-Props-That-Turn-to-Look-at-You-as-you-Wa/ <br>// The only addition is that 2 LED's will now turn on when the light sensors are triggered, and go off after. <br> <br> #include <br> Servo myservo; //create servo object to control a servo <br> <br>#define led1 9 <br>#define led2 10 <br> <br> int ResetTimer=0; //sets delay to reset position <br> int GoalPosition=3; //stores the goal postion (1-5) where the person is standing <br> int GoalPositionDegrees; //stores the goal position in degrees (30-150) <br> int CurrentPositionDegrees=90; //stores the current position in degrees (30-150) <br> int AveragingSpeed=100; //sets how quickly the average values adjust (a lower value changes average value quickly) //quickly. A value of 100 changes the average value slowly <br> // his effectively sets the speed at which the sensors recalibrate themselves to changing light conditions <br> int PinOneCurrent; //stores current value of pins 1-5 <br> int PinTwoCurrent; <br> int PinThreeCurrent; <br> int PinFourCurrent; <br> int PinFiveCurrent; <br> <br> float PinOneAverage; //stores the average value of pins 1-5 <br> float PinTwoAverage; <br> float PinThreeAverage; <br> float PinFourAverage; <br> float PinFiveAverage; <br> <br> float RatioPinOne=0.00; //stores the ratio of current pin value to average pin value <br> float RatioPinTwo=0.00; <br> float RatioPinThree=0.00; <br> float RatioPinFour=0.00; <br> float RatioPinFive=0.00; <br> <br> float Threshold=0.95; //sets minimum threshold for sensors <br> <br> void setup() <br> { <br> myservo.attach(13); //attaches servo to digital pin 13 <br> <br>pinMode(led1, OUTPUT); <br>pinMode(led2, OUTPUT); <br> <br> PinOneAverage = analogRead(1); //reads from sensors to set initial average pin value <br> PinTwoAverage = analogRead(2); <br> PinThreeAverage = analogRead(3); <br> PinFourAverage = analogRead(4); <br> PinFiveAverage = analogRead(5); <br> <br> } <br> <br> void loop() <br> { <br> //read analog pins 1-5 and set the result as current value <br> PinOneCurrent= analogRead(1); <br> PinTwoCurrent= analogRead(2); <br> PinThreeCurrent= analogRead(3); <br> PinFourCurrent= analogRead(4); <br> PinFiveCurrent= analogRead(5); <br> //adjust average pin values <br> PinOneAverage=PinOneAverage+(PinOneCurrent-PinOneAverage)/AveragingSpeed; <br> PinTwoAverage=PinTwoAverage+(PinTwoCurrent-PinTwoAverage)/AveragingSpeed; <br> PinThreeAverage=PinThreeAverage+(PinThreeCurrent-PinThreeAverage)/AveragingSpeed; <br> PinFourAverage=PinFourAverage+(PinFourCurrent-PinFourAverage)/AveragingSpeed; <br> PinFiveAverage=PinFiveAverage+(PinFiveCurrent-PinFiveAverage)/AveragingSpeed; <br> <br> //calculates ratio of current pin value to average pin value <br> RatioPinOne=(float)PinOneCurrent/PinOneAverage; <br> RatioPinTwo=(float)PinTwoCurrent/PinTwoAverage; <br> RatioPinThree=(float)PinThreeCurrent/PinThreeAverage; <br> RatioPinFour=(float)PinFourCurrent/PinFourAverage; <br> RatioPinFive=(float)PinFiveCurrent/PinFiveAverage; <br> <br> <br> //determine which ratio is the largest and sets the goal position <br> //set goal position <br> <br> if (RatioPinThree &lt; Threshold &amp;&amp; RatioPinThree &lt; RatioPinOne &amp;&amp; RatioPinThree &lt; RatioPinTwo &amp;&amp; RatioPinThree &lt; RatioPinFour &amp;&amp; RatioPinThree &lt; RatioPinFive) <br> { GoalPosition=3; <br> LedOn(); <br> ResetTimer=0; } <br> else if (RatioPinOne &lt; Threshold &amp;&amp; RatioPinOne &lt; RatioPinTwo &amp;&amp; RatioPinOne &lt; RatioPinThree &amp;&amp; RatioPinOne &lt; RatioPinFour &amp;&amp; RatioPinOne &lt; RatioPinFive) <br> { GoalPosition=1; <br> LedOn(); <br> ResetTimer=0; } <br> else if (RatioPinTwo &lt; Threshold &amp;&amp; RatioPinTwo &lt; RatioPinOne &amp;&amp; RatioPinTwo &lt; RatioPinThree &amp;&amp; RatioPinTwo &lt; RatioPinFour &amp;&amp; RatioPinTwo &lt; RatioPinFive) <br> { GoalPosition=2; <br> LedOn(); <br> ResetTimer=0; } <br> else if (RatioPinFour &lt; Threshold &amp;&amp; RatioPinFour &lt; RatioPinOne &amp;&amp; RatioPinFour &lt; RatioPinTwo &amp;&amp; RatioPinFour &lt; RatioPinThree &amp;&amp; RatioPinFour &lt; RatioPinFive) <br> { GoalPosition=4; <br> LedOn(); <br> ResetTimer=0; } <br> else if (RatioPinFive &lt; Threshold &amp;&amp; RatioPinFive &lt; RatioPinOne &amp;&amp; RatioPinFive &lt; RatioPinTwo &amp;&amp; RatioPinFive &lt; RatioPinThree &amp;&amp; RatioPinFive &lt; RatioPinFour) <br> { GoalPosition=5; <br> LedOn(); <br> ResetTimer=0; } <br> else if (ResetTimer &gt; 100) //after delay resets to position 3 <br> { GoalPosition=3; <br> LedOn(); <br> ResetTimer=0; } <br> else <br> { ResetTimer=ResetTimer+1; <br> digitalWrite(led1,LOW); <br> digitalWrite(led2,LOW); <br> } <br> <br> <br> GoalPositionDegrees=GoalPosition*25+15; //converts the goal position to degrees <br> <br> myservo.write(GoalPositionDegrees); //sets the servo position according to the scaled value <br> <br> delay(30); //sets how quckly the servo turns (lower numbers turn more quickly) <br> <br> <br> } <br> <br> void LedOn() { <br> digitalWrite(led1,HIGH); <br> digitalWrite(led2,HIGH); <br> }
Hmmm...I like this, but I'm thinking that it's time to revisit the old plastic skull model that you assemble and go with either red LEDs or eyeballs and make them face the person instead. should be able to fit most of the mechanicals inside the skull kit.
This is cool nicely done!

About This Instructable




Bio: My name is Jason Poel Smith I am a Community Manager here at Instructables. In my free time, I am an Inventor, Maker, Hacker, Tinker ... More »
More by DIY Hacks and How Tos:How to Make a Festivus Pole Add Wings to an Infant's Halloween Costume Bubble Bath That Never Runs Out Of Bubbles 
Add instructable to: