I had an opportunity to create something to introduce young minds to electronics, and I decided to create a Candy Dispenser. It was something that is very simple and achievable, but would look impressive to those who didn't know anything!
Basically, I hooked up a stepper motor to an Arduino, and made it rotate 60 degrees whenever the red button was pressed. Whenever a candy was over the hole, it would fall down into a little tray for display, and for people to take. I utilized gravity to my advantage, so that I would need fewer parts, and less energy for the entire system.
The hardest part of this project is 3D printing a mount for the stepper motor, which took a bit of modelling. It's always really cool when you design something to work on your computer, and seeing it actually working when you print it into the real world. I failed lots of times trying to print it with my cheap Chinese 3D printer, but I did finally make it work!
I used FreeCAD to design the mount, and used Ultimaker Cura 4.4 to print it out to my 3D printer! And finally, I had a beautiful mount that fit perfectly onto my stepper motor :0. Some things in life will never be that perfect. I also used some tape around the edges so that things wouldn't fall out due to the centripetal force. This saved a few hours of printing so that I could do real important stuff.
After this, I needed to design the main chassis of the build! Finally, using my engineering skills to the test, I used recycled cardboard and an old binder to create this. All I really did was cut out a circle roughly the same size as the 3D printed part, and then taped it to the stepper motor top. Then, to give it more stability, just cut a length of cardboard to wrap around the motor.
I now had a base for the candy to rest on, which was perfect for what I needed. All I did afterwards was tape it to the binder, and I was ready to start wiring!
Wiring was very simple though, just needing to put the 4 inputs of the ULN2003 board directly into the Arduino, and also a simple push button with a 10k pull up resistor on it. I ran wires underneath the binder to the red button with white wires, so that it looked more aesthetic. I used a 9V battery, to power the Arduino for portability, which I found that after ~100 uses, didn't have enough juice to power the Arduino and stepper motor. Very unreliable :(.
For the code, Arduino has a built-in library for controlling ULN2003 stepper motor drivers, so I just modified a few things in that library to create the specific angle needed for the stepper motor. Math makes sense!
Well, after all of that, it would make no sense for me not to show you a video of it actually working. I didn't have any real candy on me, but I did dispense a SD card. So here it is:
Well, after all of that, I brought it to the fair that we were having, and impressed some of the kids there! It was a real treat seeing there surprised faces, wonder where I learned magic from. They also liked the cheap candy I gave them. Other than that, it was a fairly simple project that was really fun to make!
I lost the 3D model used, but I linked the.gcode that I still have!
Comments
Please log in or sign up to comment.