Hugo Blanc
Published

Pomodoro Timer with an Arduino and an LCD Screen

Looking for more productivity, here is how to make a simple pomodoro timer prototype with LEDs and an LCD screen.

BeginnerShowcase (no instructions)1 hour5,425
Pomodoro Timer with an Arduino and an LCD Screen

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Jumper wires (generic)
Jumper wires (generic)
×1
LED (generic)
LED (generic)
×2
LCD screen
×1
10k ohm potentiometer
×1
Resistor 220 ohm
Resistor 220 ohm
×3

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

pomodoro_timer

C/C++
Just push it to your arduino !
#include <LiquidCrystal.h>

/*MODIFY THOSE VALUES TO ADAPT THE TIMER*/
const int WORK_TIME_MIN = 15;
const int REST_TIME_MIN = 5;

/*LCD INITIALISATION*/
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

/*VARIABLES*/
signed short minutes, secondes, types;
signed short periodType = 0; // periodType == 0 : work time; periodType == 1 : rest time
char timeline[16];

void setup() {
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);
  lcd.begin(16, 2);
  lcd.print("Time spent :");

  digitalWrite(6, LOW);
  digitalWrite(7, HIGH);
}

void loop() {

  lcd.setCursor(0, 1);
  sprintf(timeline, "%0.2d mins %0.2d secs", minutes, secondes);
  lcd.print(timeline);

  delay(1000);
  secondes++;

  if (secondes == 60)
  {
    secondes = 0;
    minutes ++;
  }
  /*PASSAGE TRAVAIL VERS REPOS*/
  if ((minutes == WORK_TIME_MIN) && (periodType == 0)) /*15*/
  {
    minutes = 0;
    periodType = 1;
    digitalWrite(6, HIGH);
    digitalWrite(7, LOW);
  }

  /*PASSAGE REPOS VERS TRAVAIL*/
  else if ((minutes == REST_TIME_MIN) && (periodType == 1)) /*5*/
  {
    minutes = 0;
    periodType = 0;
    digitalWrite(6, LOW);
    digitalWrite(7, HIGH);
  }

}

Credits

Hugo Blanc

Hugo Blanc

4 projects • 11 followers
Student learning computer science and electronics {thinks out of the brackets}

Comments