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

  1. wiringPi: http://wiringpi.com/download-and-install/
  2. Dual timer project: https://github.com/bablokb/doubleclock
  3. "Fast boot with Raspberry Pi" by Himesh Prasad: https://himeshp.blogspot.com/2018/08/fast-boot-with-raspberry-pi.html
  4. "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
  5. "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/
  6. Tinkercad files: https://www.tinkercad.com/things/8dUa6ugfUpZ

The Author

Bernhard Bablok works at Allianz Technology SE as an SAP HR developer. When he's not listening to music, cycling or walking, he deals with topics related to Linux, programming and small computers. He can be reached at mailto:mail@bablokb.de.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

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

US / Canada

Get it on Google Play

UK / Australia

Related content

  • ARM64 Assembly and GPIO

    Reading, writing, and arithmetic with the Raspberry Pi in ARM64 assembly language.

  • Elixer

    The Elixir programming language on a Raspberry Pi lets you create distributed projects in just a few lines of code.

  • GPIO on Linux Devices

    The general purpose input/output interface is not just for small-board computers anymore: You can use GPIO on your Linux desktop or laptop, too, through the USB port.

  • Rasp Pi Fox Trap

    As a countermeasure to predators of rare ground-breeding birds, live traps are monitored by a microcontroller and a Raspberry Pi.

  • 01000010

    Talk to your Raspberry Pi in its native assembler language.

comments powered by Disqus
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.

Learn More

News