Build a Raspberry Pi RTK GPS Base Station: Centimeter-Accurate Positioning with a u-blox ZED-F9P and NTRIP
Consumer GPS gets you within a few meters of your actual position — fine for navigation, useless for anything that needs real precision. Real-Time Kinematic (RTK) positioning closes that gap to the centimeter level by comparing satellite signals against a fixed reference station with a precisely known location, and the hardware to do it has quietly become affordable enough for a home shop. A u-blox ZED-F9P module costs roughly what a decent 3D printer nozzle upgrade does, and paired with a Raspberry Pi it becomes a base station capable of correcting a rover receiver — a drone doing photogrammetry mapping, a surveying rig, or even a CNC-adjacent positioning project — down to 1-2cm accuracy. This project builds that base station and explains the base/rover relationship well enough to get your own rover working against it.
How RTK Actually Gets You to Centimeters
A standalone GNSS receiver calculates position from satellite signal timing alone, and atmospheric delay, clock drift, and satellite orbit errors limit it to a few meters of accuracy no matter how good the receiver is. RTK cancels most of that error out: a base station at a known, fixed location continuously computes the difference between where it "should" be and where the raw satellite data says it is, then streams that correction data to one or more rover receivers nearby. Since the base and rover see nearly identical atmospheric and orbital error at any reasonable distance (typically under 10-20km for the cleanest fixes), applying the base's correction to the rover's own measurement cancels almost all of the shared error, leaving only the sub-centimeter geometric term. The rover needs a live data link to the base — this project uses NTRIP (Networked Transport of RTCM via Internet Protocol) to stream corrections over WiFi or the internet, which is more flexible for a home shop than a dedicated radio link.
Parts List
- Raspberry Pi 4 Model B (4GB)
- u-blox ZED-F9P RTK GPS breakout board
- Survey-grade multi-band GNSS antenna (L1/L2)
- SMA-to-SMA low-loss antenna cable
- 5V/3A USB-C power supply for the Pi
- Survey tripod or fixed roof mount for the antenna
- Weatherproof enclosure for outdoor mounting
- 32GB high-endurance microSD card
- Second ZED-F9P module for the rover (drone, handheld, or CNC positioning target)
Setting Up the Base Station Software
The Pi's job is straightforward: read raw correction data from the ZED-F9P over USB or UART, and serve it out as an NTRIP caster that rover units can connect to.
- Flash Raspberry Pi OS Lite (headless is fine — this runs as a background service with no display needed) and set up SSH access, following the headless setup process already covered on this site.
- Connect the ZED-F9P breakout to the Pi over USB. Confirm it enumerates as a serial device (typically /dev/ttyACM0) with dmesg | grep tty.
- Install str2str from the RTKLIB toolkit (sudo apt install rtklib or build from source for the latest version) — this is the utility that reads the module's raw RTCM output and serves it as an NTRIP caster.
- Configure the module in "Survey-In" mode using u-center or u-blox's configuration commands over the serial link. Survey-In has the receiver average its own position over a set time (typically 60+ minutes) and accuracy threshold (1-2 meters is a reasonable target) before it locks in a fixed base position and starts generating corrections.
- Once survey-in completes and the module is in Time Mode with a fixed position, start str2str pointed at the module's serial port, outputting RTCM3 messages (1005, 1077, 1087, 1097, 1127, and 1230 cover the common GPS/GLONASS/Galileo/BeiDou constellations) to a local NTRIP caster port.
- Set the service up with systemd so it survives reboots and starts automatically — a base station that requires manual restart after a power blip defeats the point of leaving it running unattended.
Antenna Placement Matters More Than Anything Else
RTK accuracy is only as good as the base station's sky view. A survey-grade multi-band antenna with a clear 360° view of the sky, away from multipath sources like metal roofing, large reflective walls, or overhanging trees, is the single biggest factor in getting a stable, low-noise fix. A base mounted under a roof overhang or near HVAC equipment will show far noisier corrections than one on a clear mast or rooftop mount, even with identical hardware. If this base station is meant to be permanent — supporting repeated drone mapping surveys of the same property, for example — a fixed roof or mast mount that can be re-surveyed once and then left alone is worth the extra installation effort over a tripod you set up each time.
Getting the Rover Talking to the Base
The rover — a second ZED-F9P on a drone, a handheld mapping pole, or wherever centimeter positioning is needed — connects to the base's NTRIP caster over WiFi or a cellular hotspot, receives the RTCM correction stream, and applies it to its own raw GNSS measurements. Most rover-side software (u-center, QGroundControl for drone applications, or a custom RTKLIB rover config) just needs the base's IP address or NTRIP caster hostname, port, and mount point. A rover typically needs 30-60 seconds after acquiring the correction stream to move from a "float" solution (still meters of uncertainty) to a "fixed" solution (centimeter-level) — watch the fix status in whatever software you're using rather than assuming a connection means you have precision immediately.
Practical Uses for a Home or Small-Shop RTK Base
- Drone photogrammetry mapping — RTK-corrected geotags on aerial photos dramatically improve the accuracy of orthomosaics and 3D models generated from drone surveys, which matters for property mapping, construction progress documentation, or agricultural applications.
- Land surveying and staking — laying out a build site, fence line, or garden bed with repeatable centimeter accuracy without hiring a surveyor for routine work.
- Precision agriculture experiments — RTK is the backbone of auto-steer tractor guidance; a hobby-scale base station is a legitimate starting point for makers experimenting with automated planting or mowing paths.
- Fixed reference for other maker projects — outdoor robotics, long-baseline structure monitoring, or any project that needs an absolute, repeatable position reference rather than relative dead-reckoning.
A base station like this only has to be surveyed in once; after that, it's a static, low-power service quietly generating corrections for whatever rover projects need them. It's a good example of how far affordable module-level hardware has come — precision that required tens of thousands of dollars in dedicated survey equipment a decade ago now runs on a Raspberry Pi and a module smaller than a business card.
Related Guides
- Build a Stratum 1 NTP Time Server with Raspberry Pi and GPS
- GPS Modules for Maker Projects: NEO-6M/NEO-M8N Wiring, NMEA Parsing, and Logging with ESP32
- Build a Raspberry Pi Dashcam: Continuous Loop Recording, GPS Overlay, and Impact-Triggered Save
- How to Install Klipper on Any 3D Printer: Complete Setup Guide
- How to Set Up OpenCV Machine Vision on a Raspberry Pi
- Raspberry Pi: Complete Headless Setup Guide (No Monitor Needed)
- Raspberry Pi: Headless OS Setup
- How to Set Up a Raspberry Pi Headless with SSH and WiFi