Getting exact coordinates from NavIC's satellite with Odinub

In this blog we are going to recieve the coordinates of India's first navigation system NavIC's satellites and exactly get where the receiver module is!

What is GPS?

Global positioning system usually known as GPS is the system which is used to locate the particular object where the GPS receiver is placed and get the exact coordinates of the object.
GPS receiver gives the coordinates only when there are 3 satellites in range of the receiver otherwise it will give an output 0.000 for latitude and longitude. Also, if the receiver is started inside the premises then the time obtained from the receiver might also be wrong.The latitude and longitude obtained are in NMEA format we have to convert it into degrees and the process is showed in the code.

This code is also compatible with normal GPS receivers.


Step 1:

Connect Odinub to the laptop or Mac and getting ready to work with the Odinub board. If you are not aware how to, click here


Step 2: 

Connect the receiver’s Tx and Rx pins to Odinub’s pin 7 and 9 which are using the UART protocol for the serial transmission as shown in the circuit diagram.

Connection of Odinub with the GPS receiver:

Odinub Pins GPS module
UART_1 Tx(Pin 9) Rx
UART_1 Rx(Pin 7) Tx
5V(Pin 2) Vcc
GND(Pin 6) GND


Step 3:

Create a python file by typing the following command:

sudo nano <filename>.py

For reading the data coming from GPS receiver.  Data coming from the receiver is in the form a huge string containing all the required information like latitude, longitude, height and speed of the receiver and we have to extract latitude and longitude from the string. The receiver used here does not give data from inside. So, we have to move to a space where open sky is available and the receiver gets connected to the satellites.

The serial library is used to use the serial communication for the Odinub and the time library is used to use the time of the Odinub whenever required in the script.The string is separated by split method and the separated string is extracted by creating a buffer and the time latitude and longitude is fetched which is the 2nd 3rd and 5th string respectively from the separated string.

Here a function is created for the conversion(to_degrees) and the extraction (GPS_Info) of the string.
They are then converted to degrees by the given mathematical formula in the code and the obtained value is printed.


Step 4:

The script is to be run by the command:

python <filename>.py

And the output obtained after succesfully running the code will be:

Hope you have found where you are!


Code :
Code Title :
Code Language :
0 Commenting Overall Comment