Build a Customizable Pomodoro Timer
2023-01-25 | By Don Wilcher
License: See Original Project Raspberry Pi
Many well-being and productivity tools are available for smartphones, tablets, and more. A popular technique used to assist in time management is called Pomodoro, and the digital productivity tool created for time management is the Pomodoro Timer.
A Pomodoro timer
Software developer and entrepreneur Francesco Cirillo created the Pomodoro Technique: Cirillo wanted an approach to organizing his study schedule when he was a university learner. He developed the Pomodoro technique to help him study for a sociology exam, with the hopes of improving his focus. Cirillo observed that studying in 25-minute increments or chunks helped improve his focus on learning the subject effectively.
Pomodoro Timers remain a popular productivity tool today, so - how can you build your own Customizable Pomodoro Timer?
A Customizable Pomodoro Timer (CPT): Use Case and BOM
The objective of the Pomodoro Timer is to improve learning focus and develop efficient study habits in 25-minute increments. It also provides assistive technology to allow a hearing or visually impaired learner the ability to use the programmable productivity tool. You can even customize the background for an aesthetically pleasing look while the timer operates!
For this project, we’ll use an audible voice and visual indicator within a Pomodoro Timer using Scratch, a software package allowing the described design features to be easily prototyped. Scratch 3 for the Raspberry Pi allows external electronic devices like sensors, LEDs, or small DC motors to be attached using the appropriate interfacing circuits.
We’ve included a very hi-tech drawing to show the basic idea of this project.
A Customizable Pomodoro Timer (CPT)
As observed in the image above, the primary physical components of the CPT consist of a Raspberry Pi (version 3 or 4B), a Pi SenseHAT, and an LED circuit. The joystick is soldered on the SenseHAT’s printed circuit board (PCB).
Check out the circuit diagram and parts list for this project below, and let’s get started with making this project!
Assembly of the CPT Hardware
To get started, take the SenseHAT and place it on top of the Raspberry Pi. A stacking header is required to ensure the Raspberry Pi’s dual 40-pin male header can electrically connect or interface with the SenseHAT’s populated PCB electronic circuits. The stacking header allows the SenseHAT to mate with Raspberry Pi properly. The header has extendable dual male pins, which allow jumper wires or a Pi T Cobbler breakout board to be electrically attached.
Adafruit Raspberry Pi stacking header
Next, carefully insert the extendable pins through the SenseHAT copper-plated PCB pads. The SenseHAT will sit on top of the Raspberry Pi, and the stacking header pins will protrude through the SenseHAT’s copper-plated PCB pads.
Placement and alignment of the SenseHAT with the Raspberry PI
The SenseHAT-Raspberry Pi assembly will be electrically attached to the Pi T-Cobbler with a flat ribbon cable.
Attachment of the SenseHAT to the Pi T-Cobbler
You will then use the Pi-T Cobbler to wire an LED indicator circuit to the Raspberry Pi GPIO17 pin.
Pi T-Cobbler LED indicator circuit
The CPT electronic circuit schematic diagram
Once these steps have been followed, you will have completed the hardware build phase of the CPT project!
To ensure the electrical interface between the Raspberry Pi, the SenseHAT, and the Pi T-Cobbler LED indicator circuit is working properly, you may interact with the optoelectronic component using the Scratch Extension package. The Raspberry Pi Simple Electronics extension package allows control of the LED indicator by switching or toggling GPIO17.
To do this, open Scratch 3 on your Raspberry Pi. Click on the Extension Package icon located on the left bottom of the visual programming code block palette, and then select the Raspberry Pi Simple Electronics extension package to install the general-purpose input-output (GPIO) programming code blocks to the Scratch visual instruction palette.
Selecting the Raspberry Pi Simple Electronics code blocks
The GPIO extension package will be added to your code blocks palette. Next, select and place the toggle LED pin code block into the visual programming environment. Click the small down arrow to select the number 17. This number is a reference to GPIO17.
The toggle LED pin code block
To test the LED indicator circuit, click the code block with your mouse. The LED should turn ON. Select the code block to turn OFF the LED. Check the circuit's electrical wiring if the LED does not turn ON or OFF.
The final step of the assembly project includes building the CPT control software using the Scratch visual programing language. Let’s get working on that now!
The assembled and functional CPT with LED indicator
CPT Software Build
While we’re working with 25-minute timing periods for our Pomodoro timer, the Scratch does not have a minute code block. You will need to convert minutes to seconds using the following method. Here is the conversion equation that will give the time needed for the software:
Minutes to seconds conversion method
You will use this value within the set timer () code block instruction, but first, you’ll need to add the Text to Speech and the SenseHAT extension packages to the Scratch programming environment. The Text to Speech extension package will allow the software application to speak the Task Started and Task Completed messages.
The SenseHAT extension package will have a scrolling timer and a joystick switch feature added to the CPT software. Use the same approach for adding the Text to Speech and SenseHAT extension packages. With the extension packages included within the coding block palette, build the CPT software using the Scratch visual programming code shown next.
The CPT Scratch visual programming software
When the joystick is pressed, a click of a small microswitch contact will be heard. The Task Started message will be announced through a speaker attached to the Raspberry Pi’s audio jack. The SenseHAT will scroll the Pomodoro timer value on the LED matrix. When the CPT reaches 0.8 seconds, the Task Completed message will be announced. The green LED will turn ON, and the CPT value will be reset. The green LED will turn OFF when starting a new Pomodoro event with the joystick. The new Pomodoro timer value will proceed to scroll on the LED matrix.
The CPT scrolling timer value
There’s plenty more customization you can do here: for example, a backdrop image can be imported into Scratch and displayed when the Pomodoro timing event is completed. Make sure to play around with this system and let us know what your personal timer looks like and tell us if it’s helping with your productivity! Whether it’s for school, work, or just for fun, this timer can make a huge difference in how you approach tasks and get things done.
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum