Monster Under the Bed
by Beaconsfield in Living > Pranks, Tricks, & Humor
24338 Views, 234 Favorites, 0 Comments
Monster Under the Bed
This box makes scary noises and has glowing red eyes that turn on when the lights go out. Put it under a bed or desk to prank your friends (or colleagues)!
You could also change the type of sensor to make a motion- or proximity-activated monster for a haunted house.
The box contains an Arduino Uno, a recording/sound module, a servo, and a pair of LEDs. A phototransistor lets you measure the light in the room and know when the lights go out.
Materials:
- Arduino Uno - RadioShack 276-128
- 9V Recording Module - RadioShack 276-1323
- Standard Servo - RadioShack 273-766
- Light sensor/phototransistor- RadioShack 276-326
- 10k Ohm resistor - RadioShack 271-1335
- 1k Ohm resistor - RadioShack 271-1321
- 220 Ohm resistor - RadioShack 271-1111
- Red LEDs (2x) - RadioShack 276-041
- Slide switch/button - RadioShack 275-0401
- 9V battery holder - RadioShack 270-324
- 9V battery - RadioShack 23-853
- General purpose printed circuit board - RadioShack 276-149
- 5V micromini relay - RadioShack 275-0240
- Transistor - RadioShack 276-2016
- Diode - RadioShack 276-1103
- Suction cups (4x)
- Heavy string/cord
- Cleaning brush (see step 25 for photo)
- Misc. nuts, washers, and bolts (4 for attaching the servo, 4 for attaching the circuit board)
- Misc. wires, connectors, and soldering tools
- Hot glue gun
- Wood glue (and optionally, clamps)
- Plywood sheet, or existing box
The Circuit
Since there are a lot of components being controlled by the Arduino, I created a simple circuit board to hold them and (somewhat) cut down on the number of spare wires. The board consists of a relay/transistor circuit to turn the sound on/off, a voltage divider for measuring the incoming light, and a basic LED circuit for the glowing eyes. This is the layout that I used, but you may choose to move components around so the cables going off the board make more sense.
Controlling the Sound Player
Normally, the recording module works by having the two circuit halves physically connect when the "play" button is pushed. However, I wanted to be able to control the Arduino, so I needed a way to connect the two sides of the button using circuitry. I chose to use a mechanical relay, which is essentially a switch that connects a "wiper" pin to one of two sides when the relay is on and defaults to the other side when the relay is off. I only wanted the sound to play (the button to be "pushed") when the Arduino commanded it, so I connected the two sides of the button to be normally open (not connected) when the relay has no power.
The transistor is used to control the relay's connection to power. The base is connected to an Arduino pin, and when the pin is HIGH the transistor acts as a wire, connecting the relay to ground and turning it on. When the pin is LOW, the transistor acts as a short circuit and the relay remains off. (the mechanics of how it works are much more complicated, but for my purposes the transistor acts as a current-controlled switch).
Solder the Components
Next, I soldered the diode and the transistor in place. Make sure your diode is facing the right way! The silver line corresponds to the line in the schematic symbol.
I then soldered the 10K ohm resistor for the relay circuit, and the two 1K ohm resistors for the LED and sensor circuits. The middle pin (base) of the transistor I soldered to the nearby 1K ohm resistor.
Create the +5V and GND Rails
Similarly, I made a ground rail to connect all the ground ends.
Solder Off-board Wires
- five GND wires
- one 5V wire (for getting power to the board)
- one wire to connect the phototransistor to the Arduino
- one wire from the board to the phototransistor
- two wires to connect the relay to the sound module
- two wires from the board to the LEDs
- one signal wire to drive the LEDs from the Arduino
- one signal wire to drive the relay from the Arduino
- one signal wire to drive the servo from the Arduino
(I ended up adding some of these wires later on, which is why they aren't in the photos)
Attach Sensor and LEDs
Record Scary Noises
Youtube videos of monster/growling sounds: (I used the last one)
http://www.youtube.com/watch?v=vrCwaJYNO_o
http://www.youtube.com/watch?v=IbTfeNeSf7Q
https://www.youtube.com/watch?v=2kwFYsZ4PH4
Hack the Sound Recorder (removing the Button)
Remove the button using pliers - the metal ring is connected to the board by tabs that can be easily bent back. The ring and the plastic button should simply come off. Under the button you should see copper traces in a sort of interwoven finger pattern - the two sides are what I soldered to.
Hack the Sound Recorder (soldering)
Copper traces are sometimes difficult to solder to due to the large surface area. If you have flux, apply a tiny amount to the copper before soldering. Otherwise, take the time to heat up the copper before applying solder; it may take longer than expected.
Once the wires are in place, I simply connected them to the leads coming off the board from the relay. The order doesn't really matter since the relay is creating a physical connection, but the white wire is positive and the yellow wire is negative (there is a 5V drop between the two).
Hack the Sound Recorder (power)
Make Connectors
I made four of them:
- four pins for the power cables (Vin, GND - battery, GND - board, 5V)
- four pins for the signal out cables (sound module, LEDs, NC, servo -- Pins 12, 11, 10, 9)
- two pins for the sensor input (phototransistor, NC -- Pin A0, A1)
- three pins for the servo (GND, 5V, Signal -- order may vary based on servo brand)
I matched the colors to the wires coming off the board so it was easy to match them up to the ones on the board when I soldered (the "extra ground wire on the power connector goes to the battery ground). I originally used fairly long cables, but they were messy in the box and I ended up cutting them all down to about 2-3 inches.
Add Wires to the Switch
Arduino Code
Downloads
Sensor and Servo Calibrations
Not all servos use the same pwm duration for control, so check the datasheet. The servo I'm using ranges from 0 degrees at 0.6 ms to 150 degrees at 2.1 ms (hence the ranges in the code). Later on I checked the range of motion in the code, but this isn't terribly useful before you have the box built and can see where it will hit.
Make the Enclosure Parts
I also used some hardware to attach various components to the box; nuts and bolts for the servo, nuts, bolts, and washers for the circuit board, and suction cups for eventually hanging the box.
Since this is going under the bed and I want it to blend in to the darkness, I painted the parts of the box a matte black on all sides.
Downloads
Add the Eyes
Partially Glue the Box
Attach the Switch
The switch I used came with tiny screws that I couldn't find nuts for. Instead, I ended up simply hot gluing the screws to the interior of the box.
At this point I also glued the battery pack to the bottom of the box.
Attach the Circuit Board
Attach Speaker and LEDs
The LEDs I taped roughly in place with masking tape and secured with hot glue. I tried to center them over the flat side of the eyes, so the eyes would glow evenly.
Assemble Servo
The arm needs to be securely attached to the servo horn (the round plastic bit that comes with the servo itself). I sanded the surface of the plastic a bit, then used hot glue to secure it. The servo comes with a small screw for attaching the various servo horns that will keep the arm from falling off.
Insert Servo Mount
The servo mount fits into the bottom of the box, and like the shelf for the circuit it doesn't really require glue. I plugged the servo into the circuit board at this point (using the connector I made earlier).
Assemble Top
Attach Remaining Sides
I didn't glue the back to the rest of the box in case I needed to get to the interior again. If you use a laser cut box like I did, the back should snap into place and be held by friction.