Module 14: Where to Go Next

Level: 🟢 Beginner Board: None (conceptual) Prerequisites: Module 13 Estimated time: 20–30 minutes Goal: Identify the next skills to learn and next projects to build after completing the course.


What You'll Learn

By the end of this module you will have a clear picture of the hardware upgrades, software extensions, and learning paths that build directly on the skills from this course. You will understand which platforms to consider next and why, and you will know where to start with PID control, computer vision, and ROS.


You built a robot that senses its environment, makes decisions, and moves through the physical world. All of that from a single $30 chassis across 14 modules of work. That's a complete autonomous system. This module is about what comes next: what to add, what to learn, and where this kind of work leads.


14.1 What you actually built

Before looking forward, it's worth naming what you've done clearly.

You didn't just follow a tutorial. You built a working autonomous robot by learning each subsystem in depth:

These are real skills. The same concepts (H-bridge, state machine, UART, time-of-flight sensing) appear in production robots, industrial controllers, and autonomous vehicles at every scale. The implementations get more sophisticated; the principles don't change.

14.2 Immediate hardware upgrades

These additions work with the existing sketch and chassis, require minimal wiring, and teach directly applicable new concepts.

Add a second ultrasonic sensor

Mount a second HC-SR04 on the right side of the chassis, angled 45° outward. With two sensors, the robot can distinguish "obstacle directly ahead" from "obstacle to the right" and choose a smarter turn direction, always turning away from the nearest side wall.

Pins: with the motor driver on D5–D10, Bluetooth on D2–D3, and the primary sensor on D11–D12, the free pins are D4 and D13. Use TRIG2 = D4 and ECHO2 = D13. D13 has the Arduino's built-in LED, which will flicker briefly during each ECHO read. This is visually harmless and electrically harmless; the LED draws too little current to affect the signal. If you add a third sensor or a display, you will run out of pins on the Uno: at that point, upgrade to an Arduino Mega 2560, which has 54 digital I/O pins and four hardware serial ports.

Add an IR line sensor

A TCRT5000 IR reflectance sensor (5 V, one analog pin) reads the floor. Mount it underneath the chassis, pointing down, at the front. It can detect black tape lines on a white floor, enabling line following: a completely different autonomous behavior from the same chassis.

const int LINE_PIN = A1;
// Typical values: ~200 (dark/tape), ~900 (light/floor)
int lineReading = analogRead(LINE_PIN);
bool onLine = lineReading < 400;

Add a servo-mounted sensor

Mount the HC-SR04 on a servo motor (SG90, ~$2). Before each avoidance manoeuvre, sweep the servo left and right and pick the direction with the most clearance. This is called active scanning and turns obstacle avoidance from reactive to deliberate.

#include <Servo.h>
Servo scanServo;
// sweep from 45° to 135°, take readings, find max distance direction

Add indicator LEDs

Three LEDs (green = forward, amber = avoiding, red = stopped) mounted on the chassis top give instant visual feedback without needing a Serial Monitor. Add them to enterState() so each state sets one LED high and the others low.

14.3 Software extensions

Wall following

Instead of avoiding walls, follow them. Use the side-mounted sensor to maintain a fixed distance from the left or right wall (proportional control: if distance > target, steer toward wall; if distance < target, steer away). This is a PID controller in its simplest form.

// Proportional wall following — no integral or derivative yet
const int WALL_TARGET_CM = 15;
int error = lastSideDist - WALL_TARGET_CM;
int correction = error * 3;  // proportional gain = 3
analogWrite(ENA, CRUISE + correction);
analogWrite(ENB, CRUISE - correction);

Timed lap counter

Add a lap marker (a strip of reflective tape on the floor) and count laps with the IR sensor. Record the time per lap with millis(). Print a lap summary over Serial.

Speed governor based on distance

Implement a proper proportional approach: speed = constrain(map(lastDist, STOP_DISTANCE_CM, 100, SLOW_SPEED, CRUISE), 0, CRUISE). The constrain() wrapper prevents the value from going negative (and wrapping around as a uint8_t) when lastDist drops below STOP_DISTANCE_CM. The robot slows gradually as it approaches an obstacle, instead of the two-speed approach from Module 13. Smoother, more natural motion.

EEPROM-stored calibration

Save RTRIM, BACK_DURATION, and TURN_DURATION to Arduino's built-in EEPROM (512 bytes, survives power-off). Add a calibration mode entered via a phone command ('C'): send new values over Bluetooth, save to EEPROM, load on next boot. No more reflashing the sketch to tune.

#include <EEPROM.h>
// Write: EEPROM.put(0, RTRIM);
// Read: EEPROM.get(0, RTRIM);

14.4 The next platform

This robot is an Arduino Uno on a two-wheel chassis. It's a learning platform, not a production robot. When you're ready for more:

Arduino Mega 2560 More pins, more memory, four hardware UARTs. Drop-in for the Uno. Required if you add multiple sensors or a display.

ESP32 Dual-core, 240 MHz, built-in WiFi and Bluetooth LE, 34 GPIO pins. Control the robot from a web browser over WiFi instead of a phone app. One chip replaces the Arduino + HC-05 combination. More complex programming model but substantially more capable.

Raspberry Pi + Arduino combination The Arduino handles real-time motor control and sensor reading (where microsecond timing matters). The Raspberry Pi handles high-level decision making, camera vision, and network communication. They talk over USB serial. This is the architecture used in most research robots: a microcontroller for hardware, a Linux computer for intelligence.

ROS (Robot Operating System) The standard framework for research and professional robotics. Runs on Linux (typically a Raspberry Pi or similar). Handles sensor fusion, navigation, localization, visualization, and more. A significant learning investment: the architecture is publisher/subscriber messaging between nodes, very different from Arduino's loop. Start here once you're comfortable with the hardware: ros.org.

14.5 What to learn next

The skills that will most directly extend what you built here:

PID control The P in wall following above is proportional control, the simplest form. Add integral (I) to eliminate steady-state error, and derivative (D) to dampen overshoot. PID controllers appear everywhere: motor speed regulation, drone stabilization, temperature controllers, cruise control. Brett Beauregard's Arduino PID tutorial is the best starting point.

Computer vision A camera turns obstacle avoidance into object recognition. OpenCV on a Raspberry Pi can identify specific objects, track colors, follow faces, or read QR codes. Pair it with the Arduino motor controller you already understand.

Localization and mapping Your robot currently has no idea where it is in the room; it reacts to what's immediately in front of it. Simultaneous Localization and Mapping (SLAM) builds a map of the environment while tracking the robot's position within it. Requires more sensors (typically LiDAR or multiple sonar) and significantly more compute.

Embedded C/C++ in depth The Arduino environment simplifies a lot. Deeper embedded programming (register manipulation, interrupt vectors, DMA, RTOS/FreeRTOS) gives you control the Arduino libraries abstract away. Start with AVR-LibC if you stay on AVR hardware, or learn the STM32 platform which is industry-standard.

14.6 Real-world robotics paths

Where this work leads if you pursue it:

<svg viewBox="0 0 760 280" width="100%" xmlns="http://www.w3.org/2000/svg">
  <defs>
    <marker id="aP14" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="5" markerHeight="5" orient="auto-start-reverse"><path d="M2 2L8 5L2 8" fill="none" stroke="#c4bfb0" stroke-width="1.5" stroke-linecap="round"/></marker>
  </defs>

  <!-- Course complete box -->
  <rect x="300" y="20" width="160" height="44" rx="4" fill="#d8f0e5" stroke="#1a6b4a" stroke-width="2"/>
  <text x="380" y="38" text-anchor="middle" font-family="IBM Plex Mono,monospace" font-size="10" fill="#1a6b4a">Course Complete</text>
  <text x="380" y="54" text-anchor="middle" font-family="Manrope,sans-serif" font-size="9" fill="#0e3d28">you are here</text>

  <!-- Three paths -->
  <!-- Hobbyist -->
  <line x1="340" y1="64" x2="200" y2="110" stroke="#c4bfb0" stroke-width="1.5" marker-end="url(#aP14)"/>
  <rect x="80" y="110" width="240" height="60" rx="4" fill="#f5f2eb" stroke="#c4bfb0" stroke-width="1.5"/>
  <text x="200" y="130" text-anchor="middle" font-family="IBM Plex Mono,monospace" font-size="10" fill="#3d3c38">Hobbyist / Maker</text>
  <text x="200" y="146" text-anchor="middle" font-family="Manrope,sans-serif" font-size="9" fill="#6b6a65">More sensors · ESP32 · home automation</text>
  <text x="200" y="160" text-anchor="middle" font-family="Manrope,sans-serif" font-size="9" fill="#6b6a65">3D printing · custom PCBs · community</text>

  <!-- Education/research -->
  <line x1="380" y1="64" x2="380" y2="108" stroke="#c4bfb0" stroke-width="1.5" marker-end="url(#aP14)"/>
  <rect x="270" y="110" width="220" height="60" rx="4" fill="#daeaf5" stroke="#1f4d8c" stroke-width="1.5"/>
  <text x="380" y="130" text-anchor="middle" font-family="IBM Plex Mono,monospace" font-size="10" fill="#1f4d8c">Education / Research</text>
  <text x="380" y="146" text-anchor="middle" font-family="Manrope,sans-serif" font-size="9" fill="#2c4a6e">ROS · SLAM · computer vision · RoboCup</text>
  <text x="380" y="160" text-anchor="middle" font-family="Manrope,sans-serif" font-size="9" fill="#2c4a6e">university programs · research labs</text>

  <!-- Industry -->
  <line x1="420" y1="64" x2="560" y2="110" stroke="#c4bfb0" stroke-width="1.5" marker-end="url(#aP14)"/>
  <rect x="440" y="110" width="240" height="60" rx="4" fill="#f5eed8" stroke="#c8aa60" stroke-width="1.5"/>
  <text x="560" y="130" text-anchor="middle" font-family="IBM Plex Mono,monospace" font-size="10" fill="#8a6800">Industry</text>
  <text x="560" y="146" text-anchor="middle" font-family="Manrope,sans-serif" font-size="9" fill="#5a4200">embedded systems · mechatronics · autonomy</text>
  <text x="560" y="160" text-anchor="middle" font-family="Manrope,sans-serif" font-size="9" fill="#5a4200">robotics engineering · firmware · EV/drone</text>

  <!-- Common next step -->
  <line x1="200" y1="172" x2="380" y2="218" stroke="#c4bfb0" stroke-width="1" stroke-dasharray="3 2" marker-end="url(#aP14)"/>
  <line x1="380" y1="172" x2="380" y2="218" stroke="#c4bfb0" stroke-width="1" stroke-dasharray="3 2" marker-end="url(#aP14)"/>
  <line x1="560" y1="172" x2="380" y2="218" stroke="#c4bfb0" stroke-width="1" stroke-dasharray="3 2" marker-end="url(#aP14)"/>
  <rect x="250" y="220" width="260" height="44" rx="4" fill="#1a1a18" stroke="#c4bfb0" stroke-width="1"/>
  <text x="380" y="238" text-anchor="middle" font-family="IBM Plex Mono,monospace" font-size="10" fill="#c8c4bc">Build more things. Break them.</text>
  <text x="380" y="254" text-anchor="middle" font-family="Manrope,sans-serif" font-size="10" fill="#888">Fix them. Understand why they broke.</text>
</svg>

Fig 14.1 - Three paths from here. All three converge on the same advice: keep building.

14.7 You finished

Fourteen modules. A robot that didn't exist at the start of Module 01 now navigates a room on its own.

Take a moment to look at what's sitting on your bench. Every wire, every component, every line of code: you put it there with understanding. You know why the voltage divider is on the HC-05's RX pin. You know why ECHO doesn't need one. You know why delay() breaks Bluetooth. You know why the state machine replaced the if/else. You know what RTRIM does and how to measure the right value for your specific chassis.

That's not tutorial completion. That's understanding.

The robot on your bench is now a platform. The sensor, the motor driver, the Bluetooth link, the state machine: these are reusable tools. What you build next is up to you.

Ready to start the next one? Use Make-It to generate a project specification for any of the upgrades in this module. Try describing what you want to build: "line-following robot with IR sensors", "servo-scanning obstacle avoider", "wall-following robot with proportional control" and get a full project plan with a bill of materials, wiring diagram, and code outline to work from. The same chassis, the same skills, a new challenge.


Self-Check: Module 14

Key Terms Glossary

Term Definition
PID control Proportional-Integral-Derivative control. A feedback algorithm that corrects a system toward a target by combining a proportional response (P), a correction for accumulated error (I), and a correction for the rate of change (D).
proportional control The P component of PID. The correction applied is directly proportional to the current error. Simple but can leave a steady-state error that I corrects.
SLAM Simultaneous Localization and Mapping. A technique where a robot builds a map of an unknown environment while simultaneously tracking its own position within that map.
active scanning Moving a sensor (e.g., mounting the HC-SR04 on a servo) to gather directional measurements before making a decision, turning obstacle avoidance from reactive to deliberate.
EEPROM Electrically Erasable Programmable Read-Only Memory. Non-volatile storage on the Arduino that survives power-off. Used to save calibration values so the sketch does not need to be reflashed to update them.
ROS Robot Operating System. A framework for writing robot software using a publisher/subscriber messaging model between independent nodes. Standard in research and professional robotics.
line following An autonomous behavior where the robot tracks a line (typically black tape on a white floor) using a downward-pointing IR reflectance sensor.
differential drive A drive configuration where two independently driven wheels control both speed and direction. Turning is achieved by driving the wheels at different speeds or in opposite directions.
hardware UART A built-in serial port on a microcontroller that handles serial communication in hardware, freeing the CPU from bit-banging. The Arduino Mega has four; the Uno has one (used for USB).

Previous: ← Module 13: Final Project: Autonomous Navigator

Related Blog Posts