I would like to hookup a GPS receiver to my Pi so that I can:

  1. Get my geographical position
  2. Synchronise clock when not connected to network

What are my options? Will any hardware supported by gpsd work with the Pi?

  • 3
    This sounds awesome! – Alex Chamberlain Jun 20 '12 at 9:52
  • This GPS reciever looks like a good option, but I would have to have a play with it to provide a decent answer. It runs at 3V3 and 75mA, which is a good start! – Alex Chamberlain Jun 20 '12 at 9:58
  • 1
    Just wrote an answer about gpsd as I didn't notice it in the question. D'oh! FYI, here is the gpsd site: catb.org/gpsd/index.html which will give info on getting the time and location info from a software side. – winwaed Jun 20 '12 at 14:50
  • You could also use a Bluetooth GPS device, so you can put it at the best position (e.g. near a window), although it needs a separate power supply. GPS devices speaking NMEA 0183 work with gpsd and they are pretty standard, so maybe you can find a used one. Bluetooth on the RPi should also work with most Bluetooth dongles. – elmicha Jun 22 '12 at 21:24
  • My bounty will be awarded to an answer which provides a hardware schematic and software examples to set the clock and display geographical position. – Alex Chamberlain Jun 25 '12 at 11:12
up vote 42 down vote accepted
+50

GPS Receiver

I would go for a generic usb GPS receiver such as the BU-353

BU-353

It works with the Raspberry Pi, just like a normal linux computer.

Most usb GPS receivers are just USB-to-Serial adapters that read the NMEA data from the GPS receiver. Look into pl2303 (many units i've seen use this particular chip) drivers, should be available.

You can also use GPIO and a traditional NMEA 0183 GPS receiver, but then you need to worry about power, and the prices are often higher. GPS antannas are common onboard boats and ships, and usually consume 12v.

The usb solution is cheaper.

Software

The gps receiver I mentioned is compatible with gpsd.

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

This will install gpsd and related software. Check gps status with cgps -s.

NTP Clock

To synchronize the clock with NTP, you need to install ntp.

sudo apt-get install ntp

See this blog post: http://blog.retep.org/2012/06/18/getting-gps-to-work-on-a-raspberry-pi/. It covers ntp in detail.

  • 4
    That blog post is great. – Jivings Jun 25 '12 at 20:17
  • 2
    I can confirm that the BU-353 works with a Pi – pufferfish Dec 15 '12 at 15:35
  • Does ntp get the time from the GPS module when not connected to the Internet? – Dimme Aug 14 '13 at 15:51
  • this will eat up your one usb port.... – Ruthvik Vaila Oct 23 '13 at 6:45
  • 1
    @JohnDemetriou Depends on the use case. A precise clock can make the difference between correct and incorrect timestamps - if you aggregate from multiple sensors with their own clock, you could for example get wrong ordering of events, if the clocks are differing. – Ragnar123 May 13 '16 at 23:28

Useful GPS Module for Raspberry Pi Tutorial!

  • 1
    I'd like to see this sort of tutorial replicate here ... blogs are always disappearing .... – Maria Zverina Oct 26 '12 at 11:52
  • Downvoted due to the answer being link only – John Demetriou May 4 '16 at 14:57

Look at adafruit ultimate gps

It’s got everything you want and more:

-165 dBm sensitivity, 10 Hz updates, 66 channels
5V friendly design and only 20mA current draw
Breadboard friendly + two mounting holes RTC battery-compatible
Built-in datalogging PPS output on fix
>25Km altitude
Internal patch antenna + u.FL connector for external active antenna
Fix status LED

…all for under $40!

If you do not want to use USB you can use TTL GPS recievers. Sparkfun does a very fast 50 channel GPS receiver but you can find other ones on eBay or other sites.

You can use this by disabling the serial console on the Pi and connect the receiver directly to the UART pins.

enter image description here

* Remember to check the voltages of the GPS device you are using

  • 2
    If you don't want to step the voltages down (as these modules are almost always 5v logic) you can plug them into a ttl to usb adapter, and the usb side into the Pi. This saves the serial console (for us who love it) and circumvents a voltage divider or level converter. – Patrick Cook Mar 10 '16 at 5:45

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.