ATMEGA328P // 40KHZ HC-SR04 SONAR // L298N H-BRIDGE // SG90 PWM

FIXED-PATH
ROBOTS FAIL ON
FIRST CONTACT.

Pre-programmed line followers and open-loop timers break the moment an unexpected crate blocks the corridor. KinetiX is an autonomous mobile pick-and-place platform and real-time 3D WebGL Digital Twin driven by a deterministic 5-State Finite State Machine on an Arduino UNO — combining 40 kHz ultrasonic time-of-flight ranging (d = t / 58 cm), L298N dual H-Bridge differential steering, and 50 Hz closed-loop SG90 servo manipulation.

MECHATRONIC_BUS // REALTIME SUBSYSTEM STATUS● FSM: 25Hz LOOP
SYS_01 // HC-SR04_SONAR[D10 Trig · D11 Echo]
RANGING
40 kHz · 15° ConeBUS: 94%
SYS_02 // L298N_HBRIDGE[ENA D5~ · ENB D6~]
DIFF_DRIVE
2A/Ch · S1+S4 ClosedBUS: 78%
SYS_03 // SG90_GRIPPER[Pin D9~ · 50Hz PWM]
CLOSED_LOOP
90° (1.5ms) ↔ 30° (1.17ms)BUS: 88%
SYS_04 // ATMEGA328P_MCU[16 MHz · 5V Logic]
AUTONOMOUS
SEARCH→PICK→CARRY→PLACEBUS: 100%
GOVERNING TIME-OF-FLIGHT EQUATION [40 kHz · v = 343 m/s]
d(cm) = (t_echo × 0.0343 cm/µs) / 2 = t_echo(µs) ÷ 58
AVOID THRESHOLD: d ≤ 20.0 cm (1160 µs)DRAG 3D OBSTACLES LIVE →
40 kHz
ULTRASONIC SONAR BURST
8 pulses · 15° cone · 2–400 cm range
d = t / 58
TIME-OF-FLIGHT PRECISION
1160 µs echo = 20.0 cm stop threshold
1:48 GEAR
DIFFERENTIAL TORQUE DRIVE
L298N dual H-Bridge · 2A/ch continuous
50 Hz PWM
CLOSED-LOOP SERVO GRIP
1.50ms (90° Open) ↔ 1.17ms (30° Clamp)
AUTONOMOUS CONTROL LOOP // 5-STATE DETERMINISTIC FINITE AUTOMATONSENSE → THINK → POWER STAGE → ACT
STATE_01d > 5.0 cm

SEARCH // SEARCH & APPROACH

HC-SR04 scans at 40 kHz; L298N drives motors forward, creeping when d < 20 cm

STATE_02d ≤ 5.0 cm

PICK // PICK OBJECT

Motors halt; SG90 servo rotates from 90° (1.5 ms) to 30° (1.17 ms) to clamp cylinder

STATE_03Gripper Locked

CARRY // CARRY & AVOID

Navigates to target; if d ≤ 20 cm, halts and executes orthogonal 90° spin-in-place bypass

STATE_04Target Reached

PLACE // PLACE AT TARGET

Halts at drop zone; SG90 returns to 90° open angle and chassis reverses slightly to clear

STATE_05Payload Released

DONE // MISSION COMPLETE

ENA/ENB PWM set to 0, H-Bridge switches open, autonomous cycle terminated

MISSION EXECUTION PIPELINE // 12-STEP AUTONOMOUS CYCLEPHASE 1: SEARCH & PICK [01–06] · PHASE 2: CARRY & PLACE [07–12]
STEP 01 // PHASE 1SEARCH

SYSTEM BOOT & INIT

Arduino UNO boots, configures GPIO directions, attaches D9 servo to 90° open, and zeroes motor PWM.

HW: Battery · ATmega328P
STEP 02 // PHASE 1SEARCH

DRIVE TO PICK ZONE

Arduino sets IN1=1, IN2=0, IN3=1, IN4=0 with PWM=170 so both wheel pairs propel the chassis forward.

HW: L298N · DC Gearmotors
STEP 03 // PHASE 1SEARCH

ULTRASONIC OBJECT LOCK

40 kHz 8-pulse burst reflects off the hollow cylinder; Echo pulse width t (µs) ÷ 58 locates the object.

HW: HC-SR04 · Pin D10/D11
STEP 04 // PHASE 1SEARCH

PRECISION CREEP APPROACH

Duty cycle throttles down to creep speed (PWM=115) until cylinder sits ≤ 5 cm centered between open jaws.

HW: HC-SR04 · ENA/ENB PWM
STEP 05 // PHASE 1PICK

ACTUATE SERVO GRIPPER

Motors brake; Pin D9 shifts 50 Hz pulse width from 1.50 ms (90°) to 1.17 ms (30°), squeezing rubber pads.

HW: SG90 Servo · Pin D9
STEP 06 // PHASE 1PICK

PAYLOAD LOCK & TRANSITION

1000 ms stabilization dwell confirms servo closed-loop torque lock; FSM transitions from PICK to CARRY.

HW: Closed-Loop Potentiometer
STEP 07 // PHASE 2CARRY

CONTINUOUS OBSTACLE SCAN

While transporting payload, any echo returning with d ≤ 20 cm (t ≤ 1160 µs) triggers an obstacle interrupt.

HW: HC-SR04 · 15° Sonar Cone
STEP 08 // PHASE 2CARRY

DIFFERENTIAL SPIN BYPASS

Left wheel drives forward (IN1=1, IN2=0) while right wheel reverses (IN3=0, IN4=1) to pivot clear of obstacle.

HW: L298N · H-Bridge S1–S4
STEP 09 // PHASE 2CARRY

TRAVERSE TO TARGET ZONE

Once ultrasonic line-of-sight reads > 20 cm clear, chassis rejoins trajectory toward designated drop zone.

HW: 1:48 Geared Drive
STEP 10 // PHASE 2PLACE

OPEN GRIPPER JAWS

Upon reaching target coordinates, robot halts and commands gripper.write(90) (1.5 ms pulse) to open jaws.

HW: SG90 Servo · Pin D9
STEP 11 // PHASE 2PLACE

DEPOSIT & CLEARANCE BACKUP

Hollow cylinder rests stably on target pad; robot reverses briefly so open jaws clear the payload.

HW: L298N Reverse (S3+S2)
STEP 12 // PHASE 2DONE

AUTONOMOUS CYCLE HALT

All H-Bridge enable lines drop LOW (0V), servo remains at 90°, and FSM enters terminal DONE state.

HW: ATmega328P Controller
MECHATRONIC BILL OF MATERIALS // CORE SUBSYSTEMSFULL SCHEMATIC →
[MOD_01]Arduino UNO R3 (ATmega328P)

Executes the 5-state control loop at 16 MHz: triggers the HC-SR04, times the Echo pulse via pulseIn(), computes distance d = t / 58, drives L298N direction/PWM pins, and generates the 50 Hz servo control signal.

16 MHz · 5V GPIO
[MOD_02]HC-SR04 Ultrasonic Ranging Module

Non-contact acoustic time-of-flight distance sensor. Emits an 8-cycle burst of 40 kHz ultrasound from Transmitter (T) and measures round-trip reflection time at Receiver (R).

40 kHz · 15° CONE
[MOD_03]L298N Dual Full-Bridge Driver

Amplifies low-current 5 V logic signals from the Arduino into high-current bidirectional 7.4 V–12 V power for two independent DC motor channels using dual H-Bridge switch networks (S1–S4).

2A/CH · DUAL H-BRIDGE
[MOD_04]1:48 Geared DC Motors & 65mm Wheels

Converts electrical power into high-torque mechanical wheel rotation. Differential speed control between left and right wheel pairs steers and spins the robot without a steering rack.

1:48 TORQUE · DIFF DRIVE
[MOD_05]SG90 Closed-Loop Servo & 2-Jaw Gripper

Actuates the parallel two-jaw mechanical gripper to open wide (90°) during approach and clamp firmly (30°) around the hollow non-metallic cylinder during transport.

50 Hz PWM · 1.8 kg·cm
[MOD_06]Acrylic Chassis, 7.4V Li-Ion Pack & Harness

Provides rigid mechanical mounting with front-mounted sensor/gripper, mid-mounted controller/driver, and rear-mounted 2×18650 Li-ion battery pack for longitudinal balance.

7.4V BUS · COMMON GND
FIRMWARE & QUICKSTART // ARDUINO IDE / CLI
// Flash directly to Arduino UNO R3 (ATmega328P @ 16 MHz) via Arduino IDE
// HC-SR04: D10 (Trig), D11 (Echo) | L298N: D5/D7/D8 & D6/D4/D2 | SG90: D9
#include <Servo.h>

float readDistanceCm() {
  digitalWrite(10, LOW);  delayMicroseconds(2);
  digitalWrite(10, HIGH); delayMicroseconds(10); // 10 µs trigger pulse
  digitalWrite(10, LOW);
  long t_us = pulseIn(11, HIGH, 30000);          // 40 kHz echo duration
  return (t_us == 0) ? 400.0 : (float)t_us / 58.0;
}
TEST IN 3D STAGE →
COMPARATIVE EVALUATION // MOBILE PICK-AND-PLACE ARCHITECTURESDETERMINISTIC CONTROL BENCHMARK
ARCHITECTURESENSING MODALITYDYNAMIC OBSTACLE RESPONSEPICK PRECISIONBOM COSTAUTONOMY
FIXED-PATH LINE FOLLOWERIR Reflectance OnlyCOLLIDES / HALTS PERMANENTLYFixed Track Only$18LOW (Static)
MANUAL RC TELEOP ROVERHuman Line-of-SightOPERATOR STEERED (HIGH LATENCY)Operator Dependent$32NONE (0%)
OPEN-LOOP TIMER BOTDead-Reckoning Delay()BLIND TO DYNAMIC OBSTACLESDrifts on Wheel Slip$20FRAGILE
★KINETIX (SONAR + 5-STATE FSM)40 kHz HC-SR04 (d = t / 58 cm)AUTONOMOUS ≤ 20 cm SPIN BYPASS≤ 5.0 cm Creep + 30° Servo Lock$24FULL 5-STATE DFA