Arduino MKR WiFi 1010 - TM1637 4-Digit 7-Segment Display
This recipe walks you through driving a TM1637 4-digit 7-segment display with the Arduino MKR WiFi 1010. The MKR WiFi 1010 combines a SAMD21 processor with an ESP32-based NINA-W102 module for Wi-Fi and BLE connectivity. It runs at 3.3V, includes a LiPo battery connector for portable projects, and the TM1637 module accepts 3.3V logic directly - no level shifter required.
Ingredients in this recipe:
- Wiring the TM1637 display to the MKR WiFi 1010.
- Displaying integers, text, and temperature readings.
- Showing time in HH:MM format with a blinking colon.
- Controlling individual digits and setting brightness.

Hardware Preparation
| 1 | × | Arduino MKR WiFi 1010 | |
| 1 | × | Micro USB Cable | |
| 1 | × | TM1637 4-digit 7-segment Display (colon-separated) | |
| 1 | × | Jumper Wires |
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 .
The TM1637 Display Module at a Glance
The TM1637 is a dedicated controller for 7-segment LED displays that handles digit multiplexing and brightness control without any help from your code once the data is sent. It uses a 2-wire protocol through CLK and DIO pins and retains the displayed content in its own internal registers.
Here is what the module brings:
- 4 digits, each made up of 7 segments plus a decimal point
- Colon separator between the second and third digit for time display
- 8 software-selectable brightness levels
- 2-wire serial interface, works at both 3.3V and 5V
- Latching display - no refresh needed from the MCU
| Function | Pin |
|---|---|
| CLK | Clock signal input |
| DIO | Data input/output |
| VCC | Power supply (3.3V or 5V) |
| GND | Ground |
The MKR WiFi 1010 uses numbered pins (0-14 for digital). Any two digital pins can serve as CLK and DIO. The examples use pins 2 and 3.
Wiring Diagram
Connect the TM1637 module to the MKR WiFi 1010:
- CLK to pin 2
- DIO to pin 3
- VCC to VCC (3.3V)
- GND to GND

This image is created using Fritzing. Click to enlarge image
Installing the Library
- Connect the MKR WiFi 1010 to your computer with a Micro-B USB cable.
- Open Arduino IDE and select Arduino MKR WiFi 1010 from the board menu. Choose the correct port.
- Navigate to the Libraries panel.
- Search for "DIYables_4Digit7Segment_TM1637". Find the version published by DIYables.
- Click Install.

Fully self-contained - no additional libraries required.
Note: If the MKR WiFi 1010 does not appear in the board list, install the Arduino SAMD Boards core through the Boards Manager.
Base Template
The simplest sketch you can write with the DIYables_4Digit7Segment_TM1637 library:
Provide the CLK and DIO pin numbers to the constructor, call begin() once, and the display is ready for action.
Recipe - Display Integer Numbers
This recipe shows how to display various integer values, including negative numbers and zero-padded output.
Make It Happen
- Wire the TM1637 module to the MKR WiFi 1010 as shown in the wiring diagram.
- Plug the MKR WiFi 1010 into your computer via Micro-B USB.
- Open Arduino IDE, confirm board and port, paste the code, then click Upload.
- Open the Serial Monitor to check the output.
The display cycles through 0, 42, 1234, -5, -123, 9999, and then "0042" with zero-padding.
Quick API Reference
| Method | Behavior | Code Snippet |
|---|---|---|
| print(int) | Display an integer (-999 to 9999) | display.print(1234) |
| print(int, true) | Display with leading zeros | display.print(42, true) |
| clear() | Clear all digits | display.clear() |
Recipe - Display Text and Temperature
This recipe puts text strings and temperature values on the display, including the degree symbol.
Make It Happen
- Wire the module and upload the sketch.
- Open the Serial Monitor.
The display shows "HELP", "Hi", "COOL", "done", then "25*C" and "72*F".
Quick API Reference
| Method | Behavior | Code Snippet |
|---|---|---|
| print(const char*) | Display text (up to 4 chars) | display.print("HELP") |
| printTemperature(int, char) | Display temperature with degree/unit | display.printTemperature(25, 'C') |
| DEGREE | Degree symbol constant | display.DEGREE |
Recipe - Display Time with Blinking Colon
This recipe creates a clock-style display with the colon toggling every half second.
Make It Happen
- Upload and observe "12:30" with the colon blinking on and off.
Quick API Reference
| Method | Behavior | Code Snippet | |
|---|---|---|---|
| printTime(int, int) | Display time HH | MM with colon | display.printTime(12, 30) |
| printTime(int, int, bool) | Display time, control colon state | display.printTime(12, 30, false) |
Recipe - Blink the Display
This recipe uses off() and on() to create a blinking effect while keeping the display data.
Make It Happen
- Upload the code. "1234" blinks five times, then "HELP" blinks five times.
Quick API Reference
| Method | Behavior | Code Snippet |
|---|---|---|
| off() | Turn display off (data preserved) | display.off() |
| on() | Turn display back on | display.on() |
| setBrightness(int) | Set brightness 0-7 | display.setBrightness(4) |
Recipe - Individual Digit Control
This recipe sets each digit position independently with numbers, characters, and the colon.
Make It Happen
- Upload and observe the different digit and character combinations.
Quick API Reference
| Method | Behavior | Code Snippet |
|---|---|---|
| setNumber(int, int) | Set digit 0-9 at position 0-3 | display.setNumber(0, 1) |
| setChar(int, char) | Set character at position 0-3 | display.setChar(0, 'H') |
| setColon(bool) | Control colon on/off | display.setColon(true) |
| setSegments(int, uint8_t) | Set raw segments at position 0-3 | display.setSegments(0, 0x76) |
Troubleshoot
- Display is blank: Check all four wires. Verify CLK and DIO pin numbers match the code and VCC goes to 3.3V (VCC pin on MKR).
- Wrong characters displayed: CLK and DIO are probably swapped. Switch the two signal wires.
- Display too dim: Call setBrightness(7) for maximum brightness.
- Compile error: Make sure DIYables_4Digit7Segment_TM1637 is installed via the Library Manager.
- Board not showing up: Install the Arduino SAMD Boards core through the Boards Manager if the MKR WiFi 1010 does not appear in the board list.
Platform Support
This library relies solely on Arduino standard APIs and is compatible with all Arduino-supported platforms (architectures=*).