Introduction: MKT, the Multi-Kitchen-Timer
One of my friends, who owns a pizzeria, had a problem with the number of thinks he had to account for in the kitchen. The time needed to cook the fries was different from the time needed to cook the onion rings, and so on. So he came to me with this request:
"Hey Mike, could you build from scratch a module with 4 timers that would be independent and programmable?"
So that was my challenge.
Since I know a bit of Python and how to use à Raspberry Pi, this looked like the obvious choice to start. The Raspberry pi zero W is inexpensif and is quite versatile.
Add to that, Adafruit 7 segment digits, some push buttons, a piezo buzzer and "voilà" the MKT is born.
First of all, a crude schematic
Step 1: Part List
So to make it happen, here is a list of what your going to need
- 1 X Raspberry Pi W
- 4 X Adafruit 7segment LED I2C
- 5 X Pushbutton black
- 4 X Pushbutton red
- 1 X yellow led
- 1 X Led mounting bracket
- 1 X USB micro cable
- 1 X 10W phone adaptor
- 1 X 3vdc Piezo buzzer
- Multiples GPIO cables
- 1 X hammond houzing (don't use metal if you want the wifi to work)
Step 2: Building the Hardware Part
Equipped with a drill and a Dremel, I started to cut all the wholes I needed to accomodate the 7 segment displays, the power led and all the control buttons.
It took me a while, but I'm pretty satisfied with the result.
OK, cas close (ha ha) so now the goal is to make it a permanent thing, so I decided to skip the breadboard part and I soldered all the components directly together.
So on the second picture I recreated the schematic design with the Raspberry Pi, th GPIO cables, the timers and the buttons.
Pretty messy !
But it works!
Step 3: The Python Code Behind the Pretty Face ;-)
For the code, I did a couple of test with 2 alternative way to work with buttons.
Works OK. You need to make a loop to see if buttons are pressed.
Pros : Simple, quite fast, easy to implement
Cons : If you are not checking at the correct time, you won't know for sure is a button was pressed
Raspberry Pi now support interrupts, that even takes care of bouncing (Bouncing may happen with mecanical buttons and send false signal to the Pi)
Pros : Simple, really fast, won't miss a press,
Cons: Harder to implement and control
I also had to use Python Threading capabilities. Threading is a nice way to deal with actions that need to happen simultaneously, like the pressing of a button, the starting of a counter and the beeping of a buzzer at the same time.
The good news is that both the polling program and the interrupt one use the threading code
Step 4: Final Result
And here it is, the MKT, working with all the bells and whistles !!!