🔌 Getting started
From your first LED to your first robot that moves on its own. You’ll learn what a robot is, the electronics that matter, how to program the ESP32, read sensors, control motors safely, and finish with a rover that avoids obstacles. You can start without hardware, using the simulator.
How to read this map: The first three steps (green) lay the groundwork: what to buy, the electronics, and your first program. The next two (cyan) cover the robot’s senses and muscles. The final step, with a glow, brings it all together in the rover. If you’ve already mastered a step, skip to the next one.
🛞 What you’ll build in this track
A two-wheeled rover with a cardboard, MDF, or acrylic chassis. It moves forward, measures distance with ultrasound, and when it encounters an obstacle, it stops, looks to both sides, and chooses the clear path. Along the way, you’ll also build an LED blinker, a distance meter in the Serial Monitor, and a motor test with speed control.
- ✓ESP32 code with API 3.x (the current version)
- ✓Everything can be tested in the Wokwi simulator
- ✓Power and safe wiring from the start
- ✓A direct foundation for Track 2 (autonomous robots)
💡 Don’t have hardware yet?
Modules 1.1 to 1.4 run entirely in Wokwi, for free, in your browser. Buy the kit when you get to the motors (1.5).
Track map
🦾 What a robot is and what’s in its kit
Sense, think, act. And get started without buying anything
⚡ Essential electronics
Ohm’s law without the pain
💻 ESP32: your first program
From Wokwi to the real board
📡 Sensors: how the robot perceives
Ultrasound, infrared, and I2C
⚙️ Motors and power
Power at the wheels, battery under control
🛞 Project: obstacle-avoiding rover
Your first autonomous robot
Detailed content
🦾 What a robot is and what’s in its kit
The sense-think-act cycle, real robots in 2026, which board to use, the kit piece by piece, and your first program in the simulator.
A robot is a machine that measures its surroundings, makes decisions, and acts in a cycle, checking the result of its own actions.
Every project in the course uses this cycle with different parts; it also guides you when troubleshooting.
Sensor · controller · actuator · closed-loop control.
An overview without the hype: industry, homes, warehouses, open-source arms like the SO-101, and humanoids that are still being tested.
It helps you choose projects that work and look critically at robot videos.
Cobot · AMR · open-source arm · success rate.
The six tracks, entry points for different backgrounds, and the sequence: read, simulate, build, verify.
Start with the robot you want to build and learn only what it requires.
Learning paths · simulate first · my journey · exportable questions.
ESP32 for motors and sensors, Raspberry Pi 5 for cameras and ROS 2, Jetson Orin Nano Super for heavy AI workloads.
The right board saves battery, money, and rework as your robot grows.
GPIO · real time · TOPS · the computer thinks, the microcontroller controls.
Each part of the rover, what it does, how much it costs, and what to avoid (9 V for motors, L298N).
It helps you avoid buying parts you won’t use or building a robot that won’t move because it lacks power.
Motor driver · HC-SR04 · BMS · common GND.
Your first LED blink in the simulator, with ready-to-use code for API 3.x and workbench safety rules.
Making a mistake in the simulator won’t burn out a component; safety habits matter all the way up to the robotic arm.
Wokwi · setup and loop · Serial Monitor · ledcAttach.
⚡ Essential electronics
Voltage, current, and resistance through memorable analogies; Ohm’s law applied to an LED; breadboards, multimeters, and 3.3 V logic levels.
The three quantities found in every circuit, explained with a water tank analogy: pressure, flow, and a narrow pipe.
Without them, you can’t choose a battery, resistor, or motor driver.
Volt · amp · ohm · closed circuit.
Putting V = R × I to work: calculate the resistor that protects an LED at 3.3 V.
This is the calculation you’ll use most at the workbench, and it prevents burned-out LEDs and pins.
LED voltage drop · safe current · color code.
The breadboard’s internal layout: connected columns, power rails, and the center gap.
Half of the circuits that “don’t work” are built in the wrong row.
Power rail · jumper wire · short circuit · clean layout.
How to measure battery voltage, test a wire for continuity, and check a resistor.
Measuring turns “I think it’s right” into certainty, and helps protect your boards.
DC range · continuity · black probe on GND.
The difference between an on/off signal and one that varies, and why the ESP32 runs at 3.3 V.
Connecting a 5 V sensor directly to the ESP32 is the fastest way to burn out a pin.
HIGH/LOW · ADC · level shifter.
Two circuits found in every robot: lowering a voltage to measure it and reading a button without noise.
Measuring the robot’s battery and safely reading the HC-SR04 both depend on them.
Voltage divider · internal pull-up · floating input.
💻 ESP32: your first program
Arduino IDE 2.x with the esp32 3.x package, your first upload to a physical board, Serial Monitor, inputs, and PWM with the new API.
Install the IDE and Espressif’s official package, now in the 3.x generation.
Older tutorials use API 2.x and no longer compile; knowing the version saves you hours of troubleshooting.
Board Manager · esp32 package · API version.
Choose the right board and port, upload the LED blink, and resolve the most common connection errors.
This is where many people give up; here, your first upload becomes predictable.
COM/tty port · USB driver · BOOT button · data cable.
The structure of a sketch and the C++ basics you need to write readable robot programs.
Organizing code into functions makes the rover in 1.6 easy to adjust.
Variable type · const · if/for · function.
Use messages and Serial Plotter to see what your program is thinking.
A robot has no screen; serial is your only window into it.
Baud rate · print · Serial Plotter.
Read a button with the internal pull-up and a potentiometer through the ESP32’s ADC.
You’ll use the same kind of reading with real sensors in 1.4.
INPUT_PULLUP · analogRead · debounce.
Control LED brightness and buzzer pitch with ledcAttach and ledcWrite.
The same PWM will control motor speed in 1.5.
Duty cycle · frequency · bit resolution.
📡 Sensors: how the robot perceives
How each sensor sends its data; measuring distance with the HC-SR04; detecting lines and obstacles with infrared; noise filtering; and I2C sensors.
The four ways to send data: digital, analog, pulse width, and bus (I2C).
Once you know the sensor’s “language,” you’ll know which pin and function to use.
Digital signal · ADC · pulse · I2C.
Measure distance by timing the ultrasound’s round trip, with a safe connection for the ECHO pin at 3.3 V.
It’s the rover’s “eye” for avoiding obstacles.
TRIG/ECHO · speed of sound · pulseIn · voltage divider.
Sensors that detect reflected infrared light to find a black line or something very close.
They’re inexpensive and form the basis of the line follower in Trail 2.
Reflection · threshold · calibration in light and dark.
Why readings “jump” and how to smooth them with a moving average and discard unreasonable values.
A robot that reacts to noise stops for no reason; filtering makes its decisions reliable.
Moving average · median · out-of-range reading.
The I2C bus, addresses, and the scanner that detects connected devices, using a laser distance sensor as an example.
IMUs, displays, and modern sensors use I2C; you’ll need it in Trail 2.
SDA/SCL · address · Wire library.
Replace delay with millis so you can measure, decide, and move at the same time.
A long delay leaves the robot “blind,” and it may crash before it notices.
millis · periodic task · non-blocking code.
⚙️ Motors and power
DC, servo, and stepper motors; modern H-bridge; PWM speed control; servo on the ESP32; safe batteries and clean power.
The three motors used in desktop robotics and the kind of movement each handles well.
The wrong motor leaves your robot weak, slow, or imprecise.
Torque · rotation · position · gearing.
The circuit that lets the ESP32 control the motor in both directions without routing current through the pin.
Efficient drivers deliver more power and run cooler than the old L298N.
H-bridge · VM and VCC · STBY · peak current.
Functions for forward, reverse, turning, and stopping, with an acceleration ramp.
These are the “verbs” the rover will use in the trail’s final project.
Duty cycle · ramp · braking · dead zone.
Position a servo by angle with the ESP32Servo library, since the Arduino Uno’s Servo.h won’t work.
The servo turns the rover’s sensor so it can “look” from side to side.
50 Hz · pulse width · separate power supply.
Which battery to use, how to read its capacity, and the rules for safely charging lithium batteries.
The wrong power supply is the number one cause of a robot that “restarts on its own” and the biggest risk on the workbench.
mAh · discharge current · BMS · fireproof bag.
A buck regulator for 5 V, capacitors near the motor, and a single ground connection.
Without this, motor noise can restart the ESP32 just as it’s trying to turn away.
Buck · decoupling capacitor · brownout.
🛞 Project: obstacle-avoiding rover
From block diagram to a moving robot: assembly, testing one part at a time, obstacle-avoidance logic with a state machine, fine-tuning, and next improvements.
Block diagram, pin list, and power budget before you cut the chassis.
Planning helps you avoid rewiring and swapping parts halfway through.
Block diagram · pin map · power consumption.
Secure the motors, board, and battery to cardboard, MDF, or acrylic, with organized wires and an on/off switch.
Loose wiring is the biggest source of intermittent failures in a mobile robot.
Center of mass · wire strain relief · main switch.
A test sketch for each component: sensor, each motor, servo, and battery.
If you test everything together, you won’t know which part failed.
Hardware unit test · workbench checklist.
The move, stop, look, and turn states, and the rules for moving from one to another, in complete code.
State machines are how real robots organize their behavior.
State · transition · enum · switch.
A robot that veers to one side, restarts when turning, or can’t detect the wall: the cause and fix for each problem.
Your first robot always needs adjustments; learning to diagnose problems is the skill that lasts.
Motor compensation · distance threshold · serial diagnostics.
Three small improvements that prepare the rover for Trail 2.
They show how the same robot can grow with sensors and code, without replacing the chassis.
Expansion · reuse · next level.
🧰 Trail kit
Everything the rover in 1.6 uses. Approximate price range of R$ 200 a R$ 400 for the full set (Oct. 2026; check before buying: prices vary by store, shipping, and exchange rate).
ESP32 DevKit (WROOM-32) or ESP32-S3, preferably with USB-C, and a USB cable that supports data transfer.
830-point breadboard, male-to-male and male-to-female jumper wires, LEDs, and 220 Ω, 1 kΩ, and 10 kΩ resistors.
HC-SR04 ultrasonic sensor and two infrared sensors (line/obstacle modules).
Two TT motors with wheels and a caster wheel, plus a TB6612FNG or DRV8833 driver. Alternative: two continuous-rotation servos.
Holder for 4 rechargeable AA batteries (NiMH) or 2 18650 cells with a protection board (BMS), and an on/off switch.
Thick cardboard, MDF, or acrylic, with double-sided tape, cable ties, and M3 screws.
✓ Worthwhile optional item
A basic multimeter (module 1.2 teaches you how to use it) and an SG90 servo to turn the distance sensor.
✗ Don’t buy these for this trail
A square 9 V battery for the motors, an L298N driver, and giant sensor kits you won’t use.