Close Menu
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
Facebook X (Twitter) Instagram
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
How To Electronics
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
How To Electronics
Home » Stopwatch Using 4 Digit 7 Segment Display & Arduino
Arduino Projects

Stopwatch Using 4 Digit 7 Segment Display & Arduino

Mamtaz AlamBy Mamtaz AlamUpdated:February 3, 20256 Comments3 Mins Read
Share Facebook Twitter LinkedIn Telegram Reddit WhatsApp
Stopwatch 7 Segment Arduino
Share
Facebook Twitter LinkedIn Pinterest Email Reddit Telegram WhatsApp

Stopwatch Using 4 Digit 7 Segment Display & Arduino

In this project, we have designed Simple Stopwatch Using 4 Digit 7 Segment Display & Arduino with Start, Stop & Reset Button. A stopwatch will always have 2 buttons or modes, a start, and a stop mode. It may have other features but it will always have these. Additionally, we have added reset function too. This can be done with the pressing reset button of Arduino. The stopwatch can be used to measure up to 999.9 seconds.

The millis feature of the Arduino Code allows the Arduino to display the functions up to the value in milliseconds to 100% accuracy. Here is our previous version of the same project: Stopwatch Using Arduino, where we used LCD Display instead of LED Display. We also built a Stopwatch using ESP32 and I2C LCD Display.


Components Required:

We just need the following components to make Stopwatch/Lap Timer. All of these components can be purchased from Amazon

S.N.Components NameQuantityPurchase Links
1Arduino Nano Board1Amazon | AliExpress
2Common Anode 4 Digit 7 Segment Display1Amazon | AliExpress
3LED Driver IC MAX72191Amazon | AliExpress
4Push Button Switch1Amazon | AliExpress
5Capacitor 0.1uF1Amazon | AliExpress
6Capacitor 10uF1Amazon | AliExpress
7Connecting Wires10-20Amazon | AliExpress
8Breadboard1Amazon | AliExpress



MAX7219 / MAX7221 8-Digit LED Display Driver

Maxim Integrated MAX7219 / MAX7221 8-Digit LED Display Drivers are compact, serial input/output common-cathode display drivers that interface\microprocessors to 7-segment numeric LED displays of up to 8 digits, to bar-graph displays, or to 64 individual LEDs. Included on-chip are a BCD code-B decoder, multiplex scan circuitry, segment and digit drivers and an 8×8 static RAM that stores each digit.

MAX7219

Only one external resistor is required to set the segment current for all LEDs. A convenient 4-wire serial interface connects to all common microprocessors. Individual digits may be addressed and updated without rewriting the entire display. MAX7219 also allows the user to select code-B decoding or no-decode for each digit.

Go through MAX7219 Datasheets from here: MAX7219 Datasheets

You can check this project related to the application of MAX7219 IC: 8×8 LED Matrix MAX7219 with Arduino Circuit & Code


Circuit Diagram & Connections

Below is the circuit diagram for Stopwatch Using 4 Digit 7 Segment Display & Arduino. Assemble the circuit as shown in the figure below.

Stopwatch 7 Segment Arduino Circuit

Pin D7 is connected to DataIn (DIN) of MAX7219
Pin D8 is connected to CLK (CLK) of MAX7219
Pin D9 is connected to LOAD (CS) of MAX7219

The 4 Digit 7 Segment Display used here is the Common Anode type. You can even use the Common Cathode type and reverse the Supply and GND.


Working & Operations

Stopwatch Lap Timer

Once the code is uploaded to Arduino Board, it will display 000.0. So just press the start button and then the time elapsing starts. To stop the time elapsed just press the same button again. Hence the stopwatch will stop. Now if you want to reset the circuit, then simply press the reset button of the Arduino UNO Board.

The stopwatch can be used to measure up to 999.9 seconds.




Source Code/Program:

The Source Code for Lap Timer/Stopwatch for above circuit is given below. Simply upload the code to Arduino Board. But before that you need to add these two libraries below:
1. LED Control Library: Download
2. Bounce2 Library: Download

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#include <LedControl.h> // Library for LED control with MAX72XX
#include <Bounce2.h> // Library for Bounce of switches
 
/*
Pins of Arduino Nano for LedControl:
Pin #7 is connected to DataIn (DIN)
Pin #8 is connected to CLK (CLK)
Pin #9 is connected to LOAD (CS)
There is only one display with MAX72XX
*/
 
LedControl lc = LedControl(7, 8, 9, 1); // LedControl(dataPin, clkPin, csPin, numDevices)
 
int k, lastTime, diffTime;
int a, b, c, d;
int a1, b1, c1, d1;
 
int pinStartStop = 4; // Start-Stop Pin
 
bool statusSwitch1 = false;
 
Bounce SW1 = Bounce(); // Define Bounce to read StartStop switch
Bounce SW2 = Bounce(); // Define Bounce to read Lap switch
 
void setup() {
 
pinMode (pinStartStop, INPUT_PULLUP);
 
// After setting up the button, setup the Bounce instance
SW1.attach(pinStartStop); // Sets the pin (Internal Pull-Up) & matches the internal state
SW1.interval(3); // Sets the debounce time in milliseconds
 
lc.shutdown(0, false); // The MAX72XX is in power-saving mode on startup, we have to do a wakeup call
lc.setIntensity(0, 5); // Set the brightness of display between 0 and 15
lc.clearDisplay(0); // Clear the display
 
lc.setDigit(0, 7, 0, false);
lc.setDigit(0, 6, 0, false);
lc.setDigit(0, 5, 0, true);
lc.setDigit(0, 4, 0, false);
 
lc.setDigit(0, 3, 0, false);
lc.setDigit(0, 2, 0, false);
lc.setDigit(0, 1, 0, true);
lc.setDigit(0, 0, 0, false);
 
}
 
void loop() {
 
lastTime = 0;
diffTime = 0;
 
for (k = 0; k <= 9999; k++) {
 
SW1.update();
 
if (SW1.fell()) {
statusSwitch1 = !statusSwitch1;
}
 
if (statusSwitch1 == true) {
 
a = k / 1000;
b = (k - a * 1000) / 100;
c = (k - a * 1000 - b * 100) / 10;
d = k % 10;
 
lc.setDigit(0, 7, a, false);
lc.setDigit(0, 6, b, false);
lc.setDigit(0, 5, c, true);
lc.setDigit(0, 4, d, false);
}
else {
k = k - 1;
}
 
SW2.update();
 
if (SW2.fell()) {
 
diffTime = k - lastTime;
lastTime = k;
 
a1 = diffTime / 1000;
b1 = (diffTime - a1 * 1000) / 100;
c1 = (diffTime - a1 * 1000 - b1 * 100) / 10;
d1 = diffTime % 10;
 
lc.setDigit(0, 3, a1, false);
lc.setDigit(0, 2, b1, false);
lc.setDigit(0, 1, c1, true);
lc.setDigit(0, 0, d1, false);
 
}
 
delay(99);
 
}
 
}


Video Demonstration:

Stopwatch Using 4 Digit 7 Segment Display & Arduino
Watch this video on YouTube.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
Previous ArticleIoT Based Air Pollution/Quality Monitoring with ESP8266
Next Article NRF24L01 & Arduino Wireless Temperature Monitor with DHT11

Related Posts

DC Energy Meter using Arduino

Build a DC Energy Meter using Arduino – 32V/5A

Updated:August 26, 20252K
Interfacing ADXL375 Accelerometer with Arduino

Interfacing ADXL375 Accelerometer with Arduino (±200g)

Updated:June 28, 2025
PZEM-004T Arduino Energy Meter

DIY AC Energy Meter using PZEM-004T & Arduino

Updated:March 6, 20258K
Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Updated:February 2, 20259K
Password Based Door Lock Security System Using Arduino & Keypad

Password Based Door Lock Security System Using Arduino & Keypad

Updated:February 2, 20252436K
Earthquake Detector Alarm with with Accelerometer & Arduino

Earthquake Detector Alarm with Accelerometer & Arduino

Updated:February 2, 2025661K
View 6 Comments

6 Comments

  1. Hot Wheels Arena on October 2, 2019 10:12 PM

    Hi i try to make this with 2 digit decimal,can you help me to do that? Thanks!

    Reply
  2. Hot Wheels Arena on October 2, 2019 10:14 PM

    Thanks for sharing btw!

    Reply
  3. Mohammed on May 6, 2020 2:59 AM

    i does work for me. i have common cathode display. what changes should i make???

    Reply
  4. Neeraj on May 14, 2020 1:31 PM

    Does this work for MAX7219ENG IC

    Reply
  5. ariel on July 21, 2020 9:16 PM

    good tutorial….
    how to add more StartStop switch independent inputs and outputs … without error …in
    thank you.

    Bounce SW1 = Bounce(); // Define Bounce to read StartStop switch
    Bounce SW2 = Bounce(); // Define Bounce to read StartStop switch
    Bounce SW3 = Bounce(); // Define Bounce to read StartStop switch

    pinMode(LED1, OUTPUT);
    pinMode(LED2, OUTPUT);
    pinMode(LED3, OUTPUT);

    Reply
  6. SERGE MAZELLIER on September 3, 2021 2:08 AM

    bonjour j’ai besoin d’un contact sur un relai quand le chrono indique 8 secondes que dois je modifier au code pour cela
    merci de m’aider si celavous est possible

    Reply

CommentsCancel reply

Latest Posts
ESP32 Fingerprint Attendance System with Live Web Dashboard

ESP32 Fingerprint Attendance System with Live Web Dashboard

June 21, 2026
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

June 14, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

May 10, 2026
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

May 2, 2026
A Guide to Sourcing Obsolete ICs for Vintage Projects

Beyond AliExpress: A Guide to Sourcing Obsolete ICs for Vintage Projects

April 21, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

April 27, 2026
Building a Smart Sensor Node with a BLE Microcontroller

Building a Smart Sensor Node with a BLE Microcontroller

February 26, 2026
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

April 27, 2026
Top Posts & Pages
  • 12V DC to 220V AC Inverter Circuit & PCB
    12V DC to 220V AC Inverter Circuit & PCB
  • ESP32 Fingerprint Attendance System with Live Web Dashboard
    ESP32 Fingerprint Attendance System with Live Web Dashboard
  • ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
    ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
  • Buck Converter: Basics, Working, Design & Application
    Buck Converter: Basics, Working, Design & Application
  • IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
    IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
  • Designing of MPPT Solar Charge Controller using Arduino
    Designing of MPPT Solar Charge Controller using Arduino
  • How to use INA226 DC Current Sensor with Arduino
    How to use INA226 DC Current Sensor with Arduino
  • How to use INA219 DC Current Sensor Module with Arduino
    How to use INA219 DC Current Sensor Module with Arduino
Categories
  • Arduino Projects (197)
  • Articles (60)
    • Learn Electronics (19)
    • Product Review (15)
    • Tech Articles (28)
  • Electronics Circuits (46)
    • 555 Timer Projects (21)
    • Op-Amp Circuits (7)
    • Power Electronics (13)
  • IoT Projects (205)
    • ESP32 MicroPython (7)
    • ESP32 Projects (82)
    • ESP32-CAM Projects (15)
    • ESP8266 Projects (76)
    • LoRa/LoRaWAN Projects (22)
  • Microcontrollers (38)
    • AMB82-Mini IoT AI Camera (4)
    • BLE Projects (18)
    • STM32 Projects (19)
  • Raspberry Pi (93)
    • Raspberry Pi Pico Projects (57)
    • Raspberry Pi Pico W Projects (12)
    • Raspberry Pi Projects (24)
Follow Us
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
About Us

“‘How to Electronics’ is a vibrant community for electronics enthusiasts and professionals. We deliver latest insights in areas such as Embedded Systems, Power Electronics, AI, IoT, and Robotics. Our goal is to stimulate innovation and provide practical solutions for students, organizations, and industries. Join us to transform learning into a joyful journey of discovery and innovation.

Copyright © How To Electronics. All rights reserved.
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us

Type above and press Enter to search. Press Esc to cancel.

Ad Blocker Enabled!
Ad Blocker Enabled!
Looks like you're using an ad blocker. Please allow ads on our site. We rely on advertising to help fund our site.