Skip to main content
Version: ACS CC

Soda Dispenser

A proximity-triggered, multi-flavour soda dispenser

info

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 three‑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 sensor 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:

Bill of Materials

ComponentQuantityPrice per Unit (RON)Total Price (RON)
Fire Colorate jumper (10 cm, 10 p)22.995.98
Raspberry Pi Pico 2 W239.6679.32
Breadboard 400 points14.564.56
Breadboard jumper-wire set17.997.99
Plusivo resistor kit (250 pcs)114.9914.99
Micro-USB cable (1 m)23.997.98
Battery holder for 4 × AA/R6 cells15.335.33
HC-SR04 ultrasonic sensor114.9929.98
Tactile push-button (6×6×6 mm)30,361.08
Submersible pump (3–6 V DC)37.1521.45
NPN transistor 2N2222 (TO-92)30.170.51
MP1584EN step-down module16.496.49
40-pin 2.54 mm male pin header40.993.96

Total Estimated Cost: 188.28 RON

Photos and Images

block block block block block block block

Software

Library / CrateDescriptionUsage
embassy-time, embassy-executorAsync runtime for Cortex-MNon-blocking timing & tasks
rp-pico HALPico W hardware abstractionGPIO, PWM, UART
panic-haltHalt on panicError handling
defmt + probe-runLogging & on-device debuggingStructured logs via RTT
embedded-halHardware abstraction layerStandardized interfaces for peripherals
defmt-rttReal-Time Transfer for loggingLow-latency logging via RTT
nbNon-blocking operationsHandling non-blocking I/O
usb-deviceUSB device support for embedded systemsUSB functionality (e.g., communication or programming)
panic-probePanic handler with defmt support & backtracesPrints panic info & backtraces via RTT
embassy-rpEmbassy support crate for RP2040GPIO abstractions (Input, Output, Pull, Level)

Logs

Log — Week 1 (28 Apr – 4 May 2025)

DateActivity
28 Apr 2025Compiled and verified full component list.
30 Apr 2025Updated design: added 4-button flavour selector; repurposed ultrasonic sensors for glass-height detection; revised architecture and documentation.

Log — Week 2 (5-11 May 2025)

DateActivity
5 May 2025Added 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.

Log — Week 3 (12-18 May 2025)

DateActivity
12 May 2025Add photos and the schematics of the project.

Log — Week 4 (19-25 May 2025)

DateActivity
25 May 2025Uploaded source code, README, schematic (.sch), and SVG scheme to the project repository which can be found above.