Bus fault

I2C address not found? Scan the bus first

An I2C scanner turns a vague failure into a concrete fact: either a device answers on the bus or it does not.

22 November 20267 min read
A simple Arduino LED and resistor circuit on a breadboard used to demonstrate systematic fault finding
Start with the smallest circuit that still shows the problem, then add parts back one at a time.

Build it for real

To build this project for real, get the parts from hobidevre.com → hobidevre.com →

More build guides: hobidevre.com/blog

Run an I2C scanner

Load a small scanner sketch that tries every address and prints the ones that answer. This separates a wiring fault from a library fault in one step. If nothing is found, the problem is physical.

If the device does answer, write down the address it reports and use that exact value in your project, instead of the one in a tutorial.

Check SDA and SCL wiring

I2C uses two lines: SDA for data and SCL for the clock. Swapping them makes the bus silent. Check the pin labels on your board, because they are not in the same place on every model.

Also confirm the wires are in the correct breadboard rows and that a jumper has not come loose. A device that answers only when you press it has a bad contact.

Confirm pull-up resistors

Both bus lines need a pull-up resistor to the logic supply, typically 4.7 kΩ. Many modules include them, but a bare sensor or a long cable may not.

Without pull-ups, the lines float and the scanner finds nothing. Adding two external resistors often brings a dead bus to life immediately.

Power and common ground

Check the module supply voltage: 3.3 V devices must not be driven at 5 V without level shifting. Measure at the module, not at the board.

Connect the module ground to the board ground. This is required for the bus to work at all and is easily missed when using a separate supply.

Resolve address conflicts

Two devices with the same address cannot coexist on one bus. The scanner will show only one of them, or readings will be inconsistent. Check whether your modules have an address-select jumper.

Common modules ship with more than one factory address; a 1602 LCD, for example, is often at 0x27 or 0x3F, and RTC or barometer modules have their own fixed addresses.

Use the address the hardware reports

A library constructor usually takes an address. Passing the address from an example instead of the one your scanner found is a frequent cause of a device that is clearly powered but never responds.

If the display shows solid blocks or the sensor returns zeros, the library is talking to an address where nothing lives. Re-scan and correct the value.

Recover a stuck bus

If a device holds SDA low, the whole bus stalls and even the scanner hangs. Power-cycle the setup, then check whether one module is faulty by disconnecting devices one at a time.

Add short timeouts around bus operations so a stuck device cannot freeze your entire sketch.

Get the parts

If you want to build this project in real life, you can get the parts from hobidevre.com.

Frequently asked questions

What if the scanner finds nothing?

Check SDA and SCL, common ground, supply voltage and pull-up resistors. A silent bus is almost always one of those four.

Can two devices share one address?

Not on the same bus. Use a module with an address-select pin, a different bus, or an I2C multiplexer.

Why does my LCD show only blocks?

The address in the library does not match the module. Scan the bus and pass the reported address to the constructor.

Related reading

Practise in the browser

Open the same layout in the simulator and follow the steps. Sign in to save your work.