Intro: Double the Joy Candy Dispenser
"This instructable was created in fulfillment of the project requirement of the Makecourse at the University of South Florida (www.makecourse.com)"
This is a candy dispenser. Well not ONLY a candy dispenser this contraption can give sugar lovers everywhere TWO different types of candy!
Step 1: Materials and Hardware
(2) Small breadboards
(2) 10pin Female to female cable
Various Breadboard jumper wires
3d printed Parts
(3) SG90 9G servo
(1) HC-SR04 Ultrasonic Ranging Module
(2) Button Switches
(1) DC-47P DC Series Heavy Duty Electronics Enclosure
2 Different types of candy
Step 2: Eletrical Box
Begin with cutting a window on the front of the "DC-47P DC Series Heavy Duty Electronics Enclosure" it should be 2in by 0.8in. It should be about the size of the front of the proximity sensor as we will position the sensor through it.
Step 3: Code
Here is the code for the candy dispenser. Good luck
Step 4: Wireing
Now its time to wire this delicious creation. This is how I tackled the challenge.
Red wire = 5V
Blue = ground
Yellow = These connect the servo to the Arduino. (Make sure that the Pin correlate with the code)
Black = Connects the Button to the Arduino
Green = Trig pin on the proximity sensor
Purple = Echo pin on the proximity sensor
Step 5: 3D Printed Parts
Here are the printed part: The dispenser was made to fit together like a puzzle along with the ramp. I did have to sand the edges to get them to fit as we cannot control yet the expansion of plastic (too bad)
Step 6: Making the Slope in the Dispenser
So the dispenser's funnel is made out of cardboard and clay and then I wrapped tin foil over it to add a nice singular look and I a bit more sanitary then clay. Mold the clay to a 45 degree angle and the candy will smoothly fall through the bottom door. Make sure not to leave a sharp edge by the door as if there is the candy will get stuck.
Step 7: Assembling 3D Printed Parts
Candy dispenser ASSEMBLE! After fitting the piece together I used hot glue to keep them together It is not a necessity but i liked to have the security of it. I also glue the pillars to the bottom of the dispenser.
Step 8: Attaching Servos
I opted out of using screws because I wanted to, I prefer hot glue anyway. On the top part of the dispenser fit the servos where the rotating heads are close to each other then glue those babies to the dispenser so that they can never escape. For attaching the servo to the ramp I just glue one side of the servo to the ramp it does not need to hold a lot of wright so it is alright.
Step 9: Putting It All Together
To become one step closer to a sugar high. place the breadboard and arduino set up inside the electronics box putting the proximity sensor through the window we made earlier. The button just need to be connected to the ground and arduino pin so I used 2 small breadboards to create a little command station