Upcoming shows/vending:

 

 

 

 

 Know of a show I should go to? Tell me!

* indicates big show (attendance in the thousands)

"What is this? A vending machine for ants?!"

My very first proof-of-concept for the claw machine ran on servos. The current claw machine uses stepper motors and for the longest time I wanted to use these leftover servo motors in a project. A vending machine seemed like a good idea to match the mini arcades...

Honestly I was just messing around with this project, as usual I got carried away/serious about it. If there is an interest in this. I will make more. 

I read on the Arduino.cc site how adding the "duino" suffex to things translates poorly in Italian.. but VenDuino just sounded soo good. Sorry in advance.

 

Shop items are available for this item here.

 

Parts you will need to build this:

  •     x4 Continuous rotation servo motors
  •     x20 #6x0.75inch machine screws+nuts (what holds the body together)
  •     x16 #6x0.5inch machine screws for fastening the servo and window panels to the frame
  •     x4 16mm diameter pushbuttons
  •     Nokia 5110 LCD (optional) + hardware to mount it
  •     74HC4050 Level Shifter. Used with Nokia LCD (needed if your microntroller uses 5V logic levels)
  •     Arduino compatible or similar micro controller (requires 4 PWM pins)
  •     LED strip lights (optional)
  •     Sacrificial wire hangers
  •     misc wires
  •     misc electronic stuff

Here's the STL file for the dispensing coil discs.

coil mount dispense circle 45mmdia.rar
Compressed file archive [11.2 KB]

Here's the circuit:

The code: 
Note: Please dont email me about "I cant get ____ to work".  It works, trust me. 

/*--------------------VenDuino V0_31------(c) 2016 Ryan Bates, RetroBuiltgames.com---------
Vending machine using FULL ROTATION servos.
I/O           PIN#
ServoA        ~11
ServoB        ~10
ServoC         ~9
ServoD         ~6
ButtonA         8
ButtonB         7
ButtonC         5
ButtonD         4
LEDready       13
LEDdispense    12
coinInsert     - 3
A0-A4 Nokia5110 LCD
*/
#include <LCD5110_Graph.h>

LCD5110 myGLCD(A0,A1,A2,A3,A4);

extern uint8_t SmallFont[];

const int ServoA = 11;
const int ServoB = 10;
const int ServoC = 9;
const int ServoD = 6;

const int clockwise = 1700;
const int counterclockwise = 1300;

const int ButtonA = 8;
const int ButtonB = 7;
const int ButtonC = 5;
const int ButtonD = 4;

const int LEDready = 13;
const int coinInsert = 12;

long previousMillis = 0;
long intervalIdle = 500;
int LEDreadyState = LOW;

int y1= 0; int y2= 10; //position shifters for LCd txt

void setup() { 
  
  myGLCD.InitLCD();
  myGLCD.setFont(SmallFont);
   myGLCD.setContrast(70);
  
  pinMode(ButtonA, INPUT_PULLUP);  
  pinMode(ButtonB, INPUT_PULLUP);
  pinMode(ButtonC, INPUT_PULLUP);  
  pinMode(ButtonD, INPUT_PULLUP);

  pinMode(LEDready, OUTPUT);
  pinMode(coinInsert, INPUT_PULLUP);
 
  myGLCD.invert(true);
  myGLCD.print("VenDuino", CENTER, 1);
  myGLCD.print("by Ryan", CENTER, 10);
  myGLCD.print("(c) 2016", CENTER, 30);
  myGLCD.drawRoundRect(13, 0, 70, 8);
  myGLCD.drawRect(0, 20, 83, 47);
  myGLCD.update(); delay(1000); myGLCD.clrScr(); myGLCD.update();

}
 
void loop() 

//--Blink Ready LED---------------------------------------------------
 unsigned long currentMillis = millis(); 
  if(currentMillis - previousMillis >= intervalIdle) { // save the last time you blinked the LED 
   previousMillis = currentMillis; 
  
   if (LEDreadyState == LOW){  // if the LED is off turn it on and vice-versa:
      LEDreadyState = HIGH; 
      
      myGLCD.clrScr(); 
     myGLCD.print("Please insert", CENTER, y1);
     myGLCD.print(" $0.25. ", CENTER, y2);
     myGLCD.invert(false);
     myGLCD.update();      }
    
   else
     LEDreadyState = LOW;
     digitalWrite(LEDready, LEDreadyState);// set the LED with the ledState of the variable:
     y1=y1 +5; y2=y2+5; //shift the text position down
     if ((y1==35) && (y2== 45)) //when the text almost goes off-screen, move it back up
        {y1=0; y2=10; }
  }
  
//---Wait for Coin/Credit---------------------------------------------------------------
while (digitalRead(coinInsert)==LOW) { //if coin inserted stay in servo enable loop
  digitalWrite(LEDready, HIGH);

  myGLCD.clrScr();  myGLCD.update(); 
  myGLCD.print("Please make", CENTER, 0); 
  myGLCD.print(" a selection. ", CENTER, 10);
  myGLCD.drawRect(20, 20, 63, 47);
  myGLCD.drawRect(20, 20, 41, 47);
  myGLCD.drawRect(20, 20, 63, 34);
  myGLCD.update();
  servoEnable();

                                      } 

  
  
}

void servoEnable(){  
 

while (digitalRead(ButtonA) == HIGH || digitalRead(ButtonB) == HIGH ||
digitalRead(ButtonC) == HIGH || digitalRead(ButtonD) == HIGH) {
  
 //---------Servo A----------------------------------------------------
  if ((digitalRead(ButtonA) == LOW) ) {
     for(int i=0; i<2; i++) 
    {digitalWrite(LEDready, HIGH); delay(50); digitalWrite(LEDready, LOW); delay(50); }
    
 myGLCD.clrScr(); myGLCD.print("Vending", CENTER, 0);
 myGLCD.drawRect(20, 20, 63, 47); myGLCD.drawRect(20, 20, 41, 47);
 myGLCD.drawRect(20, 20, 63, 34); myGLCD.print("A1", 25, 24); 
 myGLCD.update();

  
   for(int i=0; i<57; i++)  // change this to adjust +- full revolution
    {
    digitalWrite(ServoA,HIGH);
    delayMicroseconds(clockwise); // 1.7ms
    digitalWrite(ServoA,LOW);
    delay(18.5); // 18.5ms 
    //delay(50); enable this line to slow the angular velcity of the servo rotation
    }
    break;                            } // when item is dispensed exit loop and return to wait for coin


  //---------Servo B----------------------------------------------------

  if ((digitalRead(ButtonB) == LOW) ) {
    for(int i=0; i<2; i++) 
    {digitalWrite(LEDready, HIGH); delay(50); digitalWrite(LEDready, LOW); delay(50); }
    
 myGLCD.clrScr(); myGLCD.print("Vending", CENTER, 0);
 myGLCD.drawRect(20, 20, 63, 47); myGLCD.drawRect(20, 20, 41, 47);
 myGLCD.drawRect(20, 20, 63, 34); myGLCD.print("B1", 46, 24); 
 myGLCD.update();
 
   for(int i=0; i<57; i++)
    {
    digitalWrite(ServoB,HIGH);
    delayMicroseconds(counterclockwise); // 1.7ms
    digitalWrite(ServoB,LOW);
    delay(18.5); // 18.5ms 
    //delay(50); 
    }

   
   break;                            }


  //---------Servo C----------------------------------------------------

  if ((digitalRead(ButtonC) == LOW) ) {
    for(int i=0; i<2; i++) 
    {digitalWrite(LEDready, HIGH); delay(50); digitalWrite(LEDready, LOW); delay(50); }
    
 myGLCD.clrScr(); myGLCD.print("Vending", CENTER, 0);
 myGLCD.drawRect(20, 20, 63, 47); myGLCD.drawRect(20, 20, 41, 47);
 myGLCD.drawRect(20, 20, 63, 34); myGLCD.print("C2", 25, 37); 
 myGLCD.update();
 
   for(int i=0; i<57; i++)
    {
    digitalWrite(ServoC,HIGH);
    delayMicroseconds(clockwise); // 1.7ms
    digitalWrite(ServoC,LOW);
    delay(18.5); // 18.5ms 
    //delay(50);
    }
    break;                            }


  //---------Servo D----------------------------------------------------

  if ((digitalRead(ButtonD) == LOW) ) {
     for(int i=0; i<2; i++) 
    {digitalWrite(LEDready, HIGH); delay(50); digitalWrite(LEDready, LOW); delay(50); }
    
myGLCD.clrScr(); myGLCD.print("Vending", CENTER, 0);
 myGLCD.drawRect(20, 20, 63, 47); myGLCD.drawRect(20, 20, 41, 47);
 myGLCD.drawRect(20, 20, 63, 34); myGLCD.print("D2", 46, 37); 
 myGLCD.update();
    
   for(int i=0; i<57; i++)
    {
    digitalWrite(ServoD,HIGH);
    delayMicroseconds(clockwise); // 1.7ms
    digitalWrite(ServoD,LOW);
    delay(18.5); // 18.5ms 
    //delay(50); 
    }
    break;                            }

                                                                    }   

"What goes where"

Venduino Connection Cheat Sheet
Print Print | Sitemap
© 2013-2016 Ryan Bates and © 2013-2016 Retro Built Games, LLC. All photos, designs, documents, and graphics (C) Ryan Bates. All Rights Reserved.

This site is best viewed on a desktop PC. (Can't find the payment buttons? Use a desktop web browser or Request Desktop Site)