Projects / Take-a-number queue display

Take-a-number queue display

One button takes the next number and another calls the next one to the counter, with the number being served shown on a big four-digit display and a chime. It is like the ticket machine at a shop counter, and a good project for a school stall or a club.

Beginner1.2 hGuided buildReviewed

Build it step by step

0 of 7 done
  1. NANO

    Wire the display

    VCC, GND, CLK to D2 and DIO to D3.

  2. NANO

    Wire the two buttons and the buzzer

    D4, D5 and D6.

  3. NANO12:45

    Install the TM1637Display library

    From the Library Manager.

  4. NANO

    Upload and open the serial monitor at 9600

    The display shows 0000.

  5. NANO

    Press the take button three times

    Tickets 1, 2 and 3 are issued.

  6. NANO

    Press the call button

    The display shows 1 and the chime rings.

  7. NANO

    Hold both buttons for two seconds

    Everything resets.

In short

How do you build a take-a-number queue display?

One button takes the next number and another calls the next one to the counter, with the number being served shown on a big four-digit display and a chime. It is like the ticket machine at a shop counter, and a good project for a school stall or a club. You need Arduino Nano, TM1637 4-digit display, Tactile push button 6 mm × 2, Passive buzzer, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm). It takes 7 steps and about 70 minutes.

Level
Beginner
Time
About 70 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 VCCNano 5VDisplay power
TM1637 GNDNano GNDCommon ground
TM1637 CLKNano D2Display clock
TM1637 DIONano D3Display data
Take button leg 1Nano D4Customers take a ticket
Take button leg 2Nano GNDPressing joins D4 to ground
Call button leg 1Nano D5The counter calls the next number
Call button leg 2Nano GNDPressing joins D5 to ground
Passive buzzer + and -Nano D6 and GNDThe chime

Code

A ticket queue needs only two counters. One counts how many tickets have been given out, and the other counts how many people have been served. The take button adds one to the first and prints your number on the serial monitor, which you could read out or write on a slip. The call button adds one to the second, shows it on the four-digit display and rings a two-note chime, but only if someone is actually waiting. Holding both buttons for two seconds starts a new day by setting both counters back to zero. The numbers live only in the Nano's memory and are lost when you unplug it, and there are no names or personal details at all. Use it for a school stall, a club or a games corner. As a next step, add a third counter so two helpers can call from the same line.

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>

const uint8_t CLK_PIN = 2;
const uint8_t DIO_PIN = 3;
const uint8_t TAKE_PIN = 4;
const uint8_t CALL_PIN = 5;
const uint8_t BUZZER_PIN = 6;

TM1637Display display(CLK_PIN, DIO_PIN);
int lastIssued = 0;     // the last ticket handed out
int nowServing = 0;     // the number on the display

bool pressed(uint8_t pin) {
  if (digitalRead(pin) == LOW) {
    delay(30);
    while (digitalRead(pin) == LOW) {}      // wait for release
    return true;
  }
  return false;
}

void chime() {
  tone(BUZZER_PIN, 988, 150);
  delay(180);
  tone(BUZZER_PIN, 1319, 250);
  delay(300);
}

void setup() {
  pinMode(TAKE_PIN, INPUT_PULLUP);
  pinMode(CALL_PIN, INPUT_PULLUP);
  pinMode(BUZZER_PIN, OUTPUT);
  display.setBrightness(5);
  display.showNumberDec(nowServing, true);
  Serial.begin(9600);
  Serial.println("Take button gives a ticket, call button serves the next.");
}

void loop() {
  if (pressed(TAKE_PIN)) {
    lastIssued++;
    tone(BUZZER_PIN, 1000, 80);
    Serial.print("Your ticket number is ");
    Serial.println(lastIssued);
  }
  if (pressed(CALL_PIN)) {
    if (nowServing < lastIssued) {
      nowServing++;
      display.showNumberDec(nowServing, true);
      chime();
      Serial.print("Now serving ");
      Serial.println(nowServing);
    } else {
      Serial.println("No one is waiting.");
    }
  }
  if (digitalRead(TAKE_PIN) == LOW && digitalRead(CALL_PIN) == LOW) {
    delay(2000);                            // hold both for two seconds to start a new day
    if (digitalRead(TAKE_PIN) == LOW && digitalRead(CALL_PIN) == LOW) {
      lastIssued = 0;
      nowServing = 0;
      display.showNumberDec(0, true);
      Serial.println("New day: counters reset.");
    }
  }
}

What the serial monitor should show

Open the serial monitor at the baud rate in the code. This is what our simulator prints for a virtual Arduino Nano with its sensors at their default values. Your numbers will follow your real readings, but the format should match.

Take button gives a ticket, call button serves the next.

Test checklist

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

CheckExpected
Take buttonNext ticket number printed
Call button with people waitingDisplay goes up one and chimes
Call button with nobody waitingSays no one is waiting
Hold both for two secondsCounters back to zero
Unplug and replugStarts again from zero

If it does not work

Display stays dark

Check the TM1637 power, CLK and DIO wires.

Wrong digits

Check CLK is D2 and DIO is D3.

Call does nothing

Take a ticket first.

Library not found

Install TM1637Display.

Buttons seem to repeat

Release them cleanly.

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

Ask Lark AI

Common questions

What parts do I need for the take-a-number queue display?

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

How long does the take-a-number queue display take to build?

About 70 minutes for a beginner maker, in 7 steps.

How do I know the take-a-number queue display works?

Take button: Next ticket number printed. Call button with people waiting: Display goes up one and chimes. Call button with nobody waiting: Says no one is waiting.

Display stays dark: what should I check?

Check the TM1637 power, CLK and DIO wires.

Wrong digits: what should I check?

Check CLK is D2 and DIO is D3.

Call does nothing: what should I check?

Take a ticket first.

Library not found: what should I check?

Install TM1637Display.