---
title: "An alarm clock based on a Raspberry Pi"
date: 2026-05-05
description: "A Raspberry Pi turns into an interactive alarm clock with an arcade button and a puzzle function."
translationKey: "wecker-raspberry-pi-post"
---

The kid came up with the idea of getting an alarm clock. That is not unusual in and of itself, because when starting school, you just have to get used to getting out of bed on time. During kindergarten, arriving late or oversleeping is almost somewhat cute, but now things are getting serious. Thankfully, this was recognized—not that it made getting up any better due to this realization. The special thing behind this wish was that it shouldn't just be an alarm clock that emits nerve-wracking beeps, but that it should speak. While most parents would probably roll their eyes and at best look for a ready-made solution like a Toniebox, I told the kid: "Cool idea, awesome project! Let's do it together."

## The Idea and the Hardware

Actually, the whole thing isn't rocket science: A [Raspberry Pi](https://www.raspberrypi.com/) with a PC speaker and some corresponding programming. Operating it was more of the challenge. Ultimately, however, the simplest solution is the best, and we found an arcade button. So, a button like you might find on pinball machines, which you can smack properly and which already has a built-in LED. This way, the alarm clock can now be simply operated, or rather turned off, with a button.

![The components: Raspberry Pi and the arcade button](wecker-1.jpg)

An old Raspberry Pi—a Model B from 2018 with 2 GB of RAM—was gratefully donated to me by a friend. A slightly larger SD card as well. Actually, I first wanted to install NixOS on the device. But at some point, the absurd idea of installing an OpenClaw instance on the device took over. At first, that seemed to work, and the first tests were promising. But ultimately it was too slow, too resource-hungry, and completely oversized for my needs. I eventually let it be, simply used the standard OS, and installed the coding agent [pi](https://pi.dev) to operate the whole thing. Here too: the simplest solution is ultimately the best.

## The Final Boss: Electronics

The true final boss in this project was the hardware. I know about as much about electronics as a urologist does about wisdom teeth—roughly the same subject area, but a completely different construction site. So I did what I always do in this situation: Ask the AI. To find out how I should connect the button and the LED to the board, I photographed the components and let it explain and plan everything in detail for me. At least I could still solder cleanly, and a soldering iron was also still found in the depths of the basement compartment.

![The wiring and soldering work on the hardware](wecker-2.jpg) 

An old wooden box from a failed experiment, where I had tried to build my own humidor a few years ago, served as the casing. Ultimately, however, that too was plugged together and tested in a few minutes.

![Installation in the old wooden box, which was originally supposed to be a humidor](wecker-3.jpg)

## From Speaking to Solving Puzzles

However, the speech output came to nothing for now. Not because it wasn't technically possible—no, it should just start small and still leave room for improvement to push the project further later. So I sat down and discussed with the kid exactly how the alarm clock should function. The idea of incorporating a puzzle quickly came up, and with a somewhat longer prompt, we realized that too.

We simply took the song ["Sunshine Reggae" by Laid Back](https://www.youtube.com/watch?v=R82XGJV_nkU) for waking up. A simple cron job entry starts an alarm script that plays the song. If you press the button, the built-in LED starts blinking randomly. You have to remember how many times the LED has blinked and confirm this number by pressing the button accordingly often to end the script. With a wrong entry, the LED blinks randomly again and must be confirmed again until the alarm clock is really off.

It is a playful way of making sure that you are really awake. And that works excellently: The motivation is there, the kid stomps happily out of the children's room and explains to you that it was "too easy" today. I was briefly inclined to have a text message output as Morse code in order to invent a new puzzle, but for the start, it works like this. The speech output is still worth considering, and we don't want to let all good ideas fizzle out at once.

![The finished, interactive Raspberry Pi alarm clock](wecker-4.jpg)

## Manageable Costs, Priceless Fun

By the way: The costs for this project were absolutely manageable. I had to order the arcade button and the matching cables for approx. CHF 10.–. Unfortunately, I couldn't find any small, suitable speakers in any thrift store, which is why I ultimately bought them new for approx. CHF 30.–. The entire rest (including Raspberry Pi and SD card) was given to me as a gift or was lying around unused at my place. So the project cost me roughly CHF 40.– bottom line. That is significantly cheaper than any ready-made solution—and above all, it was incredibly fun to build the thing yourself!

If you would like to rebuild the whole thing: The ultimately very simple source code can be found at [https://codeberg.org/gurix/wecker](https://codeberg.org/gurix/wecker).