Lever-based Non-strain Mass Measurement Sensing System

Overview

This project was completed for the Sensing and Measurement lab course (SDM273). The goal was to design a mass measurement system for objects in the 75–750 g range with error within ±5 g, without using any strain-gauge sensors. The solution used a lever-balance principle, driven by a stepper motor, with a GY-25 gyroscope detecting the tilt angle of the lever arm.

Results

  • Measurement accuracy: Relative error consistently within ±1% across the 75–750 g test range.
  • Linear calibration: Fitted a first-order relationship between stepper motor position and mass: d = −1.4194m + 1193.7, validated through least-squares regression on calibration data.
  • Notable features:
    • Voice broadcast of measurement results.
    • No additional distance sensor needed — displacement computed from stepper motor step count.
    • Extreme pin-resource utilization via combined hard and soft UART.

System Design

Hardware:

  • Core structure: Roller-screw linear module acting as a lever arm, pivoting on flange-bearing supports to minimize friction.
  • Counterweight: Two 500 g weights on a slider; the stepper motor drives the slider along the lever to balance the unknown mass.
  • Sensing: GY-25 module (MPU6050-based) attached to the lever to read real-time pitch angle and determine which side is heavier.
  • Controller: Arduino UNO; stepper motor driver board (HPD970).

Software:

  • Balance detection: The system drives the slider in the direction that reduces tilt angle; balance is detected when the pitch sign reverses on consecutive readings (zero-crossing logic).
  • Friction compensation: Due to bearing friction, the equilibrium position differs depending on approach direction. The final position estimate averages two convergence positions: d = (d₁ + d₂) / 2.
  • Kalman filter: Applied to MPU6050 angular data to suppress noise and drift; the raw sensor exhibited >2% fluctuation even at rest.
  • Serial communication: Combined hardware UART and software serial (SoftwareSerial) to manage the GY-25 module, voice broadcast module, and PC debug output simultaneously within Arduino UNO’s limited pin set.

Challenges

  1. MPU6050 noise and zero-drift: Raw gyroscope data was highly noisy; addressed with Kalman filtering and GY-25’s onboard attitude fusion.
  2. Friction asymmetry: The approaching-from-above vs. approaching-from-below slider positions differed due to pulley friction, causing measurement bias. Averaging the two crossing positions significantly reduced this error.
  3. Limited Arduino UNO pins: Needed simultaneous UART communication with GY-25 (115200 baud), the voice module, and the PC. Solved by remapping hardware/software serial ports and enabling additional UART channels.
  4. Small calibration dataset: Only a limited number of reference masses were available, risking underfitting/overfitting of the linear model; addressed by careful selection of calibration points across the full range.

Reflection and Insights

This project demonstrated that non-electrical sensing principles — in this case, mechanical leverage — can achieve high-precision measurements when combined with careful signal processing and systematic calibration. The Kalman filter was essential to making the gyroscope data useful in practice, and the friction-averaging technique was a simple but highly effective engineering heuristic. The resource constraints of the Arduino UNO also provided practical experience with low-level embedded systems optimization.

Team and Role

  • Team: Two-person team sharing hardware construction and software development.
  • My Role: Primarily responsible for the control algorithm, Kalman filter implementation, and serial communication configuration.

SUSTech Electronic Design Competition

Overview

In the SUSTech College Student Electronic Design Competition, our team developed an embedded system for a smart medicine delivery vehicle. The system utilized modular design to complete tasks such as path tracking, room number recognition, and automatic medicine delivery and return. Using Arduino Mega2560 as the main controller and OpenMV Cam H7 Plus for vision-based recognition, we successfully implemented a functional prototype that met the core requirements.

Results

  • Achievements:
    • Designed and built a smart medicine delivery vehicle capable of transporting 200g medicines to specific rooms and returning to the starting point autonomously.
    • Achieved stable path tracking and room number recognition using color sensors and OpenMV-based vision modules.
  • Performance Metrics:
    • Accuracy: Room number recognition improved from low precision (~80%) to over 95% with increased training data.
    • Stability: Optimized dual-motor control for smooth motion and reduced trajectory deviation.
Datasets collected for training visual models.

Number recognition test.

Technical Details

  • System Architecture:
    • Controllers: Used Arduino Mega2560 for motion control and OpenMV Cam H7 Plus for visual recognition.
    • Sensors: Incorporated TCS230 color sensors for red-white line tracking and ultrasonic sensors for medicine placement detection.
    • Power Management: Employed LM2596 DC-DC modules for stable power supply to the motors and sensors.
  • Vision-Based Recognition:
    • Trained a MobileNet V2 model on OpenMV for room number detection, improving accuracy with an expanded dataset of over 1,000 images.
    • Integrated servo-driven camera adjustments to widen the field of view for larger room number recognition.
  • Motion Control:
    • Implemented dual-motor PWM control for precise trajectory adjustments.
    • Addressed power distribution imbalances to enhance stability and reduce deviation during turns.

Challenges

  • Path Tracking: Gray sensors failed to distinguish red and white lines due to spectral similarity, resolved by switching to TCS230 color sensors.
  • Recognition Precision: Initial low accuracy in room number detection improved through iterative dataset expansion and neural network fine-tuning.
  • Motor Synchronization: Addressed power discrepancies by using independent motor drivers for improved stability.

Reflection and Insights

This competition underscored the importance of modular system design in solving complex real-world problems. From refining vision models to debugging hardware components, the experience deepened my understanding of embedded systems and control algorithms. It also highlighted the critical role of interdisciplinary approaches in achieving reliable system performance.

Team and Role

  • Team: Collaborated with two teammates on design, implementation, and testing.
  • My Role:
    • Designed and implemented the vision system for room number recognition.
    • Led the integration of the motion control and tracking subsystems.
    • Conducted iterative testing and fine-tuning for system optimization.