project

Autonomous Obstacle-Avoidance Robot

ENGR 122 — Field Sustainable Systems with Sensors · Stevens Institute of Technology · Spring 2026
IN PROGRESS TEAM OF 3

Objective: Design, assemble, and program a tracked autonomous robot to guide visitors on a campus tour, navigating a course, detecting obstacles via ultrasonic sensors, and executing real-time avoidance — all without human input. The robot must safely reach four target locations in sequence using MQTT-provided coordinates.

System Overview

The robot is built on a Pololu Zumo tracked chassis controlled by a WeMos D1 R2 (ESP8266) microcontroller. Three HC-SR04 ultrasonic sensors provide spatial coverage across front-left, center, and front-right fields. A Feetech FT-SMC-2CH motor driver receives PWM signals to independently drive each tracked motor. An SSD1306 OLED display provides real-time sensor readout and system status.

All navigation runs on a single control loop: sensors poll sequentially, distances are evaluated against a 10 cm safety threshold, and the appropriate motion primitive — forward, reverse, turn left, turn right, or full stop — executes with calibrated PWM values. The OLED updates asynchronously every 500 ms using millis()-based scheduling.
Hardware — Build Photos
Robot front view
Early integration — WeMos D1 R2 and motor driver visible; wiring on breadboard.
Robot sensors
Three HC-SR04 sensors on front face — left, center, and right field coverage.
OLED display
OLED display active — per-sensor distances and navigation status in real time.
Wiring & Pin Mapping

Compact breadboard atop the Zumo chassis. Motor power from onboard 4.8V NiMH battery; logic at 3.3V from the WeMos.

PeripheralSignalWeMos PinNotes
Motor Driver (FT-SMC-2CH)Motor LD6Servo PWM via Servo.h
Motor Driver (FT-SMC-2CH)Motor RD3Servo PWM via Servo.h
HC-SR04 (Center)Trig / EchoD4 / D5Ultrasonic.h library
HC-SR04 (Left)Trig / EchoRX / D0Ultrasonic.h library
HC-SR04 (Right)Trig / EchoD7 / D8Ultrasonic.h library
OLED SSD1306SDA / SCLD2 / D1I²C bus, address 0x3C
WeMos pinout
WeMos D1 R2 (ESP8266) Wi-Fi development board diagram.
Motor wiring
Wiring of WeMos D1 R2 to Feetech SMC 2CH & DC motors.
Key Code — Obstacle Avoidance Logic

C++, Arduino IDE. The control loop reads all three sensors, evaluates priority from most-blocked to least-blocked. Calibrated PWM values compensate for individual motor variance.

// Sensor thresholds and calibrated PWM constants const int SAFE_DISTANCE = 10; // cm — triggers avoidance const int STOP = 90; // neutral PWM const int L_FWD = 60, R_FWD = 120; // motors mirror mounting void loop() { int dC = sonarCenter.read(CM); delay(30); int dL = sonarLeft.read(CM); delay(30); int dR = sonarRight.read(CM); delay(30); if (dC <= SAFE && dL <= SAFE && dR <= SAFE) { stopMotors(); delay(200); moveReverse(); delay(400); turnRight(); delay(800); // U-turn escape } else if (dC <= SAFE) { (dL > dR) ? turnLeft() : turnRight(); delay(500); } else if (dL <= SAFE) { turnRight(); delay(300); } else if (dR <= SAFE) { turnLeft(); delay(300); } else { moveForward(); } if (millis() - lastUpdate > 500) { updateDisplay(dL, dC, dR); lastUpdate = millis(); } }
Competition Course
Obstacle course
Final course layout — robot navigates from SP to T1–T4, avoiding obstacles A–E.
3D Robot Sandbox

Drive the robot with WASD + Space to jump, or toggle autonomous mode. Place blocks to build your own course. Switch to the drone for aerial exploration.

ROBOT · MANUAL\nSPD: 0\nL:-- C:-- R:--
WASD — move · SPACE — jump
DRAG — orbit · SCROLL — zoom
Click terrain — place block
Status & Roadmap

✓ COMPLETED

  • Full chassis & motor assembly
  • 3-sensor obstacle detection
  • PWM motor calibration
  • Real-time OLED display
  • Sensor-based avoidance logic
  • Non-blocking display scheduling

→ IN DEVELOPMENT

  • Waypoint sequencing (T1–T4)
  • Turn angle calibration
  • Open-loop path timing
  • Reduce sensor crosstalk
  • 3D-printed sensor bracket
C++Arduino IDEESP8266PWMUltrasonicI²C / OLEDMQTTPololu Zumo