Introduction: USING GPS SENSOR
Introduction
A GPS receiver uses satellites to pinpoint locations, so as long as you have a GPS receiver and a clear view of the sky, you'll never be lost again :)
Now, how does a GPS Sensor work ?
Have a look at this amazing site : http://electronics.howstuffworks.com/gadgets/trave...
I would suggest have a look at how the GPS receiver generates a Pseudo Random Code which has a mention in the given site.
The GPS system uses an array of satellites orbiting around the earth and sending time information. It picks up the signal transmitted from the satellites, calculates the time it took for the signal to arrive, and by identifying the position of satellites, triangulates the position on the surface of the globe.
It uses the standard NMEA protocol (http://www.nmea.org ) to transmit the position data via serial port.
Let us start exploring the world of GPS! :D
Step 1: COMPONENTS
The following components are needed :
1- Arduino UNO
2- GPS Receiver ( I have used Skylab SKG13BL )
3- Jumper Wires
4- Magnetic Antenna ( Called Magnetic G Mouse which usually comes with it )
5- USB Cable
Step 2: SKG13BL
It's always a good practice to read the Datasheet, here you go :
http://www.alselectro.com/files/SkyLab_Datasheet.p...
Switch to 3.3V Power supply.
The connections are as follows: [Shown in Picture ]
GND of GPS ------------ GND of Arduino
3.3V of GPS ------------- 3.3V on Arduino
Note : You can even use a 12V Power source, but here we are using 3.3V.
Most microcontrollers these days have built in UARTs (universally asynchronous receiver/transmitter) that can be used to receive and transmit data serially. UARTs transmit one bit at a time at a specified data rate (i.e. 9600bps, 115200bps, etc.). This method of serial communication is sometimes referred to as TTL serial (transistor-transistor logic).
The last simple connection involves connecting the TLL from GPS to Arduino Board :
Rx of GPS -------- Tx of Arduino ( Pin 3 )
Tx of GPS --------- Rx of Arduino (Pin 4)
[ Refer Pg.8 of the Datasheet ]
Now, connect the G Mouse to the GPS Receiver and connect the Arduino board to the PC via USB.
Step 3: LIBRARIES
Now, all the connections are done and we need to install the required libraries.
Install the TinyGPS Library from here :
http://arduiniana.org/libraries/tinygps/
Install the Software Serial Library :
Step 4: THINGS TO KEEP IN MIND
Please take care of the following :
1- Do not connect the GPS Module to Multiple Power Supplies.
2- Place the G Mouse at a spot where it can see the sky.
3- Please go through the Datasheet.
4- You can even use Putty to obtain output -
6- If the code shows error, make sure to keep the Baud Rate to 9600.
7- If you face port or driver problem, Do this : Control Panel > System and Security > System > Device Manager > Ports > Arduino UNO > Update Driver Software > Browse computer manually and choose the Arduino IDE folder.
Step 5: CODE
Please find the attached code. Remember to see the previous step in case of Port Error.
OUTPUT
The code will give the Latitude and Longitude. Make sure to divide the output by 10^6 to get correct coordinates.
You can also visit sites likes to map the points :
Attachments
Step 6: Output
This should be the format of Output :
Position: lat: 26865785 lon: 80906375 Position: lat: 26865785 lon: 80906375 Position: lat: 26865785 lon: 80906375 Position: lat: 26865783 lon: 80906375 Position: lat: 26865783 lon: 80906375 Position: lat: 26865783 lon: 80906375 Position: lat: 26865783 lon: 80906375 Position: lat: 26865783 lon: 80906373 Position: lat: 26865783 lon: 80906373 Position: lat: 26865783 lon: 80906373 Position: lat: 26865783 lon: 80906373 Position: lat: 26865783 lon: 80906373 Position: lat: 26865783 lon: 80906373 Position: lat: 26865783 lon: 80906373 Position: lat: 26865783 lon: 80906373 Position: lat: 26865783 lon: 80906372 Position: lat: 26865783 lon: 80906372 Position: lat: 26865783 lon: 80906370 Position: lat: 26865783 lon: 80906370 Position: lat: 26865783 lon: 80906370 Position: lat: 26865783 lon: 80906370 Position: lat: 26865783 lon: 80906372 Position: lat: 26865783 lon: 80906372 Position: lat: 26865783 lon: 80906375
Well, Thanks a lot! Do show me yours :) In case of any doubt please feel free to ask.