Alien Candy Dispenser Game

by Croissanto in Workshop > 3D Printing

36 Views, 0 Favorites, 0 Comments

Alien Candy Dispenser Game

Screenshot 2025-11-05 115628.png

In the United States, October brings oversized yard spiders, cascades of orange LEDs over carved pumpkins, and a soundtrack of staged screams: Halloween. Rooted in Celtic Samhain and later Christian observances, it has long been a fixture of American life.

After the COVID-19 pandemic in 2020, concerns about distancing and contagion kept many families indoors. People also are discouraged to go out and trick or treat when there’s barely any incentive to do so. Neighborhoods reported steep drops in trick-or-treaters—some longtime residents saw fewer than five knocks at the door. Skipping communal rituals carries costs: weaker social skills, increased isolation, and fewer formative memories.

Team LOL (Lambda Omicron Lambda) has agreed to create a completely original minigame. Bright, eye-catching, exciting. This alien has invaded Earth, it is your mission to kill the alien and collect its candy. This machine will make Halloween an interactive event rather than a spectator one, reviving the Halloween spirit, encouraging people to trick or treat again.

Meet the Alien.

He’s not your usual Halloween decoration to hand out candy. Powered by IR sensors and an Arduino, the alien stores everything your heart desires. You just have to get it from him.

Shoot the 3 eyes of the alien and receive your prize.

Supplies

Here are the supplies needed for this project:

  1. 2 pieces of 24 x 24 x 0.5in plywood
  2. 4 piece 24 x 2 x 4in of MDF wood
  3. 4 pieces of 24in 2x4s
  4. 2 pieces of 22.75in 2x4s
  5. Woodscrews
  6. Arduino Uno
  7. Assortment of M-M, M-F, F-F wires
  8. Small DC motor
  9. 3 IR sensors
  10. IR laser module
  11. Tactile button
  12. H-Bridge Motor Driver L298N
  13. 4 Red LEDs
  14. 3 220Ω Resistors
  15. 1 330Ω Resistor
  16. AA Battery Pack holding 2 batteries
  17. AA Battery Pack holding 4 batteries
  18. 6 AA Batteries
  19. Tissue Paper
  20. Green Paint
  21. USB 2.0 Cable Type A/B

And the tools needed:

  1. Drill
  2. Wire Stripper
  3. Soldering Iron
  4. 3D Printer
  5. Screwdriver
  6. Hot glue gun
  7. Jigsaw

Build the Main Body Part 1

Screenshot 2025-11-06 112420.png
Screenshot 2025-11-06 112429.png
Screenshot 2025-11-06 112438.png
  1. Cut 4 Pieces of MDF wood into a 2’x2’ square
  2. Cut 2 Pieces of the plywood into a 2’x2’ square
  3. Cut the 2x4s into 4 2ft pieces (these will be the frame of the box.
  4. Cut a piece of 2x4 into 10.5’’
  5. Using the wood screws and a drill, attach the 4 2x4s onto the edges of one of the pieces of plywood all in the same orientation (as shown)
  6. Cut out the face of the alien according following to figure A
  7. Drill a hole at the edges of the the “mouth”
  8. Using a Jigsaw, cut out the hole for the mouth of the alien.
  9. Drill circular holes for where the eyes will be on the face. The left hole is 7 Inches from the left wall and 9 inches from the top of the box. The middle hole is 12 inches from the left wall 5 inches from the top. The right hole is 7 inches from the right wall and 9 inches from the top. Each hole is .75 inch in diameter.
  10. Secure the face of the alien to the frame of the box using 3 screws on each side, one on the top, another in the middle, and the third at the bottom, Line up the board so the top of the board lines up with the top of the 2x4, the board should be attached to the thin side of the 2x4s as show

Electronics

Screenshot 2025-11-05 115636.png
Screenshot 2025-11-05 115646.png

Wire all the components for the candy spinner and sensors for the main body.


For the laser gun, create a separate circuit according to the picture.

Make the IR Laser Gun

Screenshot 2025-11-06 111719.png
Screenshot 2025-11-06 111736.png
Screenshot 2025-11-06 111729.png
  1. Have all 3 pieces of gun printed
  2. Wire the battery pack, IR laser, and button like so
  3. Put the circuit into the gun according to the picture. Notice how the tactile button is sandwiched.
  4. Finish assembling the gun by screwing the two parts together with the switch sandwiched in between


Candy Dispenser

Screenshot 2025-11-06 112836.png
Screenshot 2025-11-06 112841.png
Screenshot 2025-11-06 113330.png
Screenshot 2025-11-06 112857.png
Screenshot 2025-11-06 113314.png
  1. Insert the axle into the Spinner, it will be a tight fit so feel free to use something to push it in.
  2. Place the Axle and Spinner into the Candy Dispenser body, then close the cap over it as shown.
  3. Using Hot glue, connect the candy output tube to the 9’’ piece of 2x4, line up the bent part of the tube so that It would be 1 inch from the bottom of the 2x4 as shown
  4. Put the Candy Dispenser into the existing body, lining up the tube with the mouth of the alien, line up the bottom lip of the tube with the bottom lip of the alien
  5. Using Hot glue, connect the mouth of the alien to the Bottom tube, outside of the alien as shown.
  6. Place the Candy Dispenser on top of the Bottom tube as shown

Build the Main Body Part 2

Screenshot 2025-11-06 114234.png
Screenshot 2025-11-06 114432.png
Screenshot 2025-11-06 114440.png
Screenshot 2025-11-06 114455.png
Screenshot 2025-11-06 114501.png
Screenshot 2025-11-06 114509.png
Screenshot 2025-11-06 114525.png
  1. On top of the 9” piece of the 2x4, attach a 5” x 8” wood board with wood screws as shown. This will be the board to place the electronics.
  2. Place the circuit on this board and fit the motor into the hole in the candy dispenser as shown. Secure the motor with hot glue. Use the adhesive of the breadboard to attach it securely on the wood board. Hot glue on the bottom side of the UNO board, H-bridge, and battery pack to secure it.
  3. Attach the corresponding IR sensors and LEDs to each hole for the alien eyes. Make sure the holes are big enough so the entirety of the IR sensor and LED can fit through. Widen the hole if necessary. Secure it with duct tape as shown.
  4. Create the funnel from the 3D printed parts by glueing them together.
  5. Position the funnel so that the output end of the funnel lines up with the input tube of the candy dispenser as shown. Tilt the funnel so capsules will roll down.
  6. To hold the funnel in this position, cut two 2x4s into 2ft pieces. Cut the top of each piece at an angle so the funnel can rest at the position defined in section l as shown.
  7. Use wood glue to attach the funnel onto the 2x4 pieces. To attach the wood pieces to the body, screw in wood screws from the bottom of the body.

Programming

Add this program into the code sketch.


#include <Arduino.h>

#include <IRremote.hpp>

#define LED1 2

#define LED2 3

#define LED3 4

#define IR_RECEIVE_PIN 5

#define IR_RECEIVE_PIN2 6

#define IR_RECEIVE_PIN3 7

#define in1 8

#define in2 9

#define SUPPORT_MULTIPLE_RECEIVER_INSTANCES

void UserIRReceiveTimerInterruptHandler();

IRrecv SecondIrReceiver(IR_RECEIVE_PIN2);

IRrecv ThirdIrReceiver(IR_RECEIVE_PIN3);

bool target1 = false;

bool target2 = false;

bool target3 = false;

int time = 0;

bool flag = false;

void setup() {

Serial.begin(9600);

pinMode(LED1, OUTPUT);

pinMode(LED2, OUTPUT);

pinMode(LED3, OUTPUT);

pinMode(in1, OUTPUT);

pinMode(in2, OUTPUT);

IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);

}

void reset(){

target1 = false;

target2 = false;

target3 = false;

flag = false;

time = 0;

digitalWrite(LED1, LOW);

digitalWrite(LED2, LOW);

digitalWrite(LED3, LOW);

}

void loop() {

reset();

while(time<30){

if(IrReceiver.decode()){

target1 = true;

flag = true;

digitalWrite(LED1, HIGH);

IrReceiver.resume();

}

if(SecondIrReceiver.decode()){

target2 = true;

flag = true;

digitalWrite(LED2, HIGH);

SecondIrReceiver.resume();

}

if(ThirdIrReceiver.decode()){

target3 = true;

flag = true;

digitalWrite(LED3, HIGH);

ThirdIrReceiver.resume();

}

if(target1 && target2 && target3){

break;

}

if(flag){

delay(1000);

time++;

}

}

if(target1 && target2 && target3){

digitalWrite(in1, HIGH);

digitalWrite(in2, LOW);

delay(800);

digitalWrite(in1, LOW);

digitalWrite(in2, LOW);

delay(3000);

reset();

}



void UserIRReceiveTimerInterruptHandler() {

SecondIrReceiver.ReceiveInterruptHandler();

ThirdIrReceiver.ReceiveInterruptHandler();

}