A smart beverage dispensing system that allows customers to place orders from cashier and receive their drinks through an automated dispensing mechanism. The system uses Arduino microcontrollers and ESP8266 WiFi modules for communication between the ordering station and the dispensing station.
-
Multiple Drink Options: Choose from three different beverages:
- Cream Soda (Option A)
- Fanta (Option B)
- Portello (Option C)
-
Size Selection: Select between two cup sizes:
- Half Cup (Option 1)
- Full Cup (Option 2)
-
Unique Order Number System: Each order generates a unique identifier combining drink type, size, and timestamp
-
Two Communication Methods:
- WiFi communication using ESP8266 modules
- Serial communication using Arduino Uno boards
-
Cup Detection: IR sensor detects cup presence before dispensing
-
LCD Display: Real-time feedback for customers on both ordering and dispensing stations
- 1x Arduino Uno OR 1x NodeMCU ESP8266
- 1x I2C LCD Display (20x4 for Uno, 16x2 for ESP)
- 1x 4x4 Matrix Keypad
- Jumper wires
- Power supply (5V for Arduino Uno, 3.3V/5V for NodeMCU)
- 1x Arduino Uno OR 1x NodeMCU ESP8266
- 1x I2C LCD Display (16x2)
- 1x 4x4 Matrix Keypad
- 1x IR Sensor (for cup detection)
- 3x Relay Modules (for controlling beverage dispensers)
- Jumper wires
- Power supply
- Arduino IDE (1.8.x or later)
- Required Libraries:
KeypadlibraryWirelibrary (built-in)LiquidCrystal_I2ClibraryESP8266WiFilibrary (for ESP8266 versions)
- Open Arduino IDE
- Go to Sketch → Include Library → Manage Libraries
- Search for and install:
- "Keypad" by Mark Stanley and Alexander Brevig
- "LiquidCrystal I2C" by Frank de Brabander
For ESP8266 support:
- Go to File → Preferences
- Add this URL to "Additional Board Manager URLs":
Note: The ESP8266 board package uses HTTP for the stable package index.
http://arduino.esp8266.com/stable/package_esp8266com_index.json - Go to Tools → Board → Boards Manager
- Search for "ESP8266" and install the package
- LCD (I2C): SDA (A4), SCL (A5) - analog pins on Arduino Uno
- Keypad:
- Row Pins: D2, D3, D4, D5
- Column Pins: D6, D7, D8, D9
- LCD (I2C): SDA (A4), SCL (A5) - analog pins on Arduino Uno
- Keypad:
- Row Pins: D2, D3, D4, D5
- Column Pins: D6, D7, D8, D9
- IR Sensor: D10
- Relay Modules:
- Relay A (Cream Soda): D11
- Relay B (Fanta): D12
- Relay C (Portello): D13
For ESP8266 modules, refer to the NodeMCU pinout diagram for GPIO mapping.
- Open
Sender_Uno/Sender_Uno.inoin Arduino IDE - Connect the Arduino Uno to your computer via USB
- Select Tools → Board → Arduino Uno
- Select the correct COM port under Tools → Port
- Click Upload
- Open
Receiver_Uno/Receiver_Uno.inoin Arduino IDE - Connect the second Arduino Uno to your computer via USB
- Select Tools → Board → Arduino Uno
- Select the correct COM port under Tools → Port
- Click Upload
Connect the TX pin of Sender Uno to RX pin of Receiver Uno and connect GND of both boards together.
- Open
Sender_ESP/Sender_ESP.inoin Arduino IDE - Configure WiFi credentials (modify these with your own secure values):
Note: Use a strong, unique password for your WiFi access point.
const char* ssid = "Flavor_Flow"; // Change to your preferred network name const char* password = "flavorflow123"; // Change to a strong password
- Connect the NodeMCU ESP8266 to your computer via USB
- Select Tools → Board → NodeMCU 1.0 (ESP-12E Module)
- Select the correct COM port under Tools → Port
- Click Upload
- Open
Receiver_ESP/Receiver_ESP.inoin Arduino IDE - Ensure WiFi credentials match the sender (use the same values you set in the sender):
const char* ssid = "Flavor_Flow"; // Must match sender SSID const char* password = "flavorflow123"; // Must match sender password const char* serverAddress = "192.168.4.1"; // Default AP IP address
- Connect the second NodeMCU ESP8266 to your computer via USB
- Select Tools → Board → NodeMCU 1.0 (ESP-12E Module)
- Select the correct COM port under Tools → Port
- Click Upload
-
Select Drink Type: The LCD displays the drink menu
- Press 'A' for Cream Soda
- Press 'B' for Fanta
- Press 'C' for Portello
-
Select Size: After selecting a drink, choose the size
- Press '1' for Half Cup
- Press '2' for Full Cup
-
Receive Order Number: A unique order number will be displayed on the LCD
- Format:
[DrinkType][Size][Timestamp] - Example:
A1123456789(Cream Soda, Half Cup, timestamp: 123456789)
- Format:
-
Proceed to Dispensing Station: Remember or note down your order number
-
Enter Order Number: Using the keypad, enter your order number
- Use '*' key for backspace/delete
- Use '#' key to submit/confirm
-
Place Cup: If prompted, place your cup under the dispenser
- IR sensor will detect the cup presence
-
Receive Beverage: The system will automatically dispense your selected drink
- Half Cup: 3 seconds dispensing time
- Full Cup: 5 seconds dispensing time
-
Order Complete: Remove your cup and enjoy your beverage!
[Sender Station] [Receiver Station]
Customer Input Order Validation
↓ ↓
LCD Display Menu LCD Display Status
↓ ↓
Keypad Selection Keypad Entry
↓ ↓
Order Number Generation Order Number Verification
↓ ↓
WiFi/Serial Transmission → Cup Detection (IR)
↓
Relay Control
↓
Beverage Dispensing
- Check I2C address (default: 0x27). Use an I2C scanner sketch to find the correct address
- Verify I2C connections (SDA, SCL)
- Check if LCD backlight is enabled in code
- Verify SSID and password are correct
- Ensure both ESP8266 modules are within range
- Check if Access Point is created (Sender ESP should create "Flavor_Flow" network)
- Verify IP address (default AP IP: 192.168.4.1)
- Check all row and column pin connections
- Verify pin numbers in the code match your wiring
- Test keypad with serial output to debug
- Check relay pin connections
- Ensure relay module has adequate power supply
- Verify relay logic (some relays are active LOW, others active HIGH)
- Check IR sensor connections and power
- Adjust IR sensor sensitivity (if available)
- Test sensor with Serial.println() to verify readings
Edit the drink names in Sender_Uno.ino or Sender_ESP.ino:
lcd1.print("A. Cream Soda");
lcd1.print("B. Fanta");
lcd1.print("C. Portello");Modify the delay values in Receiver_Uno.ino:
// Half Cup
digitalWrite(relayPinA, HIGH);
delay(3000); // Change this value (milliseconds)
digitalWrite(relayPinA, LOW);
// Full Cup
digitalWrite(relayPinA, HIGH);
delay(5000); // Change this value (milliseconds)
digitalWrite(relayPinA, LOW);Update in both Sender_ESP.ino and Receiver_ESP.ino:
const char* ssid = "YourNetworkName";
const char* password = "YourPassword";Security Note: Never commit your actual WiFi credentials to public repositories. Consider using a separate configuration file that is excluded from version control (add to .gitignore).
This project is open source and available for educational and personal use.
Contributions are welcome! Feel free to:
- Report bugs
- Suggest new features
- Submit pull requests
- Janith Jay
- Thanks to the Arduino community for the excellent libraries
- Inspired by automated vending machine systems