Search

I’ve been looking into methods of time management that may help me be more productive, my biggest issue is getting distracted by shiny things, interesting articles or the latest topic of intense debate amongst my friends on Facebook.  Someone suggested I take a look at something called Pomodoro, the simple premise is you concentrate on your task for 25 minutes solid then have 5 minutes to do whatever you want, rinse and repeat.

I’ve been trying various tools to assist and when stuck at a set of traffic lights on the way home realised that a device that sits on my desk and changes colour may be the best bet, I’m a person who responds strongly to visual stimulus after all.  To that end I threw together a simple timer using .NET Gadgeteer that is currently sitting on my desk, I’ll try it for a few days and if it works I’ll build something more permanent.

The idea is simple and follows this logic;

  1. If in a work period the light is red
  2. If in a rest period the light is green
  3. If at the end of an interval the light flashes orange

Here is a screen grab of the modules as connected and you can find the code below.  Please note that the reason it says “GT.Colour.Purple” is because for reasons unknown that displays as Orange from my LED module.  I assume that the definition of Orange is true for displaying on the screen but that the RBG LED uses different values, this isn’t uncommon.

Pomodoro Timer

 

using Microsoft.SPOT;

using GT = Gadgeteer;
using Gadgeteer.Modules.GHIElectronics;

namespace Pomodoro
{
    public partial class Program
    {
        //  default starting state is not working
        public bool working = false;
        public GT.Timer work_timer = new GT.Timer(60000);

        // these periods give the time in minutes for each period
        public int work_period =  25;
        public int rest_period =  5;
        public int time_remaining = 0;

        void ProgramStarted()
        {
            //  Attach event handlers for the timer and button
            button.ButtonPressed += new Button.ButtonEventHandler(button_ButtonPressed);
            work_timer.Tick +=new GT.Timer.TickEventHandler(work_timer_Tick);

            //  Blink LED to get attention
            led.BlinkRepeatedly(GT.Color.Purple);

            Debug.Print("Program Started");
        }

        void button_ButtonPressed(Button sender, Button.ButtonState state)
        {
            //  Button press either starts a work interval or resets to the interim state
            if (working)
            {
                working = false;
                work_timer.Stop();
                led.BlinkRepeatedly(GT.Color.Orange);
            }
            else
            {
                working = true;
                time_remaining = work_period;
                led.TurnRed();
                work_timer.Start();
            }
        }

        void work_timer_Tick(GT.Timer timer)
        {
            //  Timer ticks onces per minute
            time_remaining -= 1;
            Debug.Print("Time remaining: " + time_remaining.ToString() +
                " intervals");

            //  If counter = zero, either enter rest or interim period
            if (time_remaining == 0)
            {
                if (working)
                {
                    working = false;
                    led.TurnGreen();
                    time_remaining = rest_period;
                }
                else
                {
                    led.BlinkRepeatedly(GT.Color.Purple);
                    work_timer.Stop();
                }
            }
        }
    }
}

 

If you build one of these and put it in an enclosure put a link in the comments and I’d be happy to update the post with details of your project.  A photo of my finished prototype sitting between my monitors can be seen below.  The stand is from an old webcam, the button is wrapped around the base and the LED tied to the top.  Not bad for the time it took and it’s already working wonders for my focus.  Simple but effective.

Pomodoro Timer Prototype

Enjoy,
Keegan