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
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.
#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.
Current measurement
Sensor Measured I2C address Alternative address Buy INA219 Direct current measurement up to 26V@3.2A 0x40 0x41
0x44
0x45Projects and articles
Detection of pollutants. C0, CO2
eTVOC, Total Volatile Organic (or eCOV) equivalent up to 32768ppb Bus speed: 100kHz, 400kHzSensor Measured I2C address Alternative address Buy CCS811 eCO2, CO2 equivalent of 400ppm ~ 29206ppm 0x5A 0x5B 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 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.
0.1 µA (standby)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 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
Equipment Application I2C address Alternative address Buy LCD2004 4-line LCD display screen 0x27 SSD1306 Black and white OLED screens, 64×64 or 128×68 pixels 0x3C 128×64 pixels Projects and articles
Additional digital I / O expansion boards, RTC clock
Bus speed: 100kHz, 400kHz, 1.7MHz Bus speed: 100kHz, 400kHz, 1MHz Technical documentationEquipment Application I2C address Alternative address Buy ADS1115 4 additional 16-bit A / D inputs 0x48 0x4B DS1307 Real-time clock with optional battery backup 0x68 MCP23017 16 additional digital inputs / outputs, DIP28 box 0x20 0x27 PCF8574 8 additional digital inputs / outputs 0x38 0x3F PCA9685 16 12-bit PWM channels 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
- Unpacking Wemos ESP32 LoLin clone with 0.96” SSD1306 monochrome OLED display
- OLED display SSD1306 in MicroPython, example with a I2C digital barometer BME280 (or BMP180)
- Portable WiFi Scanner with OLED Display (ESP8266): signal strength, connection test to a server
- Domoticz: Lua script to create a remote OLED display with ESP Easy
- Connect an I2C SSD1306 OLED display and an ESP-01 (ESP8266)
- Jeedom, create an OLED SSD1306 remote display with ESP Easy and HTTP request
- ESP Easy: How to add OLED SSD1306 display to an IoT ESP8266 project
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
- 4 solutions to add I/O (ADS1115, MCP23017, PCF8574, PCA9685). Arduino, ESP8266, ESP32, ESP8266, Raspberry Pi Projects
- I2C addresses of the most common sensors and actuators
- Get started with the I2C bus on Arduino ESP8266 ESP32. Wire.h library
- Unpacking Wemos ESP32 LoLin clone with 0.96” SSD1306 monochrome OLED display
- Unpacking the Geekcreit PCA9685 I2C Shield 16 Servos + 2 DC motors for Arduino or ESPDuino (ESP8266)