Tap a part to see what it does.
Tap the parts to see what each one does. A teaching simulation, not a circuit simulator.
Build it step by step
0 of 4 doneWire the display
CLK D4, DIO D5.
Two buttons
Start/stop on D2, reset on D3, both to GND.
Upload
Press start.
Check accuracy
Run it beside a phone stopwatch for a minute.
How do you build a digital stopwatch?
A 4-digit display counts seconds and hundredths. One button starts and stops, the other resets, both debounced in code. You need Arduino Uno R3, TM1637 4-digit display, Tactile push button 6 mm × 2 and Breadboard 830 Tie Points. It takes 4 steps and about 35 minutes.
- Level
- Beginner
- Time
- About 35 min
- Parts
- 4
Parts list
- Development BoardsBuyArduino Uno R3 × 1
- DisplaysBuy
- SwitchesBuy
- PrototypingBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| TM1637 CLK / DIO | D4 / D5 | Display |
| TM1637 VCC / GND | 5V / GND | Power |
| Start/stop button | D2 to GND | INPUT_PULLUP |
| Reset button | D3 to GND | INPUT_PULLUP |
Code
Library: TM1637Display. The colon separates seconds from hundredths. Extend to minutes by showing MM:SS after 100 s.
Runs on a virtual Arduino Uno in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
#include <TM1637Display.h>
TM1637Display disp(4, 5);
const int START = 2, RESET = 3;
bool running = false;
unsigned long base = 0, held = 0, lastPress = 0;
bool pressed(int pin) {
if (digitalRead(pin) == LOW && millis() - lastPress > 250) { lastPress = millis(); return true; }
return false;
}
void setup() {
pinMode(START, INPUT_PULLUP); pinMode(RESET, INPUT_PULLUP);
disp.setBrightness(4);
}
void loop() {
if (pressed(START)) {
if (running) held = millis() - base; else base = millis() - held;
running = !running;
}
if (pressed(RESET) && !running) held = 0;
unsigned long ms = running ? millis() - base : held;
int shown = (ms / 1000 % 100) * 100 + (ms / 10 % 100); // SS.hh, rolls over at 100 s
disp.showNumberDecEx(shown, 0b01000000, true);
}Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Start, wait, stop | Display freezes on the elapsed time |
| Start again | Continues from the frozen time |
| One minute against a phone | Within about 0.1 s |
If it does not work
Starts and stops twice per press
Increase the 250 ms debounce.
Reset does nothing
Reset only works while stopped, by design.
Display blank
CLK and DIO swapped.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the digital stopwatch?
Arduino Uno R3, TM1637 4-digit display, Tactile push button 6 mm × 2 and Breadboard 830 Tie Points.
How long does the digital stopwatch take to build?
About 35 minutes for a beginner maker, in 4 steps.
How do I know the digital stopwatch works?
Start, wait, stop: Display freezes on the elapsed time. Start again: Continues from the frozen time. One minute against a phone: Within about 0.1 s.
Starts and stops twice per press: what should I check?
Increase the 250 ms debounce.
Reset does nothing: what should I check?
Reset only works while stopped, by design.
Display blank: what should I check?
CLK and DIO swapped.
