TTGO T Display Internet Watch/Clock
by Arnov Sharma in Circuits > Arduino
13172 Views, 7 Favorites, 0 Comments
TTGO T Display Internet Watch/Clock
This is a TTGO T1 board which is an ESP32 powered Dev board which have an ST7789V 1.14 Inch Display.
Here's a cool/ quick project for this Board, an "Internet Clock".
I always wanted to make a Clock project as it requires quite a few stuff jam-packed in a small compact form factor.
like for example, to run a clock we need a LiPo cell and to charge that cell we need a charging circuit of some sort on it. the clock also needs a deep sleep mode which will save the battery from constant discharge. The charging circuit has overcharge and over-discharge feature which will protect the battery from these two issues, one IC which can be used here is the TP4056 which is ideal for such task.
BUT the TTGO T1 already has a battery management IC so we don't really need to make any complex circuitry of any sort, also we don't need to add an external display to this board as it already has quite a powerful display onboard.
Also, no PCB is needed for this setup. even for the Body of the Clock, I will be making a custom enclosure that will have slots for a Wrist strap. Anyways, let's get started with the main part for this small built which is - editing the ESP32 Clock example sketch.
Supplies
But even before that, these are the things do you need for this small built-
- TTGO T display Board
- Stable Wifi connection
- And Your country's UTC. (find your country's UTC from here)
Basic Internet Clock Sketch
Before starting this project, you require ESP32 Boards core installed on Arduino IDE which is a necessity. Install them from here- https://github.com/espressif/arduino-esp32
So first, open SimpleTime sketch which can be found in
Example>ESP32>Time>SimpleTime
It's the generic internet clock sketch that we will use as a base sketch.
Our goal here is to Display the time which is in the serial monitor on TTGO's Display and for that, we have to change a few lines of code in this sketch.
- We first add our SSID and Password in this sketch.
- Now we have to add gmtOffset_sec which can be found from here. for example, I live in India and GMT here is +5:30.
- +5:30 in seconds is 19800s so we add 19800 in the GMT offset
Next is the daylightOffset_set, if your country has daylight saving time then set it according to that time in seconds, and if not then set it to zero.
Find out about the daylight saving time from here.
- Plug your TTGO board
- select the right board in the Board manager
- select the right port
- hit upload
- now open the serial monitor and you will see the current time printing repetitive at an interval of 1 second.
If your time is not correct then this might be because of an error in UTC offset and daylight saving offset.
Downloads
Internet Clock Sketch for TTGO T Display
The previous sketch was the basic Internet time sketch, for displaying that on the TTGO T1 board, we only have to use a simple function that lets us display anything on TTGO's display.
But before that, you need to install this library which is a TFT Display library that we require for this task.
We first add the TFT_eSPI library and other important lines of code which is required to print anything on the display.
- Plug your TTGO board
- select the right board in the Board manager
- select the right port
- hit upload
Downloads
Lipo Cell for Powering TTGO
As for the battery, I used a 3.7V 500mA Lipo cell which I have salvaged from an old project.
I have to change the connecting wire of the LiPo cell to a smaller connector wire which was included with the TTGO T1 board.
This was the basic setup for this watch project. Next is to design a Body for this setup. For that, I will be using Fusion360.
Custom Body Concept
I designed this Body for the TTGO board which looks like an M5StickC board, the 3D Model for this TTGO Board was downloaded from grabcad user MIMOSA
For now, I haven't decided on the wrist strap for this project, I will probably buy the generic leather strap for this project as well. This is all for part 2 though, the basic setup of this watch project is this, a TTGO T display board hooked up with a LiPo Cell which displays the current time and date on its DIsplay and this all is enclose nicely in a 3D Printed Body.
Downloads
RESULT
Here's the video of this whole concept-