DEV Community

張旭豐
張旭豐

Posted on

Why Your I2C Scanner Finds Nothing (And How to Fix It)

Why Your I2C Scanner Finds Nothing (And How to Fix It)

You connect your I2C sensor. You upload the I2C scanner sketch. You open the serial monitor. It says "No I2C devices found." You check the wiring. You check the address in the datasheet. You try a different sensor. You try a different Arduino. Nothing works.

I2C bus wiring on breadboard showing SDA SCL connections with pull-up resistors to microcontroller
I2C bus on breadboard — the pull-up resistors (4.7kΩ or 10kΩ) are essential. Without them, SDA and SCL stay at 0V and nothing communicates.

You have a hardware problem. I2C is a bus, and the bus requires specific termination to function correctly.


The Two Pull-Up Resistors You Probably Forgot

I2C uses open-drain drivers. This means the master and all slave devices only pull the bus low. Nobody drives it high. The bus lines (SDA and SCL) need to be pulled high by resistors. Without these resistors, the bus is always low, and nothing can communicate.

The default value is 4.7kΩ to 10kΩ. Most I2C sensor breakout boards include these resistors on the board. Some do not. If you are wiring a raw sensor directly to your microcontroller without a breakout board, you must add the pull-ups yourself.

The symptoms of missing pull-ups: the I2C scanner finds nothing. A logic analyzer shows SDA and SCL both stuck at 0V. The Arduino Wire library returns errors or hangs.


The Pull-Up Resistor Value Matters

The pull-up resistor value is a tradeoff between speed and bus capacitance.

Lower resistance: the bus transitions faster (good for high speed), but draws more current when low (bad if many devices on bus).

Higher resistance: lower current consumption, but slower transitions (limited speed), and the bus is more susceptible to noise.

The I2C specification defines the maximum rise time for each speed mode:

  • Standard mode (100kHz): rise time < 1000ns
  • Fast mode (400kHz): rise time < 300ns

Rise time is determined by R × C, where C is the total bus capacitance (all device pin capacitances plus wiring capacitance). Longer wires and more devices mean higher C. Higher C means you need lower R to meet the rise time requirement.

If you are running at 400kHz with 30cm of wire and 5 devices, 10kΩ pull-ups might give you a 500ns rise time, which passes the 300ns Fast mode requirement. If you add more devices or use longer wire, C increases and the rise time exceeds spec. The bus still "works" but is unreliable.

Rule of thumb for short busses with few devices: 4.7kΩ for 400kHz, 10kΩ for 100kHz. For longer runs or many devices, 2.2kΩ or 1kΩ.


The Address Is Probably Wrong

Before you blame the hardware, verify the address. I2C addresses are 7 bits, often expressed as an 8-bit value with the read/write bit included.

The most common mistake: the datasheet gives the address as 0x3C, but the Arduino Wire library uses 7-bit addressing. You might see examples using 0x78 (0x3C << 1). These are the same address.

Common sensor addresses:

  • OLED 128x64: 0x3C or 0x3D
  • BME280: 0x76 or 0x77
  • MPU6050: 0x68 or 0x69
  • ADS1115: 0x48 to 0x4B
  • SSD1306: 0x3C

Some sensors have address pins (AD0) that let you select between two addresses. If your scanner finds two addresses for the same sensor model, that is why. One sensor, two possible addresses.


Ground, VCC, SDA, SCL. In That Order.

I2C devices are sensitive to the order of connections during hot-plugging. Always connect power first. If you connect SDA or SCL while the device is unpowered, the voltage on those lines can backfeed through the device's ESD protection diodes and power the chip partially. This can cause the device to be in a partially-on state that corrupts the I2C bus.

Always connect: GND first, then VCC, then SDA, then SCL.

Disconnect in reverse order: SCL first, then SDA, then VCC, then GND.

This matters more for sensitive sensors like the BMP280/BME280 and for any sensor on a long wire run.


Wire Length and Level Shifting

I2C was designed for on-board communication, not long cable runs. The maximum cable length depends on the pull-up value, the bus speed, and the device input capacitance.

For cable runs longer than 1 meter:

  • Reduce the bus speed to 100kHz or below
  • Use 2.2kΩ or 1kΩ pull-ups
  • Use twisted-pair cable (like Cat5 Ethernet cable, using one pair for SDA/SCL and the other pair for GND/VCC)
  • Consider an I2C bus extender (like the P82B715) which allows runs up to 50 meters

For 5V to 3.3V I2C communication (connecting a 3.3V sensor to a 5V Arduino):

  • You cannot connect a 3.3V I2C device directly to a 5V Arduino's I2C bus
  • The Arduino's high output is 5V, which damages the 3.3V sensor
  • Use a logic level converter (bi-directional, like the BSS138-based 4-channel converter)
  • Or use a voltage divider on SDA/SCL (but only for one direction, which breaks I2C)
  • Or use a 3.3V Arduino (like the Arduino Due or a 3.3V clone) to match the sensor voltage

The Complete Diagnostic Checklist

When your I2C scanner finds nothing:

  1. Scan all addresses 1-127. Do not assume the datasheet address is correct — sometimes modules have different addresses than expected.
  2. Check pull-up resistors. If your logic analyzer shows flat lines at 0V on SDA and SCL, there are no pull-ups. Add 4.7kΩ from SDA to 3.3V/5V and SCL to 3.3V/5V.
  3. Check voltage. Is the sensor actually powered? Is the voltage correct (3.3V sensor on 5V supply will behave erratically)?
  4. Check connections. SDA to SDA (A4 on Uno), SCL to SCL (A5 on Uno). Not reversed.
  5. Try a different wire. Male-to-male jumper wires on a breadboard sometimes have poor contacts.
  6. Try at 100kHz. If it works at 100kHz but not 400kHz, the pull-ups or wire length is the issue.
  7. Power cycle everything. I2C bus can get stuck in a busy state after a communication error. Disconnect VCC from the bus (not just the Arduino reset) to clear it.

When Software Is Actually the Problem

If the hardware is correct and the scanner still fails, the issue is usually in the Wire library initialization or the clock stretching:

The Arduino Wire library has a timeout. If a slave device holds SCL low (clock stretching), the library waits for a default timeout. If the timeout is too short, it returns an error before the device finishes. You can increase the timeout with Wire.setClock(100000L) or by modifying the Wire library timeout.

Some devices require a specific initialization sequence before they respond on I2C. The BME280 needs a soft-reset command followed by a wait before the I2C address responds. The MPU6050 needs to be initialized with register settings. Check the datasheet for the specific startup sequence.


The I2C bus is robust when terminated correctly. The "No devices found" error is almost always a hardware issue: missing pull-ups, wrong voltage, or bad connections. Fix the hardware first.

For reliable I2C projects:

Logic Level Converter Bi-Directional 4-Channel — Essential for connecting 3.3V I2C sensors to 5V Arduino. Use this, not voltage dividers. (Amazon)

I2C Pull-Up Resistor Kit — 4.7kΩ, 10kΩ, 2.2kΩ assortment. For building or debugging I2C busses. (Amazon)

BME280 Breakout Board — Includes pull-up resistors, voltage regulator, and works from 3.3V or 5V. Reliable I2C sensor for temperature, humidity, and pressure. (Amazon)

I earn from qualifying purchases.


Article #015, 2026-04-18. Content Farm pipeline, Run #015.

Top comments (0)