Distance Sensing Jack-o'-Lantern With Glowing Eyes and Evil Laugh
by EdoAndIlay in Circuits > Arduino
314 Views, 2 Favorites, 0 Comments
Distance Sensing Jack-o'-Lantern With Glowing Eyes and Evil Laugh
Hello,
In this tuturial we are going to teach you how to make a distance sensing pumpkin with glowing eyes and evil laugh.
Supplies
- Arduino Uno (can also try using an Arduino Nano to make it more compact)
- 5 red LEDs
- 1 ultrasonic sensor
- 1 speaker (you can extract it out of an existing computer speaker, but it might need a higher voltage to be loud)
- 1 mini breadboard
- 1 pumpkin (Preferably a large one for ease of use)
- 1 9V Battery + Housing (for Arduino)
- Jumper wires
Cut the Pumpkin Open & Clean It
- Draw a circle with a ~5cm radius around the pumpkin's stem.
- Cut the pumpkin open with a knife, holding it at a 45 degree angle.
- Clean the pumpkin with a spoon.
Carve a Face on the Pumpkin
Draw the face you want to carve and then carve it with a knife.
Make sure to take all the pieces that fall in back out when you finish.
Connect the LEDs, Speaker and Ultrasonic Sensor
Connect the LEDs, speaker and ultrasonic sensor to the Arduino according to the circuit diagram above.
Upload the Code
- Launch Arduino IDE.
- Use the Library Manager to install the PCM library by David Mellis and Ultrasonic library by Erick Simões.
- Paste the code in pumpkin.ino and upload it to the Arduino board
If you want to replace the evil laugh with a different audio clip, first make sure it is a wav file with an 8k sample rate and then run the audio_to_arduino_array.py python script (requires the numpy, scipy and clipboard) libraries to convert it to an array the PCM library can play as audio.
Optional: Cover the Electronic Components in Plastic Wrap
You don't want your Arduino or other components to smell like pumpkin, do you? Cover them with plastic wrap to prevent them from touching the pumpkin.
Put Everything Inside the Pumpkin
First put the Arduino in the pumpkin, then put the ultrasonic sensor in the pumpkin's mouth. After that put one LED in each of the pumpkin's eye, one LED in the nose and two LEDs in the mouth. To keep the LEDs in place, try to stick them in the pumpkin, close to the eyes. For the speaker, you can either leave it hanging with the cable, screw it to the inside of the pumpkin, or put it behind the pumpkin.
And it's done.