ESP32 C3 Super Mini - 74HC595 4-Digit 7-Segment Display

Learn how to connect a 74HC595 4-digit 7-segment display to your ESP32 C3 Super Mini and display numbers, text, and sensor readings. This beginner-friendly tutorial shows you everything you need to create digital clocks, temperature displays, and counters with just three GPIO pins.

In this tutorial you will learn:

ESP32 C3 Super Mini 74HC595 4-Digit 7-Segment Display

Hardware Preparation

1×ESP32 C3 Super Mini
1×USB Cable Type-A to Type-C (for USB-A PC)
1×USB Cable Type-C to Type-C (for USB-C PC)
1×74HC595 4-digit 7-segment Display
1×Jumper Wires

Or you can buy the following kits:

1×DIYables Sensor Kit (18 sensors/displays)
Disclosure: Some of the links provided in this section are Amazon affiliate links. We may receive a commission for any purchases made through these links at no additional cost to you.
Additionally, some of these links are for products from our own brand, DIYables .

Overview of the 74HC595 4-Digit 7-Segment Display

The 74HC595 4-digit 7-segment display is a serial-to-parallel shift register module that controls four LED digit displays using only three control pins instead of twelve.

Key features and specifications:

  • Uses 74HC595 shift register IC for serial data control
  • Saves GPIO pins - only needs 3 pins instead of 12+
  • Common anode configuration (most modules)
  • Operating voltage: 3.3V to 5V compatible
  • Displays numbers 0-9, letters A-F, and some text characters
  • Built-in decimal points between digits
  • Multiplexing handled automatically by library
  • Perfect for beginners - simple serial interface
  • Great for counters, clocks, temperature displays, and scoreboards
  • Each digit contains 7 LED segments plus 1 decimal point

How it works:

  • Data is shifted in serially one bit at a time
  • Register clock latches the data to display outputs
  • Library handles all timing and multiplexing automatically
  • You simply call print() and the display updates

Pin Functions:

The module has five essential pins:

  • SCLK (SH_CP): Serial clock pin - pulses data bits into the shift register
  • RCLK (ST_CP): Register clock pin - latches shifted data to the LED outputs
  • DIO (DS): Data input pin - receives serial data stream
  • VCC: Power supply - connect to 3.3V or 5V
  • GND: Ground - connect to common ground

Wiring Diagram

Connect the 74HC595 display module to your ESP32 C3 Super Mini following this wiring guide:

Display Pin ESP32 C3 Super Mini Pin
SCLK (SH_CP) D2
RCLK (ST_CP) D1
DIO (DS) D10
VCC 3.3V
GND GND

Safety notes:

  • Note: The ESP32 C3 Super Mini operates at 3.3V logic levels - the 74HC595 module works perfectly at 3.3V
  • Note: Do not connect VCC to 5V if your module doesn't have level shifters
  • Note: Double-check polarity on VCC and GND before powering on
The wiring diagram between ESP32 C3 Super Mini 74HC595 4-Digit 7-Segment Display

This image is created using Fritzing. Click to enlarge image

Library Setup

New to ESP32 C3 Mini? Complete our Getting Started with ESP32 C3 Mini tutorial first to set up your development environment.

Follow these steps to install the required library:

  • Connect board: Plug your ESP32 C3 Super Mini into your computer using the USB-C cable
  • Open Arduino IDE: Launch the Arduino IDE software on your computer
  • Select board: Choose ESP32 C3 Super Mini from the board list
  • Select port: Choose the correct COM port for your ESP32 C3 Super Mini
  • Open Library Manager: Click the Libraries icon on the left sidebar
  • Search library: Type "DIYables_4Digit7Segment_74HC595" in the search field
  • Install library: Find the DIYables entry and click Install
  • Select version: Choose version 2.0.0 or later for best compatibility
  • Pro Tip: This library has no dependencies - installation is quick and simple
ESP32 C3 Super Mini 74HC595 4-Digit 7-Segment Display library

Starter Sketch

Here's the minimum code needed to get your 74HC595 4-digit display working with ESP32 C3 Super Mini:

#include <DIYables_4Digit7Segment_74HC595.h> #define SCLK_PIN D2 #define RCLK_PIN D1 #define DIO_PIN D10 DIYables_4Digit7Segment_74HC595 display(SCLK_PIN, RCLK_PIN, DIO_PIN); void setup() { display.begin(); display.print(1234); } void loop() { display.loop(); }

What this code does:

  • Includes the DIYables 7-segment library
  • Defines GPIO pins for SCLK, RCLK, and DIO connections
  • Creates a display object with the three control pins
  • Initializes the display in setup() with begin()
  • Displays the number 1234 on the screen
  • Refreshes the display continuously in loop() to keep it lit

Important notes:

  • display.begin() configures the GPIO pins for output
  • display.loop() must be called frequently to maintain display brightness through multiplexing
  • Use display.delay() instead of standard delay() to keep the display refreshed during waits
  • The display stays lit with your last print() command as long as loop() keeps running

Tutorial - Display Integers

This tutorial shows how to display integer values on the ESP32 C3 Super Mini 74HC595 4-digit 7-segment display including negative numbers and zero-padding.

/* * This ESP32 C3 Super Mini code was developed by newbiely.com * * This ESP32 C3 Super Mini code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/esp32-c3/esp32-c3-super-mini-74hc595-4-digit-7-segment-display */ #include <DIYables_4Digit7Segment_74HC595.h> // Pin configuration - change these to match your wiring #define SCLK_PIN D2 // The ESP32 C3 SuperMini pin connected to the Serial clock pin of 7-segment display #define RCLK_PIN D1 // The ESP32 C3 SuperMini pin connected to the Register clock / latch pin of 7-segment display #define DIO_PIN D10 // The ESP32 C3 SuperMini pin connected to the Data (DS) pin of 7-segment display DIYables_4Digit7Segment_74HC595 display(SCLK_PIN, RCLK_PIN, DIO_PIN); int numbers[] = {0, 42, 1234, -5, -123, 9999}; int numCount = 6; int currentIndex = 0; bool showZeroPad = false; unsigned long lastChange = 0; void setup() { Serial.begin(9600); display.begin(); Serial.println("4-Digit 7-Segment 74HC595 - Integer Example"); } void loop() { display.loop(); // Must be called frequently to refresh the display if (millis() - lastChange >= 2000) { lastChange = millis(); if (!showZeroPad) { display.print(numbers[currentIndex]); Serial.print("Displaying: "); Serial.println(numbers[currentIndex]); currentIndex++; if (currentIndex >= numCount) { currentIndex = 0; showZeroPad = true; } } else { display.print(42, true); // Shows "0042" Serial.println("Displaying: 0042 (zero-padded)"); showZeroPad = false; } } }

Detailed Instructions

  • Wire the display: Connect the 74HC595 module to your ESP32 C3 Super Mini following the wiring diagram above
  • Connect to computer: Plug the ESP32 C3 Super Mini into your computer via USB-C cable
  • Open Arduino IDE: Launch the Arduino IDE software
  • Select board and port: Choose ESP32 C3 Super Mini and the correct COM port
  • Copy code: Paste the integer display code into Arduino IDE
  • Upload: Click the Upload button to transfer code to your board
  • Open Serial Monitor: Click the Serial Monitor icon to view output messages
  • Observe display: Watch the 7-segment display cycle through different integers
  • Pro Tip: The second parameter in print(42, true) enables zero-padding for consistent width displays

Serial Monitor Output

Newbiely | Arduino IDE 2.3.8
──
File
Edit
Sketch
Tools
Help
ESP32C3 Dev Module
Newbiely.ino
···
8 Serial.println("Hello World!");
Output
Serial Monitor
Message (Enter to send message to 'ESP32C3 Dev Module' on 'COM15')
New Line
9600 baud
[2026-04-15 10:23:45] Displaying: 0 [2026-04-15 10:23:47] Displaying: 42 [2026-04-15 10:23:49] Displaying: 1234 [2026-04-15 10:23:51] Displaying: -5 [2026-04-15 10:23:53] Displaying: -123 [2026-04-15 10:23:55] Displaying: 9999 [2026-04-15 10:23:57] Displaying: 0042 (zero-padded) [2026-04-15 10:23:59] Cycle repeating...
Ln 11, Col 1
ESP32C3 Dev Module on COM15
2

The display cycles through various integers including zero, positive numbers, negative numbers, maximum value, and zero-padded format.

Method Reference

Method Action Syntax
print(int) Display an integer value display.print(1234)
print(int, true) Display integer with zero-padding display.print(42, true)
loop() Refresh display multiplexing display.loop()
begin() Initialize display pins display.begin()

Tutorial - Display Floats

This tutorial demonstrates displaying floating-point numbers on your ESP32 C3 Super Mini with automatic and fixed decimal places.

/* * This ESP32 C3 Super Mini code was developed by newbiely.com * * This ESP32 C3 Super Mini code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/esp32-c3/esp32-c3-super-mini-74hc595-4-digit-7-segment-display */ #include <DIYables_4Digit7Segment_74HC595.h> // Pin configuration - change these to match your wiring #define SCLK_PIN D2 // The ESP32 C3 SuperMini pin connected to the Serial clock pin of 7-segment display #define RCLK_PIN D1 // The ESP32 C3 SuperMini pin connected to the Register clock / latch pin of 7-segment display #define DIO_PIN D10 // The ESP32 C3 SuperMini pin connected to the Data (DS) pin of 7-segment display DIYables_4Digit7Segment_74HC595 display(SCLK_PIN, RCLK_PIN, DIO_PIN); void setup() { Serial.begin(9600); display.begin(); Serial.println("4-Digit 7-Segment 74HC595 - Float Example"); } void loop() { // Auto decimal placement display.print(1.5); // Shows " 1.5" Serial.println("Auto decimal: 1.5"); display.delay(2000); display.print(12.34); // Shows "12.34" Serial.println("Auto decimal: 12.34"); display.delay(2000); display.print(3.141); // Shows "3.141" Serial.println("Auto decimal: 3.141"); display.delay(2000); display.print(-1.2); // Shows "-1.20" Serial.println("Auto decimal: -1.20"); display.delay(2000); display.print(0.5); // Shows " 0.5" Serial.println("Auto decimal: 0.5"); display.delay(2000); // Fixed decimal places display.print(23.5, 1); // 1 decimal place: shows "23.5" Serial.println("1 decimal place: 23.5"); display.delay(2000); display.print(1.5, 2); // 2 decimal places: shows "1.50" Serial.println("2 decimal places: 1.50"); display.delay(2000); // Zero-padded display.print(1.5, 2, true); // Shows "01.50" Serial.println("2 decimal places, zero-padded: 01.50"); display.delay(2000); }

Detailed Instructions

  • Upload code: Copy the float display code and upload it to your ESP32 C3 Super Mini
  • Open Serial Monitor: View the serial output to track what's being displayed
  • Watch display: Observe floats with different decimal place settings
  • Note formatting: See how auto-decimal adjusts versus fixed decimal places
  • Pro Tip: Use fixed decimal places for consistent sensor readings like temperature or voltage

Serial Monitor Output

Newbiely | Arduino IDE 2.3.8
──
File
Edit
Sketch
Tools
Help
ESP32C3 Dev Module
Newbiely.ino
···
8 Serial.println("Hello World!");
Output
Serial Monitor
Message (Enter to send message to 'ESP32C3 Dev Module' on 'COM15')
New Line
9600 baud
[2026-04-15 11:15:22] Displaying: 3.14 (auto decimal) [2026-04-15 11:15:24] Displaying: 98.6 (auto decimal) [2026-04-15 11:15:26] Displaying: 3.1 (1 decimal) [2026-04-15 11:15:28] Displaying: 3.14 (2 decimals) [2026-04-15 11:15:30] Displaying: 0042 (zero-padded float) [2026-04-15 11:15:32] Cycle repeating...
Ln 11, Col 1
ESP32C3 Dev Module on COM15
2

Tutorial - Text and Temperature

This tutorial shows how to display text strings, temperature readings with degree symbols, and custom characters on the ESP32 C3 Super Mini 7-segment display.

/* * This ESP32 C3 Super Mini code was developed by newbiely.com * * This ESP32 C3 Super Mini code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/esp32-c3/esp32-c3-super-mini-74hc595-4-digit-7-segment-display */ #include <DIYables_4Digit7Segment_74HC595.h> // Pin configuration - change these to match your wiring #define SCLK_PIN D2 // The ESP32 C3 SuperMini pin connected to the Serial clock pin of 7-segment display #define RCLK_PIN D1 // The ESP32 C3 SuperMini pin connected to the Register clock / latch pin of 7-segment display #define DIO_PIN D10 // The ESP32 C3 SuperMini pin connected to the Data (DS) pin of 7-segment display DIYables_4Digit7Segment_74HC595 display(SCLK_PIN, RCLK_PIN, DIO_PIN); const char* texts[] = {"HELP", "Hi", "COOL", "done"}; int textCount = 4; int currentIndex = 0; int phase = 0; unsigned long lastChange = 0; void setup() { Serial.begin(9600); display.begin(); Serial.println("4-Digit 7-Segment 74HC595 - Text and Degree Example"); } void loop() { display.loop(); // Must be called frequently to refresh the display if (millis() - lastChange >= 2000) { lastChange = millis(); if (phase == 0) { // Display text strings display.print(texts[currentIndex]); Serial.print("Text: "); Serial.println(texts[currentIndex]); currentIndex++; if (currentIndex >= textCount) { currentIndex = 0; phase = 1; } } else if (phase == 1) { // Display temperature 25 degrees C display.printTemperature(25, 'C'); Serial.println("Temperature: 25 C"); phase = 2; } else if (phase == 2) { // Display temperature 72 degrees F display.printTemperature(72, 'F'); Serial.println("Temperature: 72 F"); phase = 3; } else if (phase == 3) { // Display degree symbol using string with DEGREE_CHAR constant char degStr[5]; degStr[0] = '2'; degStr[1] = '5'; degStr[2] = DEGREE_CHAR; degStr[3] = 'C'; degStr[4] = '\0'; display.print(degStr); Serial.println("String with degree: 25 deg C"); phase = 4; } else { // Display string with dots display.print("1.2.3.4"); Serial.println("Dots: 1.2.3.4"); phase = 0; } } }

Detailed Instructions

  • Upload code: Transfer the text and temperature code to your ESP32 C3 Super Mini
  • Open Serial Monitor: Track what text and symbols are being displayed
  • Observe text: Watch how letters appear on the 7-segment display
  • See degree symbol: Note the small degree circle for temperature displays
  • Try decimal points: See inline dots between digits
  • Pro Tip: Not all letters display clearly on 7-segment - stick to numbers, H, E, L, P, C, O, and similar characters for best results

Serial Monitor Output

Newbiely | Arduino IDE 2.3.8
──
File
Edit
Sketch
Tools
Help
ESP32C3 Dev Module
Newbiely.ino
···
8 Serial.println("Hello World!");
Output
Serial Monitor
Message (Enter to send message to 'ESP32C3 Dev Module' on 'COM15')
New Line
9600 baud
[2026-04-15 12:30:18] Displaying: HELP [2026-04-15 12:30:20] Displaying: Hi [2026-04-15 12:30:22] Displaying: COOL [2026-04-15 12:30:24] Displaying: done [2026-04-15 12:30:26] Displaying: 72°F (temperature) [2026-04-15 12:30:28] Displaying: 22°C (temperature) [2026-04-15 12:30:30] Displaying: 12.34 (with dot) [2026-04-15 12:30:32] Cycle repeating...
Ln 11, Col 1
ESP32C3 Dev Module on COM15
2

Tutorial - Time

This tutorial demonstrates creating a digital clock display on your ESP32 C3 Super Mini with HH.MM format and a blinking colon separator.

/* * This ESP32 C3 Super Mini code was developed by newbiely.com * * This ESP32 C3 Super Mini code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/esp32-c3/esp32-c3-super-mini-74hc595-4-digit-7-segment-display */ #include <DIYables_4Digit7Segment_74HC595.h> // Pin configuration - change these to match your wiring #define SCLK_PIN D2 // The ESP32 C3 SuperMini pin connected to the Serial clock pin of 7-segment display #define RCLK_PIN D1 // The ESP32 C3 SuperMini pin connected to the Register clock / latch pin of 7-segment display #define DIO_PIN D10 // The ESP32 C3 SuperMini pin connected to the Data (DS) pin of 7-segment display DIYables_4Digit7Segment_74HC595 display(SCLK_PIN, RCLK_PIN, DIO_PIN); int hours = 12; int minutes = 30; bool colonOn = true; unsigned long lastToggle = 0; void setup() { Serial.begin(9600); display.begin(); Serial.println("4-Digit 7-Segment 74HC595 - Time Example"); Serial.println("Displaying 12:30 with blinking dot separator"); } void loop() { display.loop(); // Must be called frequently to refresh the display if (millis() - lastToggle >= 500) { lastToggle = millis(); display.printTime(hours, minutes, colonOn); colonOn = !colonOn; // Toggle dot separator every 500ms for blinking effect } }

Detailed Instructions

  • Upload code: Transfer the time display code to your ESP32 C3 Super Mini
  • Open Serial Monitor: View timestamp updates
  • Watch display: See time in HH.MM format with blinking separator
  • Note blink rate: The colon blinks every 500ms like a real clock
  • Pro Tip: Combine this with an RTC module for an actual working clock project

Serial Monitor Output

Newbiely | Arduino IDE 2.3.8
──
File
Edit
Sketch
Tools
Help
ESP32C3 Dev Module
Newbiely.ino
···
8 Serial.println("Hello World!");
Output
Serial Monitor
Message (Enter to send message to 'ESP32C3 Dev Module' on 'COM15')
New Line
9600 baud
[2026-04-15 14:45:10] Displaying: 12.30 (dot ON) [2026-04-15 14:45:10] Displaying: 12 30 (dot OFF) [2026-04-15 14:45:11] Displaying: 12.30 (dot ON) [2026-04-15 14:45:11] Displaying: 12 30 (dot OFF) [2026-04-15 14:45:12] Displaying: 12.30 (dot ON) [2026-04-15 14:45:12] Blinking continues...
Ln 11, Col 1
ESP32C3 Dev Module on COM15
2

Troubleshoot

Common issues when using the 74HC595 4-digit 7-segment display with ESP32 C3 Super Mini and their solutions:

Issue Possible Cause Resolution
Display blank Wiring problem Check VCC, GND, and all three data pin connections
Display blank Power issue Verify 3.3V is present at VCC pin with multimeter
Wrong characters Anode/cathode mismatch Pass false as 4th parameter to constructor for common cathode modules
Flickering display delay() blocking loop() Replace all delay() calls with display.delay() to maintain multiplexing
Random segments Loose wiring Secure jumper wire connections and check for shorts
Dim display Low voltage Ensure stable 3.3V power supply to VCC pin
Upload fails Board in wrong mode Hold BOOT button while pressing RESET, then retry upload
No Serial output Wrong baud rate Set Serial Monitor to 9600 baud to match code
Code won't compile Library not installed Install DIYables_4Digit7Segment_74HC595 library version 2.0.0+
Port not found Driver issue Install CH340 or CP2102 USB driver for ESP32 C3 Super Mini

Applications and Project Ideas

Use your ESP32 C3 Super Mini with 74HC595 4-digit display to create these beginner-friendly projects:

  • Digital thermometer: Display room temperature from DHT11 or DS18B20 sensor with degree symbol
  • Countdown timer: Create a kitchen timer or event countdown with hours and minutes
  • Score keeper: Build a simple scoreboard for games or competitions
  • Stopwatch: Make a digital stopwatch with split-time capability
  • Voltage meter: Monitor battery voltage or power supply levels in real-time
  • Visitor counter: Count people entering through a door with IR sensor
  • RPM display: Show motor speed for robotics or RC projects
  • Clock with WiFi sync: Build an NTP-synchronized clock using ESP32 WiFi
  • Lap timer: Track lap times for slot car racing or running
  • Temperature alarm: Display temp and blink when threshold exceeded

Video Tutorial

Watch the video below for a visual walkthrough of connecting and programming the 74HC595 4-digit 7-segment display with your ESP32 C3 Super Mini.

Challenge Yourself

Test your skills with these progressive challenges for the ESP32 C3 Super Mini and 74HC595 display:

  • Easy: Modify the integer tutorial to count from 0 to 9999 continuously at one-second intervals
  • Easy: Display your age or birth year on the screen with zero-padding
  • Medium: Create a two-button counter with one button to increment and one to decrement
  • Medium: Build a temperature display that alternates between Celsius and Fahrenheit every 3 seconds
  • Advanced: Make a WiFi-connected clock that gets time from an NTP server and displays it in HH.MM format with blinking colon
  • Advanced: Create a countdown timer that accepts input from Serial Monitor and sounds a buzzer when it reaches zero
  • Expert: Build a multi-function display that cycles between time, temperature, and a custom message using a mode button

Platform Support

The DIYables_4Digit7Segment_74HC595 library uses standard Arduino APIs and works on all Arduino-compatible platforms.

Supported boards include:

  • ESP32 C3 Super Mini (featured in this tutorial)
  • Arduino Uno, Nano, Mega
  • ESP8266, ESP32, ESP32-S2, ESP32-S3
  • Raspberry Pi Pico
  • STM32 boards
  • Any board with 3 available GPIO pins

The library architecture is set to * for universal compatibility across all Arduino platforms.

※ OUR MESSAGES

  • As freelancers, We are AVAILABLE for HIRE. See how to outsource your project to us
  • Please feel free to share the link of this tutorial. However, Please do not use our content on any other websites. We invested a lot of effort and time to create the content, please respect our work!