In this post let us explore the GPS Module built on UBLOX Neo series & then parse the data to send SMS with google maps link.

Arduino UNO is used to control the GPS module.

The GPS module used here has provision for connecting an external magnetic patch antenna.This enable the GPS to get FIX  within seconds even while testing indoor.

To test the GPS we need an USB to TTL  module.Or we can use our Arduino itself with a small hack.

Connect the RST pin of Arduino to GND.This will bypass the bootloader of Arduino & we can use the serial IC of Arduino to communicate with GPS.

Connect Tx of GPS to TX of Arduino & Gnd toGnd.

Note that the connection is STRAIGHT here & not reverse .Remember this connection will be reverse while we actually upload code to Arduino & use it in regular mode.

We can power the GPS module from Arduino itself. Connect 5v of Arduino to 5v of GPS.

Wait for some time for the GPS to get FIX. Once a FIX is received a green LED flashes on the GPS board indicating that GPS is ready with data flow.

p1

Connect the USB of Arduinot o PC & open the DEVICE MANAGER to note the COM port allotted.

Open the Arduino IDE & select the PORT allotted.

Image 8

 

Image 9

Open the SERIALMONITOR to see the FLOW of NMEA sentences

We’re interested  in GPRMC which is the recommended minimum data for gps

There is an interesting link where we can decode the GPRMC sentence & understand the contents

https://rl.se/gprmc

Copy & paste a GPRMC sentence in this site to decode the contents.

Image3

 

If you notice a V  in GPRMC sentence ,it means GPS has not yet got a FIX. Relocate the antenna & wait for some time to receive a FIX & V changes to A .

Now the RMC sentence has all  the  data latitude,longitude,time,speed,altitude,etc..

Image 4

 

 

Image 10

 

Copy a portion of the data flow & paste it on to a Notepad.

Save it as text file with a name.

 

Image 11

 

To visualize the data , go to this link

http://www.gpsvisualizer.com/

Click on Choose file & select the notepad file saved.

Select the Output Format as GOOGLE MAPS  & click MAPIT.

Image 12

You can see the location on Map.

Image 13

 

Now your GPS is working.Let us go for a practical demo with Arduino.

To parse the data there are libraries that make life easier.

One such library is TINYGPS++ from Arduiniana

http://arduiniana.org/libraries/tinygpsplus/

Download the library ,unzip it.

Image 14

Rename it to TinyGPSPlus & copy paste to Arduino –> Libraries.

Image 15

Open the Arduino IDE to see a list of examples against TinyGPS++

Select the FULLEXAMPLE  code.

Image 16

Here Softwareserial is used & digital pins 4 is defined as RX , 3 as Tx

Connect the Tx of GPS to  Rx of Arduino (digital pin 4)

Gnd toGnd.

As we only receive data from GPS , a single connection is enough. Tx of GPS toRx of Arduino

Image 17

 

Now upload the code & open the Serial monitor on baud 115200.

No data is received

Image 19

This is because of BAUD RATE mismatch.

Change the GPS Baud (not the serial baud)  to 9600 & then upload.

 

Image 20

 

Now you get data which is displayed neatly on serial monitor.

Image 21

In the next example we shall parse the GPS data & send SMS as google maps link using a GSM.

For this we use the previous version of library TINYGPS .

https://github.com/mikalhart/TinyGPS

 

Image 22

Download the library & install it.

Here we use SIM900 GSM .A separate power source of 12v 1amp is required for GSM.

Connection between Arduino & GPS :

 

Tx of GPS connected to Rx of Arduino

 

Gnd to Gnd

5v of Arduino to 5v of GPS.

 

Connection between Arduino & GSM

 

Gnd to Gnd

Tx of GSM to Rx (soft serial pin 7) of Arduino

Rx of GSM to Tx (soft serial pin 8) of Arduino

 

IMG_20180421_162653

 

Download the code from here

http://www.alselectro.com/files/GPS_GSM.zip

 

In this code we make use of older version of TINYGPS library to parse the latitude,longitude data,

 

Image 23

The data parsed is then appended to google maps link&sent as SMS .

Every 20 seconds an SMS is sent.You can modify the code so that you get SMS only when you call to the GSM.

 

Image 24

 

Upload the code & get the SMS on themobile no. you provided in the code.

Touch on the SMS link to see the location of GPS.

 

IMG_20180421_170826         IMG_20180421_170829

 

IMG_20180421_170845

SUPPORT VIDEO :

 

blog_image.jpg

Advertisements