Build your own kitchen timer with a dual alarm
System Optimization
The project is complete in principle, but you can take advantage of a few optimizations to round everything off. If you have a spare power outlet and want to keep the alarm timer running all the time, you don't need to worry about booting the system, but if you only turn on the alarm timer when needed, you will soon notice that booting takes a long time and the wait can be annoying. Fortunately, a couple of tricks will reduce the wait significantly [3].
Another optimization is related to the shutdown behavior. The alarm timer does not have a control for this, but you could retrofit one in the form of an additional button. Of course, in the heat of the moment, the chef might forget more than just the salt. It makes more sense to set up the system to be read-only, which means Linux then no longer writes to the SD card. Instead of shutting down, you can simply pull the plug [4].
In the special case of this example, a much simpler method also works, but only because the program does not even write temporary files and all the other programs on the Raspberry Pi are irrelevant: Simply comment out all lines in the /etc/fstab
file. The kernel will still mount the root filesystem at startup, but in read-only mode, and the boot filesystem is unnecessary for normal operation.
Besides working under the hood, you also want the appearance to be pleasing. For the alarm timer, an attractive 3D-printed case is a good choice, because a breadboard with jumper cables is not something you would want in your kitchen. Because the atmosphere in the kitchen tends to be quite humid, you will want to use PETG instead of the more common PLA [5]. I already have a case in the making, so it's worth taking a look at the project [6]. By the time this article is published, it might even be finished.
Don't underestimate the time needed to get from the breadboard to the finished alarm clock that you would want to see in the kitchen every day. Four modules are connected to 3.3V, but the Raspberry Pi offers only two 3.3V pins. Without an additional board, nothing will work. You also need room for the cables without having an oversized housing.
Another question is how to fasten the case while leaving at least the power connection accessible from outside. Mounting the smaller components, such as the single switch or the slider, is by no means trivial. They need a firm hold, because in everyday life, they will have to withstand forces perpendicular to the housing.
Conclusions
Your own projects with cheap hardware can be prototyped with just a breadboard and a few jumper cables. The software usually takes a little more work, but thanks to the many examples online, the programming effort can be minimal.
Starting with this example as a jumping off point, you can realize your own ideas. If the alarm timer is not running, it would be a good idea to show the time and date on the two displays. I would be happy to field any corresponding pull requests. Another idea would be to convert the alarm clock into an electronic chess clock, where two buttons alternately start the timers. The possibilities offered by the Raspberry Pi are (almost) unlimited.
Infos
- wiringPi: http://wiringpi.com/download-and-install/
- Dual timer project: https://github.com/bablokb/doubleclock
- "Fast boot with Raspberry Pi" by Himesh Prasad: https://himeshp.blogspot.com/2018/08/fast-boot-with-raspberry-pi.html
- "Make your Raspberry Pi file system read-only (Raspbian Buster)" by Andreas Schallwig, Medium, 23 September 2019, https://medium.com/swlh/make-your-raspberry-pi-file-system-read-only-raspbian-buster-c558694de79
- "PETG vs PLA: The Differences – Simply Explained" by Lamin Kivelä, All3DP, 26 January 2020, https://all3dp.com/2/petg-vs-pla-3d-printing-filaments-compared/
- Tinkercad files: https://www.tinkercad.com/things/8dUa6ugfUpZ
« Previous 1 2 3
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
-
Canonical Releases Ubuntu 24.04
After a brief pause because of the XZ vulnerability, Ubuntu 24.04 is now available for install.
-
Linux Servers Targeted by Akira Ransomware
A group of bad actors who have already extorted $42 million have their sights set on the Linux platform.
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.
-
Kodi 21.0 Open-Source Entertainment Hub Released
After a year of development, the award-winning Kodi cross-platform, media center software is now available with many new additions and improvements.
-
Linux Usage Increases in Two Key Areas
If market share is your thing, you'll be happy to know that Linux is on the rise in two areas that, if they keep climbing, could have serious meaning for Linux's future.
-
Vulnerability Discovered in xz Libraries
An urgent alert for Fedora 40 has been posted and users should pay attention.
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.