Lesson 09 · 60 minutes

Robots Go Wrong

Debugging like an engineer

Today's goal

Find and fix three planted faults using the robot's own messages and Watch mode, and write down how you found each one.

Ideas in this lesson

Sense → Think → Do

Debugging is sensing the robot itself: its messages are clues. 'none found' is a sense problem, 'PIN CLASH' is a think problem, a wheel going backwards is a do problem.

How the session runs

  1. Before class, plant three faults on different robots: swap SDA and SCL; set a line sensor channel to the wrong pin in the Sensors tab; unplug one motor.
  2. Teach the routine on the board: 1 read the console, 2 guess, 3 change one thing, 4 test, 5 write it down.
  3. Clues to show: 'imu: none found' (I2C wiring), 'PIN CLASH: line sensor and light sensor both on pin a2', the app's pin map in red, Watch (lw) with a channel that never moves, t0-t3 to find a dead motor.
  4. Groups rotate between robots, 10 minutes each, logging clue, guess, fix.
  5. Share the real stories from building this robot: the cheap BNO055 that needed its PS0/PS1 pads checked and its address moved; a remote key that printed 'ir: key 0x.. not mapped'; a sensor whose label was hard to read.
  6. Each group presents its fastest find and its slowest find.

Try this

When it goes wrong

What you seeWhat it means
Fixed one thing, broke anotherChange one thing at a time and test after each change.
Can't find it at allGo back to a known-good state: re-flash, restart, check the console banner.
Readings look fine but behaviour is wrongWatch mode shows raw numbers with the robot standing still. Compare with what you expect.
Notes for the grown-up

Make debugging the hero, not the embarrassment. The course promise is 'robots go wrong, and working around that builds creative tenacity'. Celebrate good guesses even when they were wrong.

Ages: K-5: one obvious fault (unplugged motor, swapped remote batteries) and a 'detective' sheet. 6-12: subtle faults (wrong polarity setting, swapped I2C) and a written bug report.

Materials: Two or three robots, app on each, small screwdriver, labels, bug-log worksheet.

← When in Doubt, StopThe 32 KB Backpack →