Back to Expert Projects

🍹 Automated Drink Mixer

A robotic bartender combining pumps, load cells, and a web interface.

📋 Overview

Combine liquid handling with precise weight measurement. Users select a drink recipe on a web app, and the machine dispenses exact milliliter ratios using peristaltic pumps and a load cell feedback loop.

What you'll learn: Load cell calibration (HX711), pump transistor switching, and managing complex recipe JSON data.

Estimated time: 8-10 hours. Difficulty: ⭐⭐⭐⭐⭐ Expert.

🧩 Components Needed

ComponentSpecificationQtyNotes
ESP32WiFi1Hosts the web UI
Peristaltic Pumps12V4Food safe, easy to clean
TIP120 / MOSFETsTransistors4To drive the 12V pumps
Load Cell + HX7111kg max1Weighs the glass
Power Supply12V 5A1

📖 Step-by-Step Tutorial

1

Pump Circuits

Wire each 12V pump to a MOSFET, controlled by an ESP32 GPIO. Add flyback diodes across the pumps.
2

Calibrate Load Cell

Place an empty glass on the scale. Tare it. Pour exactly 100ml (100g) of water and calculate the HX711 calibration factor.
3

Web Interface

Serve a React or plain HTML page with drink recipes. E.g. "Rum & Coke: 50ml Pump 1, 150ml Pump 2".
4

Dispensing Logic

Turn on Pump 1. Constantly read the scale until the weight increases by 50g. Turn off Pump 1. Repeat for Pump 2.
💡
Peristaltic pumps are best for drinks because the liquid only touches the silicone tube, never the pump mechanism. They are hygienic and self-priming.

💻 Code / Configuration

drink_mixer.ino
INO
// Dispensing Logic (Snippet)
#include "HX711.h"

HX711 scale;
const int pump1 = 25;
const int pump2 = 26;

void setup() {
  scale.begin(16, 4); // DOUT, SCK
  scale.set_scale(2280.f); // Calibration factor
  scale.tare();
  
  pinMode(pump1, OUTPUT);
  pinMode(pump2, OUTPUT);
}

void pourIngredient(int pumpPin, float targetGrams) {
  scale.tare(); // Zero the scale before pouring
  float currentWeight = 0;
  
  digitalWrite(pumpPin, HIGH); // Turn pump on
  
  while (currentWeight < targetGrams) {
    currentWeight = scale.get_units(5); // Average 5 readings
    delay(50);

Reviews & Ratings

0 reviews
5★
0
4★
0
3★
0
2★
0
1★
0
...

Loading reviews...