Candy Machine


Our group made a candy machine for our school project. We decided it would be a fun and simple idea for high school students to be able to easily recreate.
Supplies
Materials used:
- Cardboard
- Fishbowl
- Funnel
- Sparkfun kit
- Arduino Software
- Access to Solidworks Software
- Access to 3D printer
- Hot glue
- Tape
- Candy
Make the Base


For the first step, you will cut up 4 10x10 pieces of cardboard, glue them together to make a box, leaving one of the sides to be the face and one to be the top. Then, a hole will be cut on the top side of the box that fits the diameter of the funnel.
Cut Materials Accordingly


Cut your funnel and your fishbowl to fit accordingly with each other and the hole in the box. You want everything to fit well so that the candy falls where it should. Attach it so that there is a hole that funnels the candy down to a reasonable point.
Build a Support for the Servo Motor
Next, moving inside; mark where the bottom of your funnel meets the interior of the candy machine. You will want to make a support so that the servo motor will lay securely on this to move your gear mechanism. Ae used cardboard and affixed it to the sides and floor to create a sturdy foundation! Remember! There is a lot of twisting in servo motors! Make sure you fasten it correctly or you will end up with candy on the floor!
Add Gear Mechanism to Project

Add your gear mechanism to the servo, in our case the gear simply pushed into place on the servo and did not need any extra support, if super glue is needed please use it.
Build the Candy Slide
Once you have that securely fastened and have added your gear mechanism, you can move on to building the candy slide. We used a C channel of cardboard that extended from the front face of the candy machine up to and past the mouth of the gear mechanism. Use 2 or more supports under this slide as this tends to move around a lot depending on the size of the candy. You will also want to build a catching area for the candy to end up in.
Build the Circuit and Program

The circuit will consist of a servo motor, and a distance sensor. Program it to detect the motion of your hand from a short distance, and for the servo motor to move 90 degrees forward and back. Our code for the project has been uploaded for guidance for your project.
Downloads
Place Arduino in the Machine
Last order of business is to place the Arduino board on the bottom of the machine! Make sure to cut a hole out of the side so the Arduino power cable can slot in! During this step you can also cut out the hole for you Ultra sonic sensor, this will be in the front panel along with a a hole for the candy slide.
Last Step!
Decorate as needed! And secure everything after testing a few times. Your machine will have a few common changes listed as follows:
- Varied servo rotate distance
- Varied Ultrasonic sensor range
- Varied amount of hot glue and or super glue
- Varied strength of cardboard
- Gear Mechanism
- Size shape and fit
While these do not change the overall construction procedure they will play a factor in the different steps to take so use your own discretion and have fun!