60

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?

SDsolar
  • 2,208
  • 8
  • 24
  • 42
Maria Zverina
  • 5,020
  • 5
  • 29
  • 41
  • 3
    This sounds awesome! – Alex Chamberlain Jun 20 '12 at 09:52
  • This [GPS reciever](http://www.coolcomponents.co.uk/catalog/em408-module-p-44.html) 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 09: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: http://www.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
  • I'd be interested in a GPIO/low level answer as well, anyone keen? I don't have a GPS module, otherwise I'd give it a shot using a serial/I2C connection – Alex L Jun 26 '12 at 09:27
  • @AlexChamberlain The pi can only provide 50mA on the 3V3 pin. You would need to regulate the 5V down to 3V3 and use that to power the receiver. – teraquendya Jun 27 '12 at 21:09
  • @teraquendya Interesting! Source? Or is it obvious if I look at the schematic again? – Alex Chamberlain Jun 27 '12 at 21:29
  • I got it from the [elinux page here](http://elinux.org/RPi_Low-level_peripherals) – teraquendya Jun 27 '12 at 21:41
  • I have a Q&A that describes installing a generally-available G-Mouse USB GPS unit and software: https://raspberrypi.stackexchange.com/questions/68816/how-can-i-set-up-my-g-mouse-usb-gps-for-use-with-raspbian – SDsolar Jun 22 '17 at 21:51

4 Answers4

43

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.

Ragnar123
  • 626
  • 6
  • 5
7

Useful GPS Module for Raspberry Pi Tutorial!

Avio
  • 1,167
  • 2
  • 13
  • 25
alex
  • 79
  • 1
  • 1
5

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!

Guntis
  • 213
  • 3
  • 7
4

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

Piotr Kula
  • 17,168
  • 6
  • 63
  • 103
  • 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 05:45