Page 1 of 3
How to Setup GPS Module and Use it as a Geolocator?
Posted: Wed Dec 04, 2013 5:36 pm
by peter145
Hey guys can you help me with this project of mine?
1. Interface the GPS module(
https://docs.google.com/file/d/0BxdLxDC ... edit?pli=1) to the raspberry pi
2. send the data from the GPS module to a website (Our website or Local host)
3. Use the data gathered from the gps-rasberrypi to track our device using GOOGLE map
Link to related Project:(
http://www.cooking-hacks.com/documentat ... rry-pi#gps)
My project output should be similar to these Cooking Hack Project Tutorial . But i dont know how to interface my GPS module so that it can use this codes
thanks in advance this will help me greatly on our Final project
Re: How to Setup GPS Module and Use it as a Geolocator?
Posted: Wed Dec 04, 2013 8:29 pm
by Dutch_Master
Search for gpsd in Synaptic, install it, connect the GPS unit via USB and run the software

Re: How to Setup GPS Module and Use it as a Geolocator?
Posted: Fri Dec 06, 2013 4:46 am
by peter145
Dutch_Master wrote:Search for gpsd in Synaptic, install it, connect the GPS unit via USB and run the software

How do you connect my gps module without a usb just direct to the Raspberry pi
Re: How to Setup GPS Module and Use it as a Geolocator?
Posted: Fri Dec 06, 2013 5:17 am
by ame
If the GPS does not have a USB interface then it's probably serial. You must find out the voltage level of the serial interface. It's probably either RS232, TTL, or 3.3V.
Once you know the voltage you can hook it up to the Pi. You can use a USB -> serial adapter (either RS232 or 5V or 3.3V). Or you can hook it up to the serial port pins on the GPIO connector. You will need a level shifter if it's RS232 or 5V, but not if it's 3.3V.
What is the make and model of your GPS module?
Re: How to Setup GPS Module and Use it as a Geolocator?
Posted: Fri Dec 06, 2013 5:59 am
by peter145
ame wrote:If the GPS does not have a USB interface then it's probably serial. You must find out the voltage level of the serial interface. It's probably either RS232, TTL, or 3.3V.
Once you know the voltage you can hook it up to the Pi. You can use a USB -> serial adapter (either RS232 or 5V or 3.3V). Or you can hook it up to the serial port pins on the GPIO connector. You will need a level shifter if it's RS232 or 5V, but not if it's 3.3V.
What is the make and model of your GPS module?
here is the IP pins of my GPS module...
https://docs.google.com/file/d/0BxdLxDC ... edit?pli=1
Re: How to Setup GPS Module and Use it as a Geolocator?
Posted: Fri Dec 06, 2013 6:33 am
by ame
Hi there,
Well, from looking at the spec. sheet. I'd make the following guesses. Please note, these are guesses, and it's not my hardware or my money.
The jumper J2-Vlogic seems to switch between 5V and 3.3V logic. For the Pi GPIO you need 3.3V logic, so check J2-Vlogic is set to 2-3 (it looks like you might need a solder blob there). Serial data is on JP4 Tx and Rx pins. Not sure what switch S2 does.
So, you basically need four wires.
1. Connect GND on the Pi GPIO to the module JP1 GND.
2. Connect 5V power from the Pi GPIO to the module JP1 +5V.
3. Connect TxD from the Pi GPIO14 TxD to the module JP4 Rx.
4. Connect RxD from the Pi GPIO15 RxD to the module JP4 Tx.
Then use /dev/ttyAMA0 on the Pi to send and receive data. You have to 'disconnect' the kernel using /dev/ttyAMA0 for the console before you can use it for your own application. Instructions are in the link below.
Details of GPIO and 3.3V supply pins here:
http://elinux.org/Rpi_Low-level_peripherals
Details of serial port (/dev/ttyAMA0) here:
http://elinux.org/RPi_Serial_Connection
Good luck.
Re: How to Setup GPS Module and Use it as a Geolocator?
Posted: Fri Dec 06, 2013 6:44 am
by peter145
ame wrote:Hi there,
Well, from looking at the spec. sheet. I'd make the following guesses. Please note, these are guesses, and it's not my hardware or my money.
The jumper J2-Vlogic seems to switch between 5V and 3.3V logic. For the Pi GPIO you need 3.3V logic, so check J2-Vlogic is set to 2-3 (it looks like you might need a solder blob there). Serial data is on JP4 Tx and Rx pins. Not sure what switch S2 does.
So, you basically need four wires.
1. Connect GND on the Pi GPIO to the module JP1 GND.
2. Connect 5V power from the Pi GPIO to the module JP1 +5V.
3. Connect TxD from the Pi GPIO14 TxD to the module JP4 Rx.
4. Connect RxD from the Pi GPIO15 RxD to the module JP4 Tx.
Then use /dev/ttyAMA0 on the Pi to send and receive data. You have to 'disconnect' the kernel using /dev/ttyAMA0 for the console before you can use it for your own application. Instructions are in the link below.
Details of GPIO and 3.3V supply pins here:
http://elinux.org/Rpi_Low-level_peripherals
Details of serial port (/dev/ttyAMA0) here:
http://elinux.org/RPi_Serial_Connection
Good luck.
Thanks sir gonna try this out.... can I message you if I have any questions?
Re: How to Setup GPS Module and Use it as a Geolocator?
Posted: Fri Dec 06, 2013 6:48 am
by ame
peter145 wrote:
Thanks sir gonna try this out.... can I message you if I have any questions?
You're welcome. I hope it works, but I cannot guarantee it.
You can PM me if you like, but it's more useful to other readers if you post your questions 'in the open', then other people can read and learn (and avoid your mistakes, if there are any).

Re: How to Setup GPS Module and Use it as a Geolocator?
Posted: Fri Dec 06, 2013 6:54 am
by ame
Ah, whoops. The names of the Tx and Rx pins are swapped by the PCB wiring. I am not sure if that makes the names easier to follow, or more confusing. Anyway:
3. Connect TxD from the Pi GPIO14 TxD to the module JP4 Tx.
4. Connect RxD from the Pi GPIO15 RxD to the module JP4 Rx.
Re: How to Setup GPS Module and Use it as a Geolocator?
Posted: Fri Dec 06, 2013 7:09 am
by peter145
ame wrote:Ah, whoops. The names of the Tx and Rx pins are swapped by the PCB wiring. I am not sure if that makes the names easier to follow, or more confusing. Anyway:
3. Connect TxD from the Pi GPIO14 TxD to the module JP4 Tx.
4. Connect RxD from the Pi GPIO15 RxD to the module JP4 Rx.
ah so the last one was wrong? this is the right one?
Re: How to Setup GPS Module and Use it as a Geolocator?
Posted: Fri Dec 06, 2013 7:17 am
by ame
peter145 wrote:ame wrote:Ah, whoops. The names of the Tx and Rx pins are swapped by the PCB wiring. I am not sure if that makes the names easier to follow, or more confusing. Anyway:
3. Connect TxD from the Pi GPIO14 TxD to the module JP4 Tx.
4. Connect RxD from the Pi GPIO15 RxD to the module JP4 Rx.
ah so the last one was wrong? this is the right one?
Yes, this is the right one. Previously I suggested that Rx and Tx should be crossed over, but when I re-read the datasheet it seems that they should be wired straight through for this specific module.
Re: How to Setup GPS Module and Use it as a Geolocator?
Posted: Fri Dec 06, 2013 7:29 am
by peter145
ame wrote:peter145 wrote:ame wrote:Ah, whoops. The names of the Tx and Rx pins are swapped by the PCB wiring. I am not sure if that makes the names easier to follow, or more confusing. Anyway:
3. Connect TxD from the Pi GPIO14 TxD to the module JP4 Tx.
4. Connect RxD from the Pi GPIO15 RxD to the module JP4 Rx.
ah so the last one was wrong? this is the right one?
Yes, this is the right one. Previously I suggested that Rx and Tx should be crossed over, but when I re-read the datasheet it seems that they should be wired straight through for this specific module.
oh ok... are the ones that need to be crossed over are adafruit Ultimate breakout GPS?
would it affect if I crossover the Rx Tx with my current GPS module?
I noticed something in the Schematic diagram I encircled it here: does that affect the Crossovering of the Rx and Tx?
http://imageshack.com/a/img4/6766/bwuv.png

Re: How to Setup GPS Module and Use it as a Geolocator?
Posted: Fri Dec 06, 2013 9:30 am
by ame
peter145 wrote:
oh ok... are the ones that need to be crossed over are adafruit Ultimate breakout GPS?
would it affect if I crossover the Rx Tx with my current GPS module?
I noticed something in the Schematic diagram I encircled it here: does that affect the Crossovering of the Rx and Tx?
http://imageshack.com/a/img4/6766/bwuv.png

Woah, trigger! When did the Adafruit Ultimate Breakout GPS appear? Let's stick to the original device.
So, let's say you have two devices, A and B. And they have serial ports on them. The typical serial port is three pins: transmitted data (Tx), received data (Rx) and ground (GND). Usually you expect to connect Tx (data out) from device A to Rx (data in) of device B, and vice versa. And connect the GND pins together, of course.
Unfortunately the naming convention is not rigorous, and sometimes, the name is misleading, or unconventional, or different, or wrong. Sometimes Tx means 'data out', and sometimes it means 'connect the Tx line from the other end here'. When I am looking at schematics I prefer to note them as 'data out' and 'data in', once I have figured out the sense of the pins.
When I looked at the data sheet in detail I saw that the pin labelled Tx is actually connected to GPSRx, and vice versa. Which means that the sense of the Tx pin is different to what the name suggests. So, connect Tx on the Pi to Tx on the module, and Rx on the Pi to Rx on the module. Make sure the module is set for 3.3V logic before you do this.
I don't know what S2 is for. It switches between the hardware UART of the GPS module and a secondary software UART. There is not enough information about these two ports, so I suggest you leave S2 in the hardware UART position (this is the upward position shown on the diagram, but how it appears on the physical board I don't know).
Ok, now looking at the Adafruit device, the Tx and Rx pins are marked as I expect them to be, so for *that* module, connect Tx on the Pi to Rx on the module, and Rx on the Pi to Tx on the module. This is explained in the tutorial linked from that product.
Re: How to Setup GPS Module and Use it as a Geolocator?
Posted: Fri Dec 06, 2013 10:22 am
by peter145
ame wrote:peter145 wrote:
oh ok... are the ones that need to be crossed over are adafruit Ultimate breakout GPS?
would it affect if I crossover the Rx Tx with my current GPS module?
I noticed something in the Schematic diagram I encircled it here: does that affect the Crossovering of the Rx and Tx?
http://imageshack.com/a/img4/6766/bwuv.png

Woah, trigger! When did the Adafruit Ultimate Breakout GPS appear? Let's stick to the original device.
So, let's say you have two devices, A and B. And they have serial ports on them. The typical serial port is three pins: transmitted data (Tx), received data (Rx) and ground (GND). Usually you expect to connect Tx (data out) from device A to Rx (data in) of device B, and vice versa. And connect the GND pins together, of course.
Unfortunately the naming convention is not rigorous, and sometimes, the name is misleading, or unconventional, or different, or wrong. Sometimes Tx means 'data out', and sometimes it means 'connect the Tx line from the other end here'. When I am looking at schematics I prefer to note them as 'data out' and 'data in', once I have figured out the sense of the pins.
When I looked at the data sheet in detail I saw that the pin labelled Tx is actually connected to GPSRx, and vice versa. Which means that the sense of the Tx pin is different to what the name suggests. So, connect Tx on the Pi to Tx on the module, and Rx on the Pi to Rx on the module. Make sure the module is set for 3.3V logic before you do this.
I don't know what S2 is for. It switches between the hardware UART of the GPS module and a secondary software UART. There is not enough information about these two ports, so I suggest you leave S2 in the hardware UART position (this is the upward position shown on the diagram, but how it appears on the physical board I don't know).
Ok, now looking at the Adafruit device, the Tx and Rx pins are marked as I expect them to be, so for *that* module, connect Tx on the Pi to Rx on the module, and Rx on the Pi to Tx on the module. This is explained in the tutorial linked from that product.
ahh nice.... so how do I set the GPS module to 3.3V logic? do i need to solder or put any cables?
Re: How to Setup GPS Module and Use it as a Geolocator?
Posted: Fri Dec 06, 2013 1:21 pm
by ame
peter145 wrote:ahh nice.... so how do I set the GPS module to 3.3V logic? do i need to solder or put any cables?
I'm not entirely sure. The picture of the module is not clear, but it looks like a solder blob shorts together two solder pads at J2. Check the documentation, but you need solder between 2 and 3, and nothing between 1 and 2. Maybe it's already like that. If not, get your soldering iron out.
Re: How to Setup GPS Module and Use it as a Geolocator?
Posted: Fri Dec 06, 2013 2:14 pm
by peter145
ame wrote:peter145 wrote:ahh nice.... so how do I set the GPS module to 3.3V logic? do i need to solder or put any cables?
I'm not entirely sure. The picture of the module is not clear, but it looks like a solder blob shorts together two solder pads at J2. Check the documentation, but you need solder between 2 and 3, and nothing between 1 and 2. Maybe it's already like that. If not, get your soldering iron out.
Oh so there is a chance that I can connect it directly without any soldering or use of a Level shifter....
Here are more Device specification
http://www.e-gizmo.com/KIT/gps%20shield.html
It says its compatible for 3v - 5 v
Description
Global Positioning System GPS module has buffered UART serial I/O that allows it to be interfaced with any host MCU operating within 3V to 5V range. Full I/O interface functions are available through a 2x7 header connector.
Re: How to Setup GPS Module and Use it as a Geolocator?
Posted: Fri Dec 06, 2013 11:30 pm
by ame
peter145 wrote:
Oh so there is a chance that I can connect it directly without any soldering or use of a Level shifter....
Yes. That's exactly what I said in my first message (after fixing the names of Tx and Rx):
For the Pi GPIO you need 3.3V logic, so check J2-Vlogic is set to 2-3 (it looks like you might need a solder blob there). Serial data is on JP4 Tx and Rx pins.
So, you basically need four wires.
1. Connect GND on the Pi GPIO to the module JP1 GND.
2. Connect 5V power from the Pi GPIO to the module JP1 +5V.
3. Connect TxD from the Pi GPIO14 TxD to the module JP4 Tx.
4. Connect RxD from the Pi GPIO15 RxD to the module JP4 Rx.
Then use /dev/ttyAMA0 on the Pi to send and receive data. You have to 'disconnect' the kernel using /dev/ttyAMA0 for the console before you can use it for your own application.
Done and done. No level shifter required.
Re: How to Setup GPS Module and Use it as a Geolocator?
Posted: Sat Dec 07, 2013 8:55 am
by peter145
ame wrote:peter145 wrote:
Oh so there is a chance that I can connect it directly without any soldering or use of a Level shifter....
Yes. That's exactly what I said in my first message (after fixing the names of Tx and Rx):
For the Pi GPIO you need 3.3V logic, so check J2-Vlogic is set to 2-3 (it looks like you might need a solder blob there). Serial data is on JP4 Tx and Rx pins.
So, you basically need four wires.
1. Connect GND on the Pi GPIO to the module JP1 GND.
2. Connect 5V power from the Pi GPIO to the module JP1 +5V.
3. Connect TxD from the Pi GPIO14 TxD to the module JP4 Tx.
4. Connect RxD from the Pi GPIO15 RxD to the module JP4 Rx.
Then use /dev/ttyAMA0 on the Pi to send and receive data. You have to 'disconnect' the kernel using /dev/ttyAMA0 for the console before you can use it for your own application.
Done and done. No level shifter required.
nice thanks... now for the code... how do you activate this gps module? .do they have the same codes for other gps modules?
how do you exactly program or activate the gps module through what software inside the raspberry pi?
Re: How to Setup GPS Module and Use it as a Geolocator?
Posted: Sat Dec 07, 2013 9:20 am
by ame
peter145 wrote:
nice thanks... now for the code... how do you activate this gps module? .do they have the same codes for other gps modules?
how do you exactly program or activate the gps module through what software inside the raspberry pi?
Undoubtedly the module will behave exactly the same as any other GPS module. When you power it up it will acquire satellite signals and then start sending position data once a second. It is usually not necessary for you to send any commands or data to the module to 'activate' it. Your program simply sits there listening for data and does the right thing depending on what position is reported.
Someone has already mentioned 'gpsd'. It's a GPS listening daemon. Basically it 'takes control' of your GPS receiver, and your program communicates with the daemon, not with the GPS directly. The advantage of this is that many programs can use the same GPS data feed, otherwise multiplexing it yourself is tricky.
I recommend your first step is to get the module hooked up and sending data. Set it to 3.3V logic and wire it up as I suggested (4 wires). Next, follow the instructions to release /dev/ttyAMA0 from the console. Finally, use a terminal program such as minicom or gtkterm and look at data coming in from /dev/ttyAMA0. You should see some strings of data arriving once a second. The most interesting one begins with $GPRMC, and includes the current time and position data. If you see this (and the first character after the time is 'A') then your GPS is working properly. You might have to fiddle with baud rates. Try 4800 and 9600, then others.
When that's working, install gpsd (sudo apt-get install gpsd) and point it at the Pi UART:
gpsd /dev/ttyAMA0
That's step 2.
Next use something like xgps to check that gpsd is working. That's step 2a.
Now you have a useful way of getting GPS data from your hardware you can look at the next stage of your project.
Re: How to Setup GPS Module and Use it as a Geolocator?
Posted: Sat Dec 07, 2013 11:18 am
by peter145
ame wrote:peter145 wrote:
nice thanks... now for the code... how do you activate this gps module? .do they have the same codes for other gps modules?
how do you exactly program or activate the gps module through what software inside the raspberry pi?
Undoubtedly the module will behave exactly the same as any other GPS module. When you power it up it will acquire satellite signals and then start sending position data once a second. It is usually not necessary for you to send any commands or data to the module to 'activate' it. Your program simply sits there listening for data and does the right thing depending on what position is reported.
Someone has already mentioned 'gpsd'. It's a GPS listening daemon. Basically it 'takes control' of your GPS receiver, and your program communicates with the daemon, not with the GPS directly. The advantage of this is that many programs can use the same GPS data feed, otherwise multiplexing it yourself is tricky.
I recommend your first step is to get the module hooked up and sending data. Set it to 3.3V logic and wire it up as I suggested (4 wires). Next, follow the instructions to release /dev/ttyAMA0 from the console. Finally, use a terminal program such as minicom or gtkterm and look at data coming in from /dev/ttyAMA0. You should see some strings of data arriving once a second. The most interesting one begins with $GPRMC, and includes the current time and position data. If you see this (and the first character after the time is 'A') then your GPS is working properly. You might have to fiddle with baud rates. Try 4800 and 9600, then others.
When that's working, install gpsd (sudo apt-get install gpsd) and point it at the Pi UART:
gpsd /dev/ttyAMA0
That's step 2.
Next use something like xgps to check that gpsd is working. That's step 2a.
Now you have a useful way of getting GPS data from your hardware you can look at the next stage of your project.
how do i set the logic to 3.3v again? you have to switch it up or program it?
here is a project tutorial that i would like to make... I want to make the gps module to send data over the web so that it can be used by a google map that would be used in our web application :
http://www.cooking-hacks.com/documentat ... spberry-pi
Re: How to Setup GPS Module and Use it as a Geolocator?
Posted: Sat Dec 07, 2013 12:56 pm
by ame
peter145 wrote:
how do i set the logic to 3.3v again? you have to switch it up or program it?
To set the logic level to 3.3V you must ensure J2-Vlogic has a solder blob connecting pads 2-3, and nothing connecting pads 1-2. It may already be like this, or you may need a soldering iron to change it.
I know exactly what you are trying to do, but you won't achieve it unless you start with the basics. Each part of your project is actually trivial, but you must understand the details before you can put the parts together. If you rush you won't succeed, or you'll make a mistake, or you'll find it's not exactly what you want but you won't understand how to fix it.
So, step 1. Ensure the logic levels on the GPS module are set to 3.3V.
Re: How to Setup GPS Module and Use it as a Geolocator?
Posted: Mon Dec 09, 2013 4:03 am
by peter145
ame wrote:peter145 wrote:
how do i set the logic to 3.3v again? you have to switch it up or program it?
To set the logic level to 3.3V you must ensure J2-Vlogic has a solder blob connecting pads 2-3, and nothing connecting pads 1-2. It may already be like this, or you may need a soldering iron to change it.
I know exactly what you are trying to do, but you won't achieve it unless you start with the basics. Each part of your project is actually trivial, but you must understand the details before you can put the parts together. If you rush you won't succeed, or you'll make a mistake, or you'll find it's not exactly what you want but you won't understand how to fix it.
So, step 1. Ensure the logic levels on the GPS module are set to 3.3V.
I just took a pic with my GPS module here it is... the one highlighted in yellow is the J2
http://img189.imageshack.us/img189/8554/jafm.jpg

Re: How to Setup GPS Module and Use it as a Geolocator?
Posted: Mon Dec 09, 2013 4:23 am
by ame
Sorry, that picture is no good. Does your camera have a macro mode? It's usually a button marked with a picture of a flower, and it allows the camera to focus on close things.
According to the documentation, J2 is three solder pads, numbered 1, 2 and 3. There is a solder blob which 'bridges' two adjacent pads to set the option you want. So, what you will see is a solder blob (the size of two pads) and and empty pad. For 3.3V you need a solder blob connecting pads 2-3, and nothing connecting pads 1-2. If this is not clear, or if the board does not match the documentation then you'll have to contact the manufacturer.
Actually, looking at their PDF document it looks like J2 is only *two* pads- a sort of oval shape with a split across the middle, in the picture on page 1. The schematic on page 3 shows a two-way switch for J2, therefore there needs to be three pads- 5V, VDD, and VLOGIC. If you can take a better picture we can maybe see. Otherwise, ask the manufacturer how to set J2 for 3.3V logic.
Re: How to Setup GPS Module and Use it as a Geolocator?
Posted: Mon Dec 09, 2013 4:29 am
by ame
Ok, sorry, the PCB artwork on page 4 is very clear. The solder pads are very close together in an oval pattern with *two* horizontal splits, which makes three segments to the right of R1. The top one is pad 3, the middle is 2, and the bottom one is 1. Can you see which two segments are joined with a solder blob?
If it's 1-2 (lower to centre) then you need to remove the solder, then re-apply solder to pads 2-3 (upper to centre).
If it's already 2-3 (upper to centre) then you're good to go.
Re: How to Setup GPS Module and Use it as a Geolocator?
Posted: Tue Dec 10, 2013 3:00 am
by peter145
ame wrote:Ok, sorry, the PCB artwork on page 4 is very clear. The solder pads are very close together in an oval pattern with *two* horizontal splits, which makes three segments to the right of R1. The top one is pad 3, the middle is 2, and the bottom one is 1. Can you see which two segments are joined with a solder blob?
If it's 1-2 (lower to centre) then you need to remove the solder, then re-apply solder to pads 2-3 (upper to centre).
If it's already 2-3 (upper to centre) then you're good to go.
How about this? Instead of using the +5volts I could use the +3.3v so it will be a 3.3v logic is that ok?
And it also says that "buffered UART serial I/O that allows it to be interfacedwith any host MCU operating within 3V to 5V range. Full I/O interface"
Link to Photo:
http://imageshack.com/i/gihhzyp
