A fully integrated mechanical, electrical, and software project built around a marble ramp and tank system. It automatically drops marbles into water, times their descent, counts them, and calculates their volume using water displacementβall displayed live on an LCD.
This project was designed as a capstone system for the ECE 3720 Microprocessors course at Oakland University. It showcases end-to-end integration between hardware construction, microcontroller programming, sensor interfacing, and signal processing.
Core functions include:
- Stepper motor-controlled marble dropper
- IR beam sensors for timing and marble counting
- Water level sensor for volume measurement
- LCD display for live output of time, volume, and count
- Overflow safety system to halt operations
- Dragon12-Light Rev D Board (with HCS12 MCU)
- Unipolar Stepper Motor for marble release
- IR Sensors (entry/exit detection on ramp)
- eTape Water Level Sensor (volume displacement)
- 16x2 LCD (HD44780) for display
- Custom Wood Frame with neodymium magnets for modularity
Sensor | Purpose |
---|---|
IR 1 (AN5) | Start timer when marble released |
IR 2 (AN6) | Stop timer and increment count |
Water Sensor (AN7) | Measure water level before/after marble drop |
- Uses ATD (Analog-to-Digital Conversion) to read analog sensors.
- Implements a stepper motor control routine to drop one marble per cycle.
- Calculates marble volume by difference in water level.
- Handles debounce logic to avoid double-counting.
- All values (volume, time, count) displayed in real-time on LCD.
main.c
β Main project code written in ANSI C for the HCS12 (Dragon12 board)lcd.c / lcd.h
β Handles HD44780 LCD logicstepper.c / stepper.h
β Stepper motor logic and control routinessensor.c / sensor.h
β IR and water level sensor handlingmakefile
β Compiling the project using CodeWarriorProject_Final-Report.docx
β Engineering report and documentationwiring_diagram.png
β (If included) Visual schematic of system wiring
- Marble Rotor Mechanism
- Stepper Spinner Design
- IR Sensor Positions
- eTape Water Sensor
- Stepper friction: Resolved using ball bearings
- Marble jamming: Mitigated with rounded rotor corners
- PWM/Delays: Stepper motor implemented using delays (note: ideal use would be interrupts)
- Sensor false reads: IR threshold tuned manually to prevent noise
Issue | Suggested Fix |
---|---|
8-bit ADC resolution | Upgrade to 10-bit for finer measurements |
Delay-based stepper | Replace with interrupt-driven control |
PVC water tank visibility | Use transparent vessel for better debugging |
Basic IR sensors | Upgrade to Boolean edge-triggered sensors |
LCD compatibility | Improve display to support higher bit resolution |
- Mazidi & Causey, HCS12 Microcontroller and Embedded Systems
- Adafruit β IR Sensor
- Adafruit β eTape Water Sensor
- Elegoo β 28BYJ-48 Stepper Motor
For educational use only