PortDock

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 resistor

Results
Rp min = (VDD − VOL) ÷ IOL
Rp max = tr ÷ (0.8473 × Cb)
VOL · IOL (table 10)
tr max · Cb max
E12/E24 values in range

Byte decoder

S, Sr, P, A (ACK), N (NACK) and bytes (0xA0 or A0). Without S, the first byte is taken as the address.

Examples
#FieldByteMeaningACK

Everything runs in your browser; nothing you type is sent anywhere.

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.
ModeMax ratetrIOL (VOL 0.4 V)Cb max
Standard-mode100 kHz1000 ns3 mA400 pF
Fast-mode400 kHz300 ns3 mA400 pF
Fast-mode Plus1000 kHz120 ns20 mA550 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.

ChipType7-bit addressSelected by
24C02 · 24LC256 · AT24CxxEEPROM0x50~0x57A2/A1/A0 pins (larger parts use some bits for block select)
DS1307RTC0x68Fixed
DS3231RTC0x68Fixed
PCF8523RTC0x68Fixed
PCF8563RTC0x51Fixed
MCP7940NRTC0x6FFixed
SHT30 · SHT31 · SHT35Temperature/humidity0x44, 0x45ADDR pin low/high
SHTC3Temperature/humidity0x70Fixed
Si7021 · HTU21DTemperature/humidity0x40Fixed
HDC1080Temperature/humidity0x40Fixed
AHT20Temperature/humidity0x38Fixed
TMP102Temperature0x48~0x4BADD0 to GND, V+, SDA or SCL
LM75Temperature0x48~0x4FA2/A1/A0
MCP9808Temperature0x18~0x1FA2/A1/A0
BMP280 · BME280Pressure/temperature0x76, 0x77SDO pin to GND/VDDIO
BMP180Pressure/temperature0x77Fixed
MPU-6050 · MPU-9250 · ICM-20948Accel/gyro (IMU)0x68, 0x69AD0 pin — 0x68 clashes with DS1307/DS3231
LSM6DS3Accel/gyro (IMU)0x6A, 0x6BSDO/SA0 pin
BNO055Accel/gyro (IMU)0x28, 0x29COM3 pin
ADXL345Accelerometer0x53, 0x1DALT ADDRESS pin low → 0x53, high → 0x1D
LIS3DHAccelerometer0x18, 0x19SDO/SA0 pin
MMA8451QAccelerometer0x1C, 0x1DSA0 pin
HMC5883LMagnetometer0x1EFixed
QMC5883LMagnetometer0x0DFixed
SSD1306 · SH1106OLED display0x3C, 0x3DSA0 (D/C#) pin
PCF8574I/O expander0x20~0x27A2/A1/A0 — common on character LCD backpacks
PCF8574AI/O expander0x38~0x3FA2/A1/A0
MCP23017 · MCP23008I/O expander0x20~0x27A2/A1/A0
PCA9685PWM/servo driver0x40~0x77A5–A0 (6 pins). 0x70 clashes with the default All Call address; 0x78 and up are reserved by I2C
ADS1115 · ADS1015ADC0x48~0x4BADDR to GND, VDD, SDA or SCL
PCF8591ADC0x48~0x4FA2/A1/A0
MCP4725DAC0x60~0x67Part variant (A0–A3) + A0 pin
INA219 · INA226Current/power monitor0x40~0x4FA1/A0 to GND, VS, SDA or SCL
TCA9548A · PCA9548AI2C multiplexer0x70~0x77A2/A1/A0
VL53L0X · VL53L1XDistance (ToF)0x29Default — changed in software
BH1750Light0x23, 0x5CADDR pin low → 0x23, high → 0x5C
TSL2561Light0x29, 0x39, 0x49ADDR SEL pin GND, float, VDD
VEML7700Light0x10Fixed
APDS-9960Light0x39Fixed
CCS811Air quality / CO20x5A, 0x5BADDR pin
SGP30Air quality / CO20x58Fixed
SCD30Air quality / CO20x61Fixed
SCD40 · SCD41Air quality / CO20x62Fixed
AS5600Magnetic angle sensor0x36Fixed
MPR121Capacitive touch0x5A~0x5DADDR to GND, VDD, SDA or SCL
Si5351AClock generator0x60Default (0x61 on some variants)
ATECC608Secure element0x60Factory default (8-bit 0xC0) — configurable
MAX17048Battery fuel gauge0x36Fixed
MAX30102Heart rate / SpO20x57Fixed

Reserved addresses (UM10204 table 4)

7-bitUse
0x00General call (R/W 0), START byte (R/W 1)
0x01CBUS address
0x02Reserved for a different bus format
0x03Reserved for future purposes
0x04–0x07Hs-mode master code
0x78–0x7BFirst byte of a 10-bit address (1111 0XX)
0x7C–0x7FDevice 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

Sources