We’ve used LCD1602 to DIY a clock that can show temperature and humidity at the same time. However, some thought that character screen is too simple to show information, what if a TFT LCD instead? In this blog, we will use 2.8 TFT touch screen to DIY a clock with temperature and humidity detecting.1.Hook-up
Plug 2.8 touch shield into left side interface of Iteaduino MEGA 2560, and then connect DS1307 module’s SDA to D22 pin, SCL to D23 pin. Connect s pin of DHT11 module to D25 pin, at last put CR2032 button cell into battery socket in the back of Iteaduino MAGA.
Pins pairing as follow:// DS1307: SDA pin -> Arduino Digital 22// SCL pin -> Arduino Digital 23// VCC pin -> 5V// GND pin -> GND// DHT11: S pin -> D25// V pin -> 5V// G pin -> GND2.Upload demo
Before upload the demo in MEGA, you should download the following libraries first.
Extract them into the directory arduino/libraries, then open file: Arduino\libraries\UTFT\hardware\avr\HW_AVR_defines.h and uncomment the definition and save the file.
#define USE_UNO_SHIELD_ON_MEGA 1
Download display_demo.pde and itead.c files, before upload the demos, DS1307 should be set the time in your current time. Pay attention: in order to avoid time change when re-power MEGA, the time in our demo can be modified only once. If you want to change the time set, you should modify the parameters of eeprom_address or eeprom_value first, for example modifying eeprom_address to 0x01 or eeprom_value to 0x02.
After uploading demos, you can see the 2.8 touch shield showing information as below.
We know you won’t use our itead logo when you do this DIY clock, you can change the picture by the following steps.
Run software Arduino\libraries\UTFT\Tools\ImageConverter565.exe, click “open image”, then choose picture you like, but remember that the pixel of picture must be 100*104. At last, revise the name in Array Name option into itead, and save it.
Delete the original itead.c file, and put the new into IDE, upload the demo again, you will see the new picture show.PS:Doing with Iteaduino Mega and 2.4 touch shield
We offer another demo for you to get a ticking clock with temperature and humidity demonstrating. The steps are in the same with using 2.8 touch shield, only with 2.4 touch shield instead. 2.8 and 2.4 have the same resolution, but 2.4 will be more smooth because of its smaller size.
You can download the ticking clock demo here. The final display effect will show as below picture. Have fun with this demo!