Arduino Nano - 74HC595 4-Digit 7-Segment Display
This walkthrough takes you step by step through using a 4-digit 7-segment display with 74HC595 shift register on the Arduino Nano. The Nano packs the same ATmega328P as the Uno into a compact, breadboard-friendly form factor - great for tight builds and prototyping.
What you will walk through:
- Wiring the 74HC595 display module to the Arduino Nano.
- Displaying integers and floats.
- Showing text and special characters like the degree symbol.
- Presenting time in HH.MM format with a blinking dot.

Hardware Preparation
Or you can buy the following kits:
| 1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
What Is the 74HC595 4-Digit 7-Segment Display?
A four-digit LED display driven by a 74HC595 shift register. Only 3 wires are needed from the Nano to control all digits and decimal points. The shift register converts serial data into parallel segment outputs, and the library takes care of multiplexing each digit in turn.
| Function | Pin | Description |
|---|---|---|
| SCLK (SH_CP) | Serial Clock | Clocks data bits into the shift register |
| RCLK (ST_CP) | Register Clock | Latches shifted data to outputs |
| DIO (DS) | Data Input | Serial data line |
| VCC | Power | 3.3V or 5V |
| GND | Ground | Common ground |
Wiring Diagram
Connect the display module to the Nano:
- SCLK to D7
- RCLK to D6
- DIO to D5
- VCC to 5V
- GND to GND
Both the Nano and the display module share a breadboard nicely, making the wiring straightforward.

This image is created using Fritzing. Click to enlarge image
You can also build this circuit without a breadboard. Here is the same wiring:

This image is created using Fritzing. Click to enlarge image
Do you want the wiring to stay in place? To do that, mount the Arduino Nano on a Screw Terminal Expansion Board for Arduino Nano. See the diagram below for the screw terminal version.

This image is created using Fritzing. Click to enlarge image
See The best way to supply power to the Arduino Nano and other components.
Setting Up the Library
- Plug the Arduino Nano into your computer with a Mini-B USB cable.
- Open Arduino IDE. Set the board to Arduino Nano and select the matching port.
- Go to the Libraries panel on the left.
- Type "DIYables_4Digit7Segment_74HC595" in the search box. Look for the library from DIYables.
- Click Install. Select version 2.0.0 or later.

The library is self-contained - no extra dependencies to install.
Note: If your Nano uses an older bootloader, select ATmega328P (Old Bootloader) under Processor in the Tools menu.
Foundation Code
Every sketch built with the DIYables_4Digit7Segment_74HC595 library starts from this foundation:
Call begin() once, then keep display.loop() running. The display value is set with print() and stays until changed. Use display.delay() instead of delay() to keep things visible during waits.
Arduino Nano Code - Display Integers
Shows a series of integers and zero-padded output.
Follow Along
- Wire the display to the Nano as shown above.
- Connect the Nano to your computer with a Mini-B USB cable.
- Open Arduino IDE, pick the board and port, paste the code, and click Upload.
- Open the Serial Monitor to view the output.
Cycles through 0, 42, 1234, -5, -123, 9999, and then 0042 with zero-padding.
Method Overview
| Method | Explanation | Call Example |
|---|---|---|
| print(int) | Show an integer (-999 to 9999) | display.print(1234) |
| print(int, true) | Integer with leading zeros | display.print(42, true) |
| loop() | Refresh the multiplexed display | display.loop() |
Arduino Nano Code - Display Floats
Demonstrates floats with auto and fixed decimal places.
Follow Along
- Upload the sketch and open the Serial Monitor.
Shows floats with auto decimals, then 1 and 2 fixed places, then zero-padded.
Arduino Nano Code - Text and Temperature
Shows text, degree symbol, and temperature values.
Follow Along
- Upload the sketch and open the Serial Monitor.
Displays "HELP", "Hi", "COOL", "done", then temperature values and inline dots.
Arduino Nano Code - Time
Clock-style HH.MM with blinking separator.
Follow Along
- Upload the sketch and open the Serial Monitor.
Shows 12.30 with the dot blinking every 500ms.
Arduino Nano Code - Blink
Blinks different display values on and off.
Follow Along
- Upload the sketch and open the Serial Monitor.
Blinks 1234, then 12.34, then "HELP" - five blinks each.
Troubleshoot
- Display stays blank - Check wiring. Verify SCLK, RCLK, DIO pin numbers match the code. Confirm begin() and loop() are in the right places.
- Wrong characters shown - Default is common anode. Pass false as 4th constructor argument for common cathode modules.
- Flickering display - Avoid delay() in your code. Use display.delay() instead.
- Upload fails with "not in sync" - Try selecting ATmega328P (Old Bootloader) in the Processor menu.
Platform Support
The library uses only Arduino standard APIs (pinMode, digitalWrite, millis) and works on all Arduino-compatible platforms.