How to connect 3DR GPS uBlox to Raspberry Pi

Here is my connection (You can check GPIO pinout here):

I used theFTDI GPS adapter cable, solder pads can be used also, just have in mind the TX pad = RX Ublox and RX pad = TX Ublox.

To get information from GPS in the Raspberry Pi (RPi), we will use gpsd.

Open a terminal

Install gpsd:

sudo apt-get install gpsd gpsd-clients python-gps

Setup RPi UART:

sudo nano /boot/cmdline.txt
delete the "ttyAMA0" parameter to have:
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

sudo nano /etc/inittab
comment (add a hash #) the line below "#Spawn a getty on Raspberry Pi serial line" like this:
#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

Reboot the RPi to apply the configuration:
sudo reboot

At this moment gpsd program is installed. If any gpsd session is open, stop it by:

sudo killall gpsd

Due to 3DR GPS is configured at 38400 bauds, set the RPi to 38400 bauds will be needed:

stty -F /dev/ttyAMA0 38400

(when RPi reboot baud rate returns to default)

Start gpsd:

sudo gpsd /dev/ttyAMA0 -F /var/run/gpsd.sock

Display GPS data:

cgps -s

When 3DR GPS is fixed, the fix blue led will be blinking and you will get the data like this:

If the GPS is not fixing, try outdoors where you have a clear sky view.

Views: 5942

Tags: GPS, Pi, Raspberry

Comment by Joshua Johnson on May 25, 2013 at 6:12am

I love seeing people into raspberry into 3DR gear!  Raspberry is what many of us start out using when we first get into robotics.

Comment by Juan de Dios Perez Camacho on May 30, 2013 at 7:28am

hey guy's i have a question about this post, is normal the values of latitude longitude and other , have a value variance when the GPS is moveless?

Comment by srod on May 30, 2013 at 1:37pm

Yep that worked well, thanks for posting

Comment by Nigel Armstrong on January 26, 2014 at 11:28am

Do you have any problems with using the 5v UART on the 3.3v only Pi?  I know that the pi gpio pins are not 5v tolerant. 

Comment by Tommy Larsen on January 26, 2014 at 11:50am

No problem at all. I tested just to "know" and it all went very well and i have been using it for a long time ever since.

Comment by Nigel Armstrong on January 28, 2014 at 6:50pm

I see why it doesn't damage the pi now.  Most, if not all, of the GPSs available run on 3.3 volts.  They take a 5v input and regulate it.  They are 5v tolerant on the input but output at 3.3v.

Comment by Artem on January 28, 2014 at 7:29pm

hey, a quick question on the 3dr GPS module  ->uart connectivity:

Is it possible to use that GPS unit with another UART device which operates in receive mode only, while still keeping apm connection working at the same time? 

Comment by Artem on January 28, 2014 at 7:29pm

basically  using Tx pin only? 

Comment by Nigel Armstrong on January 28, 2014 at 9:01pm

As far as I know it should be possible, but no guarantees.  http://electronics.stackexchange.com/questions/49405/multiple-clien... could be helpful.  Make sure you have a common ground.  

Comment by Artem on January 28, 2014 at 9:13pm
Yes indeed, I was going to fork vcc, gnd and tx pins from ublox, this if for the MyFlyDream automate antenna tracker. Apparently all it needs is GPS feed at any baud rate up to 112k baud.

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

© 2014   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service