Tag Archives: GPS HAT

The Ultimate GPS HAT for the Raspberry Pi

If your smartphone is lost or misplaced, you can trace it using its GPS or Global Positioning System receiver. The US Department of Defense has placed 24 satellites into the Earth’s orbit making it a satellite based navigation system. Although GPS was conceived originally for military applications, in the 1980s, the government allowed the civilians to use the system as well. GPS works without any subscription fees or setup charges for 24 hours a day, covering the entire world in any weather condition.

Circling the earth twice a day in very precise orbits, the GPS satellites transmit signal information to the earth. GPS receivers calculate their exact location by receiving and tri-lateraling this signal information. GPS receivers compare the time the signal was transmitted from the satellite with the time of its reception. The difference tells the GPS receiver its distance from the satellite.

After computing the distance measurements from at least two more satellites, the receiver determines its 2-D position and displays it on the electronic map of the unit. That allows it to know its latitude and longitude and to track its movement. If the receiver is able to contact four or more satellites, it can determine its 3-D position – latitude, longitude and altitude. With this information, the GPS unit of the receiver can compute other information such as speed, track, bearing, trip distance, sunrise and sunset time, distance to destination and much more.

The popular single board computer, the RBPi or Raspberry Pi, does not have a GPS receiver built-in. However, you can add a GPS unit to the SBC by plugging in a new HAT from Adafruit. This Hardware Attached on Top board conforms to standard specifications, enabling the board to be identified by the RBPi. Once identified, the SBC configures its GPIO ports and its drivers to suit the attached HAT.

The new HAT has an Ultimate GPS on it and enables the RBPi to know its exact position and time. It fits the RBPi Models A+ or B+. If you slip in a coin cell in the holder provided, it will power its RTC, and the RBPi will keep precise time. As the GPS unit does not take up much space, the HAT has plenty of prototyping area for adding sensors, LEDs and much more.

It must be noted that the GPS HAT uses the hardware UART of the RBPi. Once you are using this HAT, you will be unable to use the Rx/Tx pins of the RBPi for any other purpose. If you plan to use the GPS HAT along with a console, you will have to change the application and use a composite or HDMI monitor and log in with a keyboard. Of course, you can still use ssh to connect to your RBPi over the network.

Adafruit has very informative tutorials for using this HAT. They offer the HAT in a fully assembled condition, with the GPS unit already soldered in along with an unsoldered 2×20 header for sitting on the RBPi GPIO. Once you have soldered in the header, you are all set to connect the GPS HAT on your RBPi. The coin battery is not included in the kit.