Checking I2C addresses on Arduino


One of the biggest problems I found when working with I2C devices on the Arduino was being sure that the device was working and/or connected correctly.

A very useful sketch is available on github

That scans the I2C bus and shows the address of any connected device. The screen shot above shows a device at HEX address 23 has been found. The sketch as downloaded shows addresses in decimal, but it is an easy task to change three occurrences of DEC to HEX.

Two things to be aware of, the baud rate is set at 19200 so you need to set this on the Serial Monitor and if two or more devices on the bus share the same address they will show as one device.

Many thanks to the original author for publishing this sketch.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: