Soda Dispenser
A proximity-triggered, multi-flavour soda dispenser
Author: Popescu Vladimir
GitHub Project Link: Github Project Repository
Description
The dispenser now offers several drink flavours.
A front-panel button array lets the user choose the desired beverage, while the two ultrasonic sensors have been repurposed to measure glass height so the firmware can pour the correct volume for short or tall glasses. Once the button is pressed and a suitable glass is detected, the MCU actuates the corresponding pump.
Motivation
Commercial soda fountains are bulky and expensive, while DIY builds often limit users to a single flavour and a fixed pour size. By adding a four‑button flavour selector and ultrasonic cup‑height sensing, this dispenser stays low‑cost and hands‑free yet delivers multiple beverages in portions that match short or tall glasses—making.
Subsystems
- Button pad (3 tactile switches) selects flavour.
- Ultrasonic sensors measure distance to the glass rim to infer glass height.
- RP2350 MCU implements a state-machine: wait for flavour select → validate glass height → run correct pump for a preset volume.
- Three pumps deliver the chosen drink from separate reservoirs.
Hardware
Current component lineup:
- Raspberry Pi Pico 2 W
- Two HC-SR04 ultrasonic sensors
- Three tactile push-buttons (6×6×6 mm)
- Three submersible pumps (3–6 V DC)
- MP1584EN step-down module
- Three NPN transistors 2N2222
- Two 40-pin 2.54 mm male pin headers
- Breadboard 400 points
- Breadboard jumper-wire set
- Plusivo 250-piece resistor kit
- Micro-USB cable (1 m)
- Battery holder for two × 18650 cells
Bill of Materials
Component | Quantity | Price per Unit (RON) | Total Price (RON) |
---|---|---|---|
Fire Colorate jumper (10 cm, 10 p) | 2 | 2.99 | 5.98 |
Raspberry Pi Pico 2 W | 2 | 39.66 | 79.32 |
Breadboard 400 points | 1 | 4.56 | 4.56 |
Breadboard jumper-wire set | 1 | 7.99 | 7.99 |
Plusivo resistor kit (250 pcs) | 1 | 14.99 | 14.99 |
Micro-USB cable (1 m) | 2 | 3.99 | 7.98 |
Battery holder for two × 18650 cells | 1 | 3.99 | 3.99 |
HC-SR04 ultrasonic sensor | 2 | 14.99 | 29.98 |
Tactile push-button (6×6×6 mm) | 3 | 0,36 | 1.08 |
Submersible pump (3–6 V DC) | 3 | 7.15 | 21.45 |
NPN transistor 2N2222 (TO-92) | 3 | 0.17 | 0.51 |
MP1584EN step-down module | 1 | 6.49 | 6.49 |
40-pin 2.54 mm male pin header | 4 | 0.99 | 3.96 |
Total Estimated Cost: 188.28 RON
Software
Library / Crate | Description | Usage |
---|---|---|
embassy-time , embassy-executor | Async runtime for Cortex-M | Non-blocking timing & tasks |
rp-pico HAL | Pico W hardware abstraction | GPIO, PWM, UART |
panic-halt | Halt on panic | Error handling |
defmt + probe-run | Logging | On-device debugging |
embedded-hal | Hardware abstraction layer | Standardized interfaces for peripherals |
defmt-rtt | Real-Time Transfer for logging | Low-latency logging via RTT |
nb | Non-blocking operations | Handling non-blocking I/O |
usb-device | USB device support for embedded systems | USB functionality (e.g., communication or programming) |
Logs
Log — Week 1 (28 Apr – 4 May 2025)
Date | Activity |
---|---|
28 Apr 2025 | Compiled and verified full component list. |
30 Apr 2025 | Updated design: added 4-button flavour selector; repurposed ultrasonic sensors for glass-height detection; revised architecture and documentation. |
Log — Week 2 (5-11 May 2025)
Date | Activity |
---|---|
5 May 2025 | Added embedded-hal , defmt-rtt , nb , and usb-device crates to the software stack for better hardware abstraction, logging, non-blocking operations, and USB support. And add pricing to my tables. |