Lesson 07 · 60 minutes

Roll Call on Two Wires

How the parts talk: I2C buses and addresses

Today's goal

Draw every part on the robot's I2C bus with its address, and explain what goes wrong when two parts share one.

Ideas in this lesson

Sense → Think → Do

Before the robot can SENSE anything with the IMU, the laser or the ADS1115 inputs, it has to find them. At power-on it calls each address and listens for an answer, like taking attendance.

How the session runs

  1. Play roll call: everyone holds a card with a number (0x28, 0x29, 0x48, 0x49, 0x4A, 0x68). The teacher calls a number; only that person stands up.
  2. Now give two kids 0x29. Call it. Both stand and talk at once. That is exactly what happens if a BNO055 and the laser are both at 0x29.
  3. Look at the robot's breadboard: SDA rail to A4, SCL rail to A5, 5V and GND rails. Trace each board to the rails.
  4. Restart the robot and read the console: 'imu: on MPU-6050 0x68', 'tof: VL53L0X found', 'adc: ADS1115 found: 0x48 0x49 0x4A'.
  5. Unplug one ADS1115 and send kp; (probe again). Which address disappeared?
  6. Draw the bus map: each board, its address, and how its address was chosen (the ADS1115 ADDR pin to GND, VDD, SDA or SCL; the BNO055 ADD pin to GND for 0x28).

Try this

When it goes wrong

What you seeWhat it means
Nothing found on I2CSDA and SCL swapped, or no 5V/GND to the boards.
A board shows up at the wrong addressIts address pin is floating or pulled the other way. Check the ADDR / ADD wiring.
IMU and laser both missing, or garbageTwo boards at 0x29. Pull the BNO055's ADD to GND so it moves to 0x28.
Notes for the grown-up

The roll-call game makes addresses stick. The 0x29 collision is a real story from building this robot: tell it.

Ages: K-5: roll call game only, with animal names instead of hex. 6-12: read the hex addresses, the 7-bit address plus read/write bit, and the level-shifter question.

Materials: Robot with several I2C boards, index cards with addresses, breadboard close-up photo or the real robot, app console.

← Too Much, Too Little, Just RightWhen in Doubt, Stop →