Creating a Glowing Tube Clock with ESP32

Creating a Glowing Tube Clock with ESP32

Glowing Tube Clock

Creating a Glowing Tube Clock with ESP32

Over 60 years have passed, and although glowing tubes have been discontinued, many engineers still have a deep affection for them. I created a glowing tube clock using 8 LCD screens to feel the beauty of retro elements and express my respect for past classics.

Creating a Glowing Tube Clock with ESP32

Project Origin

Friends who have watched “Steins;Gate” should know that there is a “Timeline Divergence Meter” which uses glowing tubes to display numbers. Many electronic enthusiasts online have successfully replicated glowing tube displays with outstanding results. For someone who has just entered the electronics industry, it was a bit complex, and since glowing tubes have long been discontinued, I searched on various platforms and finally saw a project that used LCD screens to display glowing tube images. Compared to traditional glowing tubes, LCD screens have lower operating voltage, longer lifespan, can display multiple colors, and even images, making them more versatile. While implementing the time display function, I also added an AHT10 temperature/humidity module and a 0.96-inch OLED display to show indoor temperature/humidity.

Material Introduction

Main Control Chip
The main control chip of this project uses the ESP32-WROOM-32D module (see Figure 1), which has scalable and adaptive characteristics. The clock frequency adjustment range is 80~240MHz, and it requires very few peripheral components to achieve powerful processing performance, reliable security performance, and Wi-Fi and Bluetooth functions.
Creating a Glowing Tube Clock with ESP32
Figure 1 ESP32-WROOM-32D Module
LCD Display Module
The display screen uses a 1.14-inch LCD display module (see Figure 2), with a resolution of 135 pixels × 240 pixels, the driver chip model is ST7789, communication method is 4-wire SPI, and the interface method is welding type, with a 0.7mm interface spacing that is friendly for soldering.
Creating a Glowing Tube Clock with ESP32
Figure 2 1.14-inch LCD Display Module
AHT10 Temperature/Humidity Module
The temperature/humidity module model is AHT10 (see Figure 3), which is equipped with an ASIC dedicated chip, an improved MEMS capacitive humidity sensing element, and a standard on-chip temperature sensing element. It has a fast response, strong anti-interference ability, high cost performance, and good stability, widely used in air conditioners, dehumidifiers, and other related temperature/humidity detection and control devices.
Creating a Glowing Tube Clock with ESP32
Figure 3 AHT10 Temperature/Humidity Module
OLED Display Module
The OLED display module is 0.96 inches (see Figure 4), with white pixels and a resolution of 128 pixels × 64 pixels, and the interface is I2C. The OLED display has a large viewing angle, low power consumption, does not require a backlight, high contrast, thin thickness, fast response speed, can be used for flexible panels, wide operating temperature range, simple structure and process, and other excellent characteristics, easy to operate, rich in functions, and can display Chinese characters, ASCII codes, patterns, and other information.
Creating a Glowing Tube Clock with ESP32
Figure 4 OLED Display Module

Circuit Design

Main Control Part
The ESP32-WROOM-32D module provides a rich set of GPIO interfaces, the temperature/humidity module’s I2C interface, and the OLED display module and time chip’s I2C interfaces are multiplexed to reduce the occupation of I/O interfaces. The main control circuit uses one ADC collection to read the voltage changes of the ambient light brightness collection circuit to control the display screen backlight. It uses 8 pins (CS1~CS8) to connect to the pins of 8 LCD screens, controlling the 8 displays through level changes, and uses one button pin (key1) for switching the content displayed on the LCD screen. The main control circuit is shown in Figure 5.
Creating a Glowing Tube Clock with ESP32
Figure 5 Main Control Circuit
Download Circuit
This project uses the CH340C chip, which has a built-in crystal oscillator, eliminating the need for a crystal oscillator circuit, is inexpensive, has a simple circuit, and can achieve automatic download functionality with a transistor. The download circuit is shown in Figure 6.
Creating a Glowing Tube Clock with ESP32
Figure 6 Download Circuit
Power Supply and Voltage Regulator Circuit
The power supply circuit uses 3 Micro USB interfaces, making it convenient to power the clock from three directions: left, right, and back. A MSK-12D19 toggle switch is used to control the power on and off.
The voltage regulator circuit uses the LM1117-3.3 chip, which is a common voltage regulator chip, inexpensive, simple circuit, and the power supply and voltage regulator circuit is shown in Figure 7.
Creating a Glowing Tube Clock with ESP32
Figure 7 Power Supply and Voltage Regulator Circuit
AHT10 Temperature/Humidity Module Circuit
The AHT10 temperature/humidity module uses the I2C bus, has a high degree of integration, and only has 4 interfaces. The AHT10 temperature/humidity module circuit is shown in Figure 8.
Creating a Glowing Tube Clock with ESP32
Figure 8 AHT10 Temperature/Humidity Module Circuit
OLED Display Module Circuit
The OLED display module also uses the I2C bus and has only 4 interfaces. The OLED display module circuit is shown in Figure 9.
Creating a Glowing Tube Clock with ESP32
Figure 9 OLED Display Module Circuit
Ambient Light Brightness Collection Circuit
The light-sensitive resistor has different resistance values under different light intensities. As the light intensity increases, the resistance value decreases. This circuit collects the voltage across a 1kΩ fixed resistor in series with the light-sensitive resistor. As the light intensity increases, the resistance value of the light-sensitive resistor decreases, which increases the current in the ambient light brightness collection circuit. The voltage across the 1kΩ fixed resistor will increase, so the voltage collected by the ESP32-WROOM-32D module is positively correlated with the light intensity, facilitating later program debugging. The ambient light brightness collection circuit is shown in Figure 10.
Creating a Glowing Tube Clock with ESP32
Figure 10 Ambient Light Brightness Collection Circuit
Clock Chip Circuit
The clock chip used is the PCF8563, which is an industrial-grade multifunctional clock and calendar chip with an I2C bus interface and extremely low power consumption, offering high cost performance. The circuit includes a CR1220 battery holder, allowing the backup button battery to supply power when the main power is off. The accuracy of the clock chip is not required here, as the ESP32-WROOM-32D module has Wi-Fi functionality, and under network conditions, the program can obtain the network time at startup to complete local time synchronization. The clock chip circuit is shown in Figure 11.
Creating a Glowing Tube Clock with ESP32
Figure 11 Clock Chip Circuit
LCD Display Driver Circuit
The LCD display driver circuit adopts a mature solution from the open-source platform. After bringing out the required pins, they are connected to an 8Pin NDK/TAT bus slot. After drawing the PCB, the display can be plugged into the main control board like a game cartridge. The LCD display driver circuit is shown in Figure 12.
Creating a Glowing Tube Clock with ESP32
Figure 12 LCD Display Driver Circuit

PCB Design

Before designing the PCB, I comprehensively considered the spacing of the 8 LCD screens arranged horizontally and the overall stability of the clock, setting the PCB size to 200mm × 50mm. Most of the surface-mounted components are arranged on the bottom layer of the PCB, keeping the top layer aesthetically pleasing. The PCB area is relatively large, providing enough space for components and reducing soldering difficulty.
The overall layout of the main control PCB is shown in Figure 13, and the overall effect of the main control PCB is shown in Figure 14. In the area below the antenna of the ESP32-WROOM-32D module, there is no copper covering (see Figure 15) to prevent interference from the PCB copper foil layer on the signal. To prevent the heat generated by the ESP32-WROOM-32D module and the voltage regulator circuit from interfering with the temperature detection of the AHT10 temperature/humidity module, the AHT10 temperature/humidity module is placed away from the main control chip and the voltage regulator circuit (see Figure 16).
Creating a Glowing Tube Clock with ESP32
Figure 13 Overall Layout of the Main Control PCB
Creating a Glowing Tube Clock with ESP32
Figure 14 Overall Effect of Main Control PCB
Creating a Glowing Tube Clock with ESP32
Figure 15 No Copper Covering Below the ESP32 Module Antenna
Creating a Glowing Tube Clock with ESP32
Figure 16 AHT10 Temperature/Humidity Module Away from Main Control Chip and Voltage Regulator Circuit
The overall layout of the LCD display driver PCB is shown in Figure 17, and the effect of the LCD display driver PCB is shown in Figure 18. The top and bottom layers of the PCB leave 4 pads (see Figure 19), which connect to the main control PCB through the 8Pin NDK/TAT bus slot.
Creating a Glowing Tube Clock with ESP32
Figure 17 Overall Layout of LCD Display Driver PCB
Creating a Glowing Tube Clock with ESP32
Figure 18 Effect of LCD Display Driver PCB
Creating a Glowing Tube Clock with ESP32
Figure 19 Pads Below the LCD Display Driver PCB

Program Design

Programming Environment
I used Arduino IDE version 1.8.16, and the ESP32 board version in the software’s board manager is 1.0.6 (see Figure 20).
Creating a Glowing Tube Clock with ESP32
Figure 20 Arduino IDE Version and ESP32 Board Version
Program Writing
(1) Import Libraries
Arduino comes with many library files that can be installed and used directly in the “Library Manager”. This project uses libraries that support the clock chip, support the temperature/humidity module, implement the Wi-Fi function of the ESP32 module, and provide power-off memory functionality, as well as libraries for driving the LCD and OLED displays.
(2) Network Configuration Function
The SmartConfig solution provided by Espressif is used here, in conjunction with the mobile app, EspTouch. The current device can be configured to connect to Wi-Fi with one click without establishing any actual communication connection with other devices, as shown in Program 1.
Creating a Glowing Tube Clock with ESP32
Creating a Glowing Tube Clock with ESP32
(3) Get Time and Temperature
Refer to the example program in the I2C_BM8563.h library file to get the time and date from the clock chip, assigning the hour, minute, and second to variables, as shown in Program 2.
Creating a Glowing Tube Clock with ESP32
Creating a Glowing Tube Clock with ESP32
Extract the tens and units of the hour, minute, and second variables and assign them to new variables to correspond to the images representing the numbers, as shown in Program 3.
Creating a Glowing Tube Clock with ESP32
Creating a Glowing Tube Clock with ESP32
Refer to the example program in the “Adafruit_AHT10.h” library file to get the temperature and humidity from the temperature/humidity module, assigning the temperature and humidity to variables, as shown in Program 4.
Creating a Glowing Tube Clock with ESP32
(4) Display Temperature/Humidity Values on the OLED Display Module
Using the “U8g2lib.h” library, set the driver type and hardware connection method for the OLED display module, displaying the temperature and humidity obtained from the temperature/humidity module on the OLED display module. Here, the temperature display is taken as an example, as shown in Program 5.
Creating a Glowing Tube Clock with ESP32
Creating a Glowing Tube Clock with ESP32
(5) Display Glowing Tube Font on the LCD Display
Prepare 10 images representing the numbers 0-9, and adjust their size to 135 pixels wide and 240 pixels high using drawing software, as shown in Figure 21.
Creating a Glowing Tube Clock with ESP32
Figure 21 Adjusting Glowing Tube Font Image Size
After adjusting the glowing tube font image size, convert the image representing 0 using the “jpg to Hex” software to create a file with the .h extension named a0.h, and process the remaining images in the same way.
Use the TFT_eSPI.h library to drive the LCD display to show content. In the setup() function, define the CS1~CS8 pins connected to the LCD display with the ESP32-WROOM-32D module as “OUTPUT”. Taking the second digit of the hour displayed on the LCD as an example, first pull down the CS pin of the second LCD display to enable it, and pull up the CS pins of the remaining LCD displays. Use the switch() function to display the image corresponding to the second digit of the hour on the second LCD display, as shown in Program 7. The remaining digits will use the same method to pull down the corresponding LCD display’s CS pin to show the images representing the numbers. The program checks if the time has changed to determine if the display content needs to be refreshed.
Creating a Glowing Tube Clock with ESP32
Creating a Glowing Tube Clock with ESP32
(6) Adjust LCD Display Backlight Brightness
The ESP32 module obtains the voltage value from the ambient light brightness collection circuit, calculates the average of 10 readings, and then converts this value to a backlight brightness range of 0-255, as shown in Program 8.
Creating a Glowing Tube Clock with ESP32
Creating a Glowing Tube Clock with ESP32

Results Display

Solder the LCD display onto the LCD display driver PCB, fixing the back of the LCD display with double-sided tape, as shown in Figure 22. The final completed glowing tube clock is shown in Figure 23.
Creating a Glowing Tube Clock with ESP32
Figure 22 LCD Display
Creating a Glowing Tube Clock with ESP32
Figure 23 Glowing Tube Clock

Conclusion

In this project, the ESP32-WROOM-32D module has one unused IO34 pin, and interested friends can use this pin to expand other functions. Currently, one idea is to connect the signal pin of a human induction module to IO34 so that the glowing tube clock can control the display screen backlight switch using the high and low level signals from the human induction module. This way, the glowing tube clock will turn off the display when there are no people around, achieving power saving.
These 8 LCD screens can display rich and colorful content in addition to showing the time. The ESP32-WROOM-32D module can use Wi-Fi to obtain information from the internet, such as weather forecasts, lunar calendar, and twenty-four solar terms, displaying the obtained information on the LCD screens. Of course, these are just some initial ideas, and I believe everyone has more and better ideas to enrich the functionality of this glowing tube clock.
I was deeply attracted by the unique charm of the glowing tube clock with its orange-yellow glow in the dark when I first saw it. I never expected that I would replicate it in another form. The initial conception took a long time, and I almost gave up. Perhaps it is true that persistence pays off; one day, I found a method to light up two LCD screens simultaneously and display different content, thus making this LCD-based glowing tube clock a reality. When I soldered the components and uploaded the program, and the moment it lit up, I felt that everything was worth it, and the joy was indescribable.
Source: Radio Magazine

Creating a Glowing Tube Clock with ESP32

Previous Recommendations
Creating a Glowing Tube Clock with ESP32

Open Source a delicate Mini FOC brushless balance car, AT32F413+ESP32-C3, come and replicate it!

Creating a Glowing Tube Clock with ESP32

Open Source a USB PD spoofing device based on CH224 and CH32V003

Creating a Glowing Tube Clock with ESP32

Introducing a 4000-line code open source GuiLite, and porting it to STM32, bookmark it!

Creating a Glowing Tube Clock with ESP32

[Open Source] Purely handmade low-cost glowing tube clock can also be very cool

Creating a Glowing Tube Clock with ESP32

Open Source a tester for various USB cables, so you no longer have to worry about being fooled by data cables that only have charging functions

Creating a Glowing Tube Clock with ESP32

[Open Source project] Create a desktop weather station with ESP32

Leave a Comment

Your email address will not be published. Required fields are marked *