Project tutorial
Pomodoro Timer Using Arduino

Pomodoro Timer Using Arduino © CC BY

Arduino based Pomodoro timer to increase your productivity and to manage time efficiently.

  • 2,408 views
  • 0 comments
  • 3 respects

Components and supplies

Ph a000066 iso (1) ztbmubhmho
Arduino UNO
×1
09590 01
LED (generic)
I have chosen three 3 mm yellow LEDs and four 3mm orange LEDs
×7
Adafruit industries ada1536 image
Buzzer
×1
Omron b3f 1000 image 75px
SparkFun Pushbutton switch 12mm
×1
Mfr 25frf52 1k sml
Resistor 1k ohm
you may use resistor values ranges from 220 ohm to 1 K Ohm for LEDs and buzzer ,and 1K to 10 K Ohm resistor as pull up resistor for push button.
×9
Perfboard
×1
Pec36sfcn sml
Male-Header 36 Position 1 Row- Long (0.1")
×1

Necessary tools and machines

09507 01
Soldering iron (generic)
4966285
Solder Wire, Lead Free

Apps and online services

About this project

The Pomodoro technique is a time management methodology that combines task-driven planning with periods of focused time broken up with short rest periods.

The Idea:

Me and my friend Febin were casually discussing about techniques that saves time and makes us more productive.So we found out that there is a technique called "Pomodoro Technique".On short the techniques is to focus on only one task for 25 minutes then take a break of 5 minutes.So we decided to make its hardware version using Arduino.

So we made Pomodoro system with the following functionalities:

There are 3 modes of operation

1.Work mode(duration of 25 minutes)

2.Short Break mode(duration of 5 minutes)

3.Long break mode(duration of 20 minutes)

  • There are 4 LEDs to represent number of pomodoros completed

(one pomodoro = 1 complete work mode)

  • There are 3 LEDs to represent current mode(work mode (or) short break mode (or) long break mode)
  • after 4 pomodoros there will be a long break(duration of 20 minutes)
  • Push button is used to start the pomodoro timer or to restart(after long break mode)
  • Buzzer for indicating, start and end of, short break mode and long break mode

Video:

Schematics:

The circuit:

  • one leg of push button is attached to pin 2, from the same leg, by using a 10 kilo ohm resistor(you can use resistor values ranges from 1 to 10 K Ohm) connect to +5 V(pull up externally), and push button's other leg is connected to ground.
  • Connect cathode of buzzer and cathode all LEDs to GND of Arduino
  • buzzer is connected to pin using a 1 k ohm resistor
  • workPeriodLED is connected to pin 4 using a 1 k ohm resistor
  • shortBreakLED is connected to pin 5 using a 1 k ohm resistor
  • longBreakLED is connected to pin 6 using a 1 k ohm resistor
  • pom1LED is connected to pin 7 using a 1 k ohm resistor
  • pom2LED is connected to pin 8 using a 1 k ohm resistor
  • pom3LED is connected to pin 9 using a 1 k ohm resistor
  • pom4LED is connected to pin 10 using a 1 k ohm resistor

Note:

The current limiting resistor values can range from 220 ohm to 1 kilo ohm

  • workPeriodLED - to represent work mode
  • shortBreakLED - to represent short break mode
  • longBreakLED - to represent longbreak mode
  • pom1LED, pom2LED, pom3LED, pom4LED - to represent number of pomodoros completed

Prototype:

Components Used:

you need to build a shield for Arduino using perfboard, so you can insert it or remove easily.

FEW HOURS LATER...(soldering time....)

Once the hardware part is done you need to upload the code to control the circuit. You can find the sketch in github repo.

The Delay() Function:

In the Arduino sketch, delay function is used for provide timing,

The way the Arduino delay() function works is pretty straight forward.

It accepts a single integer as an argument. This number represents the time in milliseconds the program has to wait until moving on to the next line of code.

delay() is a blocking function, but in our case this can be used to full fill our requirement.

Below is the code for the Pomodoro timer – have a read through the inline comments, as they explain what each step of the code is doing.

/* Pomodoro Timer using Arduino
* ---------------------------
*
* There are 3 modes of operation
* 1.Work mode(duration of 25 minutes)
* 2.Short Break mode(duration of 5 minutes)
* 3.Long break mode(duration of 20 minutes)
* There are 4 LEDs to represent number of pomodoros completed (one pomodoro = 1 complete work mode)
* There are 3 LEDs to represent mode(work mode (or) short break mode (or) long break mode)
* after 4 pomodoro there will be a long break
* one push button for start the pomodoro or to restart(after long break mode)
* Buzzer for indicating start and end of short break mode and long break mode
* As each mode works based on delay function use inbuilt reset button on arduino to restart the pomodoro(if required)
*
* The circuit:
- pushbutton is attached to pin 2,push button's other leg is connected to ground.
- 10K resistor attached to pin 2 from +5v(externally pulled up)
- buzzer is connected to pin 3
- workPeriodLED is connected to pin 4
- shortBreakLED is connected to pin 5
- longBreakLED is connected to pin 6
- pom1LED is connected to pin 7
- pom2LED is connected to pin 8
- pom3LED is connected to pin 9
- pom4LED is connected to pin 10
*
*
*
* Created 14 July 2020
* by Febin Joseph and Amal Mathew
*/

#define work 0
#define shortBreak 1
#define longBreak 2

int state = work;
int counter = 0;

// constants won't change. They're used here to set pin numbers:
const int buttonPin = 2; // the number of the pushbutton pin

const int buzzer = 3; // buzzer to arduino pin 3
const int workPeriodLED = 4; // Work Period indication LED to arduino pin 4
const int shortBreakLED = 5; // Short Break period indication LED to arduino pin 5
const int longBreakLED = 6; // Long Break Period indication LED to arduino pin 6

//Indication for number of Pomodoros completed
const int pom1LED = 7;
const int pom2LED = 8;
const int pom3LED = 9;
const int pom4LED = 10;

void setup() {
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);

// initialize following pins as outputs:
pinMode(buzzer, OUTPUT); // Set buzzer - pin 3 as an output
pinMode(workPeriodLED, OUTPUT); // pin 4 as an output
pinMode(shortBreakLED, OUTPUT); // pin 5 as an output
pinMode(longBreakLED, OUTPUT); // pin 6 as an output
pinMode(pom1LED, OUTPUT); // pin 7 as an output
pinMode(pom2LED, OUTPUT); // Pin 8 as an output
pinMode(pom3LED, OUTPUT); // pin 9 as an output
pinMode(pom4LED, OUTPUT); // pin 10 as an output

while(digitalRead(buttonPin) == 1); //Wait until Push button is pressed to start pomodoro timer
}

void loop() {
if(state == work){
workMode();
}
if(state == shortBreak){
shortBreakMode();
}
if(state == longBreak){
longBreakMode();
}
}

void workMode(void){
pomodoroStatus();
digitalWrite(workPeriodLED, HIGH);
digitalWrite(shortBreakLED, LOW);
digitalWrite(longBreakLED, LOW);
delay(1500000); //25 minutes delay , 25*60 seconds *1000 , 1 second = 1000 millisecond
counter++;
if(counter <= 3){
state = shortBreak; //once workmode is completed move to short break
}

if(counter == 4){
state = longBreak;
}
}

void shortBreakMode(void){
pomodoroStatus();
digitalWrite(workPeriodLED, LOW);
digitalWrite(shortBreakLED, HIGH);
digitalWrite(longBreakLED, LOW);
digitalWrite(buzzer, HIGH);
delay(1000);
digitalWrite(buzzer, LOW);
delay(298000); //around 5 minutes
digitalWrite(buzzer, HIGH);
delay(1000);
digitalWrite(buzzer, LOW);
if(counter<=3){
state = work;
}

}

void longBreakMode(void){
pomodoroStatus();
digitalWrite(workPeriodLED, LOW);
digitalWrite(shortBreakLED, LOW);
digitalWrite(longBreakLED, HIGH);
digitalWrite(buzzer, HIGH);
delay(1000);
digitalWrite(buzzer, LOW);
delay(1198000); //around 20 minutes ‬
digitalWrite(buzzer, HIGH);
delay(1000);
digitalWrite(buzzer, LOW);
//Turn on all LEDs to represent 4 pomodoros has completed completed
digitalWrite(workPeriodLED, HIGH);
digitalWrite(shortBreakLED, HIGH);
digitalWrite(longBreakLED, HIGH);
while(digitalRead(buttonPin) == 1); //once 4 pomodoro is over , restart pomodoro timer by pressing push button
//reset all variables and move to workmode
counter = 0;
state = work;

}

//This function is used to represent number of pomodoros
void pomodoroStatus(void){
if(counter == 0){
digitalWrite(pom1LED, LOW);
digitalWrite(pom2LED, LOW);
digitalWrite(pom3LED, LOW);
digitalWrite(pom4LED, LOW);

}
if(counter == 1){
digitalWrite(pom1LED, HIGH);
}
if(counter == 2){
digitalWrite(pom1LED, HIGH);
digitalWrite(pom2LED, HIGH);
}
if(counter == 3){
digitalWrite(pom1LED, HIGH);
digitalWrite(pom2LED, HIGH);
digitalWrite(pom3LED, HIGH);
}
if(counter ==4){
digitalWrite(pom1LED, HIGH);
digitalWrite(pom2LED, HIGH);
digitalWrite(pom3LED, HIGH);
digitalWrite(pom4LED, HIGH);
}

}

1 hour 37 minutes were saved using the pomodoro technique in the making of this project 😄

Happy Pomodoring (is it even a word?)!

-

Code

Pomodoro Timer using Arduino Arduino
/* Pomodoro Timer using Arduino
 * ---------------------------
 *
 * There are 3 modes of operation  
 * 1.Work mode(duration of 25 minutes)
 * 2.Short Break mode(duration of 5 minutes)
 * 3.Long break mode(duration of 20 minutes)
 * There are 4 LEDs to represent number of pomodoros completed (one pomodoro = 1 complete work mode)
 * There are 3 LEDs to represent mode(work mode (or) short break mode (or) long break mode)
 * after 4 pomodoro there will be a long break
 * one push button for start the pomodoro or to restart(after long break mode)  
 * Buzzer for indicating start and end of short break mode and long break mode 
 * As each mode works based on delay function  use inbuilt reset button on arduino  to restart the pomodoro(if required) 
 *
 *  The circuit:
  - pushbutton is attached to pin 2,push button's other leg is connected to ground. 
  - 10K resistor attached to pin 2 from +5v(externally pulled up)
  - buzzer is connected to pin 3 
  - workPeriodLED is connected to pin 4 
  - shortBreakLED is connected to pin 5 
  - longBreakLED is connected to pin 6 
  - pom1LED is connected to pin 7 
  - pom2LED is connected to pin 8 
  - pom3LED is connected to pin 9 
  - pom4LED is connected to pin 10 
 *
 *
 *
 * Created 14 July  2020
 * by Febin Joseph and Amal Mathew
 */

#define work 0
#define shortBreak 1
#define longBreak 2

int state = work;
int counter = 0;

// constants won't change. They're used here to set pin numbers:
const int buttonPin = 2;               // the number of the pushbutton pin

const int buzzer = 3;                  // buzzer to arduino pin 3
const int workPeriodLED = 4;           // Work Period indication LED to arduino pin 4
const int shortBreakLED = 5;           // Short Break period indication LED to arduino pin 5
const int longBreakLED  =  6;          // Long Break Period indication LED to arduino pin 6

//Indication for  number of Pomodoros completed
const int pom1LED =   7;                 
const int pom2LED =   8;
const int pom3LED =   9;
const int pom4LED =   10;

void setup() {
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT);
  
  // initialize following pins as  outputs:
  pinMode(buzzer, OUTPUT);              // Set buzzer - pin 3 as an output
  pinMode(workPeriodLED, OUTPUT);       // pin 4 as an output
  pinMode(shortBreakLED, OUTPUT);       // pin 5 as an output
  pinMode(longBreakLED, OUTPUT);        // pin 6 as an output
  pinMode(pom1LED, OUTPUT);             // pin 7 as an output
  pinMode(pom2LED, OUTPUT);             // Pin 8 as an output
  pinMode(pom3LED, OUTPUT);             // pin 9 as an output
  pinMode(pom4LED, OUTPUT);             // pin 10 as an output
  
  while(digitalRead(buttonPin) == 1);    //Wait until Push button is pressed to start pomodoro timer 
}

void loop() {
  if(state == work){
    workMode(); 
  }
  if(state == shortBreak){
    shortBreakMode();
  }
  if(state == longBreak){
    longBreakMode();
  }
}

void workMode(void){
  pomodoroStatus();
  digitalWrite(workPeriodLED, HIGH);
  digitalWrite(shortBreakLED, LOW);
  digitalWrite(longBreakLED, LOW);
  delay(1500000);          //25 minutes delay ,  25*60 seconds *1000   , 1 second = 1000 millisecond 
  counter++;
  if(counter <= 3){
    state = shortBreak;      //once workmode is completed move to short break
  }
   
  if(counter == 4){
    state = longBreak;
  }
}

void shortBreakMode(void){
  pomodoroStatus();
  digitalWrite(workPeriodLED, LOW);
  digitalWrite(shortBreakLED, HIGH);
  digitalWrite(longBreakLED, LOW);
  digitalWrite(buzzer, HIGH);
  delay(1000);
  digitalWrite(buzzer, LOW);        
  delay(298000);   //around 5 minutes  
  digitalWrite(buzzer, HIGH);
  delay(1000);
  digitalWrite(buzzer, LOW);
  if(counter<=3){
    state = work;
  }

}

void longBreakMode(void){
  pomodoroStatus();
  digitalWrite(workPeriodLED, LOW);
  digitalWrite(shortBreakLED, LOW);
  digitalWrite(longBreakLED, HIGH);
  digitalWrite(buzzer, HIGH);
  delay(1000);
  digitalWrite(buzzer, LOW);
  delay(1198000);     //around 20 minutes    ‬
  digitalWrite(buzzer, HIGH);
  delay(1000);
  digitalWrite(buzzer, LOW);
  //Turn on all LEDs to represent 4 pomodoros has completed  completed   
  digitalWrite(workPeriodLED, HIGH);
  digitalWrite(shortBreakLED, HIGH);
  digitalWrite(longBreakLED, HIGH);
  while(digitalRead(buttonPin) == 1);  //once  4 pomodoro is over , restart pomodoro timer  by pressing push button
  //reset all variables and move to workmode 
  counter = 0;
  state = work;  
  
}

//This function is used to represent number of pomodoros 
void pomodoroStatus(void){
  if(counter == 0){
    digitalWrite(pom1LED, LOW);
    digitalWrite(pom2LED, LOW);
    digitalWrite(pom3LED, LOW);
    digitalWrite(pom4LED, LOW);
    
  }
  if(counter == 1){
    digitalWrite(pom1LED, HIGH); 
  }
  if(counter == 2){
    digitalWrite(pom1LED, HIGH);
    digitalWrite(pom2LED, HIGH);
  }
  if(counter == 3){
    digitalWrite(pom1LED, HIGH);
    digitalWrite(pom2LED, HIGH);
    digitalWrite(pom3LED, HIGH);
  }
  if(counter ==4){
    digitalWrite(pom1LED, HIGH);
    digitalWrite(pom2LED, HIGH);
    digitalWrite(pom3LED, HIGH);
    digitalWrite(pom4LED, HIGH);
  }

}

Schematics

Fritzing Files
pomodoro_timer_using_arduino_A8dlz8IHBh.fzz
Bill of Materials
Created Using Fritzing
pomodoro_timer_using_arduino_bom_Mj44LLpx4L.html

Comments

Similar projects you might like

More than an Hour Timer

Project tutorial by Ian Cumming

  • 8,823 views
  • 2 comments
  • 10 respects

Arduino Kitchen Timer

Project tutorial by Team I and myself

  • 76,997 views
  • 47 comments
  • 109 respects

Stopwatch and Lap Timer with Arduino

Project tutorial by LAGSILVA

  • 25,446 views
  • 22 comments
  • 52 respects

Reaction Timer - F1 Style

Project tutorial by LAGSILVA

  • 3,134 views
  • 4 comments
  • 14 respects

Retro View Timer

Project tutorial by yilmazyurdakul

  • 1,969 views
  • 2 comments
  • 3 respects

COVID - 19 Touchless Hand Wash Timer

Project tutorial by Akshay Joseph

  • 4,516 views
  • 1 comment
  • 17 respects
Add projectSign up / Login