In this tutorial we will show how to build real time clock display with time synchronization over WiFi network.
-Arduino mega 2560
|Arduino Mega 2560|
-3.2" LCD TFT display
-3.2" TFT LCD adapter shield
|3.2 TFT LCD + 3.2 TFT LCD Shield|
|RTC DS1302 Real Time Clock Module|
-ESP8266 WiFi module
|ESP8266 ESP-01 Serial WIFI Wireless Transceiver Module|
|ESP8266 ESP-03 Serial WIFI Wireless Transceiver Module|
|ESP8266 ESP-12 Serial WIFI Wireless Transceiver Module|
|ESP8266 ESP-05 Serial WIFI Wireless Transceiver Module|
|ESP8266 ESP-07 Serial WIFI Wireless Transceiver Module|
See buying guide at the end for details and please shop in our store to support EasyIoT framework.
Connect ESP8266 on serial1 on Arduino Mega 2560 and reset pin to pin 12 on Arduino. Use Connect ESP8266 and 5V Arduino guide. You can use 3.3V power supply from 3.2" TFT LCD adapter shield to power ESP8266.
Next conenct DS1302RTC module:
|Arduino Mega 2560||DS1302|
Connecting Arduno LCD 3.2" should not be a problem, because we use shield.
Program requests time from EasyIoT server to synchronize real time clock. After synchronization time is stored in RTC module which keep time if when Arduino is switched off. If Arduino is connected to EasyIoT server it keeps syncing time every hour. EasyIoT server is synchronized by time server if it's connected to internet. Time sent to Arduino is always UTC time. To display local time we use Timezone library. Time zone in example program is set to Central European Time (CET). Change time zone if you live in different time zone.
We need to add our Arduino to EasyIoT server. Our clock example does not use any sensors, but to be correctly added to EasyIoT server node list we present as digital input "esp.present(0, S_DIGITAL_INPUT);".
Program example is available on GitHub.
See more tutorials at http://iot-playground.com/build
To support this site and EasyIoT framework development please buy in our store.