Table of contents
Abstract
In this project, I created a GPS clock that not only shows time and date, it can even show the number of satellites orbiting above our head. It can also be customized to show time across various time zones as well.
Project
Understanding the GNSS statement.md
Enhanced Digital GPS Clock stand with satellite tracking
Out of all the clock models available, atomic clocks are the most accurate. However, they are obviously too expensive for everyday use. Quartz clocks are affordable, but they require manual adjustments from time to time. This can be a pain during daylight saving time (DST). That’s why I’ve decided to build a GPS clock. It offloads all the time-related adjustments to satellites and is inexpensive to create as a DIY project.
In addition to the GPS receiver, the DIY clock build requires a microcontroller for processing the received data and a display for showcasing the date/time.
GPS Module
For this project I am using the GPS that comes integrated with Waveshare SIM7600 LTE RPI hat module.
Microcontroller
Since I needed a 3 UART for processing debug information, connection with GPS module and the display, I used ESP32 as my MCU. Which to be honest is an overkill for this project.
Display
While you can use even a simple LCD display, I wanted the product to look visually pleasing and decided to use DWIN HMI display. It supports UART interfacing, has capacitive touch and inbuilt buzzer.
Power Supply
Now that we have acquired all the materials, only thing we need to provide is power supply. Since both the display and the LTE modem consumes significant amount of power, I decided to power them up using Waveshare USB to UART/SPI/I2C converter. I highly recommend buying one for testing any boards/kits that supports the mentioned protocols. It is a low cost product that can be used to communicate with 2 UART devices at same time and has support for JTAG, limited supported to communicate with SPI/I2C devices.
Stand
Since I had a rectangular display, I checked online for various clock models that can be used as a casing. Few number of models that could serve the purpose are of different size and could not fit the display. So I decided to turn a 3D printed pen stand with mobile holder that I already had into a clock stand. I printed this 3D model for this stand from thingiverse(It has been some time since I printed this stand, will attribute once I find the link to the 3D model). The display fit snuggly in the holder.
Putting it all together
Now we will start wiring all the devices together.
Both the display and GPS module are powered by the Waveshare USB converter module, while the ESP32 is powered by a Type C to Micro USB B cable. All of them are connected to my laptop.
Since the antenna needs to be exposed towards the sky, I placed it near the window. Unlike the short cabled Ublox GPS modules, we get a really long antenna cable with Waveshare LTE hat module which is really convenient if you want to keep the module indoor.
Once everything is put together and powered up, we will be greeted with the current time in UTC format after few seconds.
Features
Changing timezone
As mentioned above, the datetime is always in UTC format. I have added few more time zones so that anyone who wants to recreate it can change it to their local timezone. Current IST, PST and JST are supported.
GPS co-ordinate
Since I wanted to make the clock offline, I have no means to query the location data using co-ordinates, so I hardcoded the location. You can see the latitude and longitude in Nerd stats page. The altitude represents how high the land is above sea level. The speed section shows how fast you are moving, which is useful if you keep the clock in a moving vehicle.
Satelite tracking
I have added an extra page to show the number of GPS/GLONASS/BEIDOU satelites orbiting above. If you keep the page open for a long time, you can actually see the values changing. Unfortunately when I was testing, the values did not change much.
Alarm [work in progress]
- User selected ringtone
- Customisable timing
- On/Off
- Snooze option
- Snooze period customisation
I wanted to add alarm option as well, but all the features that comes with alarm will take some time so I have left it as mockup for now.
Understanding the GNSS statement
The GNSS information received has a variety of information such as
- Day and Date Time in UTC formtat
- Number of satellites orbiting above
- Latitude and Longitude
- Speed if the GPS receiver is in transit
- Altitude above the sea level
- Some precision details.
String format is specified as below, taken from SIMCOM’s website.
[20/06/2024] [edit] :Found the reason why satellite tracking page was not updating. Logic to update in display was not added, added the logic in recent git commit.
References
- https://github.com/davidledwards/gps-clock
- https://stackoverflow.com/a/2413463
- https://www.thingiverse.com/
- https://www.flaticon.com/
- https://www.youtube.com/playlist?list=PLKfWyFPPaoDoNWXWGr1tCCIvTxLw5O634
- https://github.com/cookieDroid/GPS_clock
Top Comments