Autonomous Floor Cleaning Robot:
Pathfinding Control Engine
A physical robotics architecture engineered with dynamic obstacle handling and asynchronous sensor evaluation arrays built for non-blocking execution loops. Designed to achieve intelligent indoor mobility using minimal computing overhead.
Project Overview
This Autonomous Floor Cleaning Robot was designed to bypass the high mechanical cost and heavy power drain common in consumer robotic vacuums. It establishes a direct link between simple proximity sensor arrays and responsive motor control adjustments.
By enforcing strict timing logic in the embedded C++ source code and optimizing path directions within a single processing thread, the vehicle avoids obstacles immediately. This architecture keeps room coverage fluid and smooth without requiring expensive processing boards.
Problem Statement
Impeded Obstacle Avoidance
Typical low-cost cleaning platforms generate erratic navigation changes that drop overall area tracking efficiency and stall vehicles in corner dead ends.
Sensor Echo Inaccuracies
Ultrasonic transducers and infrared modules can return noisy signals, causing false triggers or sudden movement changes due to environmental interference.
Highly Limited Microcontroller Memory
Running multi-sensor processing algorithms alongside continuous pulse-width modulation (PWM) actuator loops on a basic 8-bit chip requires careful code footprint management.
Technical Objectives
Real-Time Processing
Keep main execution loops under 50ms to read sensor arrays and adjust motor states before physical impacts can occur.
Low-Cost Deployment
Utilize standard hardware components (HC-SR04, L298N, SG90 servo) to achieve reliable pathing without complex computing chips.
Deterministic Stability
Isolate voltage tracks across logic circuits and high-current drive motors to stop microchip lockups caused by inductive power feedback.
Scalable C++ Base
Structure firmware tasks into clear, independent functions to allow adding alternative navigation patterns easily.
Hardware Layer Architecture
Arduino Uno (ATmega328P)
Processes incoming sensor metrics, executes path-selection rules, and outputs real-time directional commands over configured GPIO and PWM connection lines.
HC-SR04 Ultrasonic Transducer
Measures forward distances by tracking the flight time of 40 kHz acoustic sound bursts, signaling upcoming structural impacts up to 400cm out.
Infrared Sensor Array
Detects nearby surfaces and checks floor drops using reflected infrared beam signatures to give the platform quick boundary feedback.
L298N Dual H-Bridge Module
Switches high-current lines to drive the vehicle's independent DC motors, using PWM signals from the microchip to tune output speed safely.
SG90 Micro Servo Motor
Rotates the forward ultrasonic sensor across a 180-degree field of view, gathering directional depth scans before turning the chassis.
Geared DC Motors & Chassis
Provides reliable output torque through integrated gearboxes to drive the wheels, using a rear caster point for fast pivot steering.
Full-Stack Functional Architecture
Data profiles update continually through localized loops, enabling the robotic platform to adjust its course immediately when hitting path blocks.
Operational Loop Workflow
// 01 / Sensor Scan Burst
The microchip triggers the ultrasonic port, timing the echo response to find the exact distance to any forward obstacle.
// 02 / Threshold Logic Check
Firmware checks the distance against a preset 15cm limit. If the path is open, the platform drives ahead smoothly.
// 03 / Servo Directional Sweep
When blocked, the vehicle stops, rotates its servo to measure side paths, and selects the clearer direction.
// 04 / Motor Driver Activation
The microchip changes the L298N pins, driving the wheels in opposite directions to perform a crisp pivot turn before restarting the cycle.
Feature Deep-Dive
Autonomous Navigation
Runs continuous pathfinding logic that explores interior floor areas without needing manual controls or human intervention.
Dynamic Obstacle Avoidance
Interprets echo signals immediately to spot upcoming furniture, walls, or clutter, redirecting the chassis safely.
Differential Drive Control
Manages independent wheel lines via digital I/O adjustments to enable tight turns and backward exit paths in narrow corners.
Sensor Verification Pipeline
Filters erratic sensor noise inside the firmware to prevent false movement changes and maintain a steady course.
Low-Power Footprint Design
Coordinates actuator cycles efficiently to lower the load on attached battery cells, extending continuous operational runtimes.
Modular Electronics Base
Groups component connections systematically on a shared structural bus, making debugging and parts maintenance straightforward.
Technology Verification Matrix
Obstacle Navigation Decision Flow
The firmware uses an option-tree decision algorithm. When the forward sonic distance drops below the 15cm threshold, the microcontroller drops the drive pins low to avoid collision. It then activates a servo sweep routine to inspect alternative paths.
Comparing the side distance metrics determines the pivot direction. If the right path offers more clearance than the left, the firmware activates the left wheel forward while reversing the right wheel, turning the platform toward the open space.
PWM Motor Driver Interface
The L298N H-bridge uses 4 digital logic pins to control direction alongside 2 enable pins hooked to microcontroller PWM lines. Pulling alternative inputs high or low reverses the current flow across the motors, changing wheel rotation.
Modulating the PWM duty cycle controls the robot's movement speed. Dropping the output value lowers the average voltage, allowing smooth slowdowns near obstacles and keeping tracking performance reliable on slick floors.
Engineering Challenges Faced
Inductive Motor Voltage Spikes Causing MCU Restarts
High current draws from the DC motors regularly injected noise into the main power rail, causing voltage drops that reset the microcontroller.
Erratic Acoustic Echoes from Angled Wall Surfaces
Sonic waves hitting walls at odd angles reflected away instead of returning to the receiver, generating incorrect deep clear paths.
Performance Engineering Results
Project Responsibilities
As the sole researcher and developer, I handled the entire evolution of this autonomous platform—from selecting the electronics components to tuning the motion control firmware.
Platform Scale Statistics
Future Improvements Roadmap
// 01 / LiDAR Scanner Array
Swapping basic transducers for an active 360-degree laser sensor to build accurate spatial pathing across complex layouts.
// 02 / Local SLAM Mapping
Migrating the platform to an ESP32 chip to run lightweight floor grid mapping algorithms, preventing duplicate area cleaning loops.
// 03 / IoT Telemetry Dashboard
Adding a Wi-Fi pipeline to stream vehicle runtime charts, battery stats, and sensor alerts out to an online control window.
Platform Environment Previews
Chassis Front View Layout
Displays the structural placement of the sonic sensor array on its micro servo mounting point.
Power & Logic Circuits Layout
Shows the isolated layout design separating the logic microchip from high-current actuator tracks.
Pathfinding Execution Logs
Tracks structural decision flow paths, timing registers, and sensor echo processing windows.
Takeaways & Growth
Building this hardware platform emphasized the challenge of managing electrical noise and timing constraints in real-time embedded systems. Designing hardware without isolated power paths frequently leads to stability issues and microchip resets.
This engineering build improved my skills in handling hardware interrupts, optimizing pulse-width calculations, and structuring non-blocking firmware design. It showed that responsive physical automation projects can be completed successfully using clean, direct code frameworks on basic microprocessors.
Why This Initiative Matters
This project tackles a core robotics requirement: How do you execute stable real-time sensor loops and mechanical control path transitions under strict hardware memory limitations?
The repository moves past basic wiring guides to showcase production engineering choices. It highlights practical knowledge in processing real-time sensor inputs, isolating motor power tracks, and structuring clean C++ code loops—the core skills needed to build robust hardware products at scale.
Inspect the Implementation Layer.
Review the dynamic hardware configuration rules, responsive steering algorithms, and peripheral input logic driving this machine directly on the source pipeline.