Our customer Hans-Ulrich Küster, who showed us his project Electronic hourglass / egg clock, is obviously mighty impressed by the 4x64 matrix display. Because it is also ideal for a large-format display. He writes: Age comes with limitations in seeing and hearing. That is true for a relative of mine. He can not read a normal watch, and the speaking clock does not really work without hearing aid. So I was allowed to come up with proper solution. To get the greatest possible display, I have coupled two MAX7219 8x32 4 in 1 Dot Matrix LED on top of each other. As clock served the Real Time Clock RTC DS3231 I2C.
Also this project I have rebuilt and would like to share it with you. In a second blog, I will report how I replaced the Micro Controller with Atmega 328P by the WLAN-enabled Micro Controller of Espressif. Because at the end of this blog I would like to write about the further development of the hourglass by Mr. Küster.
|1||Micro Controller with Atmega 328P
|2||MAX7219 8x32 4 in 1 Dot Matrix LED display module|
|1||Real Time Clock RTC DS3231 I2C|
|Breadboard (Breadboard) and Cable (Jumper Wire)
In my provisional replica, after soldering the second, angled pin strip, I have connected the two matrix displays with a long piece of Tesafilm, then connected the "Daisy Chain" with the enclosed cable and finally I attached the power supply and the SPI interface to the Micro Controller.
The circuit has no special features: The SPI interface with the Micro Controller is the second assignment of the digital pins D13 = SCK (= Serial Clock), D12 = MISO (= master in-slave out, not needed on displays), D11 = MOSI ( = Master Out - Slave IN) and D10 = SS (= Slave Select). The names on the matrix display soften slightly: DIN (= DATA IN) is connected to MOSI, CS (= CHIP SELECT) is a synonym for SS (= Slave SELECT) and SCL is the clock line and is connected to SCK. Then only the power supply is missing: GND to GND and VCC at 5V.
The Real Time Clock (RTC DS3231) used has an I2C interface, ie SDA to the analog Pin A4 and SCL to A5, power supply to GND and VCC at 3.3V or 5V.
At the beginning of the sketch, three program libraries are loaded to easily integrate the hardware used:
If not yet happened, search and add them in the known manner under the menu item / Tools /Manage_libraries.
The inclusion of the display is then done with
Because the library MD_MAX72XX.h can be used for different displays, the matrix display used by AZ-Delivery is defined as FC16_HW . Since a total of 8 matrix displays are switched in series (cascaded), is Max_Devices set to 8. The initialisation of the SPI interface is integral part of the library MD_MAX72XX.h.
If you want to use another display, you can use the Sample Sketch MD_MAX72XX_HW_MAPPER to determine your settings.
The other two libraries are needed for activating the I2C interface and the Real Time Clock.
For the big numbers you will not find a template on the internet. Therefore Mr.Küster then described this in self-defined functions.
For the synchronization of the Real Time Clock, the system time of the computer is used when uploading the sketch. For this purpose, the variable in line 22
bool syncOnFirstStart = false; // set true to synchronize with PC, otherwise false
At first upload true is set, then upload again with false.
Here the entire sketch for Download
Update hourglass / egg clock
Now as announced a short update to Electronic hourglass / egg clock.
In order to be able to enter the time for the countdown even more flexible, switch 2 was replaced by a potentiometer.
The value for the potentiometer is uncritical, everything between 1 kOhm and 10 kOhm will do. Now for time. In the declaration part, pause_1 and pause_x are responsible for the times. If the potentiometer is turned to minimal value, pause_1 determines the time in the sketch with the value for 5 minutes. If the potentiometer is turned to maximum value, pause_x determines the time.
By changing the value pause_x you can change the time span, which can be adjusted. The following values were measured:
35 -> 6:05 minutes
30 -> 6:15 minutes
25 -> 6:30 minutes
20 -> 6:50 minutes
15 -> 7:30 minutes
10 -> 8:45 minutes
9 -> 9:10 minutes
8 -> 9:40 minutes
7 -> 10:20 minutes
6 -> 11: 15 minutes
5 -> 12:30 minutes
However, if you change the value for pause_1 then all other settings change and you have to try the times.
It is certainly useful, no matter what values you choose to create a scale for your own potentiometer.
Here is the Sketch Hourglass_Poti to Download
Have fun with the suggestions of Mr. Küster. Next time we take a Wi-Fi-enabled Micro Controller of Espressif for the clock display.