Project 9 Digital Tube Display

1. Description

This 4-Digit tube display is a device used to display counting or time, which is able to display numbers from 0 ~ 9 and simple letters. It consists of four digital tubes, each of which has seven light-emitting diodes (LED).

Moreover, multiple functions can be realized by connecting their pins to the Arduino development board, such as timekeeping and some game storing.

2. Working Principle

TM1650 utilizes IIC protocol and adopts two bus lines (SDA and SCL).

The code is provided in our blocks, and the digital tube will display numbers via this code.

3. Wiring Diagram

4. Test Code

To show numbers on the display, you only need to drag a “TM 1650 display” block from “Digital tube” and set the number string to 9999.

5. Test Result

After connecting the wiring and uploading code, the digital tube display shows “9999”, as shown below.

6. Extended Code

Let’s have some difficult operations. Rather than static numbers, we handle it to show some dynamic ones.

The following code manipulates the tubes to display 1~9999.

  1. Drag the two basic code blocks.

  1. Drag the following block from “Variables”. Set the type to int and name to item, and assign 0 as its initial value.

  1. Drag the following block from “Control” and set to 9999 times.

  1. Drag a “variable mode” from “Variables”, define its name to item and set the mode to “++”.

  2. Drag a “TM 1650 display” block from “Digital tube” and replace the string value with variable item. Add a delay time of 0.5s after it.

  1. Add a “set variable” block after the “repeat” block. Set item variable by 0. Otherwise, the item value will be out of display range after 9999 loops.

Complete Code:

7. Code Explanation

  1. Set the display string. Directly type numbers or letters you want to display in the blank.

  1. Set the ON or OFF of this TM 1650 digital tube. Each tube can be controlled separately.

  1. It is able to clear the display or used as a master switch to turn on or turn off the digital tube.