Simulator

An RTC simulator: a PCF8563 real-time clock on an Arduino Uno

Mokxi is a free online RTC simulator that runs in your browser, with nothing to install and no account needed. A PCF8563 real-time clock wired to an Arduino Uno over I2C: VCC to 5V, GND to GND, SDA to A4 and SCL to A5, read with RTClib. If the VL flag says the time was lost, the sketch sets it before printing the date and time every second.

  • 526parts on the bench
  • 46boards running now
  • 1.00xreal time, on every board
PCF8563 clocklive0.000 s 0.00x
Click to open it in the editor
Click the circuit to open it in the editor, then change the clock's start time or set lostpower and watch what the sketch does.

What you can do here

In the circuit above, or in the editor it opens.

  • Read the date and time from a PCF8563
  • See the sketch set the time when VL is set
  • Change the clock's start time
  • Set lostpower to test a chip whose time was lost
  • Watch the serial monitor tick once a second
  • Follow wiring: SDA to A4 and SCL to A5

What the running circuit shows

A clock that prints itself once a second.

At the default settings the serial monitor finds the chip and then prints the date, the time and the day, one line each second:

“PCF8563 found at 0x51”, then “2026-11-16 09:41:00 Monday”, “2026-11-16 09:41:01 Monday” and “2026-11-16 09:41:02 Monday”.

Set the start time to 2026-12-31 23:59:50 and the same circuit counts up to the new year's eve: “2026-12-31 23:59:50 Thursday”, “2026-12-31 23:59:51 Thursday”, “2026-12-31 23:59:52 Thursday” and “2026-12-31 23:59:53 Thursday”.

How the real-time clock is modeled

Sixteen registers and a careful calendar, with a few honest gaps.

The model follows NXP's data sheet: sixteen registers, including the seven BCD time registers with the VL flag in bit 7 of the seconds register, and an alarm and a countdown timer. The calendar ticks once a second, treats every year divisible by four as a leap year, and holds the counters while a transfer reads or writes the time registers, taking any tick that came meanwhile at the STOP.

Some things are not modeled. The 32.768 kHz CLKOUT is too fast to simulate cheaply, the voltage-low detector never triggers because the coin cell keeps the supply up, so VL comes only from the lostpower setting, and the crystal's drift is absent: this clock is exact.

How it works

Three steps from a blank tab to a running circuit.

  1. Open the editor

    It runs in your browser tab. Nothing to install, and you need no account to start.

    Your first project
  2. Wire it and write the code

    Drag parts onto a breadboard, run each wire from pin to pin, and write the sketch beside it.

    Wiring
  3. Press Run

    Your sketch compiles in the tab and runs on a model of the chip, with the Serial Monitor beside it.

    Run and serial
Reviews

What makers say about Mokxi.

“The AI checker helps check and correct my circuits, and it has way more components than Tinkercad. As a student I really appreciate the tool.”

ChloeEngineering student

“I’d been looking for a real online electronic simulator that was intuitive and complete when I found Mokxi. I was able to quickly import a Fritzing file and my Arduino sketch and start testing. Mokxi has all of the makings for the best online Arduino simulator I have been able to find!”

JayModel builderFeatured in his DioramaOS post

“I’m using Mokxi to develop and simulate an STM32-based four-wheel-drive robot car before building the actual hardware. It allows me to experiment with DC motor control, PWM, RPM measurement using photointerrupters, and different acceleration, braking, and reversing strategies, helping me understand and refine the system before implementing it in real life.”

NusretRobot car builder, Hamburg

Share your story

FAQ

Questions, answered.

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.

What does the VL flag mean?

Bit 7 of the seconds register, read by RTClib's lostPower(), says the time can no longer be trusted, as with a fresh chip or one whose cell ran flat. The sketch checks it and writes the time to clear it.

Where does the PCF8563 answer on the bus?

At the fixed I2C address 0x51, on SDA and SCL. On the Uno those are pins A4 and A5.

Can I change what time the clock starts at?

Yes. In the editor, the start setting sets the date and time the clock holds when the circuit starts, and lostpower makes it a chip whose time cannot be trusted.

More simulators

Each one opens on a circuit that is already running.

Watch the clock tick

Open the circuit, set a start time and watch the serial monitor count seconds. Nothing to install, and no account needed.