I²C Sensor Bus Across Platforms
Wire, scan and troubleshoot common I²C sensors with pull-up resistors.
◷ 50 minParts and tools
- Any supported development board
- I²C sensor
- 4.7 kΩ pull-up resistors
- Logic analyser (optional)
Lesson
Learning objective
Wire, scan and troubleshoot common I²C sensors with pull-up resistors.
Procedure
- Review the circuit and confirm the board voltage.
- Build and inspect the wiring before applying power.
- Upload the example, observe the result and record your readings.
- Change one parameter, predict the result and test again.
Troubleshooting
Check power, ground, pin selection, polarity, compiler target and serial output. Use a multimeter or logic analyser where appropriate.
Example code
// Initialise the platform I2C peripheral,
// scan 7-bit addresses, then verify ACK responses.Knowledge check
What do SDA and SCL normally require?
