IOT

Stopwatch Using Arduino & LCD with Start, Stop & Reset Button

In this project, we created a simple stopwatch with an LCD screen and buttons for start, stop, and reset. Two buttons or modes, a start, and a stop mode are always present on a stopwatch. Although it might have additional features, these are always present. The reset function has also been included. By depressing the Arduino’s reset button, this can be accomplished.

The Arduino can show functions up to the value in milliseconds with 100% accuracy thanks to the millis feature of the Arduino Code. After the decimal point, we can display up to 4 digits. However, we just showed 2 digits here. A 4-digit 7-segment display can be used for the same project.

Components Required:

  • Arduino UNO Board
  • 16*2 LCD Display
  • Push-Buttons – 2
  • Breadboard
  • Connect jumpers wires

Circuit: Stopwatch Using Arduino & LCD Display

Assemble the circuit as shown in the figure below and make the following connections.

  • Connect Pin no 4,6,11,12,13,14 of LCD to Pin no 7,6,5,4,3,2 of Arduino.
  • Connect the two push buttons to digital pin 8 and 9 of Arduino.

Working & Operations:

Press Start will be displayed once the code has been uploaded to the Arduino Board. Therefore, all you need to do is push the start button to begin the timer. Simply press the Stop button to stop the timer from running. So the stopwatch will come to a stop. Simply hit the reset button on the Arduino UNO Board if you want to reset the circuit right now.

Stopwatch Using Arduino & LCD
Stopwatch Using Arduino & LCD

Source Code/Program:

Here is the code for an Arduino stopwatch with an LCD display. Transfer it to your Arduino UNO Board by copying it.

#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

void setup()
{
lcd.begin(16, 2);
lcd.clear();

Serial.begin(9600);

pinMode(8, INPUT);
digitalWrite(8, HIGH);
pinMode(9, INPUT);
digitalWrite(9, HIGH);
}
double i = 0;
double a = millis();
double c ;

void loop()
{
lcd.clear();
lcd.print(“press start”);
delay(100);

if(digitalRead(8) == LOW)
{

lcd.clear();
a = millis();
while(digitalRead(9) == HIGH)
{

c = millis();
i = (c – a) / 1000;
lcd.print(i);
lcd.setCursor(7,0);
lcd.print(“Sec’s”);
lcd.setCursor(0,0);
Serial.println(c);
Serial.println(a);
Serial.println(i);
Serial.println(“……”);
delay(100);
}

if(digitalRead(9) == LOW)
{
while(digitalRead(8) == HIGH)
{
lcd.setCursor(0,0);
lcd.print(i);
lcd.setCursor(11,0);
lcd.print(“”);
lcd.setCursor(0,0);
delay(100);
}
}
}
}

Leave a Reply

Your email address will not be published.