Production Grade Firmware // SYSTEM_04 // MECHATRONICS

Autonomous Floor
Cleaning Robot Architecture

An embedded systems case study featuring real-time collision aversion, state-machine driven pathfinding navigation, and register-optimized telemetry processing for custom multi-axis hardware platforms.

Role
Lead Systems Eng.
Duration
Academic Term
Category
Robotics & IoT
Platform
ATmega Silicon
Firmware
C++ (.ino)
Hardware Matrix
8-Bit Core
Status
Validated
Pipeline
GitHub ↗
// INTERACTIVE SHOWCASE

Autonomous Obstacle Avoidance Simulator

Watch the robot's sensor-fusion pathfinding algorithms in action. Click cells to place/remove obstacles in real-time.

Dirty Cleaned Obstacle Robot
Ultrasonic Range 100 cm
Coverage Efficiency 0%
FIRMWARE_SERIAL_MONITOR
01 // STRUCTURAL DIRECTIVE

Project Context

The Autonomous Floor Cleaning Robot is a custom mechatronic setup engineered to perform path navigation and surface sweeping loops. It bypasses the need for high-compute microprocessing boards by utilizing efficient, low-overhead firmware architectures.

Built directly from circuit level to structural casing, the system manages incoming data streams from distance sensor arrays using non-blocking timer triggers. By checking environmental variations through real-time state trees, the vehicle applies deterministic correction maneuvers ideal for handling unmapped layouts.

02 // THE ENGINEERING CRUCIBLE

Problem Statement

Kinematic Collision Risk

Standard blind execution loops often cause hard impacts against moving room hazards, requiring responsive fallback loops to adjust navigation profiles safely.

Signal Echo & Phase Jitters

Acoustic pulse cancellation and external infrared noise introduce severe tracking interference, creating loop errors if data isn't properly debounced.

Constrained Allocations

Running multi-stage choice trees on limited 8-bit registers requires careful code optimization to prevent memory limits or stack overflows.

03 // STRATEGIC BLUEPRINT

Technical Objectives

[OBJ_01]

Continuous Scanning

Deploy non-blocking background read cycles to check environmental space without stopping active movement paths.

[OBJ_02]

H-Bridge Matching

Calibrate duty cycles directly on controller pins to enable reliable straight runs and clean turning transitions.

[OBJ_03]

Low-BOM Layout

Maximize performance metrics while using budget-friendly microcontrollers and standard peripheral sensors.

[OBJ_04]

Automatic Corner Release

Build reactive choice sequences to pull the robot out of unexpected physical traps or dead ends autonomously.

04 // MECHATRONICS LAYER SPECS

Hardware Layer Deep-Dive

CENTRAL COMPUTE U1

Microcontroller Core

Orchestrates the primary asynchronous loop, handles raw signal debouncing, and generates independent PWM channels for velocity control.

Architecture: 8-Bit AVR Processing
Operational Clock: 16 MHz Crystal
Interface Strategy: Low-Level Timers
ACOUSTIC TELEMETRY SEN1

Ultrasonic Arrays (HC-SR04)

Calculates spatial distance lines using Time-of-Flight sound reflections to build a structural barrier map ahead of the platform.

Frequency Node: 40 kHz Sound Pulses
Scanning Bounds: 2cm – 400cm Thresholds
Aperture Target: 15° Directional Cone
INDUCTIVE ISOLATION DRV1

L298N Dual H-Bridge Platform

Isolates sensitive logic lines from inductive motor draw, safely distributing power to twin drive tracks.

Current Max: 2.0A Continuous Per Line
Protection Strategy: Flyback Diode Array
Control Mapping: Dual Channel PWM Enablers
BUS ISOLATION PWR1

Li-Ion Power Subsystem

High-capacity battery configurations deployed with independent regulator lines to filter motor ripple noise out of processing circuits.

Chemistry Profile: 18650 Cell Balancing
Bus Configuration: Dual 5V Logic / 12V Drive
Filtering Strategy: Decoupling Electrolytics
KINEMATIC ACTUATION MOT1-2

High-Torque Geared DC Motors

Delivers steady rotational force across varying surface transitions, maintaining predictable platform tracking over time.

Drive Layout: Differential Two-Wheel Setup
Torque Control: Step Duty Cycle Balancing
Caster Nodes: Passive Pivot Center Assembly
05 // SIGNAL COHERENCE

Firmware & System Architecture

Telemetry
Inputs Layer

Sensor Array

  • • Sonar Echo Pins
  • • IR Proximity Status
  • • Interrupt Buffers
Polling
Firmware
Decision Layer

ATmega328P Core

  • • Debounce Registers
  • • Non-Blocking State Loop
  • • Duty Cycle Maps
Disptch
Motors
Actuator Layer

H-Bridge Drive

  • • Isolated H-Bridge
  • • PWM Speed Drivers
  • • Differential Motors

The software relies on asynchronous timing loops, checking sensors continuously and updating motor speeds via PWM duty cycles.

06 // TIME CONVERSION SCHEMAS

Main Run Loop Lifecycle

01 //

Boot Config & Register Allocation

Configures I/O pin states, sets up timer presets for PWM, and assigns initial safety boundaries.

02 //

Ultrasonic Interrogation Wave

Fires a 10-microsecond trigger pulse to capture real-time distance metrics via low-latency hardware counter checks.

03 //

Telemetry Boundary Verification

Compares raw echo tracking vectors against safe thresholds to quickly flag oncoming hazards.

04 //

Adaptive Correction Sequences

When obstacles block the forward path, the logic alters individual motor tracks, executing a sharp pivot away from the barrier.

05 //

Velocity Output Dispatch

Applies calculated power levels to the driver control registers, keeping platform transitions smooth and controlled.

07 // SYSTEM FUNCTION ARRAYS

Feature Showcase

[FUNC_01]

Real-Time Aversion Matrix

Monitors physical environment boundaries continuously to reliably adjust drive behaviors before contact occurs.

[FUNC_02]

Differential Traction Steering

Enables high-efficiency rotational turning profiles, reducing wheel drag across tricky carpet-to-hardwood flooring transitions.

[FUNC_03]

Asynchronous Logic Loop

Leverages non-blocking check loops to execute sensor sweeping routines without halting motor propulsion cycles.

[FUNC_04]

Hardware Power Separation

Features split power rails that shield sensitive microcontroller boards from high-amp motor feedback spikes.

[FUNC_05]

Fallback Escape Sequences

Monitors for potential trap states, automatically executing reverse-and-pivoting paths to free the robot from tight corners.

[FUNC_06]

Modular Frame Geometry

Built with an balanced chassis layout that lowers the center of gravity while keeping components accessible for quick updates.

08 // MATH MATRICES

Sensor Interfacing & Conversion Calculations

Ultrasonic Echo Time-of-Flight Calculus

The logic driver converts raw acoustic return times into structural space metrics. The distance calculation relies on standard high-speed sound velocities:

Distance = (Measured Pulse Travel Time × 0.0343) / 2
Reflection Limits: Irregular layout corners or dampening fabrics can weaken echo returns, leading to brief pulse scattering.
Firmware Patch: Runs values through an integrated multi-step comparison window to filter out single-point sensor errors cleanly.

SYSTEM GATEWAY INTERCONNECT

Review Code & Circuit Schematics.

Explore firmware structures, physical pin mappings, and optimization logic configurations inside the active open-source codebase.