Project Overview
The Environment-Aware Bot is an exploration into reactive autonomy. Instead of hardcoded paths, the robot makes split-second decisions from live sensor feeds — a 180° ultrasonic radar sweep combined with multiple downward and forward-facing IR sensors.
The chassis was designed and modeled in SolidWorks before being fabricated, ensuring precise sensor placement and weight distribution for stable navigation at speed.
Navigation Modes
The system supports three primary autonomous behaviors, implemented as a clean modular state machine in C++. Switching between modes is triggered by environmental conditions in real time:
void objectFollowing() {
int distance = getRadarDistance();
if (distance > 10 && distance < 30) {
moveForward(SPEED_NORMAL);
} else if (distance <= 10) {
stopMotors();
} else {
scanForObject(); // Initiates sweeping motion
}
}
Sensor Noise Filtering
A major challenge was the ultrasonic sensor's susceptibility to false positives from echo bouncing off low surfaces. I resolved this by implementing a median filter over multiple consecutive ping cycles, which smoothed the data curve significantly and eliminated phantom obstacle detections.
int getFilteredDistance() {
int readings[SAMPLE_COUNT];
for (int i = 0; i < SAMPLE_COUNT; i++) {
readings[i] = sonar.ping_cm();
delay(5);
}
// Sort and return median
sort(readings, readings + SAMPLE_COUNT);
return readings[SAMPLE_COUNT / 2];
}
Need autonomous navigation logic for a custom robot?