3 displays alarm-clock with TFT screen, developped with Arduino [170112]
3 displays alarm-clock with TFT screen, developped with Arduino
Current software can be found here
At the beginning, I wanted to build a 7 segments clock with Arduino . . . I found on Internet the little TFT screens (2.2’) able to display anything at very low price. But what to do first ? This clock ! It displays the time, but the way to display the time changes each hour.
1st display : at 0, 3, 6, 9, 12, 15, 18, 21, 24 hour: classic clock with hands
2nd display : at 1, 4, 7, 10, 13, 16, 19, 22 hour: the time is display with bars
3rd display : at 2, 5, 8, 11, 14, 17, 20, 23 hour: the time is displayed with seven segments
See the pictures.
The time is set in a SETTING screen to adjust the time and date, and the alarm-clock.
The setting is done by 3 keys : “-“ key, “+” key and “ok” key, used in the SETTING screen.
The day and month in local languages are defined in the program, but need too much bytes in the FlashRom. The tinker will recompile the software with the wanted language (only uncomment its language).
The alarm-clock (when set) rings during 1 minute. (3 times if snooze function)
The alarm-clock may be set or not, by a manual switch (to sleep the week-end without setting adjustment) and it is possible to snooze 2 times (5 minutes each). In case of power leakage, the alarm-clock setting (hour and minute) is saved in the EEPROM.
The power of the LEDs of the TFT screen is automatically adjusted by a solar cell, which dims the LEDs, for people who need a complete darkness to sleep (like me!). The screen remains readable in the dark.
The RTC is a DS1302 with 32kHz Xtal, the microprocessor is the famous ATMega328P, the TFT display is an ILI9341, and the associated libraries.
I developed all the displays by myself, and it was interesting to understand the components/libraries operation. This program (if published by Elektor) is interesting to use for other software developments.
I also used the Streaming library to display some strings: very nice results and very simple to use.
The ports RX and TX are not used, if someone wants to modify this software and transmit information to another system.
I designed the hardware to allow programming by the ISP port: this will make easier modification of the screen display (mainly the colours?).
The total consumption is about 40 mA.
The FlashROM is used at 29500 bytes (very near with the bootloader!), and 1160 bytes of the RAM are used.
At the beginning, I wanted to build a 7 segments clock with Arduino . . . I found on Internet the little TFT screens (2.2’) able to display anything at very low price. But what to do first ? This clock ! It displays the time, but the way to display the time changes each hour.
1st display : at 0, 3, 6, 9, 12, 15, 18, 21, 24 hour: classic clock with hands
2nd display : at 1, 4, 7, 10, 13, 16, 19, 22 hour: the time is display with bars
3rd display : at 2, 5, 8, 11, 14, 17, 20, 23 hour: the time is displayed with seven segments
See the pictures.
The time is set in a SETTING screen to adjust the time and date, and the alarm-clock.
The setting is done by 3 keys : “-“ key, “+” key and “ok” key, used in the SETTING screen.
The day and month in local languages are defined in the program, but need too much bytes in the FlashRom. The tinker will recompile the software with the wanted language (only uncomment its language).
The alarm-clock (when set) rings during 1 minute. (3 times if snooze function)
The alarm-clock may be set or not, by a manual switch (to sleep the week-end without setting adjustment) and it is possible to snooze 2 times (5 minutes each). In case of power leakage, the alarm-clock setting (hour and minute) is saved in the EEPROM.
The power of the LEDs of the TFT screen is automatically adjusted by a solar cell, which dims the LEDs, for people who need a complete darkness to sleep (like me!). The screen remains readable in the dark.
The RTC is a DS1302 with 32kHz Xtal, the microprocessor is the famous ATMega328P, the TFT display is an ILI9341, and the associated libraries.
I developed all the displays by myself, and it was interesting to understand the components/libraries operation. This program (if published by Elektor) is interesting to use for other software developments.
I also used the Streaming library to display some strings: very nice results and very simple to use.
The ports RX and TX are not used, if someone wants to modify this software and transmit information to another system.
I designed the hardware to allow programming by the ISP port: this will make easier modification of the screen display (mainly the colours?).
The total consumption is about 40 mA.
The FlashROM is used at 29500 bytes (very near with the bootloader!), and 1160 bytes of the RAM are used.
Updates from the author
TechDoc 8 years ago
The supply
The ATMega328 and the DS1302 are powered in 5 volts, the screen is powered in 3.3volts. The screen is connected to the microprocessor via level shifters (5V <->3.3V converters). The ATMega328 is powered in 5 V to have the best frequency (16MHz).
The screen library
I use the UCG screen library . . . why not ? It seems to run correctly !
The screen and the keys
I don't use a touch screen but keys . . . because it is still a good projects. And the FlashRom is full.
. . . the bugs
As the pictures show, the microprocessor time is fully used by the display : the display of the second are lightly bugged.
chang 7 years ago
TechDoc 7 years ago
Hum . . .
I didn't upload the code because some details needed to be improved : I use now a LDR rather than a solar cell (not easy tu buy): I received last week-end the LDR, and I needed to adust the values.
I have 1 more improvement to write and I will upload the code. All the displays show the date and time. The display by hands doesn't show AM or PM.
And I worked on other projects these last times.
TREINROVER 7 years ago
I don't know how to open de schematic file. Can anyone help me or convert the file to a more common type? Looks like a very nice project!!
Thank you for sharing.
TechDoc 7 years ago
You will find nextly the schematic ( . . . scan of PDF file . . . I got some problem withe the PDF file generation ! )
I am preparing the circuit on breadboard (baord with holes), and then build a box. I'll make pictures of all these steps, and share them.
Thanks for your interrest.
Regards
Wer Weis 6 years ago
chen shanfu 6 years ago
I want to gerber file for PCB!!!!!!!!!!
rjv 6 years ago
you can purchase the pcb here in our shop:
https://www.elektor.com/3-way-display-alarm-with-2-2-inch-tft-screen-8697?utm_source=MagazineSite&utm_medium=ProductLink
kind regards
Jan Elektor