Build your own kitchen timer with a dual alarm
Kitchen Helper
A simple kitchen helper with two timers assists budding chefs in coping with dishes that are unlikely to be ready at the same time.
Not all the recipes you cook likely need to be ready at the same time, especially if everyone in the household has their own idea of how long you need to boil eggs for breakfast. A simple dual timer solves the problem.
This project uses a Pi Zero and some cheap components sold by the usual mail order companies for a few euros, dollars, or pounds. In principle, it is possible to build the project from scratch on a breadboard without any soldering, which makes it perfect as a starter project for your own experiments.
On the Pi Zero you need to install Raspbian "Buster" up front; the Lite version will do the trick. The only additional package you need to install for the time being is wiringPi [1], which uses a numbering system different from the header pin and GPIO systems. If you want to work with a graphical user interface, you could switch to a Raspberry Pi 3 or 4, but these platforms are oversized for this use case.
Strictly speaking, even the Pi Zero is overkill because, in principle, any microcontroller could control an alarm clock. The advantage of the Raspberry Pi is that software implementation is faster and easier: I use Python in this project. Before you move on to the software for the project, you first need to wire the hardware.
Mini Displays
Segment displays based on the TM1637 driver are ideal for displaying times (Figure 1). Each digit can be displayed with seven segments, and suitable displays are easily found by searching for "7-segment display." The monochrome displays are inexpensively available in red, white, blue, yellow, and green. They are available with a colon in the middle (clock type) or with one decimal point per digit.
Many sellers (especially on eBay) do not always provide the correct data. Often you will find a description of the clock type combined with an image of the decimal point display. Other sellers show both types to protect themselves against complaints relating to wrong delivery. Make sure you take a close look.
The connector pins are another potential source of concern. Pre-soldered specimens, as shown in Figure 1, are useful for experiments on the breadboard, but for installation in a housing, pins soldered from the back would be more useful. Finding the perfect device is not that easy.
TM1637 displays require two lines (CLK and DIO, or clock and data) in addition to power and ground. It is a lean I2C protocol that works on any pin. The device can handle 5V of input voltage, but the 3.3V on the Raspberry Pi are perfectly OK.
In this project, the displays are deployed on GPIO6 and GPIO12 (CLK) and GPIO13 and GPIO16 (DIO) on the left side of the display. Figure 2 shows the complete assembly with wiring for orientation.
Sound the Alarm
A buzzer serves as an alarm signal. You want to use an active buzzer; for a passive version, you would have to generate the sound yourself as PWM signals. Buzzers are typically available with two or three pins. In the first case you just need to apply a voltage (set the GPIO to High); in the alternative case, you have a control pin in addition to voltage and ground. For the versions I used for this example, I had to set the control pin to Low to make the buzzer go off.
The alarm clock program expects the control pin on GPIO26. To check this functionality, enter:
$ gpio -g mode 26 out $ gpio -g write 26 0 $ gpio -g write 26 1
The first line switches GPIO26 as the output pin, and the second line activates the buzzer. The third line switches it off again. At startup time, GPIO26 is an input pin and you might hear a short sound. If this annoys you, a low pullup resistor will prevent this happening.
Toggle
To edit the alarm times, you need to be able to switch between the two displays. To do so, you can use a slider, which is a button with two states. Of its three connectors, the central is grounded, and depending on the position of the switch, either the left or the right connector is grounded.
In this project, only the left connector GPIO20 and ground are wired. Also, the GPIO20 internal pullup is switched on. While the switch is on the right, GPIO20 is High, but otherwise Low. To test the wiring, enter:
$ gpio -g mode 20 in $ gpio -g mode 20 up $ gpio -g read 20
Repeat the command in the third line for different switch positions; depending on the position, the read
command outputs a 0 or 1.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.
-
OSI and LPI Form Strategic Alliance
With a goal of strengthening Linux and open source communities, this new alliance aims to nurture the growth of more highly skilled professionals.
-
Fedora 41 Beta Available with Some Interesting Additions
If you're a Fedora fan, you'll be excited to hear the beta version of the latest release is now available for testing and includes plenty of updates.
-
AlmaLinux Unveils New Hardware Certification Process
The AlmaLinux Hardware Certification Program run by the Certification Special Interest Group (SIG) aims to ensure seamless compatibility between AlmaLinux and a wide range of hardware configurations.
-
Wind River Introduces eLxr Pro Linux Solution
eLxr Pro offers an end-to-end Linux solution backed by expert commercial support.
-
Juno Tab 3 Launches with Ubuntu 24.04
Anyone looking for a full-blown Linux tablet need look no further. Juno has released the Tab 3.
-
New KDE Slimbook Plasma Available for Preorder
Powered by an AMD Ryzen CPU, the latest KDE Slimbook laptop is powerful enough for local AI tasks.
-
Rhino Linux Announces Latest "Quick Update"
If you prefer your Linux distribution to be of the rolling type, Rhino Linux delivers a beautiful and reliable experience.