Beginner Project: Jack-O-Lanterns that follow you

Hi, I am new to this forum and an amateur with microcontrollers. I'm reasonably handy, but not strong in the realm of electronics. So I have a neat Halloween project that will also serve the purpose of getting me started with the Arduino.

There is a long staircase leading up to my front door with 3 pairs of posts along the handrails suitable for putting Jack-o-lanters, mannequin heads, or anything else creepy on top of them. I want the heads to turn to follow you as you walk up the stairs. Right now I am trying to find out if there's a cheap distance sensor with a long range that will reliably sense someone approaching. If I mounted it at the top of the staircase looking down, it would need to see about 5 to 6 meters. The distance reading would be used to tell 6 servos (one for each head) the angle to turn to face the person.

The sensor doesn't need to be super accurate, as long as it can tell roughly how far away a person is standing. Does anyone know of something that will work?

So I found this Ultrasonic Range Finder that looks like it would do the trick: Ultrasonic Range Finder - LV-MaxSonar-EZ1 - SEN-00639 - SparkFun Electronics

I haven't bought anything yet, but for electronics it looks like I will need:

microcontroller (Uno)
6 servos
range finder
shield?

... and that's it. Except of course for wires and mounting hardware, etc. Simple enough? Once I get the correct electronics in my hands then the learning can begin.

Does it sound like I'm approaching this right? If anyone has suggestions I would appreciate it. Thanks.

Sounds fun, and fairly plausible. You will need a separate power supply for the servos - the arduino won't be able to provide enough current. It would probably pay to do some experiments early on to see how large an object the servos you buy can rotate - Jack-o-lanterns are pretty heavy.

Thanks for the reply. If pumpkins were too heavy, I was going to use small ones or mannequin heads or something. And a separate battery pack for each servo. I can imagine roughly how the program would be laid out and seems like it's within my ability as long as the range finder works as expected...

I'm planning to steal your idea - I hope we're not neighbors. My sister has suggested though that an override switch be included - she thinks the littlest kids would be too freaked out.

Awesome! If you don't mind, please post back here with your results or any roadbumps you encounter. It may be helpful. I'll do the same.

Just got my prototype working, i.e. breadboarded up a couple of LEDs, servos and a pot to simulate the range sensor I don't have yet. Coded up a few simple routines and it's working. Now off to Party City to see if I can find skulls or jack-o-lanterns light enough to avoid having to buy stronger servos. Any progress on yours?

cdean:
Hi, I am new to this forum and an amateur with microcontrollers. I'm reasonably handy, but not strong in the realm of electronics. So I have a neat Halloween project that will also serve the purpose of getting me started with the Arduino.

There is a long staircase leading up to my front door with 3 pairs of posts along the handrails suitable for putting Jack-o-lanters, mannequin heads, or anything else creepy on top of them. I want the heads to turn to follow you as you walk up the stairs. Right now I am trying to find out if there's a cheap distance sensor with a long range that will reliably sense someone approaching. If I mounted it at the top of the staircase looking down, it would need to see about 5 to 6 meters. The distance reading would be used to tell 6 servos (one for each head) the angle to turn to face the person.

The sensor doesn't need to be super accurate, as long as it can tell roughly how far away a person is standing. Does anyone know of something that will work?

Why not use an IR BEAM SENSOR on each set of stairs you have a prop?
Then when the person stands on each step, each prop gets its own activation signal.
Here is what I use for my props this year:

  1. Beam Sensor - Velleman Kit MK120 - http://store.qkits.com/moreinfo.cfm/MK120
  2. Magnecraft W117SIP-6; 5 VDC SPST N.O. DIP REED RELAY - http://www.allelectronics.com - p/n CAT# RLY-541
  3. LM7805CT; Standard Voltage Regulator 5 Volt - http://www.jameco.com - Part no. 786138
    Note: the beam sensor activates a 9VDC buzzer, you will not use this. The reed relay and voltage regulator are inexpensive so I used the voltage regulator to bring the 9V down to 5V, because that is what the reed relay is rated for, and used the relay to act as a DRY CONTACT, aka switch thinking I could copy the DEBOUNCE sketch, for a binary input which will activate the Arduino.

Look at my post #11 here to see how I set it up:
http://arduino.cc/forum/index.php/topic,74183.0.html

Also, on your output, have the Arduino control relays so you don't need to worry about power or current.
Then you can use a wall-wart and use what ever your relay can handle. I like to use an old computer power supply, I get 3, 5, 12 and inbetween volts DC to run my props. I also use a 24VAC door bell power supply for some stuff. Good luck.

wildbill, I shelved the project. Something came up, maybe next year. Or bloody rabbit heads for Easter.

And Happy-Coffee, thanks for your input, especially the idea about relays. And nice stuff in the thread you linked to.

I'm having a little trouble getting this working. I bought a Maxbotix MaxSonar-EZ1 to sense trick or treaters - datasheet: Under Construction. It turns out to have a brown spot on the back, which according to the datasheet designates slightly different behaviour.

It works well with the analog output, but I'm going to have to run 10 feet or so of wire, so I'd prefer to have serial if possible. I have simplified my sketch to this:

#include <NewSoftSerial.h>

NewSoftSerial MaxSonar(2,3); // receive,transmit

void setup()
{
Serial.begin(9600);
MaxSonar.begin(9600);
Serial.println("MaxSonar test");
}

void loop()
{
char ch;
while(MaxSonar.available())
  {
  ch=MaxSonar.read();
  Serial.print(ch,DEC);
  Serial.print(" ");  
  Serial.println(ch);
  }
delay(1000);
}

Wiring is Arduino(UNO) gnd -> EZ1 gnd, Arduino +5V -> EZ1 PWR, Arduino pin 2-> EZ1 TX

I do get serial output from the EZ1 and it varies if I put things near the sensor, just as it does using Analogread, but it doesn't bear any relation to the output the datasheet leads me to expect. I get this pretty continuously:

43 +
0

Great. Thanks!

I resolved my problem with some advice from the manufacturer - although the serial signals are TTL level, they are inverted, they suggest a max232 or a simple inverter circuit. The latter worked for me, which is lucky given the deadline and the fact that I don't have a max232 chip handy.

Edit: spelling