Projects / Kitchen countdown timer

Kitchen countdown timer

Beginner1.5 hGuided buildReviewed

Build it step by step

0 of 8 done
  1. NANO12:45

    Install the library

    Search for TM1637Display in the Library Manager.

  2. NANO

    Wire the display

    CLK to D7, DIO to D8, power from 5V and GND.

  3. NANO

    Wire the three buttons

    D3, D4 and D5 to GND.

  4. NANO

    Wire the buzzer

    Plus to D6, minus to GND.

  5. NANO

    Upload the sketch

    Display shows 00:00.

  6. NANO

    Press minutes twice and seconds once

    Display shows 02:10.

  7. NANO

    Press start

    It counts down each second.

  8. NANO

    Let it reach zero or pause midway

    Alarm sounds at zero, pause stops the count.

In short

How do you build a kitchen countdown timer?

A four-digit display counts down minutes and seconds, set with two buttons, and a buzzer sounds when time is up. You need Arduino Nano, TM1637 4-digit display, Tactile push button 6 mm × 3, Passive buzzer, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm). It takes 8 steps and about 90 minutes.

Level
Beginner
Time
About 90 min
Parts
6

Parts list

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
TM1637 CLK and DIONano D7 and D8Display
TM1637 VCC and GNDNano 5V and GNDDisplay power
Minutes buttonNano D3 to GNDInternal pull-up, adds a minute
Seconds buttonNano D4 to GNDInternal pull-up, adds ten seconds
Start and pause buttonNano D5 to GNDStarts, pauses and stops the alarm
Passive buzzer plus and minusNano D6 and GNDAlarm tone

Code

The sketch is a small state machine with four states: setting, running, paused and done. In the setting state each press of the minutes button adds a minute and each press of the seconds button adds ten seconds. The start button begins the countdown, which uses millis() and steps lastTick by exactly 1000 each time, so small delays do not make the timer drift. The display shows minutes and seconds with the colon lit using the 0x40 flag. When the time reaches zero the buzzer beeps on and off until you press start or 30 seconds pass, then the timer returns to the setting state. Install the TM1637Display library by Avishay Orpaz from the Library Manager. A passive buzzer plays whatever tone you give it, while an active buzzer would make a fixed tone and ignore the frequency.

Runs on a virtual Arduino Nano 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(7, 8);                 // CLK, DIO
const uint8_t B_MIN = 3, B_SEC = 4, B_GO = 5, BUZ = 6;

enum State { SETTING, RUNNING, PAUSED, DONE };
State state = SETTING;

long remaining = 0;                       // seconds left
unsigned long lastTick = 0;
unsigned long alarmStart = 0;

bool pressed(uint8_t pin, uint8_t idx) {
  static bool prev[8] = {HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH};
  bool now = digitalRead(pin);
  bool hit = (prev[idx] == HIGH && now == LOW);
  prev[idx] = now;
  if (hit) delay(25);                     // simple debounce
  return hit;
}

void show() {
  int mins = remaining / 60;
  int secs = remaining % 60;
  disp.showNumberDecEx(mins * 100 + secs, 0x40, true);   // 0x40 lights the colon
}

void setup() {
  pinMode(B_MIN, INPUT_PULLUP);
  pinMode(B_SEC, INPUT_PULLUP);
  pinMode(B_GO, INPUT_PULLUP);
  pinMode(BUZ, OUTPUT);
  disp.setBrightness(5);
  show();
}

void loop() {
  switch (state) {
    case SETTING:
      if (pressed(B_MIN, 3) && remaining < 99 * 60) remaining += 60;
      if (pressed(B_SEC, 4)) remaining = min(remaining + 10, 99L * 60 + 59);
      if (pressed(B_GO, 5) && remaining > 0) { state = RUNNING; lastTick = millis(); }
      show();
      break;

    case RUNNING:
      if (millis() - lastTick >= 1000) {
        lastTick += 1000;
        remaining--;
        show();
        if (remaining <= 0) { state = DONE; alarmStart = millis(); }
      }
      if (pressed(B_GO, 5)) state = PAUSED;
      break;

    case PAUSED:
      if (pressed(B_GO, 5)) { state = RUNNING; lastTick = millis(); }
      if (pressed(B_MIN, 3)) { remaining = 0; state = SETTING; show(); }   // minutes button clears
      break;

    case DONE: {
      bool on = ((millis() - alarmStart) / 300) % 2 == 0;
      if (on) tone(BUZ, 2000); else noTone(BUZ);
      if (pressed(B_GO, 5) || millis() - alarmStart > 30000) {
        noTone(BUZ);
        state = SETTING;
        show();
      }
      break;
    }
  }
}

Test checklist

What you should see at each check. If a reading is far off, stop and use the troubleshooting list.

CheckExpected
Press minutes once01:00
Press seconds three times00:30 added
Start and wait 10 secondsDisplay falls by 10
Pause and waitTime does not change
Reach 00:00Buzzer beeps until start is pressed

If it does not work

Display blank

Check CLK and DIO are not swapped and the library is installed.

Timer runs fast or slow

Check that no long delay() calls were added to the loop.

Buttons add more than one step

Increase the 25 ms debounce delay.

Buzzer silent

Use a passive buzzer with tone(), and check its polarity.

Colon missing

Use showNumberDecEx with the 0x40 flag as shown.

Still stuck? Find the fault step by step with your multimeter →

Ask Lark AI

Common questions

What parts do I need for the kitchen countdown timer?

Arduino Nano, TM1637 4-digit display, Tactile push button 6 mm × 3, Passive buzzer, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm).

How long does the kitchen countdown timer take to build?

About 90 minutes for a beginner maker, in 8 steps.

How do I know the kitchen countdown timer works?

Press minutes once: 01:00. Press seconds three times: 00:30 added. Start and wait 10 seconds: Display falls by 10.

Display blank: what should I check?

Check CLK and DIO are not swapped and the library is installed.

Timer runs fast or slow: what should I check?

Check that no long delay() calls were added to the loop.

Buttons add more than one step: what should I check?

Increase the 25 ms debounce delay.

Buzzer silent: what should I check?

Use a passive buzzer with tone(), and check its polarity.