Connecting your Raspberry Pi with a real-time clock

Lead Image © Joanne Weston, 123RF.com

Keeping Time

Your Raspberry Pi comes with many powerful components, but it doesn't have a built-in clock. If your project needs to keep time, and you don't have a reliable Internet connection for NTP updates, you'll need a real-time clock.

This article is the first of a bimonthly series of columns talking about basic electronics, software, and connecting things to your Raspberry Pi and Arduino. My goal is to show you how to extend the reach of your small computers using sensors, motors, actuators, and other components to sense and interact with your environment.

In this column, I show you how to set up your Raspberry Pi with a real-time clock. A real-time clock is necessary for any project requiring accurate timekeeping, especially when you don't always have an Internet connection – for example, a Raspberry Pi set up in a balloon or a Pi working in the remote Caribbean, as in Project Curaçao.

Introduction to Real-Time Clocks

One of the components left off of the Raspberry Pi for cost reasons is a real-time clock (RTC). The RTC will continue keeping time via a battery, even when the Raspberry Pi is shut off. The Raspberry Pi has the ntp daemon software (ntpd), which will periodically sync the Raspberry Pi clock with external timekeeping, but if you don't have a constant network connection, the daemon doesn't do you much good.

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF

Pages: 5

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content