We are living in a technology-based society where we have lots of innovative ideas day by day. These new innovations in electronics projects come as an ever-growing network that strives constantly to share and gather insight on the latest trends in the industrial Platform.
Many GPS satellites orbit the Earth and are used to know the exact location of any given area. It also provides other data, such as time, date, altitude, and direction tracking angle, in addition to the geographical coordinates (Latitude and Longitude). So we are going to make a GPS clock using the ‘Time and Date’ data from the GPS satellite. The GPS Updated Clock is extremely accurate, providing real-time data with millisecond precision. Here we use Blox NEO-M8N GPS Module in the Arduino GPS clock construction.
- Arduino Uno
- U-Blox NEO-M8N GPS module
- 16×2 LCD
- Connecting wires
- Power supply
Global Positioning System
The GPS (Global Positioning System) is a satellite-based navigation system with at least 24 satellites. Global Positioning System (GPS) makes use of signals sent by satellites in space and ground stations on Earth to accurately determine their position on Earth. The GPS receives radio frequency signals from satellites and ground stations. These signals are used by GPS to identify their precise location. With no subscription fees or setup charges, GPS works in any weather condition, anywhere in the world, 24 hours a day.
U-Blox NEO-M8N GPS module
This popular NEO-M8N is designed as a high Precision GPS Module. It comes with a Built-in Compass HMC5883L digital compass for APM and pixhawk. This module provides a high level of sensitivity and features active circuitry for the ceramic patch antenna. It is enclosed in a plastic case to protect the module from the elements. Also, the module outputs offer precise position updates at 10Hz and also have a rechargeable backup battery for warm starts. The Ublox NEO-M8N is configured to run at a baud rate of 38400 and can be used with Pixhawk and APM. Moreover, this popular neo-M8N is capable of connecting the same module to All versions of the PIXHAWK Flight Controller.
The NEO-M8N features better performance and the easiest RF integration of all the NEO-M8 configurations. The NEO form factor allows for easy migration from previous NEO generations. Hence, the Sophisticated RF architecture and interference suppression ensure maximum performance even in GNSS-hostile environments. NEO-M8 combines a high level of robustness and integration capability with flexible connectivity options. Finally, the NEO-M8N consists of an internal Flash that allows simple firmware upgrades for supporting additional GNSS systems.
Features of U-Blox NEO-M8N GPS module
- Concurrent reception of up to 3 GNSS (GPS, Galileo, GLONASS, BeiDou).
- industry-leading–167 dBm navigation sensitivity.
- Security and integrity protection.
- Onboard ROM memory.
- Supports all satellite augmentation systems.
- Advanced jamming and spoofing detectionBackward compatible with NEO-7, NEO-6, and NEO-5 families
- The default baud rate: is 9600.
- With a data backup battery.
- Data-logger For position, velocity, and time
Arduino Clock Using UBlox NEO-M8M GPS Module
The GPS Clock is a satellite-based device that delivers extremely accurate timing. The GPS module also delivers time-related data, which we’ll employ to create an Arduino GPS clock.U-Blox NEO-M8M GPS Module outputs a large amount of data in serial format, which includes the precise location of the location. GPS also gives time and date information, as well as geographic coordinates (latitude and longitude). We’re also using an Arduino board to isolate the essential information from the GPS data.
The data from the GPS module is sent in NMEA format, as shown in the screenshot below. The NMEA format is made up of multiple sentences, one of which is required to extract the Date and Time. This statement begins with $GPRMC and includes the coordinates, time, and other relevant data. The string $GPRMC stands for Recommended minimum particular GPS/Transit data, and it’s around 70 characters long.
The data received by the UBlox NEO-M8M GPS module in NMEA format from several satellites is shown in the above image. There are multiple lines in this output, one of which begins with $GPRMC.
Code To Receive GPS Time From $GPRMC String
- $GPRMC string mainly contains velocity, time, date, and position
The letter next to $ GPRMC in the above line stands for Coordinated Universal Time (UTC) (“hhmmss.ss”).
Next, the letter next to the UTC number indicates the status of the data.
- An ‘A’ means that you are receiving a signal and that everything is in order.
- If you see a ‘V,’ that signifies your GPS isn’t connected to any satellites.
- Your latitude and longitude are determined by the two numbers after the letter “A.”
The chart below will help you comprehend what the NMEA line above means.
|220516||Time in hour minute seconds and milliseconds format.(h-m-s) 18-23-06|
|A||Status // A= Active and V= No signal|
|Latitude||Latitude 15 deg. 23.82 min. North|
|N||Direction N=North, S=South|
|Longitude||Longitude(Co-ordinate) 22.24 min. West|
|W||Direction E= East, W=West|
|Speed||173.8 speed in knots|
|Date||DATE in UTC – 11/01/20|
|W||The direction of variation E/W|
By counting the commas in the string, we can extract Time and Date from $GPRMC. We locate the $GPRMC string and put it in an array using Arduino and programming, then Time (24-hour format) is found after one comma, and Date is found after nine commas. Strings are used to save time and date.
We must convert the time and date provided by a GPS satellite to Coordinated Universal Time (UTC). We added 5:30 to UTC time to convert to Indian time because Indian time is 5 and a half hours ahead of UTC/GMT.
The Arduino is in charge of the entire process; it receives GPS data from the satellite via the GPS module, extracts the Date and Time from the $GPRMC string, and displays it on the LCD.
Data pins D4, D5, D6, D7 of the 16×2 LCD are linked to Arduino pins 5, 4, 3, 2, and command pins RS and EN are connected to Arduino pins 7 and 6, respectively. Tx pin 10 of the GPS receiver module is connected to Rx pin 10 of the Arduino. The Arduino’s ground pin and the GPS are wired together. Here the GPS module is set with a baud rate of 9800 bits per second. Arduino is also set to a baud rate of 9800 bps.
Code For Arduino GPS Clock
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
SoftwareSerial Serial1(9, 10); // RX, TX
lcd.print(“GPS Updated Clock”);
lcd.print(” Circuit Digest “);
while (Serial1.available()) //checking serial data from GPS
char inChar = (char)Serial1.read();
str[i]= inChar; //store data from GPS into str
if (i < 7)
if(str[i-1] != test[i-1]) //checking for $GPRMC sentence
I hope all of you are clear about the design of the Arduino GPS clock..We MATHA ELECTRONICS will be back soon with more interesting topics.