Candyland Gumball Machine
We created a Candy Land-themed gumball machine that targeted all types of people in hopes of gaining a wide range of audience. The machine is ignited by a coin that pushes a button that signals a gear to rotate 180 degrees to drop a gumball that slides down a tube into the hands of a customer. It provides a well-themed and engaging process that people will never want to let go of.
Supplies
- 3D Printer and then required stl files
- Arduino Uno
- Servo motor
- Wires
- Limit switch
- Code for Arduino
- 3x cardboard pieces
- Hot glue
- Clear tube
- 2 panels of wood(3 feetx1 foot)
- Candy Land signs
- Plexiglass
- Multi-colored paint
- Yarn
- Cardboard sheets
- Craft knife or scissors
- Ruler
- Pencil
- Acrylic paint and brushes
- Optional: decorations like colored paper, markers, and other craft supplies
Assemble the Base Rectangle/Plexiglass
Steps:
- Design Your Cuboid:
- Use a ruler to measure and draw the desired dimensions on the cardboard.
- Cut Out the Cuboid:
- Using a craft knife or scissors, carefully cut along the lines you've drawn on the cardboard. Be sure to cut out two identical rectangles for the sides and two identical rectangles for the top and bottom of the cuboid.
- Assemble the Cuboid:
- Fold the rectangles along the lines, creating right angles to form the cuboid shape. Use craft glue or a hot glue gun to secure the edges and hold them in place until the glue dries.
- Paint the Cuboid:
- Once the cuboid is assembled, you can start painting it. Consider the Candy Land theme of your castle.
- Use acrylic paints and brushes to paint the cuboid. You can add texture and details to make it look like the actual pathways and roads of Candy Land to make your piece come to life(candy canes, winter wonderland)
- Add Details:
- You can enhance the appearance of the cuboid by adding details like adding different characters and buildings from the board game Candy Land. You can paint these on or use construction paper to cut out and glue them onto the cuboid/ just paint the pictures on as we did.
- Let It Dry:
- Allow the paint and glue to dry completely. This may take a few hours, depending on the materials and the thickness of the paint.
- Attach to the Castle:
- To attach the painted cuboid to your castle, use craft glue or a hot glue gun. Be careful with the placement to ensure it fits seamlessly with the rest of your castle structure so that it is in line with the insertion of the coin.
- Decorate the Castle:
- Continue to decorate the entire castle with additional features such as distinct colors from the board game, different characters, or different architectural pieces that are components of the game.
- Let It All Dry:
- Once you've attached and decorated your cuboid and the rest of your castle, let everything dry thoroughly.
- Plexiglass
- Cut out the dimensions of the cuboid with plexiglass and hot glue the piece to the base board and ensure its stability before ensuring trust that it will stay in place.
Regenerate
Castle Creation/Coin Insertion
- Sketch out a basic design for your cubed castle. There are 4 sides and a top that is squared representing the castle structure.
- Cut the Cardboard:
- Using a utility knife or scissors, cut out the cardboard pieces for your castle based on your design. Be sure to cut out squares or rectangles for the walls, towers, and the other structural components needed for the castle like structure of the roof.
- Assemble the Cubes:
- To create the basic cube-shaped towers and walls, fold the cardboard pieces at the edges and use the hot glue gun to attach them. Make sure the edges are aligned properly to create a sturdy structure.
- Create Towers:
- For the towers, you can create turrets by cutting and folding smaller pieces of cardboard and attaching them to the top of the main tower structure.
- Connect the Cubes:
- Use the hot glue gun to connect the cubes to one another, forming the walls and towers of your castle. Ensure that they are securely attached and aligned as desired.
- Add the squared Roof:
- Create the roof by cutting squares that go up and down depicted in the image that displays the castle-like structure.
- Decorate Your Castle:
- You can get creative with decorating your cardboard castle. There are so many specific aspects in Candy Land that you could paint across the castle to add more theming to your gumball machine.
- Interior Details:
- For the coin insertion, cut out 3 one-inch by 4-inch cardboard rectangles and glue them together with hot glue. Make sure it is lined up with the gap made between the plexiglass and the base pathway that is used to transport the coin to push the button to ignite the gear.
- Finishing Touches:
- Once you're satisfied with the appearance of your cubed castle, you can add any final touches or details to make it even more impressive.
Arduino Code/Servo Motor
- First, you have to make your circuit to power to contraption which means you need to gather your supplies.
- Place everything according to this demonstration and make sure all of the wires are in their proper position to ensure there is no errors with the function of the Arduino(VERY IMPORTANT). Even if a single wire is out of place, this will cause the code to be nonfunctional and the servo motor will not be able to deliver the gumballs.
- Once this is done use the Arduino ide app and transfer this code into the circuit. This code will ensure and notify the gear of what movements are required to complete the proper gear drop-off.
- This is the code that will be used to tell the servo motor how to move.
#include <Servo.h>
Servo myservo; // create servo object to control a servo
#define servoPin 3 //~
#define pushButtonPin 2
int angle =0; // initial angle for servo (beteen 1 and 179)
int angleStep =10;
const int minAngle = 0;
const int maxAngle = 180;
const int type =2;//watch video for details. Link is at the top of this code (robojax)
int buttonPushed =0;
void setup() {
// Servo button demo by Robojax.com
Serial.begin(9600); // setup serial
myservo.attach(servoPin); // attaches the servo on pin 3 to the servo object
pinMode(pushButtonPin,INPUT_PULLUP);
Serial.println("Robojax Servo Button ");
myservo.write(angle);//initial position
}
void loop() {
if(digitalRead(pushButtonPin) == LOW){
buttonPushed = 1;
}
if( buttonPushed ){
// change the angle for next time through the loop:
angle = angle + angleStep;
// reverse the direction of the moving at the ends of the angle:
if (angle >= maxAngle) {
angleStep = -angleStep;
if(type ==1)
{
buttonPushed =0;
}
}
if (angle <= minAngle) {
angleStep = -angleStep;
if(type ==2)
{
buttonPushed =0;
}
}
myservo.write(angle); // move the servo to desired angle
Serial.print("Moved to: ");
Serial.print(angle); // print the angle
Serial.println(" degree");
delay(100); // waits for the servo to get there
}
5. Once the code is successfully placed into the site, the basic code will be able to tell the servo motor what to accomplish.
6. Furthermore, you print the required files which allows you to obtain the gumball holder.
The Gear(moves the Gumball)
- Software: Inventor
- Make sure the opening of the gear is a little greater than 10 mm as this is how big the gumballs are.
- Create a circle and extrude the circle so there is at least a 10 mm gap and that the shape resembles a robotic arm or PAC-MAN(good reference). The gap is rectangle-shaped and should be at least 10 mm in length, width, and depth.
- The gumball holder is what you'll attach to the servo motor.
- With this you add the mechanism to the required spots as shown in the pictures.
- Configure everything together where the limit switch is in the coins end path and the gumball holder is in a spot under a gumball reservoir and where it can turn 180 degrees into an exit hole and boom the internals are finished.
Downloads
Coin Collecting Station
Overview: After the coin is pushed to ignite the entire gumball process, the coin hits the button to start the gear to release the gumball. The coin then falls into an accessible compartment that collects the coins to prevent them from falling on the ground. This compartment was made out of cardboard was cube-shaped and had a square cut out to be able to regain the coins.
- Cut 4 pieces of cardboard(all 3 inches by 3 inches). Glue these together in a cube shape which will leave one side that does not contain a side of the cube.
- After glued together, correctly place and glue this structure over the button that the coin will ignite. This cardboard box will allow for a place for the coins to be collected without having to pick up all of the falling coins.
- Cut out a 2-inch by 2-inch square out of the facing side of the box to be able to have a location that is easily accessible to regain all used coins.
- Make sure it centered so that the coins have enough room to fall and gather.
Carrier for the 10 Mm Gumballs
Overview: We made an area for the gumballs to gather and wait to be acquired by a customer. We made steep ramps to ensure the gumballs were going into the slot of the gear so that the process of getting a gumball would be quick and efficient. The carrier was made of cardboard that was glued to the wooden structure above the moving gear.
- Measure and mark your cardboard:
- Draw a 4x4 inch square on your cardboard. You can use a ruler to ensure your measurements are accurate.
1. Cut out the square:
- Use scissors or a utility knife to carefully cut out the 4x4 inch square you marked.
- Score the lines:
- On the cardboard square, mark lines 1 inch away from each edge, creating a smaller square in the center.
- Fold along the scored lines:
- Carefully fold the cardboard along the scored lines to create the sides of the box. You may want to use a ruler to help with straight folds.
- Assemble the box:
- Apply glue to the flaps created by the folded sides, and then press them together to form the box.
- Allow the adhesive to dry:
- If you're using glue, give it some time to dry and set the box.
- Create ramps in the box to ensure gumballs fall into place with the hole(2x2 inch ramps x4-glue as a guide for the gumballs)
NOTE(The recommended amount of gumballs this can fit is 17 as we wanted enough for the required amount(10) but a little more just to be on the safe side)
Assembling All Components
- Gather the two wood panels and drill them to the base wood boards so they are 2 inches apart from each other. They should create an image as if two skyscrapers were next to each other(allows for more stability and height so that everything can fall into place with enough gravity pulling every object into its correct position.
- Next, Hot glue the castle in line with the base structure on top of the wooden panels. The base structure is where the coin will go along the path and eventually ignite the gear through the button. The castle should be placed in between the plexiglass to allow space for the coin to fall through and be aligned with the correct path. Allow a few minutes for the glue to dry before any other assembling
- After the glue is dried, get another sheet of cardboard and cover the entirety of the front of the wooden panels so that no wooden panels can be seen. This piece will be used to increase Candy Land theming by placing the Candy Land signs bought to display the different "lands" of the board game. It adds to the theme and makes it more appealing to the human eye. There are a lot of signs, so it is important to try your best and evenly spread them out so they are not all on top of each other.
- Glue the coin-collecting cardboard box into the area where the button is located to ignite the gear.
- Place the engineering/code/button right under where the coin is dispensed from the Candy Land pathway seen through the plexiglass. The button's wires that connect to the servo motor will be placed inside the castle to increase the overall look of the gumball machine.
- The servo motor is then placed on the other side of the machine which allows the right amount of space for the gumball carrier box to go above it. The servo motor should be placed carefully to ensure that the gumball will fit when it moves along the box of the cardboard.
- Place the gumball carrier right above the opening of the servo motor so the gumballs can easily fall into the opening to maximize efficiency in the gumball machine
- Cut a hole right under where the servo motor will drop the gumball and create a ramp to guide the gumball to the clear tube. The hole should be bigger than the diameter of the gumball(10 mm) so that it does not get stuck.
- Once the hole is created, hot glue the clear tube to the hole so that the gumball can be seen as it drops to the compartment to pick your gumball up for chewing.
- Create another cardboard box that has similar dimensions to the coin collection box, so that the gumballs have somewhere to fall in to ensure they do not go on the ground.
- Observe any pieces that need tweaking and fix the issues that may be created. After everything works perfectly, you have successfully made your Candy Land-themed gumball machine!!