Back to engineering

Georgia Tech · ME 4405 · Spring 2026

Mechatronics Gauntlet Robot

From blinking an LED to getting a robot through a maze. Across eight labs, I wrote embedded C, built sensor circuits, drove motors, tuned PID control, and used an IMU to track motion. Each lab added another piece to the robot—and another thing to figure out on the bench.

On the bench. In the maze.

Short clips · Original speed · Audio removed

The platform

Same robot. More to figure out each week.

I started with an Elegoo robot kit, replaced its stock Nano controller with an STM32 Nucleo, and added a breadboard, mounting hardware, and a support caster. The kit supplied the chassis; my work was connecting the electronics, writing the firmware, and getting sensing and motion to work together through the course's obstacle gauntlet.

Balancing was one part of the course's scope, not the whole project. The core work stretched from individual components to a mobile robot that could measure its surroundings, follow a path, hold a distance, and respond to changes in orientation.

The build, lab by lab

Eight labs. From code to motion.

These are the tasks I completed through ME 4405. Open a lab for the details.

01Embedded C & the STM32Firmware fundamentals, GPIO, and seeing what the code is doing.

Lab 1 · Introduction to C Programming

  • Set up the STM32 Nucleo-L476RG in STM32CubeIDE and used the HAL API to read, write, and toggle GPIO.
  • Compared fixed-width integer types, signed values, floats, and doubles for memory use, range, and precision.
  • Programmed changing LED blink intervals and button-to-LED behavior; inspected signals through serial output and Serial Wire Viewer (SWV).
  • Wrote temperature-conversion functions using integer and floating-point math, and used standard C libraries to produce bounded pseudo-random dice values.
02Digital circuits & inputsTurning code into reliable button, LED, and buzzer behavior.

Lab 2 · Digital Signals

  • Read component and microcontroller datasheets to check voltage tolerance, source/sink current limits, and the overall GPIO current budget.
  • Calculated current-limiting resistors and built a four-color LED sequence on a breadboard.
  • Worked with floating inputs and internal/external pull-up and pull-down resistors, then implemented independent button-controlled LEDs.
  • Compared active and passive buzzers and added a button-controlled active buzzer after checking its electrical requirements.
03Analog sensing & signal conditioningA temperature sensor, an op-amp, and useful ADC readings.

Lab 3 · The Flamethrower — analog signals

  • Used an LM34 temperature sensor and related its voltage output to temperature, sensitivity, and ADC resolution.
  • Calculated the gain and resistor values for an OPA340 non-inverting amplifier, built the signal-conditioning circuit, and checked voltages with a multimeter.
  • Configured ADC polling, converted readings to temperature, and sent measurements over serial.
  • Added red/yellow/green temperature-status indications and a separate indication for invalid readings.
04Robot integration & ultrasonic rangingHardware timers, interrupts, and a stop/wait/proceed routine.

Lab 4 · Robot Eyes and the Guillotine

  • Assembled and adapted the Elegoo platform for the STM32 controller, breadboard, and support caster.
  • Used the HC-SR04 ultrasonic sensor's echo timing to measure distance, with timer/prescaler configuration for microsecond timing.
  • Planned a ranging state machine and implemented button interrupts, timer-based measurement, and serial readouts.
  • Moved from button-triggered readings to periodic sensing, then integrated battery-powered motion with a gate-approach routine: stop, wait for clearance, and continue.
05PWM, encoders & motor matchingCharacterizing two motors before asking them to drive together.

Lab 5 · The Cliff Path

  • Interfaced the TB6612FNG H-bridge with the drive motors and worked through direction, standby, stop, and braking behavior.
  • Generated timer-based PWM, compared frequency/resolution tradeoffs, and swept duty cycle to find the motor dead zone.
  • Counted Hall encoder pulses using interrupts and measured each motor's tick rate across duty-cycle settings.
  • Built motor calibration curves and applied feed-forward gain matching to compensate for left/right differences.
  • Programmed the cliff-path sequence with a stop at the end and compared behavior at different driving speeds.
06Closed-loop distance controlTuning PID so the robot responds to a moving wall.

Lab 6 · Tunnel of Poison Darts

  • Implemented a distance-keeping PID loop using ultrasonic measurements, building on the earlier motor-matching work.
  • Converted distance error into forward/reverse motor commands around the lab's 20 cm reference distance.
  • Tuned proportional, integral, and derivative behavior while considering overshoot, steady-state error, oscillation, sensor noise, and the motor dead zone.
  • Used SWV to inspect sensor readings and error while testing the robot's response as the wall moved.
07Scanning, steering & the labyrinthCombining servo scans, a stepper pointer, and navigation logic.

Lab 7 · The Labyrinth

  • Controlled an SG90 servo with PWM, related pulse width to angle, and checked positioning resolution and the component current budget.
  • Built a transistor-and-flyback-diode driver for a 28BYJ-48 stepper, then programmed wave-drive, full-step, and half-step sequences.
  • Mounted the ultrasonic sensor on the servo, collected distance readings at successive scan angles, and stored the scan in a C array.
  • Established a zero reference for the stepper pointer and pointed it toward the scan direction with the greatest measured clearance.
  • Combined scanning and drive control to navigate the labyrinth, with a button-operated stop.
08I2C, IMU data & orientationReading sensor registers and reacting when the platform turns.

Lab 8 · The Spinning Wheel

  • Connected the MPU-6050 IMU over I2C, worked through its device address and register map, and used HAL memory reads/writes with communication error checks.
  • Read temperature and three-axis acceleration, configured measurement range, combined register bytes, and handled signed acceleration values and unit conversions.
  • Reviewed sensor offset tolerances and sampling behavior, then integrated the supplied Kalman-filter library to inspect angle and acceleration around the wheel axis.
  • Completed the spinning-wheel task: track a platform turn, turn the robot back toward its starting orientation, and drive down the ramp.

Self-balancing with a PD controller was a separate bonus in this lab. The main sequence above is the focus of this project.

What I worked with

Code, circuits, and the robot in between.

Embedded firmware
C · STM32CubeIDE · HAL · GPIO · interrupts · hardware timers · state machines · arrays · UART serial debugging · SWV
Electronics & measurement
Datasheet interpretation · current budgets · pull resistors · breadboarding · op-amp gain · ADC conversion · multimeter checks
Motion & control
H-bridge drive · PWM · encoder pulse counting · motor characterization · feed-forward matching · PID tuning · servo positioning · stepper sequencing
Sensing & navigation
Ultrasonic ranging · scan arrays · obstacle response · maze navigation · I2C registers · IMU readings · Kalman-library integration · orientation tracking

On the bench

STM32 Nucleo-L476RG · Elegoo robot chassis · TB6612FNG motor driver · encoder-equipped gear motors · HC-SR04 ultrasonic sensor · SG90 servo · 28BYJ-48 stepper · MPU-6050 IMU · LM34 temperature sensor · OPA340 op-amp