SensorCatalog
UM102042-wire Open-Drain (SDA / SCL)

I²C プルアップ抵抗計算&MOSFET双方向レベルシフタ回路

UM10204 Open-Drain Bidirectional · 3.3 V LV ↔ 5.0 V HV Shifted

I²Cプルアップはtr = 0.8473·Rp·Cbを1000 ns(100 kHz)または300 ns(400 kHz)以内、シンク電流3 mA以下に収めます。BSS138 1石で方向ピン無しに3.3 V↔5 V双方向変換できます。

UM10204 PASS (400 kHz): tr = 239 ns ≤ 300 ns · I_sink = 1.77 mA

BSS138 bidirectional shifter cleanly translates 3.3 V ↔ 5.0 V with zero direction pin needed.

正常電流フロー警告・クランプ故障・過電流速度 ∝ 電流 |I|
3.3 V MCUOpen-Drain SDA3.3 V (HI)ESP32 / STM32+3.3 V4.7 kΩBSS138Gate = +3.3 V (Always!)+5.0 V4.7 kΩ120 pF · tr=239ns5.0 V SensorOpen-Drain SDA5.0 V (HI)UM10204 Bus⚠ RISE TIME VIOLATES UM10204 SPEC!

Bus Rise Time (30–70% tr)

239 ns

Combined Sink Current (IOL)

1.77 mA

LV / HV Bus Logic State

3.3 V / 5.0 V

UM10204 Min / Max Rp

1.5–5.9 kΩ

BSS138 MOSFET ChannelOFF (Isolating 3.3 V / 5 V)
Signal DirectionBUS IDLE (Both Pulled High)
NXP UM10204 Timing CheckPASS (≤ 300 ns)
Bus Capacitance Budget120 / 400 pF
kΩ

Standard 4.7 kΩ for 100 kHz; 1.8–2.2 kΩ for 400 kHz Fast-Mode!

pF

UM10204 hard max is 400 pF (each sensor ~10 pF + cable ~80 pF/m).

kHz

100 kHz allows tr ≤ 1000 ns; 400 kHz requires tr ≤ 300 ns!

プリセット:

リアルタイム計算式

1. UM10204 30–70% bus rise time

t_r = 0.8473 · (R_p / 2) · C_b = 0.8473 × 2.35 kΩ × 120 pF

⇒ 239 ns (Max 300 ns)

2. Combined open-drain sinking current

I_OL = (3.3 V + 5.0 V) / R_p = 8.3 V / 4.7 kΩ

⇒ 1.77 mA (Spec ≤ 3.0 mA)

3. Bidirectional level-shift condition

V_GS(th) < 1.5 V (BSS138) = Vgs = 0 V → OFF

⇒ 3.3 V | 5.0 V ISOLATED

動的部品選定・BOM

記号部品推奨定格判定
Q1/2Low-Vth N-Channel MOSFET (SDA & SCL)BSS138 (Vgs_th ≈ 1.3 V, Ciss ≈ 27 pF)OK
Rp1-4I²C Pull-Up Resistors (LV & HV)4.7 kΩ ±1% (on both 3.3 V & 5 V sides)OK
ESDLow-Capacitance I²C ESD ArrayTPD2E001 / USBLC6 (<1.5 pF per line)OK

1. 回路概要と動作原理

I²C (NXP UM10204) connects millions of digital temperature, humidity, pressure, IMU, and ToF sensors (BME280, SHT40, MPU6050, INA219) over just two open-drain wires: SDA and SCL.

Almost every I²C failure in real hardware comes down to two circuit details: mis-sized pull-up resistors Rp violating the UM10204 rise-time limit (300 ns at 400 kHz Fast Mode!), or interfacing a 3.3 V MCU with 5 V sensors without the classic single-MOSFET (BSS138) bidirectional level shifter.

UM10204 Pull-Up Window: Too large Rp fails rise time (R_max = t_r / (0.8473 · C_b)); too small Rp overloads open-drain drivers above 3 mA (R_min = (Vdd − 0.4 V) / 3 mA). Note that with a level shifter, BOTH sides have pull-ups in parallel when pulling LOW!

BSS138 Bidirectional Magic (Zero Direction Pin!): Tie Gate to 3.3 V, Source to LV (3.3 V bus), Drain to HV (5 V bus). When idle, Vgs = 0 V → MOSFET OFF so LV sits at 3.3 V and HV sits at 5 V safely. When LV pulls LOW, Vgs = 3.3 V turns MOSFET ON pulling HV LOW. When HV pulls LOW, the body diode pulls LV down to 0.7 V, turning Vgs ON to pull LV all the way to 0.1 V!

I²C プルアップ抵抗計算&MOSFET双方向レベルシフタ回路 — SensorCatalog
I²C プルアップ&変換PNG 1200×630

2. Step-by-step: Sizing I²C pull-ups & wiring a 3.3 V ↔ 5 V BSS138 level shifter

  1. 1Sum total bus capacitance Cb (devices + traces + cable)

    Count ~10 pF per I²C IC pin plus ~1 pF/cm on PCB traces (~80 pF/m on ribbon/shielded cable). Keep total Cb strictly ≤ 400 pF per UM10204.

  2. 2Calculate Rp window for 100 kHz vs 400 kHz

    For 400 kHz Fast Mode (tr ≤ 300 ns), 10 kΩ fails even on short buses! Use 2.2 kΩ–3.3 kΩ on single-voltage buses (or 4.7 kΩ on each side of a dual-pullup BSS138 shifter = 2.35 kΩ effective).

  3. 3Verify BSS138 low Vgs(th) (< 1.5 V) and never swap LV/HV sides

    Ordinary power MOSFETs (Vgs_th = 3 V) will NOT turn on cleanly at 3.3 V! Use BSS138 (Vgs_th ≈ 1.3 V) with Gate tied strictly to the LOWER voltage rail (3.3 V).

  4. 4Inspect SDA/SCL rise time on a scope and add 9-clock bus recovery in firmware

    Check actual 30%–70% rise time at the farthest sensor. In firmware, toggle SCL 9 times at startup to free any sensor stuck holding SDA LOW after an interrupted reset.

3. 現場トラブルシューティングとテスタ確認

症状原因テスタ測定ポイント対策
I²C works at 100 kHz but randomly NACKs or reads 0xFF at 400 kHzPull-up resistors too weak (e.g. 10 kΩ) or excessive cable capacitanceMeasure 30–70% SCL/SDA rise time with oscilloscopeLower Rp to 2.2–3.3 kΩ, shorten cable, or add an active I²C bus accelerator (LTC4311)
Multiple breakout boards connected together fail to pull SDA below 0.8 VToo many parallel onboard pull-ups (e.g. 5 × 4.7 kΩ = 940 Ω → >5 mA sink overload!)Measure total resistance from SDA to Vcc with power offRemove duplicate pull-up resistors so only ONE pair remains on the bus

4. よくある技術質問(FAQ)

Why does the UM10204 rise-time formula use 0.8473 instead of 2.2?

Standard digital logic defines rise time from 10% to 90% (ln(9) = 2.197). NXP UM10204 defines I²C rise time strictly between V_IL(max) = 30% Vdd and V_IH(min) = 70% Vdd, and ln(0.7 / 0.3) = 0.8473!

Can I rely on my microcontroller’s internal 40 kΩ pull-ups for I²C?

Almost never reliably! Even on a tiny 50 pF PCB trace, 40 kΩ gives tr = 1,700 ns — violating even 100 kHz spec (1,000 ns) and making the bus a magnet for EMI. Always install real 2.2–4.7 kΩ external pull-ups.

How far can I run an I²C sensor cable?

I²C is an Inter-IC board bus, not a fieldbus! Bare I²C reliably runs ~0.5–2 m (limited by 400 pF capacitance). For 5–30 m runs, use differential I²C buffers (PCA9615) or switch to RS-485 / 4–20 mA.

Why do I need pull-ups on BOTH sides of a BSS138 level shifter?

When the bus is idle, the BSS138 is OFF, completely isolating the two sides — so each side needs its own pull-up resistor to reach its respective HIGH rail (3.3 V on LV, 5.0 V on HV).

Should I put pull-ups on every I²C sensor module?

NO! Put ONLY ONE pair of pull-up resistors per I²C bus (one on SDA, one on SCL). Stacking multiple breakout boards with onboard 4.7 kΩ resistors drops total resistance below 1 kΩ and prevents sensors from pulling the bus LOW.

What if I have a 1.8 V sensor talking to a 3.3 V MCU?

BSS138 (Vgs_th up to 1.5 V) is marginal at 1.8 V! For 1.8 V buses, pick an ultra-low-Vth MOSFET like RUM001L02 / BSS138W-L or a dedicated I²C translator IC like TI TCA9406 / PCA9306.

5. 関連計算ツール・比較ガイド・その他の回路

↑ ↓ 選択 · Enter 開く · Esc 閉じる