Clock based on the retro game PONG

Video
click to open video

Description
Version v2 of the LCD clock is based on version one and extended with audio.

The audio system is based on the DY-SV19R MP3 player module, which integrates both internal storage and an amplifier. The software interfaces with the module using the dyplayer library.

A key challenge when working with this module is understanding how audio files are identified in UART serial mode. While the module can operate in standalone mode using switches to select MP3 files, this design uses UART mode (hardware configuration: CON[3:1] = “100”).

In this mode, selecting file “0001.mp3” does not necessarily correspond to a file with that filename. Instead, the module assigns file numbers based on the order in which files are stored in memory. For example, if “0039.mp3” is written first to memory and later “0001.mp3” is stored, then selecting track “0001.mp3” will actually play “0039.mp3”. This occurs because the module builds an internal lookup table based on storage order rather than filename.

Recommendation:
Format the internal storage before use, sort the source files by name, and copy them in a single operation (e.g., using copy/paste). After copying, verify that the storage order matches the filename order. If not, repeat the process or, if necessary, copy the files one by one to enforce the correct sequence.

Implemented audio features:
- Speaking clock (using British Amy synthesized voice)
- Hourly or half-hourly chime options, including: bell, church bell, cuckoo, and cannon
- Configurable silent periods

The software is build using Visual Studio Code and PlatformIO.

The case is built from 3mm plywood. The parts are cut by a laser cutting machine (xTool S1). The frame around the display is 1mm bamboo. The case is designed by my own software and adapted in Autodesk Fusion 360 by adding holes for the speaker, LCD, potmeter, USB port and pen.

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 (by version controlled) library files.
These library files are 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 / Arduino thinks about a 'proper setup of a project'. Thus the source has external dependencies by this .ini file, which in my opinion is not optimal related to code security and maintainability. The software can suddenly brake because of external changes or even availability, my worst nightmare in engineering.


Schematic


Note: The MISO pin of the LCD is not connected. According to info on the internet this pin cannot go into tri-state, which would be a conflict if it was connected to the use touchscreen MISO pin. 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).

Note: The first compile installs libraries. One change is required in a library file to fix that, if you see next error message then
please see note 1 in main.cpp for the instruction how to fix this error:
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\esp32-c3-devkitm-1\firmware.elf] Error 1


DOWNLOAD: Download code ZIP file



MP3 files
Note: See text above how to copy the MP3 files to the DY-SV19R module.

DOWNLOAD: Download MP3 ZIP file



Case
The case is build from these files:
File Description
case_back.svg Case back side
case_bottom.svg Case bottom side
case_front.svg Case front side
case_left.svg Case left side
case_right.svg Case right side
case_top.svg Case top side
penholder_bottom.svg Touch screen pen holder, glue on the Right inner side at the bottom of the front hole
Cut this part 3 times and glue them on top of each other
penholder_top.svg Touch screen pen holder, glue on the RIght inner side at the top of the front hole
Cut this part 3 times and glue them on top of each other
penholder_close_top.svg Touch screen pen holder, glue on top of the previous items
penholder_close_bottom.svg Touch screen pen holder, glue on the bottom of the previous items
LCD_border_LR_layout.svg Border around LCD at front side 1mm bamboo. Print this part 2x (Left and Right)
LCD_border_TB_layout.svg Border around LCD at front side 1mm bamboo. Print this part 2x (Top and Bottom)
usbc.svg Additional piece to mount over the USB hole on the back side
pcb_mount.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.

Additonal files related to the case (These files are not needed to create the case):
File Description
clock_v2.xcs xTool Studio project file containing clock plywood parts (svg files) + laser settings
LCD_borders.xcs xTool Studio project file containing clock bamboo parts (svg files) + laser settings
case_v2.txt Input file for raw case generation using the 'angled box tool'
case_v2_raw_org.svg Generated case sides used as source to add holes for LCD, pen, USB, etc.

Laser settings for xTool S1 40W laser:
Action Speed Power
3mm plywood CUT 10 mm/s 80 %
3mm plywood SCORE 150 mm/s 60 %
3mm plywood ENGRAVE 200 mm/s 60 %
1mm bamboo CUT 15 mm/s 80 %


DOWNLOAD: Download case ZIP file


For more information about the construction of the case see this page.