In this project we use an Arduino Uno along with some simple components to create an interactive, scary and playful decoration for Halloween to impress all your guests.
Our idea is basically designing a candy dispenser that only provides the user with a few candy if a riddle is solved properly; of course everthing ambiented for the spooky season.
- Computer (with Arduino software)
- Arduino Uno (or equivalent)
- Jump wires
- 7 segment display
- LED lights
- Servo motor
- 3D printer
- PLA material
- Ply wood
- Laser cutting machine
- Paint (spray and non-acid better)
- Resistors 7x330Ohm and 3x220Ohm
- MP3 player
The underlined elements can be easily replaced by commercial already made Halloween products, by purchasing them you save a significant amount of time and reduces difficulty.
Step 1: IDEA DEVELOPMENT
To begin with, we decide what we want to achieve with our gadget and plan how it will get done. Which is the hardware that we need, how we have to program it and brainstorm ideas for the design. In this step, it has been decided that we will use a seven-segment display and the user will have to guess a number as the answer to an enigma. When the right digit is on display, the user should press the button. Once the number is correct a servo will activate and throw some candy. In our case we ask: “How old is our university? (in decades)”, and the answer to that is 6, so when the displayed number is 6 the candy is released. This code can be changed to whatever number suits you better.
Step 2: DESIGN
In this part everyone can bring their own creativity and come up with those final touches that will make your design unique. As we planned to do a two-pieces setup, we will need a grave and a tree. We want to 3D print both of them, this is why we start with this part as it takes quite a bit of time to print. As it’s been mentioned before, if you purchase the parts from a store it might save you some time.
Step 3: 3D PRINTING AND LASER CUTTING
We got the tree file from Thingiverse.com and reescalded it to make it 50% bigger; also the previous design for the grave that we did ourselves and after passing them through the slicer (Cura), we printed them. Once that is done with Autocad we design the base structure and using a laser machine, we cutted the base precisly.
In addition, as we were using the laser machine, we could engrave our riddle in the ply-wood.
We drilled holes in the base right under the grave and tree so we can run the cables down to the Arduino.
Step 4: COLOUR
We painted the different parts with spray to achieve the desired spookiness.
Step 5: PROGRAMMING
Once the setup is ready, we should program the different functions in Arduino. In order to assure that all components work, what we do is program them individually. Once we know for sure that all elements work, we start putting it all together.
For example we connect the 7-segments display and write a short code that displays all numbers with a short delay.
Don’t forget to download the Libraries for each element, for example the 7segments or the mp3 player, as they require to have the installed libraries on your computer.
Also the pins of the Arduino are according to our connections, if you don’t follow the scheme that you can find in Step 8, the code won’t work.
Step 6: CODE
In the following file you can find the code for this project.
Step 7: DISPENSER MECHANISM
In order to release some sweets when the right answer is pressed, we designed a mechanism and printed the parts. It consists of a structure that is glued inside the tree and has a funnel shape. Next to it there’s a space where the servo will rest and on top of that we have the candy tank. Simple yet functional. The only thing left to do is add a tiny piece of cardbord to the servomotor so that it works like a door.
Step 8: FINAL ASSEMBLY
The last part, to assemble and achieve the final product. We have connected all the hardware with the Arduino and glued all the elements to the plywood base. Connections are shown in the graphics generated in Fritzing.
As you can see in the second image, the 7 segments has an independent welded PCB attached at the back of the grave due to its complicated connections. Each of the 7 lights it’s an LED that works independently and requires a resistor. Then the cables run down from the welded PCB to the base where we can find the Arduino.
Step 9: FILL THE TANK WITH CANDY
Make sure there’s enough sweets for everyone and the Halloween candy dispenser is set and ready to go.