Projects / Ten-step counter display

Ten-step counter display

Beginner1 hGuided buildReviewed

Build it step by step

0 of 8 done
  1. NANO

    Power the chip

    5V to pin 16, GND to pin 8.

  2. NANO

    Tie the enable pin

    Pin 13 to GND.

  3. NANO

    Wire the clock and reset

    Pin 14 to D2, pin 15 to D3.

  4. NANO15.7 mA

    Wire ten LEDs

    Each output through 1 kohm to an LED and GND.

  5. NANO

    Wire the buttons

    D4 and D5 each to GND.

  6. NANO15.7 mA

    Upload the sketch

    A lit LED runs along the row.

  7. NANO

    Press the run button

    The slow clock stops.

  8. NANO

    Press the step button

    One step per press.

In short

How do you build a ten-step counter display?

A decade counter lights ten LEDs one after another from a clock pulse. You need Arduino Nano, CD4017 Counter, LED 5 mm red × 10, Resistor 1 kΩ × 10, Tactile push button 6 mm × 2 and Breadboard 830 Tie Points. It takes 8 steps and about 60 minutes.

Level
Beginner
Time
About 60 min
Parts
6

Parts list

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

Wiring

FromToWhy
CD4017 pin 16 (VDD)Nano 5VPower
CD4017 pin 8 (VSS)Nano GNDGround
CD4017 pin 13 (CE)Nano GNDEnables the clock
CD4017 pin 14 (CLK)Nano D2Clock pulses from the Nano
CD4017 pin 15 (RESET)Nano D3Back to the first output
Outputs 0 to 9Pins 3, 2, 4, 7, 10, 1, 5, 6, 9, 11Each through a 1 kohm resistor to an LED then GND
Step buttonNano D4 to GNDManual step
Run and pause buttonNano D5 to GNDSwitch between slow clock and manual

Code

The CD4017 is a classic counter chip that has ten outputs and lights only one at a time. Each rising edge at its clock pin moves the lit output to the next one, and after the tenth it goes back to the first. A pulse on the reset pin sends it back to output zero at once. The Nano here simply produces the clock, one pulse every 0.4 seconds, so the lit LED seems to run along the row. A second button pauses this slow clock, and then the first button steps the counter by hand so you can watch each output turn on in order. The chip is a CMOS part with weak outputs, which is why the resistors are 1 kilohm rather than 220 ohm: the LEDs are a little dimmer but the chip stays within its ratings. The clock enable pin must be tied to ground or the counter will not move. This is a good way to see counting, decoding and sequencing in hardware, and later you can try the carry output on pin 12 to chain two chips.

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).

const int CLK = 2, RST = 3, STEP_BTN = 4, RUN_BTN = 5;
bool autoRun = true;
unsigned long lastStep = 0, lastPress = 0;

void pulse() {
  digitalWrite(CLK, HIGH);
  delay(2);
  digitalWrite(CLK, LOW);
}

bool clicked(int pin) {
  if (digitalRead(pin) == LOW && millis() - lastPress > 250) {
    lastPress = millis();
    return true;
  }
  return false;
}

void setup() {
  pinMode(CLK, OUTPUT);
  pinMode(RST, OUTPUT);
  pinMode(STEP_BTN, INPUT_PULLUP);
  pinMode(RUN_BTN, INPUT_PULLUP);
  digitalWrite(RST, HIGH);   // reset to output 0
  delay(10);
  digitalWrite(RST, LOW);
}

void loop() {
  if (clicked(RUN_BTN)) autoRun = !autoRun;

  if (autoRun) {
    if (millis() - lastStep >= 400) { lastStep = millis(); pulse(); }
  } else if (clicked(STEP_BTN)) {
    pulse();
  }
}

Test checklist

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

CheckExpected
Power onFirst LED lit, then runs along
After the tenthBack to the first
Press runCounting stops
Press stepOne LED at a time
Hold reset highFirst LED lit

If it does not work

Nothing moves

Pin 13 must go to GND.

LEDs light in the wrong order

Check the output pin order 3, 2, 4, 7, 10, 1, 5, 6, 9, 11.

Skipped steps

The clock line is noisy, add a 100 nF capacitor from pin 14 to GND.

Two LEDs lit

Reset is floating, wire it to D3.

LEDs very dim

Use a low-current LED.

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

Ask Lark AI

Common questions

What parts do I need for the ten-step counter display?

Arduino Nano, CD4017 Counter, LED 5 mm red × 10, Resistor 1 kΩ × 10, Tactile push button 6 mm × 2 and Breadboard 830 Tie Points.

How long does the ten-step counter display take to build?

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

How do I know the ten-step counter display works?

Power on: First LED lit, then runs along. After the tenth: Back to the first. Press run: Counting stops.

Nothing moves: what should I check?

Pin 13 must go to GND.

LEDs light in the wrong order: what should I check?

Check the output pin order 3, 2, 4, 7, 10, 1, 5, 6, 9, 11.

Skipped steps: what should I check?

The clock line is noisy, add a 100 nF capacitor from pin 14 to GND.

Two LEDs lit: what should I check?

Reset is floating, wire it to D3.