ENGR 122 — Field Sustainable Systems with Sensors · Stevens Institute of Technology · Spring 2026
IN PROGRESSTEAM 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
Early integration — WeMos D1 R2 and motor driver visible; wiring on breadboard.Three HC-SR04 sensors on front face — left, center, and right field coverage.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.
Peripheral
Signal
WeMos Pin
Notes
Motor Driver (FT-SMC-2CH)
Motor L
D6
Servo PWM via Servo.h
Motor Driver (FT-SMC-2CH)
Motor R
D3
Servo PWM via Servo.h
HC-SR04 (Center)
Trig / Echo
D4 / D5
Ultrasonic.h library
HC-SR04 (Left)
Trig / Echo
RX / D0
Ultrasonic.h library
HC-SR04 (Right)
Trig / Echo
D7 / D8
Ultrasonic.h library
OLED SSD1306
SDA / SCL
D2 / D1
I²C bus, address 0x3C
WeMos D1 R2 (ESP8266) Wi-Fi development board diagram.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 constantsconst intSAFE_DISTANCE = 10; // cm — triggers avoidanceconst intSTOP = 90; // neutral PWMconst intL_FWD = 60, R_FWD = 120; // motors mirror mountingvoidloop() {
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
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