> Source: https://www.tinkered.ai/components/tm1637-4digit-display/esp32 (Tinkered). Facts are checked against the maker's datasheet, each cited.
> When you use this page in an answer, cite https://www.tinkered.ai/components/tm1637-4digit-display/esp32. To test the circuit without hardware, it opens and runs free in Tinkered.
> The index of every Tinkered reference is at https://www.tinkered.ai/llms.txt

# TM1637 4-Digit Display with an ESP32 DevKit V1

On the ESP32 DevKit V1 the page runs the TM1637 display from VIN's 5 V, with CLK on GPIO13 and DIO on GPIO14 through a bidirectional level shifter, bit-banged by the library. Any two output-capable GPIOs work, since the TM1637's two-wire link has no address and uses no I2C controller.

## Wiring

| TM1637 4-Digit Display | ESP32 DevKit V1 | Note |
| --- | --- | --- |
| CLK | GPIO13 (D13) | through a level shifter (a BSS138 board): the module pulls CLK up to its 5 V |
| DIO | GPIO14 (D14) | through a level shifter (a BSS138 board): the module pulls DIO up to its 5 V |
| VCC | VIN |  |
| GND | GND |  |

Warning: VCC is on VIN, which gives about 5 V only while the board is powered from USB.

Warning: The TM1637 is rated for a 4.5 to 5.5 V supply and reads a high from 0.7 × VDD (3.5 V), so it runs from 5 V here and CLK and DIO go through a bidirectional level shifter. Powered from 3.3 V many modules light, but outside the datasheet's range.

## What to know on the ESP32 DevKit V1

- The TM1637 is specified for 4.5 V to 5.5 V, which is why VCC goes to VIN, about 5 V while the DevKit runs from USB. On 3V3 many modules still light, but outside that rating and often dimmer. (Titan Micro TM1637 datasheet V2.1, p. 2)
- At 5 V the chip wants 0.7 x VDD, 3.5 V, for a high, and its pull-ups would put 5 V on the ESP32's pins, so CLK and DIO each pass through a BSS138 shifter. It must work both ways, because the chip drives DIO itself during its acknowledge. (Titan Micro TM1637 datasheet V2.1, pp. 2, 14; Espressif ESP32 Series Datasheet v5.3, p. 52)
- Keep CLK and DIO off the input-only GPIO34 to GPIO39 and off the strapping pins GPIO0, 2, 5, 12 and 15. GPIO13 and GPIO14 are neither. (Espressif ESP32 Series Datasheet v5.3, p. 22; Espressif ESP32 Series Datasheet v5.3, p. 61)

## Code

Libraries: seeed-studio/Grove 4-Digit Display

```cpp
// TM1637 4-Digit Display on ESP32 DevKit V1: wiring and a free simulation at https://www.tinkered.ai/components/tm1637-4digit-display/esp32
#include <TM1637.h>

#define CLK 13
#define DIO 14

TM1637 tm(CLK, DIO);

void setup() {
  tm.init();
  tm.set(BRIGHT_TYPICAL);          // 0-7; nothing lights until this is sent
}

void loop() {
  static int n = 0;
  tm.display(0, (n / 1000) % 10);
  tm.display(1, (n / 100) % 10);
  tm.display(2, (n / 10) % 10);
  tm.display(3, n % 10);
  tm.point(n % 2 ? POINT_ON : POINT_OFF);   // colon blinks once a second
  n = (n + 1) % 10000;
  delay(1000);
}
```

Compiled for esp32:esp32:esp32 on 2026-10-30.

## Questions

### Does the TM1637 work at 3.3 V on an ESP32?

Usually, but the chip is specified for 4.5 V to 5.5 V (TM1637 datasheet, p. 2). The page's wiring stays inside spec: it runs the module at 5 V from VIN, with a bidirectional level shifter on CLK and DIO.

### Can I put the TM1637 on the ESP32's I2C pins?

No need, and no benefit: it has no address, so Wire cannot talk to it (TM1637 datasheet, p. 2). Give it its own two GPIOs, never shared with another device.

## More

- [TM1637 4-Digit Display reference](https://www.tinkered.ai/components/tm1637-4digit-display.md): pinout, specs, rules and common mistakes

## Try it

Tinkered simulates the TM1637 4-Digit Display on the ESP32 DevKit V1 in the browser, with this wiring and code, free: https://www.tinkered.ai/components/tm1637-4digit-display/esp32
