Clock based on the retro game PONG
Description
This clock uses a 480x320 TFT LCD screen and an RTC module controlled by an ESP32-C3 super mini CPU board.
The default screen shows the game 'pong', auto played by the CPU, where the score shows the actual time. The user interface is based on the touchscreen of the LCD board MSP3520. When the default screen is touched a month overview, including week numbers is shows. In this overview you can navigate to the previous month(s) or next month(s). Furhter a button is shown to access the settings window. In the settings window you can set the date and time.
The software is build using Visual Studio Code and PlatformIO.
The case is built from wood and the parts are cut by a laser cutting machine (XTOOL S1). The basic parts are 3mm plywood and the frame around the display is 1mm bamboo. The case is designed using Autodesk Fusion 360.
The used tools (VS Code, Platform IO, Autodesk Fusion 360) are free to download for non commercial use.
Below you find download links to zip files containing the clock software and the files to cut out the case parts.
Note: The software uses a platform.ini file, this file is responsible for downloading the correct (by version controlled) library files.
These library files are thus not packed in the download file itself, which creates a 'non complete package'. Personally I do not like that approach, but this is the way PlatformIO or Arduino thinks about a 'proper setup of a project'. I did not yet spend the time how to isolate these libraries. If one simply copy the files into the project, the compile process fails. Thus the source has external dependencies by this .ini file, which in my opinion is very wrong related to code security and maintainability.
Why this project could be a good candidate for students during practical programming lessons:
- If you do not look at the final result, but think about the spec, then there are many big decisions to make related to the SW.
Specification is simple: Create an auto-played pong view where the score represents the time.
- Major taks is to further define that spec, since many details are left out in that single sentence. Examples:
- The ball wipes away the background, how do you restore that.
- If you use a memory based bit blit, how much memory is actually needed and how do you code it (layout).
- What are the bouncing rules.
- How do you calculate the week numbers.
- How do you know on which day a certain date relates.
This basic clock can be extended to your liking with other functionality
- Birthday calendar
- Holiday information
- Alarm or multiple alarms, with or without sound
- Use the touch screen to play the game against the CPU
- More settings: play speed, backlight control, display auto dim based on time or LDR or both
- Cook timer, stopwatch, ....
- .... be creative ....
Schematic

Note: The MISO pin of the LCD is not connected. According to info on the internet this pin cannot go to tri-state, which would be a conflict if it was connected to the required pin TMISO. The info from the touch screen is needed, there is no info read from the LCD, therefor this unconnected pin is not an issue, and there is no need to use two SPI interfaces.....
Download items
Software
The download file contains the content from the VS Code project directory.
Advice:
1) Create a new project in PlatformIO running inside VS Code.
2) Select the board: "Espressif ESP32-C3-DevKitM-1".
3) Copy the files from the zip file, take over at least the content of the "src" folder and the "platformio.ini" file (lib dependencies).
Download code ZIP file
Case
The case is build from these files:
| File | Description |
| back_layout.svg | Case backside |
| bottom_layout.svg | Case bottom |
| front_layout.svg | Case front |
| side_L_layout.svg | Case left side |
| side_R_layout.svg | Case right side (Flip this file before laser cutting to have the 'outside' on top) |
| top_layout.svg | Case top |
| USB_mount_layout.svg | Additional piece to mount over the USB hole on the backside |
| mount1_layout.svg | Optional, cut 8x, glue 2 on top of eachother. The 4 parts
can be glued on the bottom to mount the PCB on (4 screws). Location based on USB port and CPU board. |
| holder_bottom_layout.svg | Touch screen pen holder, glue on the Right inner side at the
bottom of the front hole Cut this part 3x and glue them on top of each other |
| holder_top_layout.svg | Touch screen pen holder, glue on the RIght inner side at the
top of the front hole Cut this part 3x and glue them on top of each other |
| holder_L_layout.svg | Touch screen pen holder, glue on top of the previous items |
| LCD_border_LR_layout.svg | Border around LCD at front side. Print this part 2x (Left and Right) |
| LCD_border_TB_layout.svg | Border around LCD at front side. Print this part 2x (Top and Bottom) |
Download case ZIP file
For more information about the construction of the case see this page.
Contact information
If you want to share feedback, please let me know. See the 'Contact' page.