Finding I2C Device Addresses: The Arduino I2C Scanner Guide
An I2C display can light up, a sensor can have the correct supply voltage, and your sketch can still report “device not found.” One wrong address is enough to stop the conversation. Guessing another popular address from a forum is slow and unreliable. A faster step is to ask the bus directly which addresses respond.
An I2C scanner is a short diagnostic sketch that tries each normal 7-bit address and reports the ones that acknowledge. It cannot identify a chip with certainty, and it cannot prove every feature works. It can answer the first useful question: does a device respond on this wiring, and at which address?
This guide gives you a scanner for an Arduino Uno R3, explains its output, and follows a practical troubleshooting order when the result is empty or unexpected. It also lists the default I2C pins for other common boards, gives a table of addresses that popular parts use, and covers changing the bus speed and releasing a bus that a device is holding low. For the protocol itself, including START conditions, pull-ups, register reads, and multiple devices, see Mastering Arduino Part 12: I2C, Addressing a Bus. Run the scanner before touching any library code. It takes a couple of minutes and separates a wiring problem from a software problem.
What the Scanner Tests
I2C, short for Inter-Integrated Circuit, is a two-wire communication bus. SDA carries serial data and SCL carries the clock. Several peripheral devices can share those lines because each normally has a 7-bit address.
The Arduino acts as the controller. It sends a START condition and an address. A connected peripheral with that address should pull SDA low during the acknowledge clock. That low response is called an ACK, short for acknowledge. If no peripheral responds, the controller receives a NACK, or not acknowledge.
A scanner repeats that address-only exchange across the usable address range. It does not read a manufacturer ID or decode a sensor register (a numbered storage location inside the chip). That is why an address such as 0x3C suggests some common displays but does not prove the attached device is an SSD1306 OLED.

Hardware and Wiring
For an Arduino Uno R3, connect:
| I2C device pin | Arduino Uno R3 | Purpose |
|---|---|---|
| SDA | A4 or the duplicate SDA pin | Serial data |
| SCL | A5 or the duplicate SCL pin | Serial clock |
| GND | GND | Shared voltage reference |
| VCC/VIN | Documented compatible supply | Device power |
The labeled SDA and SCL pins near AREF are electrically connected to A4 and A5. They are not a second bus.
Check the module’s voltage before connecting it. Some breakout boards accept 5V power and include level shifting. Others expose a 3.3V-only chip directly. A scanner does not protect a device from the wrong supply or from pull-ups tied to an unsafe logic voltage.
I2C also needs pull-up resistors on SDA and SCL because devices normally pull the lines low or release them. They do not actively drive them high. Many breakout modules already include pull-ups, so inspect the schematic or board documentation before adding more. A 4.7kΩ resistor on each line is a common starting point for a short beginner bus, not a universal answer.
Default I2C Pins on Other Boards
The Uno R3 pins above are not the same on every board. The table lists the default I2C pins that the standard Arduino Wire library uses on common boards, along with the logic voltage of the pins. Confirm the pins against your board's pinout, since clones and board-package versions can differ.
| Board | SDA | SCL | Logic level |
|---|---|---|---|
| Arduino Uno R3 and Nano | A4 | A5 | 5V |
| Arduino Uno R4 | A4 | A5 | 5V |
| Arduino Mega 2560 | 20 | 21 | 5V |
| Arduino Leonardo and Micro | 2 | 3 | 5V |
| Arduino Due | 20 | 21 | 3.3V |
| ESP32 (classic DevKit) | GPIO21 | GPIO22 | 3.3V |
| ESP8266 (NodeMCU, Wemos D1 mini) | D2 (GPIO4) | D1 (GPIO5) | 3.3V |
| Raspberry Pi Pico (arduino-pico core) | GPIO4 | GPIO5 | 3.3V |
The scanner sketch works on any of these boards without changes to the loop, because Wire.begin() picks the default pins. Boards that run at 3.3V need 3.3V modules or a level shifter, and their pins are not 5V tolerant.
The ESP32 and the Pico can move I2C to other pins. On the ESP32, pass the pin numbers to Wire.begin(), SDA first:
Wire.begin(21, 22); // SDA on GPIO21, SCL on GPIO22. Change these to use other pins.
Boards with a second I2C bus use a second object named Wire1. To scan it, start that bus with Wire1.begin() and change each Wire. call in the sketch to Wire1.. The two buses are separate, so a device on one does not appear in a scan of the other.
Try the Scanner in the Lab
The Makers Workbench Electronics Lab runs this scanner on a simulated Uno R3 with one I2C peripheral: an SSD1306 OLED display at its default address, 0x3C. The simulated bus works without pull-up resistors. A real bus needs them, as covered above.
The Lab circuit is wired like this:
| From | To | Why |
|---|---|---|
| OLED SDA | Uno A4 | Carries address and data bits |
| OLED SCL | Uno A5 | Carries the controller's clock pulses |
| OLED VCC | Uno 5V | Powers the simulated device |
| OLED GND | Uno GND | Establishes a shared reference |

To use the Lab:
- Press the green Run button. The first run compiles the sketch, so give it a few seconds.
- Open the Serial monitor above the circuit.
- Read the scan results:
Device found at 0x3CandTotal devices: 1. The scan repeats every five seconds.

The Scanner Sketch
The hard way would be to write the START condition, clock seven address bits plus a direction bit, release SDA for the acknowledge clock, and generate STOP for every address. Arduino’s Wire library handles those electrical steps. We still write the address loop ourselves so the diagnostic remains visible and easy to modify.
#include <Wire.h> // Load Arduino's I2C library.
void setup() {
Serial.begin(115200); // Open the Serial Monitor link.
Wire.begin(); // Start the Uno as the I2C controller.
Serial.println("Arduino I2C scanner"); // Show that setup completed.
}
void loop() {
byte devicesFound = 0; // Count successful address replies.
Serial.println("Scanning 0x08 through 0x77...");
for (byte address = 0x08; address <= 0x77; address++) {
Wire.beginTransmission(address); // Prepare an address-only transaction.
byte result = Wire.endTransmission(); // Send it and save the Wire status code.
if (result == 0) { // Zero means the address was acknowledged.
Serial.print("Device found at 0x");
if (address < 0x10) { // Pad one-digit hex values with a zero.
Serial.print('0');
}
Serial.println(address, HEX); // Print the 7-bit address in hexadecimal.
devicesFound++; // Add the response to the total.
} else if (result == 4 || result == 5) {
Serial.print("Bus error near 0x"); // Separate a bus fault from no reply.
Serial.println(address, HEX);
}
}
if (devicesFound == 0) { // Give an explicit empty-scan result.
Serial.println("No I2C devices found");
} else {
Serial.print("Total devices: ");
Serial.println(devicesFound);
}
Serial.println(); // Separate one scan from the next.
delay(5000); // Scan again after five seconds.
}
The loop begins at 0x08 and stops at 0x77 because addresses outside that range are reserved. Some older scanner examples probe 1 through 126. That often works as a quick diagnostic, but skipping reserved ranges is clearer and avoids treating special address patterns like ordinary peripherals.
How the Code Finds an Address
The sketch is short because Wire handles the physical signaling. It still helps to follow one pass through the loop.
Wire.begin() starts the Uno’s I2C hardware in controller mode. Nothing has been scanned yet. Inside loop(), the for statement sets address to 0x08, runs one probe, adds one to the address, and repeats until 0x77 has been tested.
Wire.beginTransmission(address) tells Wire which 7-bit address to use. There is no sensor register or data byte in this transaction. Wire.endTransmission() sends the address and checks the result. The function returns zero when a peripheral acknowledges.
The scanner treats return codes 4 and 5 differently from a normal NACK. A NACK simply means no ordinary device answered that address. Code 4 indicates another bus error, while current AVR Wire versions can use 5 for a timeout. Seeing one of those codes repeatedly gives you a reason to inspect the electrical bus, not merely try another address.
The if (address < 0x10) line prints a leading zero for addresses below 16 decimal. It turns 0xA into the conventional 0x0A form. That formatting does not change the address.
After all probes, the sketch waits five seconds and repeats. Repetition matters. A device that appears once and vanishes is not a stable result. Leave the monitor open for several scans before copying an address into the project.
Run the Scan
- Disconnect power while wiring the module.
- Check SDA, SCL, ground, supply voltage, and pull-ups.
- Connect the Uno by USB.
- Select Arduino Uno and the correct port in Arduino IDE.
- Upload the sketch.
- Open Serial Monitor and select 115200 baud.
- Read the address list, then watch at least one repeat scan.

A successful result might look like:
Arduino I2C scanner
Scanning 0x08 through 0x77...
Device found at 0x48
Device found at 0x68
Total devices: 2
Use the 7-bit values exactly as printed in Arduino libraries that ask for an I2C address. For example:
const byte SENSOR_ADDRESS = 0x48; // Save the scanner's 7-bit result.
Do not convert 0x48 to decimal unless a specific API asks for decimal notation. 0x48 is simply the C++ hexadecimal form of the number.
Record three things in your project notes: the module name printed on the board, the address the scanner found, and the address configuration of any jumpers or pins. That record becomes important when another revision of the module arrives with a different default.
Next, replace the scanner with the smallest official or manufacturer-supported example for the exact device. Set that example to the scanned address. If the example works, move its initialization into the larger project. This progression keeps the diagnostic surface small.
Seven-Bit and Eight-Bit Address Confusion
An I2C transfer sends seven address bits followed by one read/write bit. Arduino’s Wire functions expect only the 7-bit address. Some datasheets instead print two 8-bit values, one for writing and one for reading.

Suppose a datasheet lists 0x90 for writes and 0x91 for reads. Those differ only in the low read/write bit. Shift either one right by one bit and the Wire address is 0x48.
Use this clue carefully. If the scanner prints 0x48 while a datasheet table lists 0x90 and 0x91, the device may be working correctly. Do not double the scanner result before passing it to Wire.beginTransmission().
Interpreting Common Results
One expected address
This is the cleanest outcome. Put that 7-bit address into the device library or your register-level code. Then test an actual read or write. An ACK proves presence at the address, not correct configuration.
More addresses than expected
Several connected modules may each respond once. A single development board can also contain more than one I2C device. Scan modules separately to map each response.
If many or nearly all addresses appear, suspect an electrical problem before assuming that many peripherals are connected. SDA may be stuck low, pull-ups may be wrong, or a device may be holding the bus.
No addresses
An empty result is a symptom, not a verdict that the module is dead. Work through power, pins, ground, pull-ups, address mode, and wiring before replacing hardware.
A bus error but no device address
If the sketch repeatedly reports a bus error near one part of the range, simplify the circuit. Disconnect all but one peripheral, shorten the wires, and restore the normal clock speed. An address scanner expects an idle bus between probes. A line that cannot return high or a device that never releases it can prevent later probes from being meaningful.
One address disappears intermittently
Loose jumpers, long wires, marginal pull-ups, incompatible logic levels, or unstable power can produce intermittent ACKs. Shorten the bus and simplify it to one device before changing software.
Troubleshooting an Empty Scan
Confirm the correct pins
On the Uno R3, use A4 for SDA and A5 for SCL. A Mega, Due, ESP8266, ESP32, and many other boards use different defaults, and the table in the hardware section lists them. The wiring table near the top of this guide is specifically for the Uno R3.

Share ground
SDA and SCL voltages need the same reference at both devices. Join the module ground to Arduino GND. A powered module without a common reference may light an LED while communication fails.
Verify power and logic voltage
Read the exact breakout documentation. “The chip is 3.3V” and “the module accepts 5V on VIN” can both be true when a regulator and level shifting are present. They can also be dangerously false for another board that looks similar.
Inspect pull-ups
Power off and check whether the breakout already has pull-up resistors. Multiple modules place their pull-ups in parallel. Two 4.7kΩ resistors become about 2.35kΩ. Too little pull-up current produces slow rising edges; too much forces devices to sink excessive current when pulling low.
Scan one device at a time
Remove every peripheral except one. If it appears alone, add the next. This finds address conflicts, a module holding the bus, and pull-up combinations that only fail when boards are combined.
Check configurable address pins
Pins labeled A0, A1, A2, ADDR, or SA0 may choose among addresses. Floating, soldered, or jumper-selected states vary by chip. Use the datasheet, not a generic address chart.
Shorten the wires
I2C was designed for communication between integrated circuits over short distances. Longer wire adds capacitance and picks up noise. Use short jumpers for the first test and return to the default 100kHz clock before experimenting with other speeds.
Look for a stuck line
With power removed, inspect for shorts. With suitable equipment and a safe low-voltage setup, verify that SDA and SCL idle high. A line held low can indicate swapped wiring, a damaged module, an unpowered device being back-powered, or a peripheral stuck mid-transaction.
Release a held-low SDA line in software
A peripheral that loses power or is reset in the middle of a byte can leave SDA held low, because it is waiting for clock pulses that never arrive. Cycling power clears it, and so does a procedure from the I2C specification: the controller sends up to nine clock pulses on SCL until the device lets go of SDA, then sends a STOP condition. The sketch below does that by driving the two pins directly, before Wire.begin() takes them over. It is written for the Uno R3 pins and only helps when a device is holding SDA. It does not fix a short circuit or a wiring error.
const byte SDA_PIN = A4; // Uno R3 SDA pin.
const byte SCL_PIN = A5; // Uno R3 SCL pin.
void clearBus() {
pinMode(SDA_PIN, INPUT_PULLUP); // Release SDA so we can read what the bus is doing.
pinMode(SCL_PIN, INPUT_PULLUP); // Release SCL for the same reason.
if (digitalRead(SDA_PIN) == HIGH) { // If SDA is already high, the bus is free.
return;
}
for (byte i = 0; i < 9; i++) { // The specification allows up to nine clock pulses.
pinMode(SCL_PIN, OUTPUT);
digitalWrite(SCL_PIN, LOW); // Pull SCL low for one half of a pulse.
delayMicroseconds(5);
pinMode(SCL_PIN, INPUT_PULLUP); // Release SCL so the pull-up raises it.
delayMicroseconds(5);
if (digitalRead(SDA_PIN) == HIGH) { // Stop pulsing once the device releases SDA.
break;
}
}
pinMode(SDA_PIN, OUTPUT); // Create a STOP condition: SDA goes low,
digitalWrite(SDA_PIN, LOW);
delayMicroseconds(5);
pinMode(SCL_PIN, INPUT_PULLUP); // then SCL is high,
delayMicroseconds(5);
pinMode(SDA_PIN, INPUT_PULLUP); // and SDA is released to rise while SCL is high.
}
Call clearBus(); at the top of setup(), before Wire.begin();. If SDA is still low after the routine runs, the cause is electrical, such as a short, a damaged part, or a device holding the line low permanently, and the isolation routine below is the next step.
A Repeatable Isolation Routine
When a full project has several modules, do not troubleshoot all of them at once. Use this sequence:
- Save the project sketch and upload the known-good scanner.
- Photograph or write down the original wiring before disconnecting anything.
- Remove power and disconnect every I2C peripheral.
- Reconnect one peripheral with short wires, compatible power, and a shared ground.
- Power up and watch three complete scans.
- Record the stable address or the empty result.
- Power down and repeat for each peripheral by itself.
- Reconnect two devices with different addresses and scan again.
- Add the remaining devices one at a time, scanning after every addition.
This routine tells you when the failure appears. A module that never scans alone points toward its wiring, power, address mode, or condition. Two modules that scan alone but fail together point toward an address conflict, combined pull-ups, supply loading, or added bus capacitance.
Do not hot-plug breadboard modules during this process unless their documentation explicitly supports it. Powering down prevents accidental pin shorts and avoids putting current into an unpowered device through SDA or SCL.
Address Conflicts
Two devices with the same address cannot be selected independently on one I2C bus. A scan may show one address even though two physical modules respond together. That result does not resolve the conflict.

Use one of these supported approaches:
- Change an address strap or register if the device supports it.
- Use an I2C multiplexer, which creates separately selectable bus branches.
- Put one device on a second hardware bus when the controller supports one.
- Choose a module variant with a different address.
Do not expect a library to distinguish two identical fixed-address devices connected to the same lines.
An I2C multiplexer is itself an addressed device. The Arduino tells it which downstream channel to connect, then communicates with a device on that isolated branch. Two identical sensors can use the same fixed address when they sit on different channels because only one branch is connected at a time.
That solution adds hardware and code, so use a configurable address first when available. The key point is that the conflict is electrical and architectural. Renaming two variables in a sketch cannot make two simultaneously connected fixed-address targets answer separately.
Scanner Results versus Library Errors
A library can report “device not found” even when the scanner finds the expected address. The two tests ask different questions. The scanner asks for an ACK. A library may also read an identity register, check a reset value, or configure a supported mode.
When the address appears but initialization fails:
- Confirm the exact chip marking, not only the seller’s product title.
- Confirm that the library supports that chip revision.
- Set the library to the scanner’s 7-bit address.
- Check whether address jumpers also change another hardware mode.
- Run the library’s smallest included example before using the full project.
- Verify byte order, identity-register values, and startup delay in the datasheet.
Do not “fix” the scanner to print the name you expected. The scanner’s value is that it reports the bus response without assuming which product created it.
Safe Changes to the Scanner
You can lengthen the delay between full scans or change the Serial Monitor rate if you update Serial.begin() and the monitor to the same value. You can also print the Wire return code for every address while diagnosing an unusual failure, though the output becomes noisy.
Avoid writing data to unknown devices during discovery. An arbitrary write can change configuration, clear a flag, start a conversion, or alter nonvolatile memory (memory that keeps its contents without power). Address-only probes are deliberately limited.
Once the scanner works, preserve one unchanged copy. Make experiments in a duplicate so you always have a known-good diagnostic to return to.
Scanning at Other Bus Speeds
The Wire library starts at 100kHz on the Uno and on most other boards, which suits breadboard wiring and nearly every device. Many devices also support 400kHz, called fast mode. To scan at that speed, add one line after Wire.begin():
Wire.setClock(400000); // Run the bus at 400kHz instead of the default 100kHz.
Scanning at 400kHz is a useful second test. A device that appears at 100kHz and disappears at 400kHz usually has a bus problem, such as long wires, high bus capacitance, or pull-up resistors that are too large for the faster edges, and not a faulty device. A device that supports only 100kHz can also fail at 400kHz, and some will hold the bus low or stop answering. Return to the default speed before changing anything else, and check each device's datasheet for its maximum clock.
Common I2C Addresses
The table lists addresses that popular parts use by default. Many chips can be moved to other addresses with an address pin or jumper, and a module sold under one name may carry a different chip, so treat the table as a starting point and confirm against the datasheet.
| Address | Common devices | Notes |
|---|---|---|
| 0x1E | HMC5883L magnetometer | |
| 0x20 to 0x27 | PCF8574 and MCP23017 I/O expanders | Set by three address pins |
| 0x23 | BH1750 light sensor | 0x5C when the ADDR pin is high |
| 0x27 | PCF8574 LCD backpack (16x2, 20x4) | Often 0x3F on the PCF8574A version |
| 0x29 | VL53L0X distance sensor, TCS34725 color sensor | |
| 0x38 to 0x3F | PCF8574A I/O expanders | 0x3F is common on LCD backpacks |
| 0x3C and 0x3D | SSD1306 and SH1106 OLED displays | 0x3C is the usual default |
| 0x40 | INA219 current sensor, PCA9685 PWM driver, Si7021 humidity sensor | INA219 can use 0x40 to 0x4F |
| 0x44 and 0x45 | SHT31 temperature and humidity sensor | Chosen by the ADDR pin |
| 0x48 to 0x4B | ADS1115 converter, TMP102 temperature sensor | PCF8591 and LM75 also use 0x48 |
| 0x50 to 0x57 | AT24Cxx EEPROM chips | Many DS3231 modules include an EEPROM at 0x57 |
| 0x53 | ADXL345 accelerometer | 0x1D when the ALT pin is high |
| 0x5A | MLX90614 infrared thermometer, MPR121 touch controller, CCS811 air-quality sensor | |
| 0x68 and 0x69 | DS3231 and DS1307 clocks, MPU6050 motion sensor | 0x69 on the MPU6050 when AD0 is high |
| 0x70 to 0x77 | TCA9548A multiplexer, HT16K33 LED driver | Multiplexer address set by three pins |
| 0x76 and 0x77 | BME280, BMP280, and BMP180 pressure sensors | BMP180 is fixed at 0x77 |
When two devices on one bus both default to the same address, such as an MPU6050 and a DS3231 at 0x68, change the address on one of them with its address pin, or use a multiplexer, as described in the address conflicts section.
Limits of an Address List
Published “common I2C address” tables are useful hints, not identification databases. Address 0x68 is used by several clocks and motion sensors. Address 0x48 appears on temperature sensors, converters, and other parts. The scanner sees an ACK, not a product label.
Identify the device from its markings and schematic, then check a documented identity register or perform a safe, device-specific read.
Keep the Scanner as a Known-Good Tool
Save this sketch unchanged after it works. When a new project fails, temporarily replace the project code with the scanner. If the address appears, basic wiring and bus acknowledgment work, and you can investigate the library, register map, or configuration. If it does not appear, stay with the electrical and address checks.
That separation saves time. It prevents a large application, several libraries, and a wiring fault from being debugged at once.
Wrapping Up
An Arduino I2C scanner probes the normal 7-bit address range and reports the peripherals that acknowledge. It tells you where a device responds, not exactly what the device is or whether all of its functions work. On an Uno R3, start with SDA on A4, SCL on A5, a shared ground, compatible voltage levels, and suitable pull-ups. When a scan is empty, simplify to one device and check pins, power, pull-ups, address straps, and wire length in that order. When two devices share an address, change the hardware arrangement rather than trying to solve the conflict with a different number in code.
Keep the scanner sketch saved. When a project reports “device not found,” it shows whether the cause is electrical or in the software.
Hack The World and Make Awesome.
