Welcome to the distributore Swag repository! This project manages a water dispenser controlled via an ESP32.
- Requirements
- Project Tree Organization
- Getting Started
- Proejct diagram and user guide
- Things to improve
- Presentation and Videos
- Team Members
ESP32 and relative sensors:
- Buzzer
- Display LCD 1602 with I2C module
- RGB LED
- Button
- Ultrasonic HC-SR04 sensor
- Microservo 9G SG90 5V
- Breadboard, cables and resistors
VS Code with the PlatformIO extension.
.
├── README.md
├── lib
│ ├── AP
│ │ ├── AP.cpp
│ │ ├── AP.h
│ │ ├── captiveRequestHandler.cpp
│ │ └── captiveRequestHandler.h
│ ├── button
│ │ ├── button.cpp
│ │ └── button.h
│ ├── buzzer
│ │ ├── buzzer.cpp
│ │ ├── buzzer.h
│ │ └── pitches.h
│ ├── display
│ │ ├── display.cpp
│ │ └── display.h
│ ├── logic
│ │ ├── logic.cpp
│ │ └── logic.h
│ ├── rgb
│ │ ├── rgb.cpp
│ │ └── rgb.h
│ ├── servo
│ │ ├── servo.cpp
│ │ └── servo.h
│ ├── timerControl
│ │ ├── timerControl.cpp
│ │ └── timerControl.h
│ └── ultrasound
│ ├── ultrasound.cpp
│ └── ultrasound.h
├── platformio.ini
├── src
│ └── main.cpp
You can either clone this repository via terminal
git clone https://github.com/jagorev/distributoreSwag.gitor download the project folder.
Then, using VS Code with the PlatformIO extension, open the project (PlatformIO Home Page --> Open Project).
Ultimately, using the terminal inside VS Code, proceed to build the project
platformio runalternatively, click on the ✔️ in the bottom bar.
First, you need to connect the ESP32 to the computer.
Then, proceed by uploading the built project through the terminal inside VS Code (specifying the target port)
pio run --target uploadalternatively, click on the → in the bottom bar.
To run the project, just click on the RST button on the ESP32.
- The system is powered on and enters the ready state.
- The ESP32 is set as an AP. Wi-fi is now ready.
- The display will show: "Ready to connect".
- STATUS_LED: 🔵 (BLUE).
- The user connects to the dispenser’s WiFi via their phone and scans the QR code to access the local dispenser page.
- They select the amount of water to dispense (0.2L, 0.33L, 0.5L, 1L).
- STATUS_LED: 🟣 (PURPLE) when a device connects.
- STATUS_LED: 🟡 (YELLOW) when a selection is made.
- The proximity sensor checks if the bottle is correctly positioned.
- If the bottle is placed at the correct distance, dispensing begins and STATUS_LED turns 🟢 (GREEN).
- If the bottle is removed during dispensing:
- STATUS_LED turns 🟡 (YELLOW).
- The system remembers the dispensing level and resumes when the bottle is repositioned.
- Scenario 1:
- Water has been successfully dispensed.
- The display will show "Water dispensing finished", and the buzzer will sound.
- The system returns to step 1.
- Scenario 2:
- The user presses the STOP button.
- The system immediately halts, regardless of the current state.
- The display will show "Emergency! Rebooting...", and STATUS_LED turns 🔴 (RED) for a few seconds.
- The system returns to step 1.
- Add more beverages
- Add temperature options
- Show in the display the live percentage of water erogated
- Notify users of leaks or maintenance needs, for example when dispenser need to be refilled
- Giulia Garonzi: designed step 3, built the dispenser, made pitch video and presentation
- Giulio Gualtiero: designed step 1 and 2, built the dispenser, overviewed cable management and sensors interaction
- Jago Revrenna: designed step 1 and 2, built the dispenser, managed code organization and work direction
- Elena Rubbo: designed step 4, built the dispenser, made pitch video and presentation
