Home > Projects > Other Projects > HALLOWEEN DIY CANDY DISPENSER WITH RIDDLE, 7-SEGMENTS & PUSHBUTTON, ARDUINO & 3D PRINTED | ELISAVA

HALLOWEEN DIY CANDY DISPENSER WITH RIDDLE, 7-SEGMENTS & PUSHBUTTON, ARDUINO & 3D PRINTED | ELISAVA

Summary of HALLOWEEN DIY CANDY DISPENSER WITH RIDDLE, 7-SEGMENTS & PUSHBUTTON, ARDUINO & 3D PRINTED | ELISAVA


This project builds a spooky Halloween candy dispenser using an Arduino Uno, a seven-segment display riddle, and a servo-controlled dispenser inside a 3D-printed grave and tree. Users must press a button when the correct digit appears to trigger the servo and release candy. The build involves 3D printing, laser-cut plywood base, painting, wiring, programming with required libraries, and assembling a funnel-like dispenser and welded PCB for the display. Final steps include testing components and filling the candy tank.

Parts used in the Halloween Candy Dispenser:

  • Computer (with Arduino software)
  • Arduino Uno (or equivalent)
  • Jump wires
  • 7 segment display
  • LED lights
  • Servo motor
  • 3D printer
  • PLA material
  • Candy
  • Plywood
  • Laser cutting machine
  • Paint (spray and non-acid better)
  • Drill
  • Resistors 7x330Ohm and 3x220Ohm
  • Speaker
  • MP3 player
  • Pushbutton

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.

 

Supplies

  1. Computer (with Arduino software)
  2. Arduino Uno (or equivalent)
  3. Jump wires 
  4. 7 segment display 
  5. LED lights 
  6. Servo motor
  7. 3D printer 
  8. PLA material 
  9. Candy
  10. Ply wood 
  11. Laser cutting machine 
  12. Paint (spray and non-acid better)
  13. Drill
  14. Resistors 7x330Ohm and 3x220Ohm
  15. Speaker
  16. MP3 player
  17. Pushbutton

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.

Source: HALLOWEEN DIY CANDY DISPENSER WITH RIDDLE, 7-SEGMENTS & PUSHBUTTON, ARDUINO & 3D PRINTED | ELISAVA

Quick Solutions to Questions related to Halloween Candy Dispenser:

  • What is the main idea of the project?
    The project is a Halloween candy dispenser that releases candy when a user solves a riddle by pressing a button when the correct digit is shown on a seven-segment display.
  • Which microcontroller is used in the project?
    An Arduino Uno or equivalent is used.
  • How does the dispenser release candy?
    A servo motor activates a cardboard piece acting as a door, allowing candy to fall through a funnel-shaped mechanism into a tank.
  • Do I need to 3D print parts for the project?
    The project uses 3D-printed grave and tree parts, though commercial alternatives can be purchased to save time.
  • What must be done before combining all components in the final assembly?
    Program and test each component individually to ensure they work, install required libraries, and follow the pin connections from the wiring scheme.
  • How are the seven-segment LEDs wired?
    Each of the seven LEDs is wired independently with a resistor; an independent welded PCB is attached at the back of the grave for these connections.
  • Can the riddle answer be changed?
    Yes, the displayed target digit in the code can be changed to any number that suits you.
  • What fabrication tools are used for the base?
    The plywood base is designed in AutoCAD and cut precisely using a laser cutting machine, which can also engrave the riddle.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top