Plug and Play Vending Machine!

by oneillgq in Circuits > Assistive Tech

100 Views, 3 Favorites, 0 Comments

Plug and Play Vending Machine!

IMG_2248.jpg
Interactive Accessible Vending Machine for Boston College Campus School.

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

stepper motors.jpg
lights.jpg
pico.jpg
breadboard.jpg
wires.jpg
female_audio.jpg

Electronics:

  1. Stepper Motor and Driver Board (3x)
  2. Addressable 50x LED Wire
  3. Raspberry Pi Pico*
  4. Raspberry Pi Pico Breadboard
  5. Female to Male Wires (a lot)
  6. Female Audio Jacks (x5)
  7. Small Speaker
  8. Extension Cord
  9. USB Wall Charger
  10. Male Audio Button (assuming you don't have one)


Materials:

  1. 1/4 in and 1/8 in Wood Boards*
  2. 1/4 in and 1/8 in Clear Acrylic*
  3. Foam Board
  4. Hinge
  5. Velcro Strips
  6. Electrical Tape
  7. Wood Glue
  8. Super Glue
  9. Screws (for 1/8 in holes)


Tools:

  1. 3D Printer (and plenty of filament)
  2. Laser Cutter
  3. Power Drill
  4. Hot Glue Gun
  5. Staple Gun
  6. 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

Set up a Raspberry Pi Pico W or Pico to use CircuitPython

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

IMG_2218.jpg
IMG_2224.jpg
IMG_2234.jpg
IMG_2233.jpg

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

IMG_2221.jpg
IMG_2223.jpg
IMG_2235.jpg

Using the attached files, laser cut the pieces of the box. Here are the different parts, and the materials they should be cut from:

  1. Box Front (1/4 in Acrylic)
  2. Vending Panels (1/8 in Acrylic)
  3. Track Panel (1/8 in Wood)
  4. 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

IMG_2242.jpg

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

IMG_2246.jpg
IMG_2236.jpg
IMG_2227.jpg
IMG_2229.jpg

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:

  1. Screw the U-Shaped piece into front where the letters are shown.
  2. Screw the two backing pieces (bump facing up!) to the back side.
  3. Screw the motor holder into back side, such that the motor faces to the right.
  4. Feed the track in all the way.
  5. 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

campus_wiring.png

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

IMG_2247.jpg

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

IMG_2244.jpg

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

IMG_2238.jpg
IMG_2243.jpg
IMG_2241.jpg

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!

IMG_2249.jpg

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!