Back to engineering projects
// PRJ_001 · Mechatronics

Ice Dispensing
Machine.

A two-Arduino, closed-loop ice dispenser that delivers a user-specified mass of ice into a cup using real-time weight feedback. Custom 3D-printed hopper and auger, 5 kg load cell, and Simulink-generated SR-latch motor control.

Project type
Mechatronics prototype
Role
Designer · Hardware & firmware
Core systems
Load cell · Arduino · 3D-printed mechanism
Focus
Closed-loop mass control
The yellow 3D-printed ice dispensing machine in operation
// Live demonstration · 100 g target
Target mass
100 g ±5 g design goal
Sensor
5 kg load cell HX711 24-bit ADC
Actuator
12 V gearmotor 251 RPM · 18 kg·cm stall
Budget
≤ $120 CAD final BOM under target
// 01 — Problem

The brief: deliver an exact mass of ice, every time.

Build, and validate an automated ice-dispensing machine capable of delivering a user-specified mass of ice into a cup using real-time weight feedback. The system must be repeatable, easy to maintain, and safe to operate around melting ice.

Performance requirements

  • Target mass: 100 g of ice
  • Accuracy: ±5 g (design goal)
  • Overshoot: ≤ 10 g, dependent on stopping latency
  • Dispense 100-120 g of crushed ice under normal conditions

Mechanical & environmental

  • Hopper and auger 3D-printed, jam resistant for irregular cubes
  • Cup sits securely on the load cell with no lateral movement
  • Tolerates meltwater; electronics elevated and isolated
  • Auger and hopper removable for cleaning
// 02 — System Architecture

Two Arduinos, one tight feedback loop.

Sensing and actuation are split across two Arduino Mega 2560 boards. Cleanly separating the scale and motor responsibilities meant the SR-latch logic in Simulink stayed simple and the load-cell sketch could focus on filtering and tare.

User starts a dispense

Cup placed on the platform, button pressed on Pin 10 of the Motor Arduino — Latch S input goes HIGH.

SR latch sets, motor turns on

Q output enables a fixed PWM duty cycle (~50%) on Pin 5, driving the H-bridge that powers the FIT0186 gearmotor. The auger begins rotating ice into the cup.

Scale Arduino samples mass

HX711 reads the 5 kg load cell at 10-20 Hz with digital averaging. Tare is captured at startup; sustained readings are compared to the 100 g target.

Threshold reached → reset

When the cup mass crosses 100 g, the Scale Arduino drives Pin 22 HIGH. The Motor Arduino sees the 5 V signal as the latch's Reset, Q drops to 0, PWM goes to zero, and the motor stops without overshoot.

System idles for the next press

If the cup is already at or above 100 g, the latch stays reset and a button press cannot restart the motor — a built-in safety against overfilling.

// 03 — Build

CAD, 3D-printed mechanics, and a wired-up bench.

All mechanical components — hopper, auger, motor housing, drainage tray — were modeled in SolidWorks and Fusion 360, then 3D-printed in PLA. Two Arduino Mega 2560s, an HX711 amplifier, and an H-bridge motor driver formed the electronics stack on a perfboard breadboard.

CAD & mechanical

  • Sloped 3D-printed hopper with melt-runoff perforations
  • Two-turn helical auger sized to barrel ID for jam resistance
  • Sealed motor housing with quick-detach for maintenance
  • Slide-out water reservoir under the dispensing zone
  • Replaceable chute geometry tuned to avoid bridging

Electronics & firmware

  • Scale Arduino: HX711_ADC library (Olav Kallhovd), digital output on Pin 10 at 100 g
  • Motor Arduino: Simulink-generated code on Mega 2560
  • SR latch + PWM block on Pin 5, ~980 Hz fast PWM
  • H-bridge driver capable of >7 A peaks for the 12 V auger motor
  • Optional cup-presence and hopper-door safety inputs
SolidWorks Fusion 360 Arduino Mega 2560 Simulink HX711 FIT0186 gearmotor PLA 3D printing SR latch logic PWM control
// 05 — Outcome

Repeatable cutoff, minimal overshoot.

The completed system met every functional and performance goal. Filtered HX711 readings produced a clean 5 V stop signal at 100 g; the SR-latch and PWM driver shut the FIT0186 gearmotor off with minimal overshoot. The 3D-printed hopper and auger geometry held up across repeated trials with crushed ice — minor tolerance tweaks resolved the early jamming during testing, and the drainage tray kept water away from the electronics throughout testing.

What worked

  • Separating sensing and actuation across two Arduinos kept each program simple
  • SR latch eliminated bounce, flicker, and re-trigger noise
  • Helical auger metered ice consistently after a small clearance bump

What I'd change

  • Add adaptive PWM (slow-down phase) for sub-2 g final accuracy
  • Switch to a stepper for deterministic auger position control
  • Move from breadboard to a small custom PCB for production polish