Some days are worse than other. On these bad days you don’t feel like working, people are constantly interrupting and, in general, not much is being done. When I have a day like this I use the Pomodoro technique to get back on track. The basic idea of the Pomdoro technique is that you try to focus solely on your work for 25 minutes minimizing all external and internal interruptions. You measure the time using a tomato shaped kitchen timer and hence the name – Pomodoro. Using the actual Pomodoro timer might seem like a good idea at first but in reality is not. The timer is ticking quite loudly which is annoying not only for you but also for people around. Using a software timer (I tried http://timemanage.me/) did not work for me either – other people can’t see it so it is impossible for them to know you are in the middle of your Pomodoro. On top of that you can’t check how much time is left without switching windows and losing focus which contradicts the very goal of Pomodoro (i.e. avoiding interruptions). This is why I decided to build my own Pomodorro timer. The requirements were simple – the timer had to be standalone so that I could check how much time is left with just one glimpse. To help prevent from external interruptions it also needed an indicator showing other people that I am busy. Meeting the first requirement was quite simple – a TM1637 based 4-digit LED display seemed good enough for the job. The second one was a bit harder. I got a little creative and bought a mood enhancing light (you should have seen my wife’s face when I showed her what I ordered) on Amazon. Now, that I got two most important parts the rest of the project was quite easy. I needed a few more parts like Arduino board (I went with Arduino Nano because of its size), a button (needed for restarting the timer), a color LED (to light my cube to indicate when I am busy) a small breadboard and a handful of resistors and jumper cables. This is the end result:
This project is quite easy but is really fun. You can try building a timer like this yourself. First connect the parts as shown on this picture:
Once the hardware part is done you need to upload the code to control the circuit. You can find the sketch in my ArduinoPomodoroTimer github repo. The most complicated part of the code is setting up the interrupt handler. I took it from my other project where I built a digital clock using an LCD display from an old Nokia phone. Take a look at this post for more details. Another complex piece is handling the LED display. Again, I wrote a very detailed post on this very subject a while ago so take a look at it to understand the code. The rest of the code is just about changing the color of the LED when the timer reaches 0 and reacting to button presses and is pretty straightforward.
Happy Pomodoring (is it even a word?)!
Hello. I have found your article with this awesome countdown with the TM1637 and I have a question for you. Is it possible to speed up the countdown in any way, for example with button actions?
Thanks in advance and regards.
LikeLike
Sure it is possible. The clock is set to tick every millisecond. Each time it ticks a counter is decremented until it reaches 0 (https://github.com/moozzyk/ArduinoPomodoroTimer/blob/master/ArduinoPomodoroTimer/ArduinoPomodoroTimer.ino#L86). To speed up the clock you would have to decrease the timer by more than one.
Hope this helps,
Pawel
LikeLike
Sure! I am testing with the code and interactuating with a push button to do it. I think is a interesting experiment.
Thanks and regards
LikeLike
I try to use timer for hour & minutes instead min&sec. and use switch not only to start Pomodoro timer but freeze time when switch is off.
To do first condition I’ve changed 2 values exp.:
const unsigned long sprintDuration = 36000000; // 25 minutes=1500000 for t=1000
unsigned long t = (unsigned long)(time/1000); // default 1000 t=1s, for 60000 t-1min
but if I do that, double dots flashing not every sec. but min. Code is clear form me only a little bit and I do not know how to do that – any suggest please.
Is it possible to stop counting if switch is changing from position on to off & start again as switch is next on?
thank You for any suggest
LikeLike
On this line: https://github.com/moozzyk/ArduinoPomodoroTimer/blob/master/ArduinoPomodoroTimer/ArduinoPomodoroTimer.ino#L127
the `(seconds & 0x01) << 7` is responsible for blinking the dot. You can see that on odd seconds the leftmost bit is set and on even seconds it is cleared. This bit turns on and off the dot.
It is certainly possible to stop counting. Just don't decrement time on this line when/if you want to stop the count down: https://github.com/moozzyk/ArduinoPomodoroTimer/blob/master/ArduinoPomodoroTimer/ArduinoPomodoroTimer.ino#L86
Hope this helps,
Pawel
LikeLike
Hello, I love what you’ve done, I think it’s a fun project and easy for beginners. I’m actually a beginner myself and I was wondering if you could use this same design and code on the Arduino Nano Every?
I’ve tried already and there seams to be a problem with the code somewhere around lines 45 to 73. I would really appreciate your help, thank you.
LikeLike
I have not tried this with Arduino Nano Every so am not sure why it does not work. This thread https://forum.arduino.cc/t/nano-vs-nano-every/622834 claims that:
“The Nano Every and Uno WiFi Rev 2 use a modern version of the AVR based MCU (…) the MCU peripherals configuration is very different then in the classic ATmegas.”
I am not sure if this can be the reason but it is a possibility. Here is another thread on timers in Arduino Nano Every that might help:
https://forum.arduino.cc/t/arduino-every-timer-interrupts/605677/10
LikeLike
I’ll for sure test this and read the articles. I very much appreciate your response. Thanks.
LikeLiked by 1 person