Source: https://mokxi.com/parts/ds1307
Updated: 2026-11-10

Part

# Real-time clock, DS1307

The older clock: the same BCD registers, 56 bytes of RAM, and a halt bit that keeps a new one stopped. Five volts only.

See every part

- 5 pins
- 2 settings
- In 1 project

Drawn live by the editor's own code, at the size you see it.

At a glance

## The Real-time clock, DS1307 in brief

What it is, and every setting the properties panel gives it.

The DS1307 is the real-time clock of the older starter kits, on the Tiny RTC module with a coin cell. Its pins are GND, VCC, SDA, SCL and SQW, and its I2C address is 0x68, fixed. Unlike the DS3231 it is a 5 V chip: VCC must be 4.5 to 5.5 V. On an Uno that is the 5 V pin with SDA on A4 and SCL on A5. On the 3.3 V of an ESP32 it switches to its cell and drops off the bus, so it keeps time and never answers, in Mokxi too. The time registers are the same BCD layout as the DS3231, but bit 7 of the seconds register is CH, clock halt: a new chip sits stopped at 2000-01-01 until a write clears it, which is what RTClib’s isrunning() reads. The halted property is that new chip, and start sets the time otherwise. Writing the seconds restarts the one-second divider, SQW gives 1 Hz, 4.096 or 8.192 kHz, and 56 bytes of battery-backed RAM sit at 0x08. There are no alarms and no thermometer. The 32 kHz output, crystal drift, the coin cell and the AT24C32 on many modules are not modeled.

Family

Clocks and links

Pins

5

start

2026-01-01 12:00:00

halted

false

Pins

## 5 pins

Named as the editor names them, so a wire lands where you expect it.

Pin

What it does

GND

Ground.

VCC

Supply, 4.5 to 5.5 V.

SDA

I2C data. The module carries the pull-ups.

SCL

I2C clock.

SQW

Square wave or a plain output, open drain: it needs a pull-up.

How to use it

## How to use the DS1307 real-time clock with an Arduino

SDA to A4, SCL to A5, VCC to 5 V and GND to GND. It has to be 5 V: the DS1307 needs 4.5 to 5.5 V, and below that it runs from its cell and stops answering on the bus. SQW can stay open.

With RTClib, create an RTC_DS1307, call begin(), then check isrunning(). A new DS1307 comes up halted at 2000-01-01 00:00:00 and stays there until something starts it, so the sketch calls adjust() with a DateTime when it finds the clock stopped. Tick the part’s halted property to see that path; leave it clear and the clock runs from its start time. rtc.now() then gives the date and time, already converted from BCD.

Part pin

Board pin

SDA

A4

SCL

A5

VCC

5 V

GND

GND

Not on 3.3 V: on an ESP32 or a Pico the DS1307 keeps time but never answers its address. For a 3.3 V board, the DS3231 is the clock that works.

Click to open it in the editor

This is the simulator itself, running here. Click anything to open it in the editor.

Open this project in the editor Read the full tutorial

Start it if it is stopped, then read it

How it is modeled

## What is true about the Real-time clock, DS1307, here

In its help article’s own words: what the simulation gets right, and where it stops.

### Modeled

It is a 5 V chip. Below 4.5 V it switches to its cell and cuts itself off the bus,
so on a 3.3 V board (a Pico, an ESP32, a Blue Pill) it keeps time and never answers
its address. That is the most common DS1307 question there is, and the part does
exactly that.

Writing the seconds register restarts the chip's one-second divider, so a clock set
by adjust() ticks a whole second later. The calendar is real: the right number of
days in each month and February 29 in every leap year to 2099. SQW gives a 1 Hz,
4.096 kHz or 8.192 kHz square wave, or the level of the OUT bit.

### Not modeled

The 32.768 kHz square wave, which would cost 65,536 edges a simulated second; with
that rate selected the pin is let go. The crystal's drift: this clock is exact. The
coin cell's voltage and life, and the RAM's undefined contents on a new chip, which
read as zeros here. The module's other chip: many DS1307 boards also carry an AT24C32
EEPROM at 0x50, and this one does not.

From DS1307 real-time clock, in full.

Projects

## See the Real-time clock, DS1307 in a project

One built-in project uses it. It opens in the editor, already wired.

Boards

## The boards it is shown on

This board has a built-in project with the Real-time clock, DS1307 in it.

- Arduino Uno R3

Libraries

## Arduino libraries for the Real-time clock, DS1307

Built in, so the sketch compiles with nothing to install. Each page has the calls, the wiring and an example to run.

- RTClib
- DS1307RTC

More parts

## The rest of the bench

Every one of these is drawn and simulated the same way.

Full-size breadboard

A real 0.1 inch grid with the rails and the center channel, 63 columns wide.

Jumper wires

Drag from any pin or hole to any other. Corners snap, and you can drag them.

Power

A supply rail at the voltage you choose.

Ground

The other end of every circuit.

LED

Lights when current flows. Five colors, and the brightness is what your eye would see.

Filament lamp

A tungsten bulb in a holder: an inrush when it is switched on cold, tens of milliseconds to warm up, and dim on half its voltage.

Resistor

Any value you like, with the color bands drawn to match.

ESP32-C3-DevKitM-1

A RISC-V board that runs your firmware at 160 MHz on the real memory map.

Pushbutton

A 12 mm tactile switch. Hold it while the simulation runs.

Raspberry Pi Pico

The RP2040 board on our own Cortex-M0+ core. Pick a program and press Run.

Raspberry Pi Pico W

Raspberry Pi Pico W (RP2040). The same board and the same pinout as a Pico, with the CYW43439 on it. The WiFi is simulated (no radio; real internet through the Cloud panel’s switch), and the on-board LED, which hangs off that chip rather than off GP25, is driven through the same path. Everything else is the Pico.

Raspberry Pi 4 Model B

Raspberry Pi 4 Model B: the 40-pin header, driven by main.py with RPi.GPIO or gpiozero.

See every part

## Wire up the Real-time clock, DS1307

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.

Start building free Open the editor
