Watch START, address, R/W, ACK, data, repeated START, clock stretching, and bus arbitration on a two-wire I2C bus.
animation
i2c
serial-communication
sensing
actuation
protocol
intermediate
AnimationI2CTimingDebugging
I2C Communication Protocol Animation
Follow an I2C transaction as a master uses the shared SCL and SDA lines to address one device, exchange bytes, wait for ACKs, handle repeated START, and expose common bus problems such as slow pull-ups, clock stretching, address conflicts, and arbitration loss.
Temp sensor 0x48Selected target device
Register readTransaction pattern
ACK expectedReceiver response on bit 9
Rise OKPull-up and capacitance check
TryChoose Bus speed 100 kHz, Pull-up resistor 2.2 kOhm and Bus capacitance 120 pF, then select Step.ObserveFollow SDA and SCL through START, address, ACK, data and STOP while comparing calculated Rise time with the limit for the selected speed mode.ExplainOpen-drain devices pull a line low and the resistor releases it high. The first-order rise time is approximately 0.8473 times pull-up resistance times bus capacitance.BoundaryThe digital waveform and first-order RC check omit ringing, trace inductance, receiver thresholds, metastability, electromagnetic interference, multi-controller arbitration races, variable clock stretching and damaged drivers.
1IdleSCL and SDA sit high because the pull-up resistors release the bus.2STARTThe master pulls SDA low while SCL is still high. Every slave starts listening.3AddressSeven address bits are sent MSB first, followed by the R/W direction bit.4ACKThe receiver pulls SDA low on the ninth clock. High means NACK.5DataBytes move MSB first. A register read uses a repeated START before switching to read.6STOPThe master releases SDA high while SCL is high, freeing the shared bus.
Bus and Timing Animation
Idle bus: no device is pulling the lines low, so pull-up resistors hold both SCL and SDA high.
Step 0 of 0
Current eventIdle
Address frame0x48 + W
Electrical rise224 ns
Bus stateReady
Healthy I2C transactionThe addressed device ACKs, SDA is stable during SCL-high sample windows, and the pull-up network is fast enough for the selected speed mode.
Why it mattersSTART and STOP are the two legal times SDA changes while SCL is high. During data bits, changing SDA while SCL is high would be misread.
Debug habitWhen a transaction fails, first check pull-ups and address ACK before debugging firmware parsing.
Protocol Controls
Choose a realistic transaction, step through the waveform, then add electrical and protocol faults to see what changes.
Speed mode
rise time ~= 0.8473 x R_pullup x C_bus = 224 ns; Fast-mode max rise time = 300 ns
Teaching model: it shows protocol timing and first-order RC rise-time checks. Use the device data sheets and the I2C-bus specification limits for final hardware design.
Quick Reference: What to Look For on I2C
START and STOPThese are the exceptions to the data-stability rule.
START: SDA falls while SCL is high.
STOP: SDA rises while SCL is high.
Both lines idle high on a released bus.
Address plus R/WA 7-bit address is followed by one direction bit.
0 means master writes to slave.
1 means master reads from slave.
The byte is sent MSB first.
ACK and NACKThe receiver owns the ninth clock bit.
ACK: receiver pulls SDA low.
NACK: SDA remains high.
Master usually NACKs the final read byte before STOP.
Repeated STARTUsed when the master wants to keep bus ownership.
Common pattern: write register address, repeated START, then read data.
No STOP appears between the write and read phases.
Clock stretchingA slave may hold SCL low to delay the next bit.
The master must wait if it supports stretching.
Some controllers or software stacks do not tolerate long stretches.
Electrical limitsOpen-drain signaling makes pull-ups part of the protocol.
Too-weak pull-ups and high capacitance slow rising edges.
Too-strong pull-ups increase sink current.
Shorter buses and lower capacitance give more margin.
Technical Accuracy Notes: What the Model Does and Does Not Prove
Open-drain behaviorI2C devices actively pull low and release high. The animation treats a high bit as released SDA/SCL, not as a driven high output.Rise-time estimateThe model uses the common first-order estimate tr ~= 0.8473 x R x C. It is useful for screening, but layout, device capacitance, level shifters, and measurement threshold matter.Speed-mode limitsThe built-in checks use typical I2C rise-time maxima: 1000 ns for Standard mode, 300 ns for Fast mode, and 120 ns for Fast-mode Plus.Address conflictsIf two slaves share one address, both can ACK. The bus cannot tell which one accepted the transaction unless hardware addressing or a multiplexer separates them.ArbitrationArbitration is shown at bit level: a master loses when it attempts to send a released high but reads back low. Low dominates on an open-drain bus.Not a compliance testerThe page does not replace an oscilloscope, logic analyzer, or data-sheet timing check. It is a learning aid for recognizing protocol phases and likely failure causes.
Example Debug Readings
Address scan finds nothingCheck wiring, power, common ground, pull-ups, and whether the device uses an alternate address pin setting.ACK appears but data is wrongConfirm register address order, repeated START requirements, byte order, and whether the final read byte should be NACKed.Works at 100 kHz, fails at 400 kHzSuspect rise time, bus capacitance, level shifters, long wires, or a device that does not support the faster mode.
Check 1: Repeated STARTUse Temp register read. Which phase writes the register address, and why is there no STOP before the read address?Check 2: Pull-up marginIncrease capacitance at 400 kHz. When does the rise-time warning appear, and what hardware change helps?Check 3: ArbitrationEnable multi-master arbitration. Which master loses, and what bus observation proves it lost?Compare with SPISPI avoids address ACK and open-drain pull-ups, but uses more wires and chip-select lines.Open SPI animationUse the bus visualizerCompare I2C and SPI side by side when choosing a sensor interface.Open I2C/SPI visualizerConnect to hardwareUse the sensor interfacing chapter to connect protocol behavior with wiring and firmware patterns.Open sensor interfacing
Technical boundaries. This is a logical transaction plus lumped-capacitance estimate, not a signal-integrity simulation; final pull-up selection must also satisfy device sink-current and specification limits.