Site Navigation

Your Account

Choose Language

Controlling a Dispenser with an Arduino Uno

Hey everyone!

I've been attempting to control my Bartendro Dispenser with my Arduino Uno for the past few weeks. I've been getting the pump to work intermittently, but it often shuts off without warning, or will randomly start and stop pumping commands, but usually the pump doesn't respond at all. I have been unable to make any serial contact with the pump using the "!" or "?" as suggested. (I have tried switching the Tx and Rx around as often suggested in other help forums.)

Accessory parts I've been using include the RJ-45 Connector and RJ-45 Breakout as suggested on the "Control a Dispenser from a Computer"guide on this same site, as well as a 12 Volt Arduino adapter as the power source (I have also tried hooking an 18V power supply with no results). The code I've been using is shown below; it is designed to first establish communication with the pump, then have it start/stop pumping for a short amount of time in a loop. Does anyone have any suggestions for improving this code, or does anyone have a piece of code they have gotten to work with their Pump/Arduino setup that they would be willing to share?

Thanks everyone.

#include <SoftwareSerial.h>  

SoftwareSerial mySerial(0, 1); // RX, TX

void setup() {
  pinMode(0, INPUT);
  pinMode(1, OUTPUT);
  mySerial.begin(9600);
  delay(100);
  mySerial.println('!');
  delay(1000);
}

void loop(){
    mySerial.write("tickdisp 50 255/n/r");
    delay(5000);
}
Answer this question I have this problem too

Is this a good question?

Score 2

Comments:

I was able to get pump going using code below, however, It does not work consistently. For example, I run it the first time and then cut the power so that I can upload a new sketch and it doesn't work again. Not sure what the issue is... maybe I have a bad pump???

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX, TX

byte d=0xFF;

void setup() {

pinMode(2, INPUT);

pinMode(3, OUTPUT);

mySerial.begin(9600);

delay(100);

mySerial.println("!!!");

mySerial.println("?");

mySerial.write(d);

}

void loop(){

mySerial.write(" tickdisp 50 255\n\r"); // tickdisp <ticks> <speed>

delay(500);

}

by

Hey Rishimanda59. Have you been able to get a fix for the issue above? I have had a similar problem where the dispenser does not work at times.

by

Add a comment

1 Answer

This worked for me on a teensy 3.2 that has two serial ports.

I also had to add a wire between 5VDC and RST on the cat5 cable to the bartendro. It was reseting constantly otherwise.

#include <Bounce2.h>

#define BUTTON_PIN 16

Bounce debouncer = Bounce();

void setup() {
  // Setup the button with an internal pull-up :
  pinMode(BUTTON_PIN, INPUT_PULLUP);
  // After setting up the button, setup the Bounce instance :
  debouncer.attach(BUTTON_PIN);
  debouncer.interval(20); // interval in ms
  delay(2000);
  Serial.begin(9600);
  Serial1.begin(9600);
  Serial.println("Both serial ports initialized...");
  //textmode...
  Serial1.write("!!!");
  Serial1.write(0x0D);
}

void loop() {
  // Update the Bounce instance :
  debouncer.update();
  if ( debouncer.fell() ) {
    Serial.println("Button Press detected");
    dispense(30);
    digitalWrite(13,LOW);
  }
}

void dispense(uint16_t ml) {
  //uint16_t ticks = int(ml*2.78F);
  Serial1.write("tickdisp 11 135"); 
  Serial1.write(0x0D);
  delay(500);
}

Was this answer helpful?

Score 0

Comments:

I also had to add a wire between 5VDC and RST on the cat5 cable to the bartendro. It was reseting constantly otherwise.

by

Add a comment

Add your answer

Joe Budenske will be eternally grateful.
View Statistics:

Past 24 Hours: 0

Past 7 Days: 13

Past 30 Days: 22

All Time: 158