Follow a five-phase path from blinking an LED to a working robot car
Wire up an L298N driver and control two DC motors with PWM
Measure distance with an HC-SR04 ultrasonic sensor using pulseIn
Build a final sketch that combines IR line following and obstacle avoidance
Needs the Arduino IDE plus a full starter kit of hardware including UNO R3, L298N driver, motors, and sensors before any sketch runs end to end.
This repository is a personal learning log and codebase by Leonardo La Rocque for building a two-wheel-drive autonomous robot car from scratch with an Arduino UNO R3 starter kit. The README frames it as a step-by-step path for absolute beginners, going from blinking the small LED already on the Arduino board all the way to obstacle avoidance and line following. The hardware list covers an Arduino UNO R3, an L298N motor driver module that the README explains is needed because the Arduino alone cannot supply enough power for the motors, two DC gear motors with wheels and a caster, a chassis in acrylic, wood, or metal, an HC-SR04 ultrasonic sensor described as the robot's eyes, one or more IR sensors for line following, a breadboard, red yellow and green LEDs with current-limiting resistors, a push button, jumper wires, a battery holder, and a USB Type-B cable. Software requirements are the Arduino IDE plus the optional NewPing library, and Linux users are reminded to add their account to the dialout group to use the serial port. The code is organized into folders that mirror a five-phase progression. Phase 1, Electronics Basics, walks through the built-in LED blink, an external LED on a breadboard with a resistor, reading a push button with INPUT_PULLUP and the Serial Monitor, building a timed traffic light with three LEDs, and turning it into an interactive crosswalk. Phase 2 introduces the robot's senses by measuring distance with the HC-SR04 ultrasonic sensor using pulseIn and time-to-distance math, and detecting black or white surfaces with an IR sensor. Phase 3 covers motors and the L298N driver: identifying its terminals, spinning one motor forward and in reverse, then controlling speed with analogWrite and PWM duty cycles. Phase 4 is the mechanical assembly, wiring, and writing reusable movement blocks for forward, backward, and turning. Phase 5 brings everything together with two final sketches: obstacle avoidance and line following. Each step folder holds the .ino sketch, short wiring notes, and a description of what was learned, so a reader can follow the journey one phase at a time.
Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.