I2C Tools (Pull-up Resistor, Addresses, Decoder)
I2C pull-up resistor min/max from VDD, bus capacitance and 100k/400k/1M mode, 7-bit addresses of common chips, 8-bit address conversion and a byte decoder.
Pull-up formulas (UM10204 §7.1)
- Rp(min) = (VDD − VOL(max)) ÷ IOL — so a device pulling LOW never has to sink more than IOL
- Rp(max) = tr ÷ (0.8473 × Cb) — so the rise from 0.3·VDD to 0.7·VDD stays within tr (ln(0.7/0.3) = 0.8473)
- VDD > 2 V: VOL = 0.4 V, IOL = 3 mA (Sm, Fm), 20 mA (Fm+). VDD ≤ 2 V: VOL = 0.2·VDD, IOL = 2 mA
- tr = 1000 ns (Sm), 300 ns (Fm), 120 ns (Fm+); Cb max = 400 pF (Sm, Fm), 550 pF (Fm+)
- If the maximum is below the minimum, no resistor works for that capacitance and speed — slow down, shorten the wiring, or use a bus buffer or current-source pull-up.
- Pull-ups on several modules add in parallel (three 4.7 kΩ → about 1.6 kΩ). Use the parallel value.
- Cb is hard to measure. You can also measure the rise time on a scope and work back from rise ≈ 0.8473 × Rp × Cb.
| Mode | Max rate | tr | IOL (VOL 0.4 V) | Cb max |
|---|---|---|---|---|
| Standard-mode | 100 kHz | 1000 ns | 3 mA | 400 pF |
| Fast-mode | 400 kHz | 300 ns | 3 mA | 400 pF |
| Fast-mode Plus | 1000 kHz | 120 ns | 20 mA | 550 pF |
Common chips — 7-bit addresses (datasheet values)
Depends on address pins and part variants. Breakout boards may strap pins differently; check the board schematic or an I2C scan.
| Chip | Type | 7-bit address | Selected by |
|---|---|---|---|
| 24C02 · 24LC256 · AT24Cxx | EEPROM | 0x50~0x57 | A2/A1/A0 pins (larger parts use some bits for block select) |
| DS1307 | RTC | 0x68 | Fixed |
| DS3231 | RTC | 0x68 | Fixed |
| PCF8523 | RTC | 0x68 | Fixed |
| PCF8563 | RTC | 0x51 | Fixed |
| MCP7940N | RTC | 0x6F | Fixed |
| SHT30 · SHT31 · SHT35 | Temperature/humidity | 0x44, 0x45 | ADDR pin low/high |
| SHTC3 | Temperature/humidity | 0x70 | Fixed |
| Si7021 · HTU21D | Temperature/humidity | 0x40 | Fixed |
| HDC1080 | Temperature/humidity | 0x40 | Fixed |
| AHT20 | Temperature/humidity | 0x38 | Fixed |
| TMP102 | Temperature | 0x48~0x4B | ADD0 to GND, V+, SDA or SCL |
| LM75 | Temperature | 0x48~0x4F | A2/A1/A0 |
| MCP9808 | Temperature | 0x18~0x1F | A2/A1/A0 |
| BMP280 · BME280 | Pressure/temperature | 0x76, 0x77 | SDO pin to GND/VDDIO |
| BMP180 | Pressure/temperature | 0x77 | Fixed |
| MPU-6050 · MPU-9250 · ICM-20948 | Accel/gyro (IMU) | 0x68, 0x69 | AD0 pin — 0x68 clashes with DS1307/DS3231 |
| LSM6DS3 | Accel/gyro (IMU) | 0x6A, 0x6B | SDO/SA0 pin |
| BNO055 | Accel/gyro (IMU) | 0x28, 0x29 | COM3 pin |
| ADXL345 | Accelerometer | 0x53, 0x1D | ALT ADDRESS pin low → 0x53, high → 0x1D |
| LIS3DH | Accelerometer | 0x18, 0x19 | SDO/SA0 pin |
| MMA8451Q | Accelerometer | 0x1C, 0x1D | SA0 pin |
| HMC5883L | Magnetometer | 0x1E | Fixed |
| QMC5883L | Magnetometer | 0x0D | Fixed |
| SSD1306 · SH1106 | OLED display | 0x3C, 0x3D | SA0 (D/C#) pin |
| PCF8574 | I/O expander | 0x20~0x27 | A2/A1/A0 — common on character LCD backpacks |
| PCF8574A | I/O expander | 0x38~0x3F | A2/A1/A0 |
| MCP23017 · MCP23008 | I/O expander | 0x20~0x27 | A2/A1/A0 |
| PCA9685 | PWM/servo driver | 0x40~0x77 | A5–A0 (6 pins). 0x70 clashes with the default All Call address; 0x78 and up are reserved by I2C |
| ADS1115 · ADS1015 | ADC | 0x48~0x4B | ADDR to GND, VDD, SDA or SCL |
| PCF8591 | ADC | 0x48~0x4F | A2/A1/A0 |
| MCP4725 | DAC | 0x60~0x67 | Part variant (A0–A3) + A0 pin |
| INA219 · INA226 | Current/power monitor | 0x40~0x4F | A1/A0 to GND, VS, SDA or SCL |
| TCA9548A · PCA9548A | I2C multiplexer | 0x70~0x77 | A2/A1/A0 |
| VL53L0X · VL53L1X | Distance (ToF) | 0x29 | Default — changed in software |
| BH1750 | Light | 0x23, 0x5C | ADDR pin low → 0x23, high → 0x5C |
| TSL2561 | Light | 0x29, 0x39, 0x49 | ADDR SEL pin GND, float, VDD |
| VEML7700 | Light | 0x10 | Fixed |
| APDS-9960 | Light | 0x39 | Fixed |
| CCS811 | Air quality / CO2 | 0x5A, 0x5B | ADDR pin |
| SGP30 | Air quality / CO2 | 0x58 | Fixed |
| SCD30 | Air quality / CO2 | 0x61 | Fixed |
| SCD40 · SCD41 | Air quality / CO2 | 0x62 | Fixed |
| AS5600 | Magnetic angle sensor | 0x36 | Fixed |
| MPR121 | Capacitive touch | 0x5A~0x5D | ADDR to GND, VDD, SDA or SCL |
| Si5351A | Clock generator | 0x60 | Default (0x61 on some variants) |
| ATECC608 | Secure element | 0x60 | Factory default (8-bit 0xC0) — configurable |
| MAX17048 | Battery fuel gauge | 0x36 | Fixed |
| MAX30102 | Heart rate / SpO2 | 0x57 | Fixed |
Reserved addresses (UM10204 table 4)
| 7-bit | Use |
|---|---|
| 0x00 | General call (R/W 0), START byte (R/W 1) |
| 0x01 | CBUS address |
| 0x02 | Reserved for a different bus format |
| 0x03 | Reserved for future purposes |
| 0x04–0x07 | Hs-mode master code |
| 0x78–0x7B | First byte of a 10-bit address (1111 0XX) |
| 0x7C–0x7F | Device ID |
FAQ
The datasheet says 0xA0 but the library says 0x50
Same device. 0xA0 is the 7-bit address 0x50 shifted left — the 8-bit write byte (R/W = 0); 0xA1 is the read byte. Arduino Wire and Linux i2c-dev use 7-bit; some MCU HALs and datasheets use 8-bit.
Is 4.7 kΩ fine?
It is a common choice for Standard-mode and short wiring, but with a large bus capacitance or Fast-mode and up the rise time may be too slow. Enter VDD, Cb and mode above to check.
I get an address NACK
Likely causes: address (7- vs 8-bit mix-up), power or ground, missing pull-ups, SDA/SCL swapped, an address clash (DS3231 and MPU-6050 are both 0x68), level shifting.
What about 10-bit addresses?
The first byte is 1111 0XX plus R/W, the second byte carries the low 8 bits. The byte decoder handles them.
For UART, SPI and CAN: UART Waveform Drawer · SPI Mode Helper · CAN Frame Decoder · UART Baud Rate Error Calculator