← All articles

19 October 2026

Your kid's first obstacle-avoiding robot: the classic first autonomous project

Your kid's first obstacle-avoiding robot

Almost every robotics engineer remembers their first robot — not the prettiest one, but the first one that dodged an obstacle by itself. The moment the little car rolls toward a wall, pauses, swerves aside and keeps going... most kids cheer out loud. It's the first time they watch a machine make its own decision, and the moment they realize they just gave it "eyes".

Why this is the beginner's graduation project

Before this project, kids usually build things that "follow a script": LEDs blinking on a fixed pattern, a car driving back and forth on hardcoded commands. An obstacle-avoiding robot is different — it reacts to the real world, a world the programmer can't fully predict.

This is the first time a child builds a complete system with all three parts: sensing (a distance sensor) → thinking (code that compares and decides) → acting (motors that steer). This sense–think–act architecture is the foundation of every robot that comes later, from vacuum robots to self-driving cars.

The brain of an obstacle-avoiding robot

The robot's entire "intelligence" fits in a loop that runs continuously. In plain words:

  1. Drive straight ahead.
  2. Every tenth of a second, ask one question: "Is anything within X cm ahead?"
  3. If no: keep driving.
  4. If yes: stop → back up a little → turn aside → back to step 1.

The key insight for parents: this is a loop, not a script. The robot isn't programmed to "drive 1 meter then turn left" — it looks, decides, and repeats forever. Put another cardboard box in its path and it handles that too. That's the difference between "a machine running code" and "an autonomous machine".

Two levels to grow into

Level 1 — "see it, dodge it". One sensor fixed at the front. When something enters the threshold, stop and turn a default direction (say, always right). Simple, works immediately — the downside is sometimes turning right into... another wall.

Level 2 — "look before deciding". The ultrasonic sensor sits on a servo motor, sweeping side to side like radar before deciding: how far left, how far right, then take the clearer path. This is exactly how real competition robots work — and it's the setup in ManuStem's ESP32 kits.

Going from level 1 to level 2 teaches a big engineering lesson: gather more information before deciding, and the decision gets smarter — true in robotics, true in life.

4 classic mistakes (and the lesson inside each)

1. Threshold too short + speed too high. The robot "sees" the obstacle but crashes before it can turn. The lesson: every system has a reaction time — fast sensing isn't enough if the body can't keep up.

2. Tilted sensor. An ultrasonic beam hitting a slanted wall bounces away instead of returning — the robot thinks the path is clear and drives straight into the wall. The lesson: sensor angle is part of the design.

3. Cornered, spinning forever. Turn left, wall. Turn right, wall. The robot spins in circles. Time to teach an "escape move": reverse longer, turn wider. The lesson: good code plans for the worst case.

4. Works on the table, fails on the carpet. Soft surfaces like rugs and curtains absorb sound instead of reflecting it — the sensor suddenly goes "blind". The lesson: the environment is part of the problem, and good engineers always test in real conditions.

The parent's role: ask questions, don't give answers

This project is a golden chance for parents to practice a skill worth more than any component: don't wire it for your kid — question them.

Failure here is data, not a bad grade. Every crash gives your kid a number to tune — and that's exactly how real engineers work every day.

From toy car to competition robot

In ManuStem's ESP32 kits, the ultrasonic sensor on its servo radar-sweep is the "eyes" of the competition robot car — the same sense–think–act architecture, raised to arena speed and precision. Kids 13+ can follow the C++ track and program these robots like real engineers.

ManuStem offers 28 lessons (8 Component Lab + 20 Competition Robot), 4 free trial lessons, for ages 8+. Kids learn entirely in the browser — AI Circuit wires alongside them, Gen AI writes code with them, and the Agent coach debugs step by step every time the robot hits a wall — no kit purchase needed, in Vietnamese and English.

Let your kid build their first autonomous robot at stem.manusignal.com — free, 15 minutes, right in the browser.

Read the Vietnamese version:

Robot tránh vật cản: dự án tự hành đầu tiên con nên làm