Skip to the content
2 layers96 × 75 mmCocktail PCB, the printed circuit board in 3D

Tell it what's in your liquor cabinet, it asks an AI for a cocktail, then pours it through peristaltic pumps. Judges your ingredient choices silently.

Size
96 × 75 mm
Copper layers
2
Thickness
1.6 mm
Parts
21
Nets
58
Pads
149
Tracks, vias
78, 75
Pours
3
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
31 Jul 2026
Updated
30 Sep 2026

Overview

Cocktail PCB is an open-source printed circuit board by Will946, from the Will946/Cocktail-Machine repository on GitHub, published under the MIT licence. It is a 2-layer board of 96 × 75 mm with 21 parts on 58 nets, routed with 78 tracks and 75 vias.

Its parts include 16 connectors and 1 capacitor. It belongs with the ESP32 boards of this library.

README

README.md

Cocktail Machine

An automated cocktail dispenser powered by an ESP32-S3, up to eight peristaltic pumps, and a Groq AI backend. Users connect to the machine via a self-hosted web interface, input available ingredients, and receive AI-generated cocktail suggestions tailored to exactly what they have on hand. Selections are confirmed via onboard buttons and dispensed automatically with real-time LCD feedback and glass-type imagery loaded from SD card.

The system is designed around a modular motor driver architecture — each custom TB6612FNG PCB drives two pumps, and up to four boards can be chained together to support up to eight pumps total. The current firmware configuration drives four pumps across two boards, all connected to a central ESP32-S3 carrier board.


Table of Contents

SectionDescription
Machine Render3D render of the full enclosure
PCB OverviewCarrier board and motor driver board renders and schematics
Project File StructureFolder and file layout
System OverviewArchitecture diagram
FeaturesFull feature list
HardwareComponent descriptions
Pin ConnectionsESP32 GPIO assignments for LCD, motors, and buttons
Software DependenciesRequired Arduino libraries
ConfigurationWiFi, API key, and flow rate calibration
SD Card SetupBMP image requirements and conversion
Operation FlowStep-by-step usage guide
Groq API LimitsFree tier request and token budgets
BOMFull bill of materials

Machine Render

Machine Render


PCB Overview

ESP32-S3 Cocktail Carrier Board

The main carrier board hosts the ESP32-S3 WROOM module in the center, with four TB6612FNG motor driver sub-boards mounted in the corners — one per two pumps. Power input, bulk capacitance, and pin headers for the LCD and buttons are also on this board.

Cocktail Carrier PCB — KiCad 3D Render

Cocktail Carrier PCB — Full Render

KiCad files: PCB/Cocktail_PCB.kicad_pcb, PCB/Cocktail_PCB.kicad_sch, PCB/Cocktail_PCB.kicad_pro


TB6612FNG Motor Driver Sub-Board

A compact self-contained dual H-bridge driver board. Each board drives two peristaltic pumps and includes local decoupling capacitors, a power indicator LED, and pin socket connectors for motor outputs, control inputs, and power. Boards are panelized for cost-effective fabrication at JLCPCB.

TB6612FNG Motor Driver — PCB Render

KiCad files: PCB/TB6612FNG.kicad_pcb, PCB/TB6612FNG.kicad_sch, PCB/TB6612FNG.kicad_pro


Project File Structure

text
cocktail_machine/
├── cocktail_machine.ino         # Main Arduino sketch
├── README.md                    # This file
├── BOM.md                       # Bill of materials
│
├── PCB/
│   ├── Cocktail_PCB.kicad_pcb  # Main carrier board PCB layout
│   ├── Cocktail_PCB.kicad_sch  # Main carrier board schematic
│   ├── Cocktail_PCB.kicad_pro  # Main carrier board KiCad project
│   ├── Cocktail_PCB.png        # Main carrier board 3D render
│   ├── PCB.PNG                 # Full system PCB render
│   ├── TB6612FNG.kicad_pcb     # Motor driver sub-board PCB layout
│   ├── TB6612FNG.kicad_sch     # Motor driver sub-board schematic
│   ├── TB6612FNG.kicad_pro     # Motor driver KiCad project
│   ├── TB6612FNG.png           # Motor driver board 3D render
│   └── TB6612FNG_Sch.png       # Motor driver schematic screenshot
│
├── 3DModel/
│   └── machinerender.PNG       # Full machine enclosure render
│
└── sd_card/
    ├── start.bmp
    ├── highball.bmp
    ├── martini.bmp

System Overview

text
User's Phone/Laptop Browser
        ↕ HTTP (AsyncWebServer on ESP32)
ESP32-S3 (WiFi access point + web server)
        ↕ HTTPS (Groq Cloud API)
Groq LLM (llama-3.3-70b-versatile)
        ↕ parsed JSON recipe data
Motor Driver Boards (TB6612FNG ×2, expandable to ×4)
        ↕ H-bridge direction control
Peristaltic Pumps ×4 (expandable to ×8)
        ↕
Drink in glass

Features

  • AI-generated cocktail suggestions — powered by Groq's Llama 3.3 70B model, running on custom LPU hardware for near-instant inference
  • Up to 20 cocktail suggestions per query, strictly based on available ingredients
  • Strict recipe accuracy — AI cross-references authoritative recipes and never silently drops required ingredients
  • Mocktail support — suggests adapted recipes when exactly one ingredient is missing, with a clear substitution note
  • Proportional volume scaling — user can adjust total cocktail volume and all ingredient ratios scale automatically
  • Custom pour mode — manually dial in ml per pump without any AI involvement, useful for testing or simple pours
  • Real-time LCD feedback — per-ingredient dispensing screens with animated progress bar
  • Pause/resume dispensing — BTN3 pauses the active pump mid-pour, BTN2 resumes exactly where it left off
  • Cancel dispensing — hold BTN1 for 3 seconds during dispensing to abort and return to idle
  • Glass type imagery — loads a matching BMP image from SD card based on the AI's glass recommendation
  • Pump confirmation screen — before dispensing, LCD shows the full pump assignment layout so the user can verify the correct bottles are loaded
  • Expandable to 8 pumps — motor driver board design supports up to 4 boards (8 pumps) driven from a single ESP32-S3
  • Power indicator LED — on each motor driver board, lights whenever the 12V motor rail is live

Hardware

Main Controller

  • ESP32-S3 WROOM dev board — dual-core Xtensa LX7 at 240MHz, 512KB SRAM, 4MB flash, integrated 2.4GHz WiFi. Runs the web server, Groq API client, LCD driver, SD card reader, and pump control concurrently using FreeRTOS.

Display

  • 2.8" ILI9341 TFT LCD — 320×240 resolution, SPI interface, 3.3V logic native. Includes an onboard SD card slot used for loading BMP glass images. Driven via hardware SPI on the ESP32-S3.

Motor Driver Boards (×2, expandable to ×4)

  • TB6612FNG dual H-bridge IC in SSOP-24 package. Each custom PCB drives two pumps and is self-contained with decoupling capacitors, power indicator LED, and pin headers. Multiple boards share the same 12V and 3.3V rails. See PCB/TB6612FNG_Sch.png for full schematic.

Pumps

  • 4× peristaltic pumps — 12V DC brushed motors, rated 0.5A peak per pump. Maximum of two pumps run simultaneously. Expandable to 8 by adding two more motor driver boards.

Power

  • 12V USB-PD power supply — negotiates 12V via PD 3.0 / PD 2.0 / BC1.2. 100W supply provides ~8.3A at 12V, sufficient for 4–8 pumps plus system overhead.
  • Sparkfun buck-boost converter — steps 12V down to regulated 5V for ESP32 power input, isolated from motor switching noise.

Buttons

  • 3× momentary push buttons — normally open, internally pulled up. Active low.

Tubing

  • 3m food-safe silicone tubing — inner diameter matched to the peristaltic pump head.

Pin Connections

LCD (ILI9341) + SD Card

LCD PinESP32 GPIO
VCC3.3V
GNDGND
CSGPIO41
RESETGPIO40
DCGPIO39
SDI (MOSI)GPIO37
SCKGPIO36
LED3.3V
SDO (MISO)GPIO35
SD_CSGPIO15

Motor Driver Board 1 (Pumps A & B)

SignalESP32 GPIONotes
AIN1GPIO4Pump A direction
AIN2GPIO5Pump A direction
BIN1GPIO6Pump B direction
BIN2GPIO7Pump B direction
VCC3.3VLogic supply
VM12VMotor supply
GNDGNDCommon ground

Motor Driver Board 2 (Pumps C & D)

SignalESP32 GPIONotes
AIN1GPIO1Pump C direction
AIN2GPIO2Pump C direction
BIN1GPIO47Pump D direction
BIN2GPIO48Pump D direction
VCC3.3VLogic supply
VM12VMotor supply
GNDGNDCommon ground

Buttons

ButtonGPIOFunction
BTN1GPIO8Cancel selection / hold 3s to abort dispensing
BTN2GPIO3Resume dispensing after pause
BTN3GPIO18Pause active dispensing

Expanding to 8 Pumps

Add Motor Driver Boards 3 and 4, wiring their IN pins to available GPIOs. Update pumpOn() and pumpOff() in cocktail_machine.ino to add cases 4–7.


Software Dependencies

LibrarySource
Adafruit GFX LibraryArduino Library Manager
Adafruit ILI9341Arduino Library Manager
Adafruit ImageReader LibraryArduino Library Manager
SdFat — Adafruit ForkArduino Library Manager
ArduinoJson (by Benoit Blanchon)Arduino Library Manager
AsyncTCPGitHub: me-no-dev/AsyncTCP (install as ZIP)
ESPAsyncWebServerGitHub: me-no-dev/ESPAsyncWebServer (install as ZIP)

Note: If both the standalone SdFat and SdFat-Adafruit-Fork libraries are installed, delete the standalone one. The Adafruit ImageReader requires the Adafruit fork specifically.


Configuration

At the top of cocktail_machine.ino, set your credentials:

cpp
const char* ssid       = "YOUR_WIFI_NAME";
const char* password   = "YOUR_WIFI_PASSWORD";
const char* groqApiKey = "YOUR_GROQ_API_KEY";

Get a free Groq API key at console.groq.com

Flow Rate Calibration

cpp
#define ML_PER_SECOND 1.31

To calibrate: order a cocktail with a known total volume, measure the actual output, then:

text
new ML_PER_SECOND = current × (actual_ml / expected_ml)

Example: expected 200ml, got 175ml → 1.31 × (175 / 200) = 1.146

Run several trials and average for best accuracy.


SD Card Setup

Format as FAT32 (Mac: Disk Utility → MS-DOS FAT). Place in the root directory:

FilenameUsed for
start.bmpBoot screen, idle state, waiting for selection
highball.bmpHighball / Collins glass cocktails
martini.bmpMartini / Coupe glass cocktails
rocks.bmpRocks glass cocktails
champagne.bmpChampagne flute cocktails
mulemug.bmpMoscow Mule mug cocktails

All images must be exactly 320×240 pixels, 24-bit RGB BMP, uncompressed.

Operation Flow

  1. Power on — SD card initializes, start.bmp loads with "Press Button To Start"
  2. Press any button — ESP32 connects to WiFi, LCD shows connecting → connected → IP address
  3. Open browser — on any device on the same WiFi network, navigate to the IP shown on LCD
  4. Assign ingredients — enter the ingredient in each pump (A–D) and any extras not in a pump (e.g. simple syrup, salt)
  5. Get AI suggestions — Groq returns up to 20 cocktail options with ingredients, amounts, glass type, serving style, and substitution notes
  6. Select a cocktail — tap a card in the browser; confirmation dialog shows full recipe
  7. Pump confirmation screen — LCD shows all four pump assignments; press any button to confirm
  8. Ready screen — glass BMP loads as background with cocktail details; press BTN2/BTN3 to dispense or BTN1 to cancel
  9. Dispensing — each ingredient poured one at a time with animated progress bar
    • BTN3 = pause (pump stops, bar freezes)
    • BTN2 = resume (pump restarts exactly where it left off)
    • Hold BTN1 for 3 seconds = cancel all remaining pours, return to idle
  10. ENJOY! — shown for 4 seconds, then returns to idle waiting state

Custom Pour Mode

Press Custom Pour on the website to skip AI and manually specify ml per pump. Useful for calibration, testing, or simple single-ingredient pours.


Groq API — Free Tier Limits

Model: llama-3.3-70b-versatile

LimitValue
Requests per minute30
Requests per day1,000
Tokens per minute12,000
Tokens per day100,000

At ~3,800 tokens per request (prompt + 15 cocktail recipes), approximately 26 suggestion requests per day = 390 individual cocktail suggestions. Adding a credit card to Groq (free, no minimum spend) unlocks ~10× higher limits.

Parts

21
QtyValueFootprintReferences
8Conn_01x05_SocketConnector_PinSocket_2.54mm:PinSocket_1x05_P2.54mm_VerticalJ7, J8, J9, J12, J13, J14, J15, J16
4Conn_01x03_SocketConnector_PinSocket_2.54mm:PinSocket_1x03_P2.54mm_VerticalJ1, J2, J3, J4
3MountingHoleMountingHole:MountingHole_2.7mm_M2.5H1, H2, H4
2Conn_01x02_PinConnector_PinSocket_2.54mm:PinSocket_1x02_P2.54mm_VerticalJ5, J6
2Conn_02x22_Odd_EvenConnector_PinSocket_2.54mm:PinSocket_2x22_P2.54mm_VerticalJ10, J11
1100uFCapacitor_SMD:CP_Elec_6.3x5.9C5
1LOGOLOGOG***

More from Will946/Cocktail-Machine

1
  • 2 layers27.5 × 24.7 mmTB6612FNG, the printed circuit board in 3D

    TB6612FNG

    Will946/Cocktail-Machine

    Tell it what's in your liquor cabinet, it asks an AI for a cocktail, then pours it through peristaltic pumps. Judges your ingredient choices silently.

    12 parts1MIT

Similar boards

  • 2 layers28.3 × 39.8 mmLevelShifter, the printed circuit board in 3D

    LevelShifter

    gusmanb/logicanalyzer

    24 channel, 100Msps logic analyzer hardware and software

    21 parts5.1kGPL-3.0
  • 2 layers171.2 × 72.9 mmAmiga gfxcard before pour, the printed circuit board in 3D

    Amiga gfxcard before pour

    mntmn/amiga2000-gfxcard

    MNT VA2000, an Open Source Amiga 2/3/4000 Graphics Card (Zorro II/III), written in Verilog

    21 parts1k
  • 2 layers93.9 × 46 mmRectifier, the printed circuit board in 3D

    Rectifier

    rene-dev/stmbl

    AC Servo Driver for STM32F4

    21 parts990GPL-3.0
  • 2 layers45.5 × 42.9 mmEsphome han reader, the printed circuit board in 3D

    Esphome han reader

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    21 parts915
  • 2 layers31.8 × 14.5 mmEsp prog, the printed circuit board in 3D

    Esp prog

    drandyhaas/KiCadRoutingTools

    A set of Python/Rust tools to aid routing in KiCad

    21 parts744MIT
  • 2 layers23.5 × 15.8 mmQuiverAttachPCB, the printed circuit board in 3D

    QuiverAttachPCB

    Arrow-air/project-quiver

    Project Quiver documentation, designs, and project artifacts.

    21 parts617CERN-OHL-S-2.0
  • 2 layers69.9 × 41.3 mmHeaterMeterLCD, the printed circuit board in 3D

    HeaterMeterLCD

    CapnBry/HeaterMeter

    HeaterMeter and LinkMeter Arduino BBQ Controller

    21 parts557MIT
  • 2 layers161.3 × 111.8 mmDoj, the printed circuit board in 3D

    Doj

    kelu124/echomods

    Open source ultrasound processing modules and building blocks

    21 parts463

Questions

How big is the Cocktail PCB PCB?

It measures 96 × 75 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Cocktail PCB use?

21 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Cocktail PCB KiCad files?

From the Will946/Cocktail-Machine repository on GitHub, at the commit this page was made from: the board is PCB/Cocktail_PCB.kicad_pcb and its schematic PCB/Cocktail_PCB.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Cocktail PCB design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).