Introduction: Talking Tetris Clock
This is my take on a large digital clock
- Based on the TETRIS Library by Brian Lough:
- https://github.com/witnessmenow/WiFi-Tetris-Clock
- https://www.youtube.com/watch?v=ey2mjZ-UQNM
- Added a MP3 / WAV player to give sound to this clock
- Added a Webinterface to change settings on the fly
- Added two text tickers to display your scrolling message
- Designed a PCB that included the Audio hardware
- Based on ESP32, open source firmware and hardware
Supplies
- PCB buy it here: Talking clock Main Board
- I2S audio board: Maz98357 I2S;
- ESP32 DEVKIT V1 30pin version
- Highly Advisible: single row headers 2.54 to be used as socket for ESP32
- HUB75 display 64*64( preferable) or 32*64 Use 1 or 2( preferable) displays should be a display that is supported by the library check here to see what panel to use
- Micro SD Card
- Speaker
- Some wire's and a USB cable to program the ESP32
- You also need to install software(Arduino IDE) or upload a pre-compiled version using the webinterface
Step 1: Completing the PCB
I had my PCB produced by PCBWay, they offer great service at a good price. You can buy the PCB at my Tindie store Most components are included. You only have to solder on the ESP32 devkit, the I2s Audioboard. I highly recommend that you don't solder the EPS32 board directly onto the pcb. Use single Row headers or a socket instead! That way, you can always remove the ESP32 if needed.
Make sure you place the ESP32 in the correct orientation. See photo for example.
Step 2: Using the Arduino IDE to Program the Arduino
There are two options to program your ARDUINO ESP32
- Use Arduino IDE
- Use the webinterface (Only Limited changed to program possible)
The Webinterface will be explained in the next step. First we take a look at the Arduino IDE
If you haven't already, you can download it here and install it.
But wait, we are not there yet...after installing, we need to install the files for using the ESP32 and we need to install some libraries.
Installing the ESP32 plugin
Start the Arduino IDE software and use the menu to click: File->Preferences.
A new window will popup. Look for the line that says: Additional Boards Manager URLs: and enter the following link:
https://dl.espressif.com/dl/package_esp32_index.json
Now, press OK to close the window. Again use the menu to click: Tools->Board:xxx->Boards Manager. Again, a new window will appear. inter ESP32 in the textbox to find the ESP32 boards and press install
Installing the libraries:
Install the following libraries from the library manager. Use the menu: Sketch->include library-> Manage Libraries-> add Zipfile
Display Driver (V2.05) Must be this version and not a new release!
Audio Driver
Install the following libraries from the library manager. Use the menu: Sketch->include library-> Manage Libraries
Fastled Neomatrix (V1.1 )
Loading the Sketch
Create a folder on your harddrive named "mark_tetris.ino", download the 4 files needed and save them to that folder:
index.h , logo.h , mark_tetris.ino and settings.h
Now click on the file on your harddrive named: mark_tetris.ino. Arduino Ide will start and the sketch will open. You will see 4 tabs, 1 tab per file.
Before you compile your sketch, make sure you have selected the correct board. Use the menu: Tools-->Board-->ESP32 Arduino->Doit ESP32 Devkit V1
Now you should be able to compile all successfully and you can upload it to your ESP32 board.
Make sure the board is connected and that you have selected the correct COM port from the menu: Tools->Port
If you like, you can change some settings in the settings.h tab. However, the settings for your display will be done using the webinterface later. Make sure to recompile and upload again if you change these settings.
In case you run into compatibility problems with the libraries, this is what I used:
- Using library FastLED_NeoMatrix at version 1.1
- Using library Framebuffer_GFX at version 1.0
- Using library FastLED at version 3.4.0
- Using library Adafruit_GFX_Library at version 1.10.4
- Using library WebSockets at version 2.1.4
- Using library ArduinoJson at version 6.19.1
- Using library ESP32_HUB75_LED_MATRIX_PANEL_DMA_Display at version 2.0.5
- Using library TetrisAnimation at version 1.1.0
- Using library ezTime at version 0.8.3
- Using library ESP32-audioI2S-master at version 2.0.0
- Using library Adafruit_BusIO at version 1.7.1
Part of the ESP32 framework
- Using library WiFi at version 1.0
- Using library WebServer at version 1.0
- Using library WiFiClientSecure at version 1.0
- Using library FS at version 1.0
- Using library SPIFFS at version 1.0
- Using library SPI at version 1.0
- Using library SD at version 1.0.5
- Using library SD_MMC at version 1.0
- Using library FFat at version 1.0
- Using library Wire at version 1.0.1
- Using library EEPROM at version 1.0.3
Step 3: Alternative Programming Without Arduino IDE
Maybe Arduino IDE , installing the right libraries etc. is not your thing. luckely, there is another way.
You can not program your ESP32 without have to use the Arduino Ide, using a web browser but there are some limitations.
- Not all browsers are supported, use Edge or Chrome
- You cannot make modifications to the sketch.
- it is pre-compiled with the settings I used for my clock
- you can change the type and number of displays using the access point later.
To use this feature, use Chrome or Edge browser and go to:
https://donnersm.github.io/TalkingClock/flash.html
Step 4: Completing the Wires
It's not complicated to wire up this setup.
Connect a small speaker to connector on the I2s Audio board.
Connect the flatcable between Hub75 display and circuit board
Connect the power cable for the display ( if you are planning to use the display on a high brightness, use an external power supply of 5V
Connect your external power supply and pay attention to the polarity
Step 5: Preparing the SD Card
In order to play sounds, you will need to use an micro SD card.
Format the card and copy all the audio file to the root directory of the card
So you want different sounds? There are two ways:
Option 1
you can change the names of the files in settings.h and also the time that the sounds are triggered. However, this is not an option if you are using the precompiled version that you'll program with the webbrowser
Option 2
use your own files but use the same filenames. The player can play wav and mp3 but don't mix them up. If a file is names 1100.mp3, you cannot change it to 1100.wav.
Also, to keep the clock running smootly, I use 16bit wave files and mp3 with a bitrate of no more then 115Kbps. But you can always try....
Attachments
Step 6: Operating the Clock
Setting up the clock the first time.
When you first start the clock, it doesn't know your WIFI credentials and it will boot into Access Point Mode.
It will act as a WIFI Point. Use you cellphone tablet, or other WIFI enabled device to connect to that access point. The name of the accesspoint is GeniusWeb and the password is Genius
Once you are connected to that Wifi point, the clock will start a webserver that you can access.
If you boot while a serial monitor is connected, it will show you the IP number you need to access. If not, you'll have to check your router to find out what IP address to use.
Changing the settings with the webinterface
First thing you should change is the display setup, Select the hardware you have and press "confirm display type" You might have to change this on trial and error because there are many variations in displays and those are not very consistent
Next, you should change the WIFI credentials to give the clock access to your wifi network. You will have to reboot the clock once you changed it.
If the reboot gives the clock a successful access to your WIFI network, the time and date will be updated automatically. However, make sure you set it to the correct Timezone.
The timezone is a text format, more info here: Timezones
O No...no wifi?
If you don't have WIFI or your WIFI's policy doesn't allow the clock to make a connection, it's not ideal..but you can still use the clock. After it boots as an access point, go to the webinterface and set the time manually. In this version, the date will not be updated, it will be set to my birthday instead.
So what else?
On the top there are buttons, each button is programmed with a sound.Press it and your sound will come out of the speaker.
There are sliders to change volume, brightness, speed of animation, speed of each (news)ticker.
There are two tickers to display a scrolling message. Each ticker can hold a maximum of 100 characters.
Step 7: Show and Tell
You want to see the video? Here it is! Remember, if you build this, I would love to see your video too.

Participated in the
Electronics Contest
23 Comments
6 months ago
Guten Morgen zusammen, ich habe fehlerfrei geladen, Webinstallation auch, aber Browser öffnet sich nicht.
Doesn't work, thanks anyway
Question 1 year ago on Step 7
Hello, a very interesting project. I built another Tetris clock for my grandchild a few years ago and installed it in the children's room. Two things came up which are useful for children's rooms.
1. It would be good if you could switch off the display at night. The LEDs are very bright and disturbing at night.
2. because the LEDs are very bright, an automatic brightness control (ABC) would be very pleasant.
Maybe they can integrate these functions in a new version.
Kind regards
B.Drechsler
Answer 1 year ago
Absolutely true. A light sensor in on my list for the next update
Reply 6 months ago
or Tetris, date, switch off time from a certain time, only show the clock, of course completely dark
6 months ago
Bei mir Web Instal ok. aber..!
Arduino: 1.8.18 (Windows 10), Board: "DOIT ESP32 DEVKIT V1, 80MHz, 921600, None"
from C:\Users\Win10\Desktop\mark_tetris\mark_tetris.ino:22:
C:\Users\Win10\Documents\Win10 Arduino\libraries\Framebuffer_GFX-master/Framebuffer_GFX.h:33:21: fatal error: FastLED.h: No such file or directory
compilation terminated.
exit status 1
Fehler beim Kompilieren für das Board DOIT ESP32 DEVKIT V1.
Dieser Bericht wäre detaillierter, wenn die Option
"Ausführliche Ausgabe während der Kompilierung"
in Datei -> Voreinstellungen aktiviert wäre.
Reply 6 months ago
You need to install the framebuf libary, can be found in the lib manager
Using library Framebuffer_GFX at version 1.0 i
HEre is a list of all the libs used:
Using library FastLED_NeoMatrix at version 1.1
Using library FastLED at version 3.4.0
Using library Adafruit_GFX_Library at version 1.10.4
Using library WiFi at version 1.0
Using library WebServer at version 1.0
Using library WebSockets at version 2.1.4
Using library WiFiClientSecure at version 1.0
Using library ArduinoJson at version 6.19.1
Using library FS at version 1.0
Using library SPIFFS at version 1.0
Using library ESP32_HUB75_LED_MATRIX_PANEL_DMA_Display at version 2.0.5
Using library TetrisAnimation at version 1.1.0
Using library ezTime at version 0.8.3
Using library ESP32-audioI2S-master at version 2.0.0
Using library SPI at version 1.0
Using library SD at version 1.0.5
Using library SD_MMC at version 1.0
Using library FFat at version 1.0
Using library Adafruit_BusIO at version 1.7.1
Using library Wire at version 1.0.1
Using library EEPROM at version 1.0.3
Reply 6 months ago
Danke, meine nexte probleme,
StaticJsonDocument<800> doc;
Reply 6 months ago
Also library thing…. You need to install all the mentioned libs
Reply 6 months ago
Hallo nochmal amdee401,
jetz ok Uhr zeigt an aber Weboberflache geht nicht. HTTP-Server started nicht.
Reply 6 months ago
Ich habe alle Bibliothek installiert, HTTP- Server startet nicht, hat jemand Idee?
1 year ago
Hi Mark, ok,I just programmed my esp also with the webprogrammer and the sound works fine now.
Now I still wayting for the new ordered display. The first I had ordert by ALI ( P2.5 Indoor SMD LED Display Module 1 / 32scan 160x160mm 64x64dots for led screen led wall small piexl|LED Displays| - AliExpress) with the IC ICND2153AP (row driver) is not working with the library "ESP32_HUB75_LED_MATRIX_PANEL_DMA_Display" at all.
Thanks for help
Best regards
Burkhard
1 year ago
Hi Mark, after installation of the V1.1 I get the error : Error talking to SD card! And no Sound at all is avalable. The SD card is ok. In the V1.0 every think was working fine
Volume: 6
Chipset: ICN2038S
Error talking to SD card!
next audio....
Audio Initialized...
valid Display setting: 64*64px 1 panels
chipset changed to:ICN2038S
HTTP server started...
What can I check
Best regards
Burkhard
Reply 1 year ago
Hi, it might me be a conflict with one of the lib version...try the web programmer.
I just programmed my esp with the webprogrammer ( link is in instructable) and after that, i uploaded the V1.1 with arduino ( after compiling) here all is working fine...sd and audio
1 year ago
Hello ,I think I have a problem with the display. After I got the circuit board from tindy, I set everything up, programmed the ESP32 and connected 12 volts. The clock then forms an acsess point and can be reached at 192.168.4.1. But everything on the display remains dark, no flickering or flashing, nothing. I had similar problems a few years ago with a Tetris clock. There it was the chipsets. Displays were produced with different chipsets. Mark, you must also have experience with this, because you have already provided 4 different options. I have tested all of them but without success.
Here are the chips used on my display:
P2.5 64x64 - 32S - V2.0
Chipone ICND2153AP
MW245B
FM TC7258GN
74HC04S
I'am using Arduino IDE 2.0.0-beta.12 and ESP32 V2.0.3
(With the Arduino IDE 1.8.19 ESP32 V1.0.6 I get compiling errors) What are You using ?
Any tips on what else can be done ?
Other Problem:
I have also changed the SSID and password in the AP page in the browser, but the ESP does not log into my WLAN. In the log, I see that characters are missing at the end of both the SSID and the password. My SSID is 19 characters long and contains spaces and password is 21 characters long. Any idears?
Many greetings
Burkhard
Reply 1 year ago
I see...
the display problem could be related to the chipset, 1/8 scan panels are not supported without extra effort. However, It's more likely that it is a lib error. If you use a newer version for the display lib, it will not work. Check my doc to see what versions I used...You can also try using the web flasher...it uses my pre-compiled version using my libs.
See if that works.
REgarding the password WIFI I'd have to look into that...not sure spaces are allowed but that will be a error that can be fixed..lets deal with the issue's one at a time. Please report this issue at github and I'll address it. That way others can learn from it too.
Reply 1 year ago
HI; ok, I have now flashed the bin file by the web flasher. Flashing was ok, but the result is the same - nothing is working. There is only time by time a simpson krying. Changes on the browser site are not possble. If I click to "set", then it will be changed to "Refresh Browser" and more changes are not possible, only after reboot
Here ist the print out from the monitor
16:31:45.608 -> ** The following settings are loaded from Spiffs: **
16:31:45.654 ->
16:31:45.654 -> Top Text: HALLO BURKI
16:31:45.700 -> Bottom text: kdjflkdsjgöifdjkfdölhköjhö
16:31:45.700 -> Brightness: 78
16:31:45.700 -> Display type: 64x64x1NC
16:31:45.747 -> Animation speed clock: 40
16:31:45.747 -> Scrolling Speed top text: 40
16:31:45.747 -> Scrolling Speed bottom text: 40
16:31:45.747 -> time zone from spiffs: Europe/Berlin
16:31:45.747 -> ssid from spiffs: GeniusWeb
16:31:45.747 -> password from spiffs: Genius
16:31:45.793 -> Volume: 4
16:31:45.793 -> Chipset: FM6124
16:31:45.793 ->
16:31:45.793 -> SD Card ready
16:31:45.793 -> next audio....
16:31:45.793 -> Audio Initialized...
16:31:48.021 -> Could not connect...so creating access point...
16:31:48.021 -> 0.0.0.0
16:31:48.021 ->
16:31:48.021 -> HTTP server started...
16:31:48.021 ->
16:31:48.021 -> valid Display setting: 64*64px 1 panels
16:31:48.021 ->
16:31:48.021 -> chipset changed to:FM6124
16:31:48.021 -> *** ESP32-HUB75-MatrixPanel-I2S-DMA: Memory Allocations Complete ***
16:31:48.021 -> Total memory that was reserved: 38 kB.
16:31:48.021 -> ... of which was used for the DMA Linked List(s): 6 kB.
16:31:48.021 -> Heap Memory Available: 139464 bytes total. Largest free block: 72680 bytes.
16:31:48.021 -> General RAM Available: 72712 bytes total. Largest free block: 72680 bytes.
16:32:05.294 -> 0
16:32:05.294 -> 0
16:32:05.294 -> 0
16:32:05.294 -> 0
What it can bee ???
Best regards
Burkhard
Reply 1 year ago
After Changing my SID and Password:
17:33:10.207 -> WiFi connected
17:33:10.207 -> IP address:
17:33:10.207 -> 192.168.179.3
17:33:10.207 ->
17:33:10.207 ->
17:33:10.207 -> ezTime debug level set to INFO
17:33:10.207 -> Waiting for time sync
17:33:10.442 -> Querying pool.ntp.org ... ERROR: Timeout
17:33:34.209 -> Querying pool.ntp.org ... success (round trip 930 ms)
17:33:35.146 -> Received time: Wednesday, 18-May-22 15:33:35.608 UTC
17:33:35.146 -> Time is in sync
17:33:35.146 ->
17:33:35.146 -> UTC: Wednesday, 18-May-2022 15:33:35 UTC
17:33:35.146 -> Timezone lookup for: Europe/Berlin ... ERROR: Timeout
17:33:37.162 -> Europe/Berlin
17:33:37.162 -> Time in your set timezone:Wednesday, 18-May-2022 15:33:37 UTC
17:33:46.395 -> 1
17:33:46.395 -> 5
17:33:46.395 -> 3
17:33:46.395 -> 3
17:33:59.661 -> 4
17:34:59.648 -> 5
Reply 1 year ago
Yeah the problem is the array ssid[20] and password[20] increase it to 25 and your network issue is fixed. Also change the #define ssidbuflength 20 to 25 and
#define passwordbuflength 20 to 25. Will update that in the release this week
Reply 1 year ago
Not even a logo on boot? Can you try another display panel?
Reply 1 year ago
No, nothing
Unfortunately, I don't have another panel. You have 2 panels with 32x16, 32 scan connected together, right ?
I have a 32x16 panel (3 years old) from a morphing clock. But I have to dismantle the clock so that I can use the display. We are going on holiday in 2 days. After that I can test it. Will the programme run on 64x32? Displays
Best Regards Burkhard