Plug and Play Vending Machine!
by oneillgq in Circuits > Assistive Tech
100 Views, 3 Favorites, 0 Comments
Plug and Play Vending Machine!
When I get a little bit hungry, there is nothing more satisfying to me than feeding a dollar into a vending machine and watching a delicious snack fall down. In order to make this ful-filling (get it?) feeling more accessible, a friend and I built a plug-and-play vending machine! You can select and choose any snack you want, all with one button!
Supplies
Electronics:
- Stepper Motor and Driver Board (3x)
- Addressable 50x LED Wire
- Raspberry Pi Pico*
- Raspberry Pi Pico Breadboard
- Female to Male Wires (a lot)
- Female Audio Jacks (x5)
- Small Speaker
- Extension Cord
- USB Wall Charger
- Male Audio Button (assuming you don't have one)
Materials:
- 1/4 in and 1/8 in Wood Boards*
- 1/4 in and 1/8 in Clear Acrylic*
- Foam Board
- Hinge
- Velcro Strips
- Electrical Tape
- Wood Glue
- Super Glue
- Screws (for 1/8 in holes)
Tools:
- 3D Printer (and plenty of filament)
- Laser Cutter
- Power Drill
- Hot Glue Gun
- Staple Gun
- Clamps
Notes:
Only electronics are shown in the images above and the provided purchase links are just suggestions. If you find something cheaper, go for it!
*USB-C data cable needed for connecting/uploading to Pico
*Review the AI and Design files to calculate how much wood/acrylic you think you'll need
Setup Pi Pico + Upload Code
Before using the Rasberry Pi Pico, we need to set it up! I highly advise following this informative video by John Gallaugher. After your board is setup, upload the attached code file! Be sure to name it "code.py" or it will not work!
Downloads
3D Print Additional Parts
Print out the following parts using a 3D printer using whatever color filament you want. Once they are done, super glue the six pieces into the U-shape shown in the pictures! Then, super-glue the bracket-like pieces on top of each piece, as shown in the picture. DO NOT GLUE THE GEAR TO THE MOTOR!
For the motor holders, you can super glue as well, but be sure that the SHORTER SIDE is on the LEFT SIDE of the motor.
For the rack (not shown in pictures) you will need laser-cut parts, so wait.
While these parts are still printing (it will take a while), feel free to move to future steps.
Laser Cut Box Parts + Assembly
Using the attached files, laser cut the pieces of the box. Here are the different parts, and the materials they should be cut from:
- Box Front (1/4 in Acrylic)
- Vending Panels (1/8 in Acrylic)
- Track Panel (1/8 in Wood)
- Everything Else (1/4 in Wood)
Shown above is the backing piece and the divider piece that slots between the two sides of the box. IT IS CRITICAL THAT THESE PIECES ALIGN! When the vending bottoms are retracted, they stick outside the box a bit, so be sure to assemble the box with these correctly orientated. Use the image of the assembled box to get an idea of what it should look like.
When joining wood to wood, cover all the connecting joints with wood glue. However, when connecting the acrylic, I would suggest super glue so it holds better! DO NOT GLUE THE TOP ON NOR THE DIVIDER! While it dries, I would advise using clamps so that the joints are strong and aligned!
Attach Box Top
Using screws and the hinge, connect the box top to the back side. To be extra safe, you can put foam board over the screw to make sure you do not accidentally cut yourself opening it!
We also had extra velcro which we used on the corners such that the top is extra secure, but that is up to you!
Assemble Track
A very short step, but one that can only be completed after 3D printing and laser cutting: glue the track to the track panel. Make sure it is flush against the back of the panel and as centered as possible!
Assemble Divider Piece
By this point, hopefully all your 3D prints have finished and you have glued them together!
Repeat the following steps three times for each slot:
- Screw the U-Shaped piece into front where the letters are shown.
- Screw the two backing pieces (bump facing up!) to the back side.
- Screw the motor holder into back side, such that the motor faces to the right.
- Feed the track in all the way.
- Attach the gear to the motor such that it aligns with the track.
Afterwards, super glue the acrylic panels into the front. They should fit somewhat snugly with the same height. Be careful to not scratch the panels or leave super glue that dirties them.
Use the above photos as reference material!
Wire It Up
Apologies in advance to those of you who do not like wiring... there is a lot of it 😅
Following the above wiring diagram to the best of your ability! I would also highly recommend labeling each of the audio cables, as from left to right they should be: A, B, C, Demo.
Similarly, the motor drivers are also from A, B, C from left to right.
If you are feeling extra ambitious, you can solder them in as well!
Attach Breadboard
Attach a velcro loop (fuzzy) strip the length of the divider just above the holes that will be used for the speaker! Then attach the velcro hook (not fuzzy) strip to the backs of the breadboard, and each motor controller. For the motor controllers, I would also recommend placing electrical tape on the back before adding the velcro. Then stick each piece on!
Thread Audio Cables
Having (hopefully) marked the proper audio cables, you can now thread them through the labeled holes, and use a combination of hot glue and super glue to secure them! Be careful not to accidentally yank them out!
The remaining audio cable should be plugged into the speaker.
Thread LEDs
Thread the LED cable between the containers such that they can stick into the label holes in the divider. The 4th, 7th, and 10th lights should be in C, B, and A respectively! Be sure to hot glue or super glue them in.
Next, feel free to staple remaining LEDs to the box top until there is no more room left! Any leftover LEDS can be just cutoff, the strip will still work!
Wherever you end up threading the LEDs, be sure to leave a notch such that the top can still close.
Finish!
Use the extension cord and USB charger to plug in the Pico as well as the speaker, make sure they are both on, and you are all set!
For an explanation of the vending machines functionality, be sure to watch the video at the top!
NOTE: If you notice issues with the platforms retracting, you can add counterweights to the back, or sand the backing holes to make them larger!