SIGN IN YOUR ACCOUNT TO HAVE ACCESS TO DIFFERENT FEATURES

FORGOT YOUR PASSWORD?

FORGOT YOUR DETAILS?

AAH, WAIT, I REMEMBER NOW!
  • LOGIN

  • HOME
  • SHOP
    • Furniture Hardware Solutions
    • Team Group
    • Alati I Oprema
    • Produtos De Segurança Para Instalações
    • Cura E Igiene Animali
    • Motherboards
    • Peças E Acessórios Para Equipamentos Audiovisuais
    • Pens
    • Top Proizvodi
    • Mali Dečiji Bazeni
    • Lighting
    • Router Bit Sets
    • Aromatherapy
    • Bench-Top Machinery
    • Oli Essenziali
    • Aparelhos De Ar Condicionado
    • Post Lights & Accessories
    • Cpu
    • Baterias E Fontes De Alimentação
    • Semi-Flush Mounts
    • Marvel Fan Art
  • LEARN TEENSY
  • TECH
    • Guide To Solderless Breadboards
    • Determining Unknown I2C Addresses
    • Determining LED Resistor Values
    • DC-DC Step-Down Converter Overview
    • s
  • BLOG
  • INFO
    • About Us
    • FAQ
    • International Customers
    • My Account
    • Contact Us
  • MY CART
    No products in cart.

Home » Determining Unknown I2C Addresses

June 26, 2026

Determining Unknown I2C Addresses

Determining Unknown I2C Addresses

LCD2004 With I2C Interface

The I²C interface (usually written as I2C or IIC) is a communication interface that is widely used in electronics.

It is popular as it only requires a couple of lines, has fairly fast communication speeds and allows for multiple devices to sit on the same bus, each with their own unique I2C address.

One of the common things to run into when trying to work with devices that have an I2C interface, is to hook everything up, download the applicable program and have absolutely nothing happen.

If there are no wiring or obvious programming errors, this frequently ends up being a mismatch between what you think the I2C address of the device should be and what it actually is.

Since these addresses can often be set when the product is made, the same basic device may get manufactured with different addresses from one build to another or when they are built by different mfrs.

You can take the tact of trying every possible I2C address, recompiling and downloading the code each time to see if it clears the problem, but that is error prone, time intensive and pretty low on the fun-o-meter of things to be doing.

A MUCH better method is to download a bit of code and have your Arduino tell you what I2C devices it finds attached to it.  Nick Gammon has written a nice little utility that does exactly that.  It scans through every possible I2C address to see if it gets a response on that address and then reports its findings.

You can find it buried on his website at http://gammon.com.au about half way down the page.  It is also provided down below to make it easier to find.  If you want to know more about I2C in general, I highly recommend reading the article in the link.

Just copy and paste the code into the Arduino IDE.  When it runs, it will report the address of every I2C device that it finds.  The output on the Serial Monitor will look similar to the following:

I2C scanner. Scanning …
Found address: 39 (0x27)
Done.
Found 1 device(s).

In this case, it found one I2C address at decimal 39 / hex 0x27.  This happens to be the LCD display in the picture.

I2C Address Scanner Program

// I2C Scanner
// Written by Nick Gammon
// Date: 20th April 2011
// This scanner looks for any attached I2C addresses. 
// Useful for determining address of unknow devices.

#include <Wire.h>

void setup() {
  Serial.begin (9600);

  // Leonardo: wait for serial port to connect
  while (!Serial) 
    {
    }

  Serial.println ();
  Serial.println ("I2C scanner. Scanning ...");
  byte count = 0;
  
  Wire.begin();
  for (byte i = 8; i < 120; i++)
  {
    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)
      {
      Serial.print ("Found address: ");
      Serial.print (i, DEC);
      Serial.print (" (0x");
      Serial.print (i, HEX);
      Serial.println (")");
      count++;
      delay (1);  // maybe unneeded?
      } // end of good response
  } // end of for loop
  Serial.println ("Done.");
  Serial.print ("Found ");
  Serial.print (count, DEC);
  Serial.println (" device(s).");
}  // end of setup

void loop() {}

PRODUCT SEARCH

PRODUCT CATEGORIES

  • Contadores De Energia
  • Flush Mounts
  • Bundles
  • Glues And Coatings
  • Redes
  • Dispositivos De Segurança
  • Rpg
  • Creme
  • Irwin
  • Sistema De Som Para Casa
  • Fiori Di Bach
  • Outdoor Pendants / Chandeliers
  • Full Cane Batting Pads
  • Equipamentos E Materiais Elétricos
  • Island Lights
  • Sensores E Alarmes Domésticos
  • Pendants
  • Energia Fotovoltaica
  • Wall Sconces
  • Tabletop Terrain
  • Moment Ključevi I Račne

Pay Additional Charges

CUTLERY DRAWER ORGANIZER Cutly ADJUSTABLE

Recent Blog Entries

  • Explore the Mini Platform for Teensy 4.1: New Memory Options

    destradigelagarina.it introduced the Mini Platform ...
  • 16MB PSRAM Chips For Teensy 4.1 Now Available

    Teensy 4.1 has locations for 2 memory chips to ...

Fine Print

  • Terms of Service
  • Shipping & Returns

GET IN TOUCH

Email: [email protected]

destradigelagarina.it / ReefCorner Inc
Veteran Owned and Operated
Lake Stevens WA 98258, USA

  • Terms of Service
  • Shipping & Returns

© 2026 All rights reserved.

TOP