Project · ESP32 & Rust

Cocktail machine

An open, home-built cocktail machine – controlled by an ESP32, programmed in Rust, operated via a web interface served directly by the device. No server needed: join the Wi-Fi, open the address, tap a drink.

What it is about

Using two stepper motors, the cocktail machine moves a carriage (X axis) with the glass under one of six drink slots. There the Z axis triggers a mechanism that dispenses one portion – a slot can also be a pump. Everything is operated via a web page that the ESP32 serves itself: simply join the Wi-Fi with a phone, tablet or PC, open the address, tap a drink. No additional server, no installation needed.

There is now also an Android app written in Kotlin. On start-up it looks for the machine by itself: first the last address used, the hostname and the fallback Wi-Fi, then the entire subnet. The machine is recognised by its response to the configuration query. The app speaks the same interface as the web interface; the firmware did not have to be touched for it. It is a convenience, not a requirement.

Drink selection in the cocktail machine’s web interface

Try the machine

A replica of the real controller: the carriage travels along the X axis under the selected slot, and the Z axis presses against the release mechanism – about 20 ml per stroke. At the end comes the homing run to the zero point, where the glass is removed. Slot 6 is designed as a pump and runs on a timer.

ESP32 · Cocktail machine ready
X axis0 mm
Z axisup
Slot–
in glass0 ml
Ready. The machine is homed.
Distances and times are to scale with the real machine – just faster, so there is no waiting.

What the machine can do

Operation in the browser

Large drink tiles, ideal for a tablet as a permanently installed panel. A tap is all it takes.

Teach-in by click

Slot positions, Z height and dispensing position are approached by hand and saved – no calculating.

Recipes & pump

Drinks as “slot × portions”. A slot can be a pump with its own Z position.

Safety first

Emergency stop, software end limits, speed limits, homing abort and limited queues.

Router or standalone

Join the home Wi-Fi – or the machine sets up its own Wi-Fi, with no router at all.

Guest mode

Guests only see the drinks and the emergency stop. Administration is behind a password.

A look at the interface

Setup view

Everything is taught in the protected area: the six slots, the Z release height, speeds and dosing times. Drinks are created there with an icon and a recipe.

Everything is stored permanently on the ESP32 (NVS flash) and survives power cuts and restarts. Every device on the Wi-Fi sees the same configuration.

The interface is responsive and works just as well on a phone. The emergency stop is always within reach, as is homing – for guests too, without a password.

On first start, a few example drinks are ready as suggestions, so it is immediately clear what recipes look like.

Mobile view

Getting started

What is needed: an ESP32, the mechanics (two axes with stepper motors and limit switches) and the Rust ESP toolchain. Then:

  • Enter the Wi-Fi details: copy .cargo/config.toml.example to .cargo/config.toml and fill it in.
  • Build and flash the firmware: cargo run --release
  • Open the interface at http://cockimate/ or, in standalone mode, at http://192.168.71.1/
The complete instructions (wiring, pins, API, FAQ) are in the manual and in the included DOKUMENTATION.md. How the program is structured is described under Development & structure.

Contact

Questions about how it is built, the decisions behind it, or how it might carry over to another case.

Arithmetic check Arithmetic task, shown as an image

No Google captcha, no cookies, nothing passed to third parties. Prefer e-mail? info@timobritz.de.