Straw Dispenser 

This is a 3D printed mechanism to dispense straws. It has 3 pieces, the legs that hold it above the conveyor belt, the base that holds the servo and a hole for the straw and the straw holder that holds 16 straws and connects to the servo to rotate. 


STL files for 3D Printing: Thingiverse

TinkerCAD Model: Coming Soon.

Parts Required


(1x) MG996R Servo Motor - AMAZON

(1x) Arduino Uno (can be any microcontroller) - AMAZON

(2x) M3x16mm bolts (to connect legs) - AMAZON

(1x) M3x40mm bolt (servo) - AMAZON







Build Instructions


Step 1

Print the parts in the stl file. Connect the base to the legs using M3x16mm bolts and M3 nuts.

Step 2

Connect the servo and attach the straw holder, using a M3x40mm bolt. 

Step 3

Connect the servo to an arduino and 5V power supply, see electronics and coding.  




To connect this to an arduino you need to connect the orange cable to a pin on the arduino and the red and black to 5V and GND on the arduino. If you are using multiple servos or find it cannot power them then connect them to a 5V source. You need to connect the ground of the power supply to the arduino ground or the servos will get very hot and break. 


Here is a basic example of how you would program the straw dispensing robot. It has a function for dispensing the straw and this is called in the main loop. 

Arduino code

#include <Servo.h>
Servo strawservo; //set up servo
bool START = true; //Stops looping
int strawNumber = 0; //set up variable for straw number

void setup() {
  strawservo.attach(9); //pin 9 servo

void straw() {
  if (strawNumber < 8) {strawNumber++;} else {strawNumber = 0;} //increment straws, reset at 8 straws
  strawservo.write(strawNumber*22.5); //move straw over hole (16 holes / 360 degrees)
  delay(1000);   //wait 1s

void loop() {
  delay(500); //wait 0.5s
  if (START == true) { //if first time:
    straw(); //dispense straw
    START = false // toggle this to allow looping