Skip to content

Add Arduino Pomodoro Timer Project with Code and Documentation #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions Pomodoro Timer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

# Arduino Pomodoro Timer

## Project Overview
This simple project uses an Arduino UNO to create a Pomodoro Timer with LED indicators and a buzzer. It helps users focus by timing 25-minute work sessions and 5-minute breaks. A button is used to start the timer.

## Features
- 25-minute work session
- 5-minute break
- Buzzer alerts at transitions
- LED color changes for work/break

## Components Required
- Arduino UNO
- Red LED
- Green LED
- Buzzer
- Push Button
- 220Ω Resistors
- Breadboard and Jumper Wires

## Circuit Connections

| Component | Arduino UNO Pin |
|--------------|----------------------|
| Red LED | D3 (via 220Ω resistor) |
| Green LED | D4 (via 220Ω resistor) |
| Buzzer | D5 |
| Push Button | D2 (with pull-down resistor) |

## Working Principle
- Press the button to start a 25-minute work session (Red LED on).
- After 25 minutes, the timer switches to a 5-minute break (Green LED on).
- The buzzer alerts the user at each transition.
- After the break, the session ends and the system resets.

## Usage Instructions
1. Connect all components according to the table above.
2. Upload the `pomodoro_timer.ino` sketch to your Arduino UNO.
3. Open the Serial Monitor (9600 baud) for status messages.
4. Press the button to start the Pomodoro timer cycle.

## Author
Created by [KappaNone](https://github.com/KappaNone).

## License
This project is open-source and available for educational and personal use.
77 changes: 77 additions & 0 deletions Pomodoro Timer/pomodoro_timer.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// Arduino Pomodoro Timer Project
// Description:
//
// Arduino Pomodoro Timer
//
// Project Overview
// This simple project uses an Arduino UNO to create a Pomodoro Timer with LED indicators and a buzzer. It helps users focus by timing 25-minute work sessions and 5-minute breaks. A button is used to start the timer.
//
// Features
// - 25-minute work session
// - 5-minute break
// - Buzzer alerts at transitions
// - LED color changes for work/break
//
// Components Required
// - Arduino UNO
// - Red LED
// - Green LED
// - Buzzer
// - Push Button
// - 220Ω Resistors
// - Breadboard and Jumper Wires
//
// Circuit Connections
// Component Arduino UNO Pin
// Red LED D3 (via 220Ω resistor)
// Green LED D4 (via 220Ω resistor)
// Buzzer D5
// Push Button D2 (with pull-down resistor)
//


const int redLED = 3;
const int greenLED = 4;
const int buzzer = 5;
const int button = 2;

bool running = false;
unsigned long startTime = 0;
const unsigned long workTime = 25UL * 60 * 1000; // 25 minutes
const unsigned long breakTime = 5UL * 60 * 1000; // 5 minutes

void setup() {
pinMode(redLED, OUTPUT);
pinMode(greenLED, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(button, INPUT);
Serial.begin(9600);
}

void loop() {
if (digitalRead(button) == HIGH && !running) {
running = true;
startTime = millis();
digitalWrite(redLED, HIGH);
Serial.println("Work started");
tone(buzzer, 1000, 500);
delay(500);
}

if (running) {
unsigned long elapsed = millis() - startTime;

if (elapsed >= workTime && elapsed < workTime + breakTime) {
digitalWrite(redLED, LOW);
digitalWrite(greenLED, HIGH);
Serial.println("Break started");
}

if (elapsed >= workTime + breakTime) {
digitalWrite(greenLED, LOW);
tone(buzzer, 1500, 500);
running = false;
Serial.println("Session complete");
}
}
}