FREE Standard Delivery for orders over £50 (ex VAT)

RTC Pi Real time clock for the Raspberry Pi, Arduino, ESP32,and Single-Board Computers

The RTC Pi is a battery-backed real-time clock module based on the DS1307. It works with any microcontroller or single-board computer that has an I²C bus. It keeps the date and time running from a CR2032 coin cell while your project is switched off, so your Arduino, ESP32, Raspberry Pi Pico or Raspberry Pi knows the correct time as soon as it starts. No network or NTP server is needed.

It’s ideal for offline data loggers, timers, schedulers, garden and greenhouse controllers, and any project that has to timestamp events or run to a timetable. An Arduino Uno has no clock of its own. An ESP32 loses its time whenever the power drops. The RTC Pi solves both.

The RTC Pi also includes 56 bytes of battery-backed RAM for keeping settings or counters through power cuts. It also has an I²C logic level converter, so 3.3V boards such as the ESP32 and Pico can talk to 5V I²C sensors and displays through the RTC Pi’s 5V I²C header. A programmable SQW/OUT pin gives your microcontroller an accurate 1 Hz tick for clock displays, timing loops and interrupt-driven code. It can also provide a 32.768 kHz reference clock for other circuits.

Plug it onto a Raspberry Pi’s 40-pin header, or connect five wires to a microcontroller. Libraries are available for Arduino, MicroPython, Python, C, C++ and Node.js, and the DS1307 is supported natively in ESPHome.

Important: always fit a CR2032 battery before powering the RTC Pi. Powering the DS1307 without a battery can damage the chip.

Features

  • DS1307 real-time clock that tracks seconds, minutes, hours, day, date, month and year, with leap-year compensation
  • CR2032 battery backup that keeps time with the power off (battery not included)
  • Programmable square-wave output (SQW/OUT): 1 Hz, 4.096 kHz, 8.192 kHz or 32.768 kHz. It can also be set as a fixed high or low output.
  • 56 bytes of battery-backed RAM for settings, counters or state
  • Built-in I²C level converter: 3.3V on the host side, 5V on the I²C header for connecting 5V devices
  • Works with Arduino, ESP32, ESP8266, Raspberry Pi Pico, Raspberry Pi and other I²C hosts
  • Native ESPHome support, so it keeps time for Home Assistant devices even when Wi-Fi is down
  • 5-wire connection to microcontrollers, or plugs straight onto a 40-pin GPIO header with stacking pins
  • Mounting holes for our mounting kit
  • Fixed I²C address 0x68

Technical Details

Input Ratings & Specifications

Spec Ratings
Supply Voltage 4.5V to 5.5V
Logic Voltage at GPIO Port 3.3V
Logic Voltage at I2C Header 5V

3D CAD Model

Click to downloadRTC Pi - 3D CAD File (STEP Format)

Schematic

Click to View
View the schematic PDF.

Mechanical Drawings

Click the image to enlarge

Compatibility

The RTC Pi communicates over the industry-standard I²C protocol, which is supported by the vast majority of modern SBCs. If your board exposes SDA and SCL on a 40-pin GPIO header running at 3.3 V logic, the RTC Pi should work.

Platform Status Notes
Raspberry Pi A+ / B+ Tested Primary platform, full library support
Raspberry Pi 2 / 3 / 4 / 5 Model B Tested All variants confirmed, including 400 & 500
Raspberry Pi Zero / Zero W / Zero 2 W Tested All variants confirmed
Raspberry Pi Pico Tested Via I²C pins; use MicroPython library
Orange Pi Tested Enable I²C via board config; see our Orange Pi guide
Asus Tinker Board Tested Enable SMBus/I²C; see our Tinker Board guide
Odroid Tested I²C device node must be enabled in OS config
Other 40-pin I²C SBCs Likely compatible Any board with 3.3 V I²C on SDA/SCL and a GND + 3.3 V or 5 V supply pin should work
Using an unlisted SBC? As long as your board provides a 3.3 V I²C bus, a 5 V supply and 3.3 V logic reference, and a ground connection, the RTC Pi will communicate correctly. Enable I²C in your OS (e.g., via armbian-config, orangepi-config, or your board's device-tree overlay), then use our Python or C library. Visit our Other Supported Platforms knowledge base page for configuration guides and community tips.

Connecting to Arduino, ESP32 and Raspberry Pi Pico

The DS1307 runs from 5V, so the RTC Pi always needs a 5V supply and the 3.3V logic reference, as well as the I²C lines.

IO Pi Plus pin Arduino Uno / Nano Arduino Mega ESP32 DevKit ESP8266 NodeMCU Raspberry Pi Pico
1 - 3.3V 3.3V 3.3V 3V3 3V3 3V3
2 - 5V 5V 5V 5V / VIN VIN VBUS
3 - SDA A4 20 GPIO21 D2 (GPIO4) GP4
5 - SCL A5 21 GPIO22 D1 (GPIO5) GP5
6 - GND GND GND GND GND GND
SQW (Optional) D2 (INT0) D2 Any GPIO, e.g. GPIO4 D5 (GPIO14) Any GPIO, e.g. GP15

On ESP32 and Pico boards, the 5V / VIN / VBUS pin only has 5V when the board is powered from USB or a 5V supply.

Assembly Instructions

The RTC Pi is supplied with a 40-pin GPIO connector, and the battery holder is unsoldered.

We supply the RTC Pi this way because the Raspberry Pi is also provided without a GPIO header, and the RTC Pi could therefore be fitted both above or below the Raspberry Pi.

Before using the RTC Pi, you need to solder the 40-pin GPIO connectors onto the PCB and the battery holder.  

We suggest soldering the 40-pin GPIO connector first and then the battery holder. Soldering the battery holder first will make it difficult to access the pins on the GPIO connector. The PCB has an outline for the battery connector to ensure the correct fitting.

PCB Header Assembly Jig

Download and print our PCB Header Assembly Jig to hold your circuit board when soldering the header pins.

Use

Datasheets

Code Libraries and Tutorials

All AB Electronics software libraries are open-source and available on our GitHub repository. Libraries are available for the following languages and frameworks, covering Raspberry Pi, Orange Pi, Asus Tinker Board, Odroid, and other Linux-based SBCs with I²C support:

Language   Notes
Download Python 2 and 3 code samples Python Works on any Linux SBC with the smbus or smbus2 package
Download MicroPython code samples MicroPython For Raspberry Pi Pico and other MicroPython-capable microcontrollers
Node js code samples Node.js Suitable for server-side or IoT automation on Linux SBCs
C code samples C Bare-metal performance on any I²C-capable Linux board
C++ code samples C++ Bare-metal performance with object-orientation on any I²C-capable Linux board
Download Windows 10 IOT code samples Windows 10 IOT Windows 10 IOT Library & Demos

See the RTC Pi Knowledge Base for platform-specific setup guides, including I²C configuration walkthroughs for Orange Pi, Asus Tinker Board, and Odroid.

RTC Pi Articles & Tutorials

You may also like

Order Expander Pi Photo of Expander Pi

Expander Pi

GPIO, Analogue and RTC Expander for the Raspberry Pi

£19.99 ex VAT
Order Mounting Kit Four Pack Photo of Mounting Kit Four Pack

Mounting Kit Four Pack

Mounting kit to use on our Raspberry Pi boards

£3.49 ex VAT

Important Information

This development board/kit is intended for use for ENGINEERING DEVELOPMENT, DEMONSTRATION, OR EVALUATION PURPOSES ONLY and is not considered by abelectronics.co.uk to be a finished end-product fit for general consumer use. As such, the goods being provided are not intended to be complete in terms of required design-, marketing-, and/or manufacturing-related protective considerations, including product safety and environmental measures typically found in end products that incorporate such semiconductor components or circuit boards. Persons handling the product(s) must have electronics training and observe good engineering practice standards. This development board/kit does not fall within the scope of the European Union directives regarding electromagnetic compatibility, restricted substances (RoHS), recycling (WEEE), FCC, CE or UL, and therefore may not meet the technical requirements of these directives or other related directives. Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view, download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.

Shipping and Delivery

Free standard delivery is available for orders over £50 (excluding VAT)*.

For orders under £50 and tracked orders, the following delivery charges apply.

Shipping Rates

United Kingdom

Service Cost Estimated Delivery Time
Royal Mail 1st Class £3.29 1 - 3 days (Mon - Sat)
Royal Mail Special Delivery (Tracked) £8.49 Next day (Mon - Sat)

European Union

Deliveries to: Austria, Belgium, Bulgaria, Croatia, Republic of Cyprus, Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece, Hungary, Ireland, Italy, Latvia, Lithuania, Luxembourg, Malta, Netherlands, Poland, Portugal, Romania, Slovakia, Slovenia, Spain and Sweden.

Service Cost Estimated Delivery Time
Royal Mail Airmail Service £5.49 3-5 Working Days **
Royal Mail International Tracked and Signed £12.99 3-5 Working Days **

Rest of the World

Service Cost Estimated Delivery Time
Royal Mail Airmail Service £5.99 5-7 Working Days **
Royal Mail International Tracked and Signed £18.99 5-7 Working Days **

 

Free delivery uses the Royal Mail 1st Class service for UK orders and Royal Mail Airmail Service for international orders.

** All International destinations are subject to customs clearance at the destination country, which can add a short delay to your delivery times. Additional import duty may be charged for your order by customs on arrival to your country based on the order value.

We have a full list of all available delivery destinations on the Shipping Country List.

We aim to dispatch your order within 1 working day.

Working days are normal weekdays; dispatch times do not include Saturdays, Sundays and national holidays. Delivery transit times do not include national holidays and Sundays but may include Saturdays, depending on the delivery service provider in the destination country.

You can view details of international shipping issues and delays with the Royal Mail airmail service at Royal Mail International Incident Bulletin.

You can check the status of your order by going to the My Account area of the website.

EU Orders: VAT & Customs Duty

Orders of €150 or less (most orders)

We collect VAT and customs charges at checkout, so there are no surprise fees when your parcel arrives.

  • VAT is included in your checkout price under our IOSS registration.
  • From 1 July 2026, Council Regulation (EU) 2026/382 adds a flat customs duty of €3 per HS tariff code. Most orders use a single HS code, so this is usually a one-off €3 charge.
  • A postal handling fee is added to shipping: Ireland £0.50, rest of EU £1.00, Switzerland £4.00, Norway £8.00.
  • Nothing further to pay on delivery.

Orders over €150

  • IOSS doesn't apply. Import VAT and customs duty are payable by you on delivery (Delivery Duty Unpaid), based on the order value. This also applies to orders sent to destinations outside the UK and EU.

VAT-registered EU businesses

  • Use Guest Checkout and enter your VAT number to reclaim VAT (not available via PayPal Express).

Questions about a specific order? Contact us.

Order Tracking

Our standard shipping service is not tracked, and we cannot supply tracking information for your order.

We can offer alternative shipping using Royal Mail, tracked and signed for service. You can select this option at checkout. Please note full end-to-end tracking depends on the tracking service from the regional postal service in the destination country.

Once your order has been sent, you can view your tracking code, which is available in the My Account section. Please allow up to 72 hours for your tracking code to be added to your order after despatch.

Returns, refunds and your right to withdraw

Two things apply to your order: your statutory rights as a consumer, and our 180-day returns guarantee on top of them. We never use the guarantee to reduce your legal rights. Where the law gives you more, the law applies.

Your right to withdraw (consumers)

If you bought from us as a consumer, you have 14 days to change your mind for any reason, without needing to keep the item sealed.

The 14 days run from the day you, or someone you nominate, received the goods. Where an order arrives in separate deliveries, the period runs from the day you received the last item.

To withdraw, use our withdrawal function, labelled "Withdraw from contract here", in the My Account area under your order. If you checked out as a guest, use the link in your order confirmation email and verify your order number and email address. You can also tell us in any other clear statement, such as an email. Either way, we'll send you a timestamped acknowledgement by email.

You may open and inspect a board to check it works, as you would in a shop, and still withdraw. You don't have to keep it unopened to exercise this right. You may be liable for any reduction in the item's value caused by handling beyond what's needed to establish how it works.

Once you withdraw, we refund the price you paid plus the standard outbound delivery cost, within 14 days. We may hold the refund until we've received the goods back, or until you show proof you've sent them. You're responsible for the cost of returning the items, and the parcel is your responsibility until it reaches us, so we recommend a tracked or insured service.

Some items are excluded from the statutory right to withdraw, for example goods made or configured to your specification. We'll make this clear before you order where it applies.

Faulty items

Separately from the right to withdraw, if a board is faulty or not as described, your statutory rights apply. Consumers in the EU have a legal guarantee of two years from delivery. All Raspberry Pi add-on boards are tested during production, and all inputs and outputs are checked to ensure they are within the specified ratings. We cannot accept returns for faults caused by over-voltage applied to the inputs by the purchaser, as this is damage rather than a fault.

Our 180-day returns guarantee

In addition to your statutory rights, if for any reason you are unhappy with your purchase you may return it within 180 days of the date you received it, in its original condition and unopened, with any seals and shrink-wrap intact, and we will issue a full refund for the price you paid. This guarantee is our own, beyond what the law requires, which is why it asks for items to be unopened. Opened items can only be accepted under this guarantee if they are faulty.

When returning an item, please state why you are returning it and whether you want a refund or an exchange.

Business customers

The right to withdraw applies to consumers. Orders placed in the course of a business, including boards bought as components for incorporation into other products, are not covered by the consumer right to withdraw. Our 180-day guarantee still applies as set out above.

Refunds

The time a refund takes to reach you depends on the banks involved, but it would normally take 3 to 5 working days to complete once issued.

Your statutory rights

Nothing in this policy affects or limits your statutory rights. Where our terms are more generous than the law requires, the more generous terms apply; where the law gives you more, the law applies. Customers in the United Kingdom have an equivalent 14-day cancellation right under the Consumer Contracts Regulations 2013.

Removed Delivery Destinations

We regret that we had to remove the following countries from our delivery destinations due to a very high failure rate of our parcels being delivered using the Royal Mail airmail service. This resulted in us refunding all of the missing orders, and we cannot continue to make such large losses by sending parcels to destinations where a large percentage of the items are lost in the postal systems.

Brazil, China, Israel, Mexico, Saudi Arabia, Singapore, Sri Lanka, Taiwan, Turkey and the United Arab Emirates.

Also, due to problems with the courier delivering parcels to these destinations, we cannot use a third-party courier service for these delivery destinations due to the extra costs involved.

Customers can purchase our products from one of our international resellers.