0% found this document useful (0 votes)
75 views

Stopwatch and Countdown Timer Using Arduino and LCD

Stopwatch iot with ai

Uploaded by

idalgavearpita31
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views

Stopwatch and Countdown Timer Using Arduino and LCD

Stopwatch iot with ai

Uploaded by

idalgavearpita31
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Title: - Stopwatch and Countdown Timer Using Arduino and LCD

Aim/Objective: - To create a stopwatch and countdown timer application using an


Arduino, an LCD display, and three push buttons for mode selection, start/stop, and
reset functionalities.

Material Required:

• Arduino Uno
• 16x2 LCD with I2C interface
• 3 Push Buttons
• Breadboard and connecting wires

Software Requirements:

1. Arduino IDE (for writing and uploading the code)

Theory:

The Arduino stopwatch and countdown timer operate by reading button inputs and
controlling time functions through the millis() function, which tracks the elapsed time
since the program started. In stopwatch mode, the time is incremented, and in
countdown mode, the time decreases from a preset value (60 seconds). The LCD
displays the time in real-time, allowing the user to interact with the device by starting,
stopping, resetting, and switching modes.

Circuit Diagram

The circuit diagram includes:

• Arduino Uno connected to the LCD through the I2C interface.

• Three push buttons connected to digital pins 7, 8, and 9, with GND connections.

Circuit Explanation:

• The LCD is connected to the Arduino using I2C communication (SDA and SCL
pins).

• Three buttons are connected to digital pins 7, 8, and 9 of the Arduino. These
buttons allow switching between stopwatch and countdown timer modes,
starting/stopping the timer, and resetting the timer.

• The buttons use pull-up resistors (or Arduino's internal pull-up) to ensure proper
functionality.
Procedure:

1. Set up the Hardware:

o Connect the 16x2 LCD to the Arduino using the I2C interface.

▪ SDA pin of the LCD to A4 of Arduino.

▪ SCL pin of the LCD to A5 of Arduino.

▪ VCC and GND to 5V and GND on the Arduino.

o Connect the three push buttons to digital pins 7, 8, and 9 of the Arduino.

▪ Button 1 (Mode Select) → Pin 7.

▪ Button 2 (Start/Stop) → Pin 8.

▪ Button 3 (Reset) → Pin 9.

o Connect each button to GND using one side of the breadboard and use
internal pull-up resistors in the code.

2. Upload the Code:

o Connect the Arduino to your computer via USB.

o Open the Arduino IDE, paste the provided code, and upload it to the
Arduino board.

3. Testing the Stopwatch:

o The LCD will display “Mode: Stopwatch” initially.

o Press the Start/Stop button to begin the timer, which will increment in
seconds on the LCD.
o Press the Start/Stop button again to pause the stopwatch.

o Use the Reset button to reset the stopwatch to zero.

4. Testing the Countdown Timer:

o Press the Mode Select button to switch to Countdown Timer mode.

o The LCD will display “Mode: Countdown” with the default countdown set
to 60 seconds.

o Press the Start/Stop button to begin the countdown.

o If the countdown reaches zero, the LCD will display "Time's Up!".

o Use the Reset button to reset the countdown timer to 60 seconds.

5. Repeat: You can alternate between the stopwatch and countdown modes and
test the functionality of the buttons.

Code:
Code Breakdown:

• The lcd object initializes the 16x2 LCD using the I2C protocol.

• Buttons:

o Pin 7: Mode selection (switch between stopwatch and countdown).

o Pin 8: Start/Stop the timer.

o Pin 9: Reset the timer to default.

• Mode: The code toggles between two modes:

o Stopwatch: Measures elapsed time in seconds.

o Countdown Timer: Counts down from 60 seconds.

• The debounce mechanism is used to avoid multiple detections due to button


noise.

Conclusion:

In this experiment, a simple stopwatch and countdown timer were created using
Arduino, an LCD, and push buttons. The system is user-friendly and effectively switches
between two modes, displaying the elapsed or remaining time. This project
demonstrates how basic timing functions and LCD outputs can be controlled using an
Arduino.

You might also like