Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

i2c scan

Probe all 112 valid 7-bit I2C addresses and report every device that responds with an ACK.

Requirements

An FTDI MPSSE adapter (FT232H, FT2232H or FT4232H) or a Microchip MCP2221/MCP2221A USB-to-I2C adapter connected to the I2C bus.

Usage

iottack i2c scan [OPTIONS]

Description

For each address in the range 0x08-0x77 the plugin sends a zero-byte I2C write (START + address + W + STOP) and checks for ACK. Reserved address ranges (0x00-0x07 general call/high-speed codes, 0x78-0x7F 10-bit addressing) are skipped.

Addresses that respond are reported at Medium severity together with a hint about common devices that use that address range.

Select the hardware backend with --adapter:

BackendHardwareNotes
ftdi (default)FT232H / FT2232H / FT4232HConfigurable channel and clock speed
mcp2221MCP2221 / MCP2221AUses the device’s configured I2C speed

Options

FlagShortDefaultDescription
--adapter <TYPE>-AftdiHardware backend: ftdi or mcp2221
--channel <CHANNEL>-cAFTDI channel to use, must be A or B (ftdi only)
--vid <HEX>-0403USB vendor ID in hex (ftdi only)
--pid <HEX>-auto-detectUSB product ID in hex (ftdi only)
--clock-hz <HZ>-100000I2C clock frequency in Hz (ftdi only)
--output <FILE>-o-Save result to a file
--format <FORMAT>-ftexttext or json
--verbose-v-Increase log verbosity

Address hint table

Address rangeTypical devices
0x18-0x19LIS3DH/LIS2DH accelerometer
0x1C-0x1DMMA8452/FXOS8700 accelerometer
0x1E-0x1FHMC5883L/MAG3110 magnetometer
0x20-0x27PCF8574/MCP23017 GPIO expander
0x28-0x29BNO055 IMU
0x38-0x3BPCF8574A GPIO expander/AHT10 humidity
0x3C-0x3DSSD1306/SH1106 OLED display
0x40-0x41INA219 power monitor
0x44-0x45SHT30/SHT31/SHT35 humidity & temperature
0x48-0x4FADS1115 ADC/LM75/TMP102 temperature
0x50-0x5724Cxx I2C EEPROM
0x60-0x67PCA9685 PWM driver
0x68-0x69MPU-6050/9250 IMU/DS3231/DS1307 RTC
0x70-0x75TCA9548A/PCA9548 I2C mux
0x76-0x77BMP280/BME280/BMP388 pressure sensor

Examples

FTDI adapter

$ iottack i2c scan --channel A --clock-hz 400000

Plugin name:    i2c/scan
Execution time: 312 ms
Status:         pass

[INFO] 3 I2C device(s) found
  Scanned addresses 0x08-0x77 at 400000 Hz via FTDI 0403:6011 channel A.

[MEDIUM] I2C device at 0x3c
  Address 0x3c (decimal 60) responded with ACK.
  Likely: SSD1306/SH1106 OLED display
  Evidence: "addr=0x3c hint=\"SSD1306/SH1106 OLED display\""

[MEDIUM] I2C device at 0x68
  Address 0x68 (decimal 104) responded with ACK.
  Likely: MPU-6050/9250 IMU / DS3231/DS1307 RTC
  Evidence: "addr=0x68 hint=\"MPU-6050/9250 IMU / DS3231/DS1307 RTC\""

[MEDIUM] I2C device at 0x76
  Address 0x76 (decimal 118) responded with ACK.
  Likely: BMP280/BME280/BMP388 pressure sensor
  Evidence: "addr=0x76 hint=\"BMP280/BME280/BMP388 pressure sensor\""

MCP2221 adapter

$ iottack i2c scan --adapter mcp2221

Plugin name:    i2c/scan
Execution time: 420 ms
Status:         pass

[INFO] 1 I2C device(s) found
  Scanned addresses 0x08-0x77 at 100000 Hz via MCP2221 (04d8:00dd).

[MEDIUM] I2C device at 0x76
  Address 0x76 (decimal 118) responded with ACK.
  Likely: BMP280/BME280/BMP388 pressure sensor
  Evidence: "addr=0x76 hint=\"BMP280/BME280/BMP388 pressure sensor\""

Troubleshooting

No devices found despite wiring being correct

  • Confirm pull-up resistors (4.7 kOhm) are present on SCL and SDA.
  • Try a lower clock frequency (--clock-hz 100000, ftdi only).
  • Verify target power is on.

FTDI device not found

  • Check lsusb shows the adapter (0403:6011 or similar).
  • Apply the udev rule and reconnect.

MCP2221 not found

  • Check lsusb shows 04d8:00dd.
  • Apply the udev rule and reconnect.

MPSSE initialization failed

  • Channels C and D on the FT4232H do not support MPSSE. Use --channel A or --channel B.

All or nearly all addresses respond (FTDI - ACK sensing broken)

If the scan reports a large number of devices (e.g., all 112 addresses), the ACK bit cannot be read and every probe falsely appears as ACK. The most common cause is that ADBUS2 (DI/TDO) is not connected to SDA.

The FT232H needs two pins shorted to the SDA line:

FTDI pinSignalNotes
ADBUS0 (SK/TCK)SCL4.7 kOhm pull-up to VCC
ADBUS1 (DO/TDI)SDA4.7 kOhm pull-up to VCC
ADBUS2 (DI/TDO)SDASame net, shorted to ADBUS1

ADBUS1 drives SDA low (open-drain). ADBUS2 reads SDA back to detect ACK/NACK. Without ADBUS2 on SDA the read pin floats low and every address appears to ACK.