Project

# Title Team Members TA Documents Sponsor
50 Closed-loop High-accuracy Universal Drink System
Aiden Robinson
Kevin Lu
Xiyue Zhu
Team Members:
- Kevin Lu (Kevinlu5)
- Aiden Robinson (Aidenr2)

# Problem

Preparing mixed beverages requires accurate control of the amount of each ingredient in order to maintain consistent ratios. Small errors in ingredient proportions can noticeably affect the taste of the final drink.

Many automated beverage dispensers determine the amount of liquid dispensed using a predetermined pump activation time. This assumes that each pump maintains a constant flow rate. In practice, flow rate can vary due to liquid viscosity, reservoir level, tubing conditions, and pump performance. As a result, operating a pump for the same amount of time does not necessarily dispense the same amount of liquid every time.

Our project aims to solve this problem by measuring the amount of liquid actually delivered to the cup and using that measurement as feedback to control the dispensing process. The final system will be demonstrated using non-alcoholic liquids, but the same system can be applied to other mixed beverages where accurate ingredient ratios are important.

# Solution

We propose an automated beverage dispenser with at least four independently controlled ingredient reservoirs. Each reservoir will use a 12 V peristaltic pump to deliver liquid into a cup placed on a load-cell weighing platform.

Instead of relying only on pump timing, the system will continuously measure the change in cup weight while dispensing. The controller will use this measurement to determine how much liquid has actually entered the cup and adjust pump operation as the target amount is approached.

The system will also estimate the current liquid flow rate using the measured change in mass over time. When the dispensed amount is far from the target, the pump can operate continuously. As the target is approached, the controller can reduce the dispensing rate or use short pump pulses to reduce overshoot. This allows the system to compensate for changes in flow rate instead of assuming that each pump always behaves the same way.

An ESP32-S3 will act as the main controller and will host a local web application over Wi-Fi. A user will be able to connect using a phone, tablet, or laptop to select a drink, customize ingredient quantities, start or stop dispensing, and monitor the status of the system.

A custom PCB will integrate the microcontroller, load-cell interface, pump drivers, sensor connections, and power circuitry.

# Solution Components

## ESP32 Web Interface and Main Controller

An ESP32-S3-WROOM-1 will control the complete system and host a local web interface over Wi-Fi.

The web interface will allow the user to:
- Select a predefined beverage
- Create a custom mixture
- Adjust ingredient quantities
- Start or stop preparation
- View dispensing progress
- View requested and measured amounts
- View completion and fault messages

Because the ESP32 hosts the interface itself, no dedicated touchscreen or external server is required.

## Load Cell Measurement Subsystem

The cup will sit on a weighing platform connected to a 5 kg strain-gauge load cell.

Proposed components:
- TAL220 5 kg load cell
- NAU7802 24-bit load-cell ADC
- Mechanical cup platform
- Analog filtering components

Before dispensing begins, the system will measure the initial cup weight. During each pour, the ESP32 will continuously measure the increase in mass.

The approximate mass flow rate can be calculated using:

dm/dt ≈ Δm/Δt

This information will be used as feedback for the dispensing controller.

## Peristaltic Pump Dispensing Subsystem

The system will contain at least four independently controlled 12 V peristaltic pumps, with one pump assigned to each ingredient.

Proposed components:
- Four 12 V peristaltic pumps
- AO3400A N-channel MOSFETs
- Flyback protection diodes
- Gate resistors and pulldown resistors
- Food-compatible tubing

Each pump will be controlled by a MOSFET driver circuit on the custom PCB.

While far from the requested amount, the pump will operate continuously. As the measured weight approaches the target, the controller will use shorter pump pulses to improve dispensing accuracy.

## Adaptive Dispensing Control

The controller will continuously compare the requested ingredient amount with the amount measured by the load cell.

Rather than assuming a constant pump flow rate, the controller will estimate the current flow rate during each pour. This allows the system to adapt to changes caused by reservoir level, liquid viscosity, tubing conditions, or pump variation.

The system can also account for residual liquid that continues to enter the cup after the pump is turned off and use this information to improve future shutoff decisions.

If a small dispensing error occurs, the controller may also adjust the remaining ingredient quantities to better preserve the intended final drink ratio.

## Fault Detection

The load cell will also be used to detect several abnormal operating conditions.

The system will:
- Prevent dispensing if no cup is detected
- Stop dispensing if the cup is removed
- Detect a possible empty reservoir, blocked tube, or pump failure if a pump is active but the cup weight is not increasing
- Report detected faults through the web interface

A conductive leak sensor may also be placed underneath the dispensing area so that the pumps can be disabled if unintended liquid leakage is detected.

## Custom PCB and Power System

A custom PCB will contain the major sensing, control, and power circuitry for the project.

The PCB will include:
- ESP32-S3-WROOM-1
- NAU7802 load-cell ADC
- At least four MOSFET pump-driver channels
- Load-cell and sensor connectors
- Optional INA180 pump-current sensing circuits
- 12 V input protection
- 5 V and 3.3 V voltage regulation
- Programming/debug connections
- Status LEDs and test points

The system will use an external 12 V DC supply. The 12 V rail will directly power the peristaltic pumps, while regulators on the PCB will generate the lower voltages required by the ESP32 and sensing circuitry.

# Criterion For Success

- The system will automatically prepare a beverage using at least four independently controlled liquid ingredients.
- For requested ingredient quantities between 20 g and 150 g, the system will dispense each ingredient within ±5% of the target mass or ±2 g, whichever is larger, for at least 9 out of 10 trials.
- Ingredient quantities will be controlled using real-time load-cell feedback rather than only predetermined pump activation times.
- The controller will estimate the current liquid flow rate during dispensing and use this measurement when determining pump shutoff or pulsing behavior.
- The system will continue to satisfy the dispensing accuracy requirement when the flow rate of a pump changes by at least 20% from its original calibrated condition.
- The ESP32-hosted web interface will allow a user to select or customize a beverage, start dispensing, and monitor the system from a phone, tablet, or computer.
- The system will prevent dispensing when no cup is detected.
- If a pump is activated but the measured cup weight does not increase sufficiently, the system will stop dispensing and report a fault within 5 seconds.
- After preparation is complete, the system will compare the measured final weight with the expected value and report whether the drink is within the required tolerance.

Electricity-Generating Device Retrofitted for Spin Bikes with Wall Outlet Plug Connected to Gym's Grid

Raihana Hossain, Elisa Krause, Tiffany Wang

Electricity-Generating Device Retrofitted for Spin Bikes with Wall Outlet Plug Connected to Gym's Grid

Featured Project

**Elisa Krause (elisak2), Raihana Hossain (rhossa2), Tiffany Wang (tw22)**

**Problem:** Something we take for granted everyday is energy. Constantly, there is energy consumption in malls, offices, schools, and gyms. However, the special thing about gyms is that there is always someone using either the elliptical, bike or etc. Now what if, along with losing those extra pounds, you can also generate some electricity using these machines? Our device is a straightforward and cheap alternative for gyms to have retrofitted spin bikes that generate electricity, and for the gym to save money by using the electricity generated by the bikes that can be connected to the gym’s grid by simply plugging the device into the wall outlet.

**Solution Overview:** We are retrofitting a spin bike with an electricity-generating device that can be plugged into the wall outlet, which will be the path to send the generated electricity back to the gym’s grid to be used. The amount of electricity generated can also be monitored and displayed with the device.

**Solution Components:**

* **[Retrofit for Electricity Generation]** Component that attaches to any spin bike on the outside (straightforward and simple retrofit) and generates electricity when the bike is being used.

* **[Send Power to Gym Grid]** Component that reverses the typical direction of the wall outlet and sends the energy generated by the bike riders back to the gym’s power grid.

* **[Metering]** Component that records and displays how much energy was generated between the times when someone presses a button on the device. The first button press will reset the display. The second button press will show how much energy was generated from the time when the button was first pressed.

**Criterion for success:**

* Retrofits any (or the majority of) spin bike types

* Energy generated from people working out on the spin bikes is sent from a wall outlet to the gym’s power grid

* Device displays the power generated by a bike during the time of two button presses.

* Show that our power output being generated matches and syncs up with a sinusoidal input using a mock setup to simulate the grid

Project Videos