What hardware does a Raspberry Pi clock display need?

A Raspberry Pi 3, 4, or 5. A 16GB or larger microSD card. An HDMI screen. A keyboard and mouse for the initial setup. A wired or WiFi internet connection.

You do not need a powerful Pi. A Raspberry Pi 3B+ running a single tab at 60Hz uses about 3 watts. That is roughly $3 per year in electricity at average US rates. The hardware cost is under $50.

Flash Raspberry Pi OS Lite to the SD card

Use Raspberry Pi Imager (free, runs on any computer). Pick Raspberry Pi OS Lite (64-bit). This is the version without a desktop environment. You will add a minimal window manager later. A full desktop wastes memory and adds boot time.

Before writing the image, click the gear icon in Imager and set: - Hostname: clockpi (or anything you prefer) - Enable SSH with a password - Configure WiFi if using wireless - Set your locale and time zone

Write the image to the SD card, insert it into the Pi, and boot.

SSH into the Pi and install the graphics stack

SSH into the Pi from another computer. On Windows use PuTTY. On Mac or Linux open a terminal and run:

ssh pi@clockpi.local

Default password is raspberry. Change it immediately with passwd.

Run these commands:

sudo apt update && sudo apt upgrade -y sudo apt install xorg x11-xserver-utils unclutter xdotool matchbox-window-manager chromium-browser -y

This installs the X Window System (the graphical layer), a lightweight window manager, a tool to hide the mouse cursor, and Chromium in kiosk mode.

Auto-login and launch the kiosk display

Tell the Pi to log in automatically and start X on boot:

sudo raspi-config

Go to System Options > Boot / Auto Login > Console Autologin. Select it, then Finish and reboot.

After reboot, SSH back in. Create a script that launches Chromium in kiosk mode:

nano ~/clock.sh

Before creating the script, store the chosen fullscreen clock address in a CLOCK_URL environment variable. Paste this content:

```

!/bin/bash

xset -dpms xset s off xset s noblank unclutter -idle 0 & matchbox-window-manager -use_cursor no & chromium-browser --kiosk --noerrdialogs --disable-infobars --disable-session-crashed-bubble --disable-feature=TranslationUI "$CLOCK_URL" & ```

Press Ctrl+X, Y, Enter to save.

Make the script executable:

chmod +x ~/clock.sh

The xset commands disable DPMS (Display Power Management Signaling), turn off screen blanking, and stop the screen from sleeping. unclutter hides the mouse cursor. matchbox-window-manager provides a minimal window manager that does not show title bars.

Start the clock script automatically at boot

Edit the file ~/.xinitrc:

nano ~/.xinitrc

Add this line:

exec ~/clock.sh

Now tell the system to start X on login. Edit ~/.bash_profile:

nano ~/.bash_profile

Add these lines at the end:

if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then startx fi

Reboot:

sudo reboot

After about 30 seconds, the Pi should show a fullscreen clock. The display refreshes every frame (60 times per second on a 60Hz screen). Between syncs, the system clock is maintained by the Pi's internal crystal oscillator. Consumer hardware like this drifts 1 to 15 seconds per month.

Keep the clock accurate

The Pi syncs time via NTP (Network Time Protocol) automatically. Check sync status:

timedatectl status

Look for "System clock synchronized: yes" and "NTP service: active". If the clock is wrong, force a sync:

sudo timedatectl set-ntp true sudo systemctl restart systemd-timesyncd

If the screen is in a location without internet, the Pi will keep time from its last sync. Drift accumulates at roughly 1 second every few days depending on temperature and hardware. For a permanent offline installation, add a GPS hat or a DCF77 receiver. For most lobby and signage use cases, periodic internet sync is sufficient.

How to prevent the Raspberry Pi kiosk display from going black

The screen wake lock API in the page prevents the panel from dimming only while the page is visible. If the Pi's power settings override this (some monitors have their own sleep timers), go into the monitor's on-screen display menu and disable auto-off or eco mode.

If Chromium crashes, it will not restart automatically. Add a simple watchdog by editing ~/clock.sh and wrapping the chromium line in a loop:

while true; do chromium-browser --kiosk [options...] "$CLOCK_URL" sleep 2 done

Now if Chromium exits for any reason, the script waits 2 seconds and relaunches it.

When to use a Pi versus a regular computer

Use a Pi when you need a low-cost dedicated panel that runs 24/7 and fits behind a monitor. Do not use a Pi if you need sub-second accuracy. The rendering pipeline adds 16 to 50 milliseconds of latency on every frame. The clock display is correct to the second for human reading, not for scientific measurement.

Use a regular computer when you already have one, or when you need a second monitor clock on an existing machine. The same kiosk mode works on any OS. On Windows, add the fullscreen page to startup programs. On macOS, use a tool like Keyboard Maestro or a simple AppleScript.

For more on accuracy limits, read about browser clock vs hardware clock accuracy. For a guide to putting a clock on an existing second monitor without a Pi, see second monitor clock setup.