Kitchen recipe screen with timers
Build it step by step
0 of 7 doneFit the display
Connect the ribbon with the Pi off.
Test the touch
Check it in the desktop.
Run the app
Open the page in the browser.
Add your recipes
Edit the dictionary.
Add the buzzer
Test /beep from the page.
Make it kiosk
Auto-start the app and Chromium.
Mount it
Away from heat and water.
How do you build a kitchen recipe screen with timers?
A splash-proof touchscreen in the kitchen shows recipes step by step and runs several timers. You need Raspberry Pi 4 Model B (4 GB), SanDisk microSD card 32 GB (A1, Class 10), Raspberry Pi 27 W USB-C power supply, Raspberry Pi 7 inch Touch Display 2 and Active buzzer 5 V. It takes 7 steps and about 240 minutes.
- Level
- Intermediate
- Time
- About 240 min
- Parts
- 5
Wiring
| From | To | Why |
|---|---|---|
| Display ribbon | Pi DSI connector and display board | Picture and touch |
| Display power | Pi 5 V and GND pins as the display's guide shows | Power |
| Buzzer + | Pi pin 12 (GPIO18) | Timer alarm |
| Buzzer − | Pi pin 14 (GND) | Ground |
| Pi USB-C | Raspberry Pi power supply | Power |
Code
The recipes live in a small Python dictionary, and the page runs the timers in the browser with a one-second clock. When a timer ends, the browser asks the Pi to sound the buzzer on GPIO18. The server listens only on the Pi itself, so nothing else on your network can reach it. Add recipes to the dictionary, or load them from a file as the next step. Chromium in kiosk mode fills the screen with no address bar. Mount the display away from the stove, where heat, steam and splashes can damage it; use a spill-proof cover or a clear acrylic sheet. Do not touch the screen with wet hands near the power supply, and keep the mains adapter away from the sink. Use the official power supply for the Pi.
# Kitchen recipe screen. Run on the Pi. Install first: sudo apt install -y python3-flask python3-gpiozero
# Save as ~/recipes/app.py and run: python3 app.py (it serves on this Pi only, port 5000)
from flask import Flask, jsonify, render_template_string
from gpiozero import Buzzer
import threading
app = Flask(__name__)
buzzer = Buzzer(18)
RECIPES = {
"Dal": ["Wash 1 cup toor dal", "Pressure cook with turmeric for 4 whistles", "Temper with cumin and garlic", "Simmer 5 minutes"],
"Tea": ["Boil 1 cup water with ginger", "Add tea leaves and cook 2 minutes", "Add milk and boil once", "Strain and serve"],
}
PAGE = """
<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width">
<style>
body{font-family:sans-serif;background:#111;color:#eee;margin:0;padding:12px}
button{font-size:24px;padding:14px 22px;margin:6px;border-radius:10px;border:0}
.step{font-size:34px;margin:18px 0}
.timer{display:inline-block;margin:8px;padding:10px 16px;background:#333;border-radius:10px;font-size:28px}
</style></head><body>
<div id="menu"></div><div id="view"></div><div id="timers"></div>
<script>
var recipes = {{ recipes|tojson }};
var timers = [], step = 0, current = null;
function menu(){
var h = "";
for (var name in recipes) h += "<button onclick=\"openRecipe('" + name + "')\">" + name + "</button>";
document.getElementById("menu").innerHTML = h;
}
function openRecipe(n){ current = n; step = 0; show(); }
function show(){
if (!current) return;
var s = recipes[current];
document.getElementById("view").innerHTML = "<div class='step'>" + (step + 1) + "/" + s.length + ": " + s[step] + "</div>" +
"<button onclick='step=Math.max(0,step-1);show()'>Back</button><button onclick='step=Math.min(" + (s.length - 1) + ",step+1);show()'>Next</button>" +
"<button onclick='addTimer(60)'>+1 min</button><button onclick='addTimer(300)'>+5 min</button><button onclick='addTimer(600)'>+10 min</button>";
}
function addTimer(sec){ timers.push({left: sec, done: false}); draw(); }
function draw(){
var h = "";
for (var i = 0; i < timers.length; i++) {
var t = timers[i], m = Math.floor(t.left / 60), s = t.left % 60;
h += "<span class='timer'>" + (t.done ? "DONE" : m + ":" + (s < 10 ? "0" : "") + s) + " <a href='#' onclick='timers.splice(" + i + ",1);draw();return false'>x</a></span>";
}
document.getElementById("timers").innerHTML = h;
}
setInterval(function(){
for (var i = 0; i < timers.length; i++) {
var t = timers[i];
if (!t.done && --t.left <= 0) { t.done = true; t.left = 0; fetch("/beep"); }
}
draw();
}, 1000);
menu();
</script></body></html>
"""
@app.route("/")
def home():
return render_template_string(PAGE, recipes=RECIPES)
@app.route("/beep")
def beep():
threading.Thread(target=lambda: buzzer.beep(0.3, 0.2, n=5)).start()
return jsonify(ok=True)
if __name__ == "__main__":
app.run(host="127.0.0.1", port=5000) # only this Pi can open it, so nobody on the network can
# Start Chromium full screen at login. With the current desktop (labwc), add to ~/.config/labwc/autostart:
# python3 /home/pi/recipes/app.py &
# chromium-browser --kiosk --noerrdialogs --disable-infobars http://127.0.0.1:5000 &
# (older desktops use ~/.config/lxsession/LXDE-pi/autostart; check your image's documentation)Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Open a recipe | Steps appear large |
| Next and Back | Move through the steps |
| Add a timer | Counts down, buzzer when done |
| Reboot | Opens straight to the menu |
If it does not work
Blank page
Check the Flask app is running on port 5000.
No buzzer
Check GPIO18 and the buzzer polarity.
Touch off by an offset
Check the display's rotation setting.
Kiosk not starting
Check the autostart file for your desktop.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the kitchen recipe screen with timers?
Raspberry Pi 4 Model B (4 GB), SanDisk microSD card 32 GB (A1, Class 10), Raspberry Pi 27 W USB-C power supply, Raspberry Pi 7 inch Touch Display 2 and Active buzzer 5 V.
How long does the kitchen recipe screen with timers take to build?
About 240 minutes for a intermediate maker, in 7 steps.
How do I know the kitchen recipe screen with timers works?
Open a recipe: Steps appear large. Next and Back: Move through the steps. Add a timer: Counts down, buzzer when done.
Blank page: what should I check?
Check the Flask app is running on port 5000.
No buzzer: what should I check?
Check GPIO18 and the buzzer polarity.
Touch off by an offset: what should I check?
Check the display's rotation setting.
Kiosk not starting: what should I check?
Check the autostart file for your desktop.
