Arduino Nano 33 IoT - 74HC595 4-Digit 7-Segment Display
This article shows you how to use an Arduino Nano 33 IoT board to control a four-digit display using a 74HC595 chip. It explains these topics:
- Connecting the Arduino Nano 33 IoT to the 74HC595 4-digit 7-segment display module
- Setting up the Arduino Nano 33 IoT to show whole numbers on the display
- Setting up the Arduino Nano 33 IoT to show decimal numbers on the display
- Setting up the Arduino Nano 33 IoT to show both numbers and letters on the display
This guide uses a 4-digit 7-segment display module that can show numbers with decimals. If you want to display a colon, please check the TM1637 4-digit 7-segment Display Module tutorial.

Hardware Preparation
Or you can buy the following sensor kits:
1 | × | DIYables Sensor Kit (30 sensors/displays) | |
1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Overview of 74HC595 4-digit 7-segment Display
A good module for showing temperature or any decimal number is the 74HC595 4-digit 7-segment display. This module usually has four 7-segment lights, four dot lights, and two 74HC595 drivers for each digit.
Pinout
The 74HC595 module, which displays 4 numbers using 7 segments each, has 5 connection pins.
- SCLK pin: This is a clock input. Connect it to any digital pin on the Arduino Nano 33 IoT.
- RCLK pin: This is also a clock input. Connect it to any digital pin on the Arduino Nano 33 IoT.
- DIO pin: This is for data input and output. Connect it to any digital pin on the Arduino Nano 33 IoT.
- VCC pin: This supplies power to the module. Connect it to a power source between 3.3V and 5V.
- GND pin: This is the ground connection.

Wiring Diagram
The table below explains how the Arduino Nano 33 IoT pins connect to the pins of a 74HC595 4-digit 7-segment display.
Arduino Nano 33 IoT | 74HC595 7-segment display |
---|---|
3.3V | VCC |
D7 | SCLK |
D6 | RCLK |
D5 | DIO |
If you are using other pins, update the pin numbers in the code to match.

This image is created using Fritzing. Click to enlarge image
Library Installation
To easily program the 74HC595 4-digit 7-segment display, you need to add the DIYables_4Digit7Segment_74HC595 library from DIYables.io. Follow these steps to add the library.
- Open the Library Manager by clicking the Library Manager icon on the left side of the Arduino IDE.
- Type DIYables_4Digit7Segment_74HC595 in the search box, then look for the DIYables_4Digit7Segment_74HC595 library by DIYables.io.
- Finally, click the Install button.

You can also check out this library on Github.
How To Program For 74HC595 4-digit 7-segment using Arduino Nano 33 IoT
- Add the library.
- Set up the Arduino Nano 33 IoT's pins to connect with the SCLK, RCLK, and DIO pins on the display. For example, you can use pins D7, D6, and D5.
- Make a display using the DIYables_4Digit7Segment_74HC595 type.
- Now you can show integer numbers with leading zeros, and it works for negative numbers too:
- You can display numbers with decimals. It allows you to add extra zeros at the start and works with negative numbers.
- You can also show numbers, decimal points, and characters one by one using basic functions.
- Since the 74HC595 4-digit 7-segment module uses multiplexing to control its individual segments and LEDs, the Arduino Nano 33 IoT code must call the display.show() function inside the main loop, and it must not use the delay() function there.
You can find more details by checking out the library reference here: https://arduinogetstarted.com/reference/library/diyables-4digit7segment-74hc595-library
Arduino Nano 33 IoT Code - Display Integer
Detailed Instructions
If you are new to the Arduino Nano 33 IoT, be sure to check out our Getting Started with Arduino Nano 33 IoT tutorial. Then, follow these steps:
- Connect the components to the Arduino Nano 33 IoT board as depicted in the diagram.
- Use a USB cable to connect the Arduino Nano 33 IoT board to your computer.
- Launch the Arduino IDE on your computer.
- Select the Arduino Nano 33 IoT board and choose its corresponding COM port.
- Copy the code above and open it with the Arduino IDE.
- Click the Upload button in the Arduino IDE to send the code to your Arduino Nano 33 IoT.
- Check the numbers on the 7-segment display.