DIY Projects

I2C addresses of the most common sensors and actuators

Most common I2C breakout addresses for Arduino ESP32 ESP8266 RaspberryPi project. BME280 AMG8833 SSD1306 MCP23017 BME680 SHT30 SI7021 PCA9685

To facilitate the development of your connected objects based on Arduino, ESP32, ESP8266, STM32 or Raspberry Pi micro-controllers, here is a list of the most common I2C (breakout) modules. Ambient sensors (temperature, relative humidity, atmospheric pressure, light intensity, etc.), detection of pollutants (CO, CO2, eTVOC, etc.), AMG8833 thermal camera, LDC2004 or SSD1306 screens and I/O expansion boards digital or analog.

 

Each manufacturer has provided a method to activate the alternative I2C address. Generally, it will be necessary to make a small solder on the module (breakout) or to apply a voltage (3V3 or 5V for example). On the other hand, it is very rarely possible to modify the address by programming.

Here are two examples that we meet quite often

BME280 BH1750FVI
To assign the i2c address 0x77, you have to solder a jumper between the two right pins and cut the track between the two left pins To assign the address 0x5C, a voltage greater than 0.7V must be applied to the ADDR pin

To learn more about the I2C bus, you can continue by reading this article

Arduino, ESP32 or ESP8266 I2C scanner

If you can’t find your component’s I2C address or are having communication issues, here is the source code for an Arduino, ESP32, and ESP8266 compatible I2C scanner.

Note, the Wire.h library for ESP8266 and ESP32 allows you to specify the SDA (and SCL) pins of the I2C bus. Pass the USER_PIN constant to true for this The default I2C pins for major development boards are listed in this table.

#include <Arduino.h>
#include <Wire.h>

#define DISPLAY_ERROR false 
#define LOOP_DELAY    10000
#define USER_PIN      false

// Personnaliser les broches du bus I2C pour ESP8266 ou ESP32 
// Customize I2C bus pins for ESP8266 or ESP32
const int PIN_SCL = D1;
const int PIN_SDA = D2;

String I2Ctest() {
  byte error, address;
  int nDevices;
  String s;
 
  s="Scanning...\n";
 
  nDevices = 0;
  for(address = 1; address < 127; address++ ) {  
    Wire.beginTransmission(address);
    error = Wire.endTransmission();
 
    if (error == 0) {
      s+="I2C device found at 0x";
      if (address<16)
        s+="0";
        s+=String(address,HEX);
        s+="\n";
 
      nDevices++;
    } else if ( error > 0 ) {
      if ( DISPLAY_ERROR ) {
        s+="Unknow error at 0x";
        if (address<16)
          s+="0";
          s+=String(address,HEX);
          s+="\n";
      }  
    }    
  }
  if (nDevices == 0)
    s+="No I2C devices found\n";
  else
    s+="done\n";
  return s; 
}

void setup() {
  Serial.begin(115200);
  Serial.println("I2C scanner");
  #if USER_PIN
    Wire.begin(PIN_SDA, PIN_SCL);
  #else
    Wire.begin();
  #endif
}

void loop() {
  // put your main code here, to run repeatedly:
  Serial.println(I2Ctest());
  delay(LOOP_DELAY);
}

Default pins of the I2C bus of the most common development boards

Here is the list of the default pins of the most common development boards.

It is possible to manually specify the I2C pins only for ESP32 and ESP8266.

SDA SCL SDA1 SCL1
Main bus Secondary bus
Arduino Uno * A4 A5
Arduino Ethernet A4 A5
Arduino Mega2560 20 21
Arduino Leonardo 2 3
Arduino Due 20 21 SDA1 SCL1
ESP8266 D1 D2
ESP32 DevkitC v4 21 22 User User
ESP32 (older generations) IO21 IO22 User User
STM32 PB7 or PB9 PB6 or PB8 PB11 PB10
Raspberry Pi (any generation) 3 5    

(*) Do not use the pins marked SDA and SCL on the Arduino Uno.

Before you can use I2C components using the Raspberry Pi’s GPIO, you must first activate the bus. Follow the detailed instructions in this tutorial

I2C environmental sensors

Sensors for measuring temperature, humidity, atmospheric pressure, brightness.

Sensor Measured I2C address Alternative address Buy
BH1750

Light intensity 0 ~ 65535 lux

16 bit converter

Technical documentation

0x23 0x5C

If voltage on ADDR> 0.7 VDC

$6.50
as of 23 October 2021 3 h 07 min
Amazon.com
Projects and articles on the BH1750FVI

BMP180

Air pressure 300 ~ 1100hPa

Technical documentation

0x77
$2.48
Ebay
BMP280

Temperature from -40 ~ +85 ° C

Air pressure of 300 ~ 1100 hPa

Technical documentation

0x76 0x77
$2.48
Ebay
BME280

Temperature from -40 ~ +85 ° C

Humidity 0 ~ 100%

Air pressure from 300 ~ 1100 hPa

Technical documentation

0x76 0x77
$19.99
2 new from $19.99
as of 23 October 2021 3 h 07 min
Amazon.com
$29.99
as of 23 October 2021 3 h 07 min
Amazon.com
BME680

Temperature of -40 ~ +85 ° C

Humidity 0 ~ 100%

Air pressure of 300 ~ 1100 hPa

Technical documentation

0x76 0x77
$22.95
2 new from $22.95
as of 23 October 2021 3 h 07 min
Amazon.com
$28.19
3 new from $23.99
as of 23 October 2021 3 h 07 min
Amazon.com
Projects and articles produced using a BMP180, BME280 or BME680 sensor

DHT12

Temperature from -20°C ~ +60°C (±0,5°C)

Humidity from 20 to 95% (±5°C)

0xB8
$2.65
MLX90614

No contact temperature from -40 ~ +125°C 0x5A 0x01

to

0x7F

$11.88
as of 23 October 2021 3 h 08 min
Amazon.com
MS5611

Temperature from -40°C ~ +85°C

Atmospheric Pressure from 10 ~ 1200 mbar

0x76
SHT30

Temperature de -40°C ~ +125°C

Technical datasheet

0x44 0x45 Breakout
$3.59
$11.90
as of 23 October 2021 3 h 07 min
Amazon.com

More breakout, LoLin Shields

Projects and tutorials

SI7021

Température de -10 ~ 85°C

Humidité de 0 ~ 80%

Technical datasheet

0x40
$10.49
3 new from $6.95
as of 23 October 2021 3 h 06 min
Amazon.com
TSL2561

Light Intensity from 188 μLux ~ 88000 lux

Documentation technique

0x29 0x39 0x49
$8.69
5 new from $8.69
as of 23 October 2021 3 h 08 min
Amazon.com
TCS34725

RGB color sensor

Technical datasheet

0x29

Current measurement

Sensor Measured I2C address Alternative address Buy
INA219

Direct current measurement up to 26V@3.2A

Technical documentation

0x40 0x41
0x44
0x45
$6.29
as of 23 October 2021 3 h 08 min
Amazon.com
$8.99
as of 23 October 2021 3 h 08 min
Amazon.com
$17.39
2 new from $17.39
as of 23 October 2021 3 h 08 min
Amazon.com
Projects and articles

    Detection of pollutants. C0, CO2

    Sensor Measured I2C address Alternative address Buy
    CCS811

    eCO2, CO2 equivalent of 400ppm ~ 29206ppm

    eTVOC, Total Volatile Organic (or eCOV) equivalent up to 32768ppb

    Bus speed: 100kHz, 400kHz

    Technical documentation

    0x5A 0x5B
    $10.25
    as of 25 October 2021 3 h 07 min
    Amazon.com
    $10.66
    as of 25 October 2021 3 h 07 min
    Amazon.com
    $22.95
    as of 25 October 2021 3 h 07 min
    Amazon.com
    Projects and articles

      I2C thermal camera

      Sensor Measured I2C address Alternative address Buy
      AMG8833 / AMG8831

      Thermal image 8×8 pixels (64 pixels) from -20°C to +80°C 0x69 0x68
      $49.99
      $57.89
      3 new from $49.99
      as of 17 October 2021 3 h 12 min
      Amazon.com
      $76.86
      as of 17 October 2021 3 h 12 min
      Amazon.com
      Projects and articles

      Accelerometer, gyroscope, magnetometer

      To remotely control a robotic arm, a drone, a game …

      Comparative table of the most common breakouts, MPU6050, MPU9250 and ADXL345.

      MPU6050 ADXL345 MPU9250
      Gyroscope (axes) 3 3 3
      Gyroscope measurement game ± 250, ± 500, ± 1000, ± 2000 ° / sec
      Accelerometer (axes) 3 3 3
      Accelerometer measuring range ± 2g / ± 4g / ± 8g / ± 16g ± 2g / ± 4g / ± 8g / ± 16g ± 2g / ± 4g / ± 8g / ± 16g
      Magnetometer (axes) 3
      Magnetometer measuring capacity ± 4800µT
      Total degrees of freedom (DOF) 6 6 9
      I2C addresses 0x68 0x69 0x1C 0x68 0x0C
      Max speed of the I2C bus 400 kHz 400 kHz 400 kHz
      SPI
      Supply voltage 2.375V ~ 3.46V 2.0V ~ 3.6V 2.4V ~ 3.6V
      Consumption 23 µA

      0.1 µA (standby)

      3.5mA
      Operation -40°C ~ 85°C -40°C ~ 85°C -40°C ~ 85°C
      Technical documentation Read Read Read

      OLED and LCD screens on I2C bus

      Additional digital I / O expansion boards, RTC clock

      Equipment Application I2C address Alternative address Buy
      ADS1115

      4 additional 16-bit A / D inputs

      Technical documentation

      0x48 0x4B
      DS1307

      Real-time clock with optional battery backup 0x68  
      MCP23017

      16 additional digital inputs / outputs, DIP28 box

      Bus speed: 100kHz, 400kHz, 1.7MHz

      Technical documentation

      0x20 0x27
      $1.74
      FastTech
      $4.99
      4 new from $4.99
      as of 25 October 2021 3 h 08 min
      Amazon.com
      PCF8574

      8 additional digital inputs / outputs

      Bus speed: 100kHz, 400kHz, 1MHz

      Technical documentation

      0x38 0x3F
      $5.84
      TOMTOP Technology Co., Ltd
      $5.99
      as of 25 October 2021 3 h 07 min
      Amazon.com
      PCA9685

      16 12-bit PWM channels

      Technical documentation

      0x40 0x7F

      Equipment classification by I2C address

      0x10

      VEML6075 UV sensor. 0x10 only

      VEML7700 Ambient light sensor. 0x10 only

      0x11

      Si4713 FM transmitter with RDS. 0x11 or 0x63

      0x13

      VCNL40x0 Proximity sensor. 0x13 only

      0x18

      MCP9808 Temperature sensor. From 0x18 to 0x1F

      LIS3DH 3-axis accelerometer. 0x18 or 0x19

      0x19

      LSM303 Accelerometer. 0x1E for the magnetometer

      0x1C

      LSM303 Magnetometer. 0x19 for the accelerometer

      MMA845x 3-axis accelerometer. 0x1C or 0x1D. Obsolete

      FXOS8700 Accelerometer + magnetometer. 0x1C, 0x1D, 0x1E or 0x1F. Obsolete

      MMA7455L Accelerometer. 0x1C or 0x1D

      0x1D

      LSM9DS0 IMU 9 axes (0x1D or 0x1E for Accel / Mag, 0x6A or 0x6B for Gyro)

      ADXL345 3-axis accelerometer. 0x1D or 0x53

      0x1E

      HMC5883 Magnetometer. 0x1E only

      LIS2MDL Magnetometer. 0x1E only.

      0x20

      FXAS21002 Gyroscope. 0x20 or 0x21

      MCP23008 GPIO expansion module. 0x20 or 0x27

      MCP23017 GPIO expansion module. 16 additional digital inputs / outputs. 0x20 or 0x27

      0x23

      BH1750 Light intensity 0 ~ 65535 lux, 16 bit converter. 0x23 or 0x5C

      0x26

      MSA301 3-axis accelerometer. 0x26 only. Obsolete

      0x27

      LCD2004 Driver for 4-line LCD display screen. 0x27 only

      0x28

      BNO055 IMU. 0x28 or 0x29

      CAP1188 8-channel capacitive touch sensor. From 0x28 to 0x2D

      DS3502 10K digital potentiometer. From 0x28 to 0x2B. Obsolete

      PCT2075 Temperature sensor. Several ranges available: 0x28-0x2E, 0x48-0x4F, 0x70-0x77

      0x29

      TCS34725 Color sensor. 0x29 only

      TSL2561 Light sensor. 0x29, 0x39 or 0x49

      TSL2591 Light sensor. 0x29 or 0x28

      VL53L0x Distance measurement by ToF laser. 0x29, configurable from code

      VL6180X ToF sensor. 0x29 only

      0x33

      MLX90640 8×8 pixel infrared thermal camera. 0x33 only

      0x38

      VEML6070 UV index. 0x38 or 0x39

      FT6x06 Capacitive touch sensor. 0x38 only. Obsolete

      PCF8574 8 additional digital inputs / outputs. 0x38 or 0x3F

      0x39

      APDS-9960 IR / Color / Proximity sensor. 0x39 only

      0x3C

      SSD1305 I2C Monochrome OLED display. 0x3C or 0x3D using a solder jumper on some boards

      SSD1306 I2C Monochrome OLED display. 0x3C or 0x3D using a solder jumper on some boards

      0x40

      Si7021 Humidity / temperature sensor. 0x40 only

      HTU21D-F Humidity / temperature sensor. 0x40 only. Obsolete

      HDC1008 Humidity / temperature sensor. 0x40, 0x41, 0x42 or 0x43. Obsolete

      TMP007 IR temperature sensor. From 0x40 to 0x47. Obsolete

      TMP006 IR temperature sensor. From 0x40 to 0x47. Obsolete

      PCA9685 16-channel PWM expansion board. From 0x40 to 0x7F

      INA219 DC current / voltage sensor. From 0x40 to 0x7F

      INA260 Precision DC current / power sensor. From 0x40 to 0x7F. Obsolete

      0x41

      STMPE610 / STMPE811 Resistive touch sensor. 0x41 or 0x44. Obsolete

      0x44

      SHT30 Humidity / temperature sensor. 0x44 or 0x45

      ISL29125 RBG color sensor. 0x44 only

      0x48

      ADS1115 4-channel 16-bit ADC expansion board. 0x48 0x49 0x4A or 0x4B

      PN532 NFC / RFID reader. 0x48 only

      0x50

      MB85RC FRAM memory module. From 0x50 to 0x57

      0x52

      Nintendo Nunchuck Controller . 0x52

      0x57

      MAX3010 Pulse and oximetry sensor

      0x58

      TPA2016 I2C Audio Amplifier

      SGP30 Air Quality Measurement (IAQ)

      0x5A

      MPR121 12 point capacitive touch sensor. 0x5A, 0x5B, 0x5C or 0x5D

      CCS811 VOC sensor. 0x5A or 0x5B

      MLX9061x Non-contact IR temperature sensor from -40 ° C to + 125 ° C. 0x5A only

      DRV2605 Driver for Haptic motor. 0x5A only. Obsolete

      0x5C

      AM2315 Humidity and temperature sensor. 0x5C only

      AM2320 Humidity and temperature sensor. 0x5C only

      LPS25 Digital barometer. 0x5C or 0x5D.

      LPS33HW Digital barometer. 0x5C or 0x5D.

      LPS35HW Digital barometer. 0x5C or 0x5D.

      0x5E

      TLV493D 3 axis magnetometer . 0x5E

      0x60

      MCP4728 12-bit analog to digital converter, 4 inputs. 0x60 only

      MPL115A2 Digital barometer. 0x60

      MPL3115A2 Digital barometer. 0x60 only

      Si5351A Clock generator. 0x60 or 0x61

      Si1145 Light / infrared sensor. 0x60 only

      MCP4725A0 12 bit DAC. 0x60 or 0x61

      TEA5767 Stereo radio receiver. 0x60 only

      VCNL4040 Proximity and ambient light sensor. 0x60 only

      0x62

      MCP4725A1 12-bit DAC. 0x62 or 0x63

      0x68

      AMG8833 Thermal IR Breakout Camera (0x68 or 0x69)

      DS1307 RTC clock

      DS3231 RTC clock

      ICM-20649 Accelerometer + Gyroscope. 0x68 or 0x69

      ITG3200 Gyroscope. 0x68 or 0x69

      MPU-9250 9-DoF IMU. 0x68 or 0x69

      MPU-60X0 Accelerometer + Gyroscope. 0x68 or 0x69

      PCF8523 RTC clock. 0x68 only

      0x6A

      ICM330DHC 6 axis IMU. 0x6A or 0x6B

      L3GD20H Gyroscope. 0x6A or 0x6B

      LSM6DS33 6 axis IMU. 0x6A or 0x6B

      LSM6DSOX 6 axis IMU. 0x6A or 0x6B

      0x70

      HT16K33 LED Matrix Driver. From 0x70 to 0x77

      TCA9548 Extension board with 8 additional digital outputs. From 0x70 to 0x77

      0x76

      BMP280 Temperature, atmospheric pressure. 0x76 or 0x77

      BME280 Temperature, humidity, atmospheric pressure. 0x76 or 0x77

      BME680 Temperature, humidity, atmospheric pressure, air quality (IAQ). 0x76 or 0x77

      MS5607 / MS5611 Digital barometer. 0x76 or 0x77

      0x77

      BMA180 Accelerometer. 0x77 only

      BMP085 Temperature, barometer. 0x77 only. Obsolete

      Updates

      10/6/2020 First publication 

      Click to rate this post!
      [Total: 0 Average: 0]
      Exit mobile version