Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

ESP32-Based Bluetooth-Controlled Cocktail Drink Mixer with Peristaltic and Diaphragm Pumps

View and Edit Project In Cirkit DesignerImage of ESP32-Based Bluetooth-Controlled Cocktail Drink Mixer with Peristaltic and Diaphragm Pumps

Circuit Documentation

Summary

This document provides a detailed overview of a circuit designed to control multiple pumps and LED rings using an ESP32 microcontroller. The circuit includes various components such as peristaltic pumps, a diaphragm water pump, an ultrasonic sensor, and LED rings. The ESP32 microcontroller is programmed to control these components based on Bluetooth commands and distance measurements from the ultrasonic sensor.

Component List

  1. Mini Diaphragm Water Pump

    • Pins: Positive (+), Negative (-)
    • Description: A small water pump used for liquid transfer.
    • Purpose in Circuit: Used to pump liquids at a rate of 1.4L/min.
  2. USB Module

    • Pins: RX, TX, VCC, GND, DTR, CTS
    • Description: A USB to TTL converter module.
    • Purpose in Circuit: Used for programming and communication with the ESP32 microcontroller.
  3. Peristaltic Pump

    • Pins: GND, 12V
    • Description: A high-flow peristaltic pump for dosing liquids.
    • Purpose in Circuit: Used to pump liquids at a rate of 150ml/min.
  4. Power Supply 5V 5AMP

    • Pins: 220V Positive Pole (AC), 220V Negative Pole (AC), GND, GND (DC), 12V-24V Output (DC)
    • Description: A power supply unit providing 5V and 12V outputs.
    • Purpose in Circuit: Supplies power to the entire circuit.
  5. HC-SR04 Ultrasonic Sensor

    • Pins: VCC, TRIG, ECHO, GND
    • Description: An ultrasonic distance sensor.
    • Purpose in Circuit: Measures the distance to detect the presence of a glass under the dispenser.
  6. AC Wire

    • Pins: Line, Earth, Neutral
    • Description: Standard AC power wire.
    • Purpose in Circuit: Connects the power supply to the AC mains.
  7. ESP32 8-Relay Board

    • Pins: Multiple pins including NO, COM, NC, TX, RX, IO0, G23, G22, TXD, RXD, G21, 3V3, 5V, GND
    • Description: An ESP32 microcontroller with an 8-relay board.
    • Purpose in Circuit: Controls the pumps and LED rings based on Bluetooth commands and sensor inputs.
  8. 16 LED Ring

    • Pins: DI, 5V, GND, DO
    • Description: A ring of 16 WS2812B LEDs.
    • Purpose in Circuit: Provides visual feedback and lighting effects.
  9. 12 LED Ring

    • Pins: DI, 5V, GND, DO
    • Description: A ring of 12 WS2812B LEDs.
    • Purpose in Circuit: Provides visual feedback and lighting effects.

Wiring Details

Mini Diaphragm Water Pump

USB Module

Peristaltic Pump

Power Supply 5V 5AMP

HC-SR04 Ultrasonic Sensor

AC Wire

ESP32 8-Relay Board

16 LED Ring

12 LED Ring

Documented Code

Cocktail Drink Mixer Code

#include "BluetoothSerial.h"
#include <Adafruit_NeoPixel.h>

#define LED_PIN 21            // pin til led ring
#define LED_COUNT 28          // antal WS2812B LEDs tilsluttet ESP32

Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);  // opsætning af NeoPixel library

BluetoothSerial ESP_BT; 
char bt_data; 
// pin til afstandstest "glas under"
#define trig 22  // blå
#define echo 23  // grøn
#define SOUND_SPEED 0.034
long duration;
float distanceCm;
int glas_under = HIGH;
//--
int orange        = 32; // relæ1
int dry_lemon     = 33; // relæ2
int caramel       = 25; // relæ3
int apricot       = 26; // relæ4
int lime          = 27; // relæ5
int sprite        = 14; // relæ6
int lemon         = 12; // relæ7
int cola          = 13; // relæ8
//--
int TIME4CL  = 25000; // indstilles til at give 4  centiliter med Peristaltic pumpe 150ml/min.
int TIME2CL  = 12500; // indstilles til at give 2  centiliter med Peristaltic pumpe 150ml/min.
int TIME1CL  = 6250;  // indstilles til at give 1  centiliter med Peristaltic pumpe 150ml/min.
int SODA10CL = 5000;  // indstilles til at give 10 centiliter med alm. pumpe 1,4L/min.
int SODA8CL  = 4000;  // indstilles til at give 8  centiliter med alm. pumpe 1,4L/min.
int S