Introduction: Motion Activated Descending Spider
This fun Halloween decoration is a large spider that descends from the ceiling when someone walks past! It uses an Arduino uno, IR sensors, a DC motor and a few other components. The overall build is fairly simple and suitable for beginners! Feel free to ask questions!
Step 1: What You Will Need
- Arduino Uno
- Large Rubber Spider
- Small breadboard
- hookup wire
- Small piece of pinewood ~300x100x20mm
- Double sided tape
- 2x nails ~4mm
- 6x AA batter holder (9V)
- 2x fencing staples
- 4x command strips
- 3.5mm DC power plug
- 2X IR LEDs
- BC548 transistor
- IR Phototransistor
- 2m Ribbon cable (4 wires)
- Small piece of prototype PCB
- 4 male header pins
- 100R and 10K resistors
- 1X L293D motor controller
- 12V DC Reversible Gearhead Motor - 70RPM
- Small cap/gear for end of shaft
- hookup wire
- Piece of thin packing foam
- Thin piece of aluminum
Small bulldog clip
- Soldering Iron
Step 2: IR Sensor
The IR motion detector detects the amount of reflected IR from the IR LEDs. If the level of reflected IR light increases above a certain point the spider is made to descend.
The motion detector was built on a small PCB and was deigned to sit about 2m away from the actual spider, so that it could start descending before a person gets to the door.
The circuit for the motion sensor is fairly simple. I used two IR LEDs and a transistor to control them via an IO port of the Arduino. You don't have to use the transistor but it allows for brighter LEDs.
The IR sensor itself is an IR Photo-transistor, I used a simple voltage divider and an analog pin from the Arduino to measure the voltage across it (therefore measuring the IR light level).
R1 is a 10K resistor and forms the voltage divider, R2 is a 100 ohm resistor that limits current through the LEDs.
I connected the motion detector board to the bread board via a 2m long piece of ribbon cable (4 wires). The 4 wires were 5v, LED, Analog in, GND. On the other end of the ribbon cable were the 4 male header pins that would stick into the bread board.
Step 3: Motor Control
The motor I used for this build was a 12v DC motor with gearhead that provided a 82:1 gear ratio. I tried to use a DC motor without any sort of gear box but it was unable to lift the large spider. The only consequence of using this motor and gear box was that it's top speed was around 70RPM, that together with a small spool diameter meant that the spider was a bit slow.
To control the motor I used one side of a L293D motor controller. This motor controller is very easy to use with only 3 control pins and worked well with the motor I was using. I simply plugged the L293D into the breadboard and made the connections. I connected Vin to the Vin from the Arduino (not 5v) and ground to the Arduino GND. The three input pins were connected to the Arduino IO pins.
To control the motor all you have to do is set the Enable pin HIGH and control the direction with the two input pins.
I simply used the shaft of the motor as my fishing line spool.To stop the line from unraveling off then end I hot glued a small gear (that was a perfect fit - I think from a Tamiya gearbox) on the end. I also soldered two lengths of hook up wire to the inputs of the motor.
I connected the motor to a piece of pinewood that would serve as the mount for all the components (except IR sensor). To do this I first wrapped the motor in some thin packing foam to reduce vibrations against the wood. Then using a thin piece of aluminium I had bent around the motor, I secured the motor to the board using two fencing staples (you could just use nails).
Now all you have to do is wind on the fishing line, you could do this by hand or just connect a battery to the motor and wind it up. On the other end of the fishing line I tied a small bulldog clip that would be used to connect the spider.
TIP: I made a small notch in the wood to hold the fishing line taut when i'm not using it.
Step 4: Putting It All Together
Wiring up the breadboard
There are a total of 4 digital IO pins and 1 analog pin used from the arduino.
Put the L293D in the center of the breadboard and connect up the 3 input pins to 3 digital IO pins of the Arduino. next connect Vin and ground. Finally connect the motor to the outputs.
Plug in the header pins into the breadboard.
If you are using the transistor to power the LEDs connect the collector to 5v and the emitter to the LED pin of the header pins, then connect the base pin to an Arduino digital IO pin. Connect the 5V header pin to Arduino 5v and the GND to GND. Finally connect the IR Photo-transistor pin to an analog pin of the Arduino.
Solder the 3.5mm DC plug to the battery pack - center positive
Secure the breadboard to the baseboard with some double-sided tape, you can do the same with the Arduino or just use some small nails as I did.
Last but not least, connect up the batter holder to the Arduino and secure it to the baseboard with some double-sided tape.
Step 5: Upload the Code!
The Arduino code is fairly simple, it reads in the IR values from the photo transistor and looks for a change in the amount of reflected light and then turns on the motor to lower the spiderfor a certain amount of time, then re-winds the spider to reset.
Step 6: Setting It Up
I attached the wooden pine board to the ceiling with three command strips and used another to put up the IR sensor.
The main board with the spider was put up directly above the door and the IR sensor was up up about 2m away, this way the sensor would trip as a person walked up to the door and the spider would be lowered onto their head.
All you need to do now is calibrate the decent time (aka how far down the spider would go) and the level at which the IR sensor would trip (I used a ladder and a long USB cable to program the Arduino)
Hope you enjoyed and thanks for reading!