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.
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.
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
Copy & paste a GPRMC sentence in this site to decode the contents.
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..
Copy a portion of the data flow & paste it on to a Notepad.
Save it as text file with a name.
To visualize the data , go to this link
Click on Choose file & select the notepad file saved.
Select the Output Format as GOOGLE MAPS & click MAPIT.
You can see the location on Map.
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.
Rename it to TinyGPSPlus & copy paste to Arduino –> Libraries.
Open the Arduino IDE to see a list of examples against TinyGPS++
Select the FULLEXAMPLE code.
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
Now upload the code & open the Serial monitor on baud 115200.
No data is received
This is because of BAUD RATE mismatch.
Change the GPS Baud (not the serial baud) to 9600 & then upload.
Now you get data which is displayed neatly on serial monitor.
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
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
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,
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.
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.
SUPPORT VIDEO :
how to modify the code so that it send message only when called.
the link now which is set to phone is not showing any place in map saying place not found.
Please provide to code for whic it only sends sms when we call the number and also the option to send text on multiple numbers.
The link that came in sms says result not found on google maps
Good Work bro. Can you give exaple coding when the sensor reading reaches the thershold, the location is sent through the SMS. Can you help me?