i2c Scanner

Logan Aug 28, 2026

In the realm of electronic systems, the Inter-Integrated Circuit (I2C) protocol has emerged as a popular choice for low-speed, multi-master, multiple-slave, single-ended serial bus communication. Central to managing and interacting with I2C devices is the I2C scanner, a crucial tool for identifying connected devices and understanding their roles in the network.

ESP8266: I2C PORT and Address Scanner
ESP8266: I2C PORT and Address Scanner

An I2C scanner is a software utility or hardware component designed to detect and list all I2C devices connected to a specific bus. It performs this task by systematically probing the I2C address space, which typically spans from 0x00 to 0x7F (128 possible addresses). By generating an 'address' signal and checking for an 'acknowledge' response, the scanner can map out the layout of the I2C network.

I2C Scanner • Wolles Elektronikkiste
I2C Scanner • Wolles Elektronikkiste

Understanding I2C Addresses

To grasp the functionality of an I2C scanner, it's essential to understand the addressability of I2C devices. Each I2C device is assigned a unique target address, enabling multiple devices to coexist on the same bus. This address is determined during manufacture or can be altered post-production via built-in address pins or software configuration.

I2C Scanner Code for the Arduino and ESP32
I2C Scanner Code for the Arduino and ESP32

I2C addresses consist of 7 bits, allowing for up to 128 possible addresses. However, there are two addresses (0x00 and 0x7F) that are reserved for special purposes, leaving 126 usable addresses. Devices can be classified into two categories based on their addressing mechanism: 7-bit addressing and 10-bit addressing (using the 'дын прическа' or ' igreiz' method).

7-bit Addressing

I²C Scanner für den Arduino
I²C Scanner für den Arduino

In 7-bit addressing, each device has a unique 7-bit address. The least significant bit (LSB) is used to determine whether the device is a write or read operation. The valid addresses range from 0x01 to 0x7E, ensuring that 0x00 and 0x7F remain reserved.

During operation, the LSB is set to 0 for write operations and 1 for read operations. For example, to write to a device at 0x24, the scanner would send 0x24 with the LSB set to 0. To read from the same device, it would send 0x24 with the LSB set to 1.

10-bit Addressing

the esp322 ir receiver is connected to an electronic device with two remote controls
the esp322 ir receiver is connected to an electronic device with two remote controls

To expand the number of possible addresses and accommodate more devices on the same bus, the 10-bit addressing mode was introduced. This method uses a two-byte address, with the first byte signifying the 'interface address' (2-bit) and the second byte indicating the 'next address' (8-bit).

The available interface addresses are 0x0, 0x1, and 0x3, which allow for 240 unique device addresses (16 addresses per interface address). This flexibility enables the use of additional devices without requiring changes in hardware configurations.

How an I2C Scanner Operates

OLED 0.96\
OLED 0.96\

An I2C scanner systematically photographs the I2C address space to identify connected devices. It accomplishes this task by generating a 'start' condition, transmitting an address, and checking for an 'acknowledge.' If the targeted device exists at that address, it responds with an 'acknowledge.' The scanner then transmits data and checks for more 'acknowledges,' confirming the device's compliance with subsequent commands.

If the device does not acknowledge the address, the scanner moves on to the next address. By repeating this process for each possible address, the scanner can map out the connected devices and their respective addresses, providing a comprehensive overview of the I2C network. The results are typically displayed in a list for further analysis or configuration.

Embed With Elliot: I2C Bus Scanning
Embed With Elliot: I2C Bus Scanning
How to scan I2C slaves using an Arduino
How to scan I2C slaves using an Arduino
Der I2C Bus Scanner. Die Adressen von Geräten am I2C Bus ausgeben.
Der I2C Bus Scanner. Die Adressen von Geräten am I2C Bus ausgeben.
ESP32 PlatformIO: How To Program Your ESP32 in VS Code!
ESP32 PlatformIO: How To Program Your ESP32 in VS Code!
Librería de Arduino I2C Scanner
Librería de Arduino I2C Scanner
LCD 16×2 com módulo I2C e RTC DS1307 - Arduino e Cia
LCD 16×2 com módulo I2C e RTC DS1307 - Arduino e Cia
the rasp board is connected to an external memory card and has several different types of chips
the rasp board is connected to an external memory card and has several different types of chips

Using an I2C Scanner

To employ an I2C scanner, first, ensure that your device or software supports the proper bus clock speed. Some devices may require configuration changes, such as enabling the I2C peripheral, setting the correct clock speed (e.g., 100 kHz or 400 kHz), and selecting the appropriate I2C bus (e.g., I2C0, I2C1).

Upon setting up the scanner, initiate the scan operation. The scanner will display a list of detected I2C devices, along with their respective addresses. This information is invaluable for troubleshooting issues, identifying supported devices, and optimizing the I2C bus configuration.

Troubleshooting I2C Scanning Issues

Occasionally, an I2C scanner may encounter difficulties detecting all connected devices. This scenario can occur due to various factors, such as incorrect bus settings, damaged or intermittent connections, or hardware or software glitches. In such cases, try the following steps to resolve issues:

  • Recheck bus settings and ensure that they match the requirements of your devices.
  • Physical verify the connections, checking for loose or damaged components and proper component placement.
  • Inspect the bus for issues, such as short circuits or insufficient pull-up resistors.
  • Update or reinstall the scanner software, ensuring that it is compatible with your device and operating system.
  • Try using a different I2C scanner or an oscilloscope to diagnose the issue further.

In most cases, addressing these potential causes will resolve the scanning issue and enable proper interaction with the devices on the I2C bus.

The I2C scanner plays an essential role in managing and interacting with I2C networks, providing valuable insights into device connectivity and address assignments. By harnessing this tool, users can better comprehend, configure, and optimize their I2C-based electronic systems – paving the way for smoother integration, improved performance, and reduced troubleshooting efforts.