Labs / Bipes + MicroPython / 8 Actuators (Outputs / Actuators)

8.5 Want to display a digital counter? Let the 4-digit numeric tube light up! β€”β€” 4-digit Nixie Tube Driver Module Based on TM1637 Chip

Author: Li Zisheng Β· Source: FreakStudio open documentation Β· License: CC BY 4.0

Contents

Young makers, today let's unlock a tiny electronic screen that can display numbers and text πŸ“Ÿ!

The numbers we usually see on digital clocks and calculators are all displayed by nixie tubes. Today, we are going to get to know the 4-digit nixie tube driver module based on the TM1637 chip ✨, which enables the development board to display numbers, letters and even scrolling text on the tiny nixie tube. It's super cool to make a "mini digital clock" or a "temperature display" with it!

1. Module Introduction

Want to make your development board display data in an intuitive and visible way? This digital tube module is your perfect helper!

It is a digital tube driving display module with the TM1637 driver chip as its core: a 4-digit digital tube can only turn individual segment codes on or off by itself, and the TM1637 chip acts like an "interpreter" that converts the signals from the development board into instructions the digital tube can recognize, enabling it to display numbers, letters, and even achieve text scrolling effects.

Compared with ordinary LEDs, it has the following features:

In graphical programming, these blocks are commonly used for 4-digit seven-segment displays:

In practical projects, it is often used for the following purposes:

Popular Science: What is a 4-digit Nixie Tube?

A 4-digit nixie tube consists of 4 independent "8-segment" small displays, each of which can display numbers from 0 to 9 or letters from A to F. The TM1637 chip is responsible for controlling the on/off state of each segment, so as to make the nixie tube display the characters we expect.

2. Wiring Instructions

To make the digital tube "light up", the first step is still β€”β€” to connect the wires correctly!

TM1637 4 DOUT1 DOUT0 5

We will connect the TM1637-based 4-digit digital tube module to the digital interface DIO0 of the development board, and the corresponding relationship is as follows:

Development Board Pins

Module Pins

Description

Pin 4

DOUT1

TM1637 chip's DIO data pin

Pin 5

DOUT0

TM1637 chip's CLK data pin

πŸ“Œ Note

3. Install the TM1637 library function

Before using graphical building blocks, you need to install the driver library first; click the "Install tm1637 library" button to complete the installation.

TM1637 4 github.com/mcauser/micropython-tm1637 tm1637 3

4. Example: Display a single character + scrolling text

Experiment Objective: First, display the character "E" on the 2nd digit (positions 0-3, counted from the left) of the nixie tube, then scroll and display "HELLO WORLD" after 1 second to intuitively experience the display effect of the nixie tube.

Everyday Life Inspiration: The scrolling information boards in subway stations and the digital displays on electronic clocks work on a similar principle β€” let's make our own "mini scrolling display" now!

The graphical program is as follows:

TM1637 4 9/GPIO6 10/GPIO7 2 1000

Building Block Assembly Steps:

  1. Initialize the digital tube
    • Drag in the Init TM1637 4 Digit Display block;
    • Set CLK to Pin 9 / GPIO6, DIO to Pin 10 / GPIO7, to match the wiring.
  2. Display the single character "E"
    • Drag in the Write a Single Character to Display block;
    • Set the Character to "E", and set the Position (0-3) to 2 (the 3rd position, counting from the left);
    • Add the delay block and set it to 1 second β†’ to make the character "E" display for 1 second.
  3. Scroll to display the text "HELLO WORLD"
    • Drag the Scroll Text to Display block here;
    • Set the Text to "HELLO WORLD", and set the Speed (ms) to 1000 (one character moves every 1 second).

Experimental Effect:

TM1637 4
TM1637 4 C4 C3 C2 C1
TM1637 4

Graphical blocks will be automatically converted into MicroPython code, and the running result will be displayed:

4 tm1637

Directly importable building blocks:

Four-Digit Display.xml 2 KB

Tips

  1. If the digital tube does not display:
    • Check whether the CLK and DIO pins are connected correctly (Pin9/GPIO6, Pin10/GPIO7) and whether the wiring is secure;
    • Confirm that the TM1637 library has been installed correctly, then restart the editor and try again;
    • Check whether the module power supply is normal and whether the digital tube is inserted reversely.
  2. What should I do if the scrolling text is incomplete?
    • A 4-digit nixie tube can only display 4 characters at a time, and long text will scroll automatically. Please ensure that the Speed setting is appropriate (e. g., 1000ms is suitable for reading the text clearly);
  3. Advanced Gameplay:
    • Paired with a temperature and humidity sensor, it displays temperature values in real time;
    • Build a countdown timer that displays the remaining time on a digital tube.

✨ Interactive Quick Question

  1. Think about it: Why do we need to initialize the TM1637 at the beginning of the program? If we skip the initialization, can the nixie tube display any content?
  2. Try it out: Change the scrolling speed from 1000ms to 500ms and see if the text scrolls faster or slower. Then change it to 2000ms to experience different scrolling rhythms.

Summary:

  1. The 4-digit digital tube module based on TM1637 is a display-type output module that can drive the digital tube to display characters and scrolling text;
  2. Before use, you need to complete wiring and library installation β€” these two preparation steps to ensure normal communication;
  3. It boasts the advantages of intuitive display and rich functions, making it an essential module for data visualization and interactive projects.
  4. The basic usage is to display a single character and scrolling text, while the advanced usage is to combine with sensors to display real-time data.