An I2C simulator with the bus decoded byte by byte
Mokxi is a free online I2C simulator that runs in your browser, with nothing to install and no account needed. An Arduino Uno reads the time from a DS3231 clock over I2C every second and shows it on a four-digit display, with a logic analyzer clipped to SCL and SDA writing each start, address, byte and acknowledge over the trace.
- 455parts on the bench
- 43boards running now
- 1.00xreal time, on every board
What you can do here
In the circuit above, or in the editor it opens.
- Watch a real I2C read on the logic analyzer, decoded as it happens
- Put an I2C LCD, an OLED, a BME280 or an MPU6050 on the same two wires
- Run an I2C scanner and see which addresses answer
- Pull a wire and see exactly how a sketch fails
- Use the same bus on an ESP32, a Pico or an STM32
- Edit the Arduino code and press Run again
What the running circuit shows
Seven registers in one transfer.
The DS3231 answers at address 0x68. Once a second the sketch writes the register pointer 0, sends a repeated start and reads seven bytes, seconds to year, in one transfer, so the clock cannot tick between the minutes and the seconds. Every one of those bytes is binary coded decimal, so twenty-five seconds is 0x25. The analyzer on the bus shows the whole exchange as “S 0x68W+ 0x00+ Sr 0x68R+” and the seven bytes, where each + is an acknowledge: the address and a write, the pointer, the repeated start, the address and a read.
In the engine the clock starts at 09:41:50 and the serial monitor prints “status 0x88” with “OSF set: the time is a guess”, the oscillator-stop flag a real module raises when its coin cell has been flat. Ten seconds later the minute rolls over and it prints “2026-09-17 09:42:00”, the chip’s own temperature, 25 C, and “[alarm 1]”.
How the bus is modeled
Open-drain lines, pull-ups and acknowledges.
SCL and SDA are open-drain: a device only ever pulls a line low, and a pull-up brings it back high. The clock module carries its own pull-ups, as real breakouts do. Each part on the bus answers its own address, acknowledges on the ninth clock and drives its bytes bit by bit, and the analyzer decodes the edges it sees, so a wrong address or a missing acknowledge shows up on the trace the way it would on a real one.
Pull the SDA wire off the Uno and nothing acknowledges: the sketch prints “nothing answered at 0x68” and then “read failed” on every pass. What it leaves out: bus capacitance and rise times are not modeled, so a bus that is too long or a pull-up that is too weak still works here.
Questions
Is it free?
Yes. The circuit on this page, every part in it and the editor it opens in are on the free plan, with no card.
Do I need an account?
No. The circuit runs the moment the page does, and the editor opens without one. A free account is only for saving a project to the cloud and sharing it by link.
Can I see the I2C signals?
Yes. Clip a logic analyzer to SCL and SDA and set its decoder to I2C: it draws both lines and writes the start, address, read or write bit, each byte, each acknowledge and the stop over them.
Can I put several devices on one bus?
Yes, as long as each has its own address. An I2C LCD at 0x27, a DS3231 at 0x68 and an MPU6050 at 0x69 can share the same two wires.
Does it work with the Wire library?
Yes. Wire is built in, with the usual libraries on top of it, such as LiquidCrystal_I2C and the Adafruit SSD1306 and BME280 drivers.
More simulators
Each one opens on a circuit that is already running.
Watch an I2C bus
Open the circuit, press Run and read the bus. Nothing to install, and no account needed.