GPS based clock using pic microcontroller

GPS based clock using pic microcontroller : This project is about how to design a GPS based clock using pic microcontroller and how to make a universal clock using pic18f452 microcontroller.  First of all we will see what is GPS based universal digital clock and what are it applications.  GPS based clock can be used to make universal digital clock with provides current time according to your location unlike traditional watches where you have to adjust time manually when you go from one region to another. This clock can adjust it time automatically according to your position with the help of GPS module.GPS based clock using pic microcontroller




How GPS based clock works?

There are many satellites available in our space which can be used to get your ordinates like latitude, amplitude, date and time. I have already posted a article on how interface GPS module with pic microcontroller. In which I have explained how to get co ordinates of your current location from any available satellite. But satellite provides us complete information which includes  latitude, amplitude, date and time.  So we can get date and time from this information also.

How to design GPS based clock?

GPS has many application in vehicle tracking system, vehicle theft intimation system and GPS based data loggers.  But GPS based clock can be used for many applications like military missions, railway station and bus stations and many other fields.  GPS module can provide you data from more than 10 satellites but you can choose any satellite. In this project, I have used $GPGGA satellite to design digital clock. But you can use any other satellite if you want. But to do so you have to make changes in code.  We will receive data from $GPGGA satellite in the form of string as shown below:

$GPGGA,001038.00,3334.2313457,N,11211.0576940,W,2,04,5.4,354.682,M,-26.574,M,7.0,0138*79

I will explain this string in later part of this article. I have used pic18F452 microcontroller to receive data from GPS receiver. Holux M-89 GPS module is used as a GPS receiver. whenever we turn on this module by supplying power to it, it will start getting data from all available satellites.  Data received by GPS receiver will be available at transmit pin of GPS module. You can receive this data with pic microcontroller using serial communication.  Date received is shown below:

GPS satellites data




As you can see it will receive data from all available satellites. But we have use only $GPGAA satellite to get time for GPS based clock. Data received by pic18f452 microcontroller from GPS receiver saves in a string and after that string is analyzed with the help of string functions to get time. Date received from $GPGAA satellite can be interrupted as below: $GPGAA satellite data

As shown above after $GPGAA is time in UTC format. We can also extract longitude and latitude from this string.

GPS based clock circuit diagram

Circuit diagram is given. It consists of 2*16 LCD , PIC18F452 microcontroller and GPS receiver.  I have explained above the working and use of all these components except LCD. LCD is interfaced with pic microcontroller to display value of time in UTC format.GPS based clock using pic microcontroller

Code of GPS based clock

Code for GPS based clock is written using mikro c for pic compiler.  PIC18f452 microcontroller is use to received data from GPS receiver through UART serial communication.  LCD is connected with PORTB of pic microcontroller to display time.

Add Comment

Subscribe to our blog to get updates in your email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,207 other subscribers