Jpeg

In this tutorial we will learn how to get GPS data using 3G, 4G/LTE shield.

GPS(Global Positioning System) also known as NavStar indicates the position of an individual on the earth. The Satellites orbiting around the earth sends precise details of their positions at a regular interval of time. Once information are received by a GPS receiver, a GPS receiver can pinpoint the location.

There are also navigation systems which support in their in specific regions like GLONASS provided in Russia.

For this tutorial we will need
a. Raspberry Pi
b. 3G, 4G/LTE Shield
c. 3G, 4G/LTE module (for 3G UC20 and for 4G EC25 is used)
d. PCB Mobile Antenna (2x)
e. GPS Antenna
Here it goes

 

1. Connect EC25 module to the shield.

Jpeg

Sixfab 3G,4G/LTE shield and EC25 module

Jpeg

EC25 module connected to shield

2. Insert SIM in the sim slot

Jpeg

Inserting Sim

3. Connect the shield to a Raspberry Pi

Jpeg

Shield attached to Raspberry Pi 3

4. Now connect antenna to the ports as shown in the figure below

Jpeg

Connecting Antenna

5. Now connect a microUSB to the shield from Raspberry Pi.

Jpeg

Tracker setup

So the setup is ready for tracking.

Now we can power our Raspberry Pi and control trough terminal as done in previous tutorials.

GPS data can be obtained either using minicom or writing your own python code.

***************************************MINICOM***************************************

6a. Type

to bring up the minicom settings screen

7Opening minicom

6b. Select Serial port setup

8

minicom configuration screen

6c. Make the following changes

Serial Device : /dev/ttyUSB2

Hardware Flow Control : No

9

Configuring Serial Port Setup

6d. Now Exit from the setting screen

10

Exiting from minicom configuration screen

6e. Check connectivity with ‘AT’ which in response gives ‘OK’ or returns an error.
11

minicom screen

12

minicom screen

6f. Now type ‘AT+QGPS=1’ turns on the GNSS(Global Navigation Satellite Systems) engine.

13

minicom screen

6g. Again go to minicom settings > Serial Port Setup and make the following changes.

Serial device : /dev/ttyUSB1  

Hardware Flow Control : No

14

Configuring Serial Port Setup

6h. Exit from the settings screen which will bring up following screen with GPS NMEA data.

15

GPS Data

 

****************************************************Pyhton****************************************************

Now we will write a python code to obtain the GPS values

7a. First create a python file by the following command.

16

Opening .py file

 

7b. Now type the following python code in the file and save it.

 

7c. After saving it we will run the code with following command.

18

Running .py file

19

GPS data received

Similarly depending on the code required values from the data can be extracted.

 

Leave a Reply

Your email address will not be published. Required fields are marked *