A ₹1,670 handheld that points you back to a saved spot. A NEO-6M GPS module gives latitude and longitude, a button saves the current position as the waypoint, and the sketch shows the distance and compass bearing to it. The page works the haversine formula through so the numbers on screen are not magic.
Scope: intermediate. This is a design worksheet with illustrative costs. It has not been bench-tested by this site. The distance table was computed by script at 28° north (roughly northern India), assuming a sphere of radius 6,371 km. GPS accuracy is a few metres at best in open sky and far worse near buildings or indoors, and the module can take a long time to get a first fix, so test outdoors. This is a learning tool, not a navigation aid for anywhere that matters.
How it works
One degree of latitude is about 111.2 km anywhere on Earth, so 0.0001° of latitude is about 11 m. A degree of longitude shrinks with the cosine of the latitude, so at 28° north 0.0001° of longitude is about 9.8 m.
The haversine formula gives the great-circle distance: a = sin²(Δlat/2) + cos(lat1)·cos(lat2)·sin²(Δlon/2), then d = 2R·asin(√a). The bearing comes from atan2(sin(Δlon)·cos(lat2), cos(lat1)·sin(lat2) − sin(lat1)·cos(lat2)·cos(Δlon)), converted to 0–360 degrees. TinyGPS++ reads and parses the NMEA text for you, and can also compute these two values itself, but writing them out shows the maths.
Bill of materials
| Part | Qty | Unit | Total |
|---|---|---|---|
| Arduino Uno R3 (or compatible) | 1 | ₹550 | ₹550 |
| NEO-6M GPS module with antenna | 1 | ₹500 | ₹500 |
| 16×2 LCD with I2C backpack | 1 | ₹250 | ₹250 |
| Push button | 1 | ₹10 | ₹10 |
| Power bank or 9 V battery with clip | 1 | ₹250 | ₹250 |
| Breadboard | 1 | ₹60 | ₹60 |
| Jumper wires | 1 | ₹50 | ₹50 |
| Parts total | ₹1,670 | ||
Scroll the table sideways to see every column.
Prices checked Nov 2026. Shipping and tools are not included.
Prices are illustrative figures for Indian sellers in November 2026, before shipping, and have not been checked against current listings.
The numbers
| Offset from 28° N, 77° E | Distance |
|---|---|
| 0.0001° lat, 0° lon | 11.1 m |
| 0° lat, 0.0001° lon | 9.8 m |
| 0.001° lat, 0° lon | 111.2 m |
| 0° lat, 0.001° lon | 98.2 m |
| 0.01° lat, 0.01° lon | 1483.3 m |
Because consumer GPS wanders by metres from reading to reading, a waypoint saved right now will show a distance of several metres when you stand on it a minute later. Show the distance only to the nearest metre and add a “you have arrived” radius of about 10 m so the display does not flicker.
Power and wiring
| Part | Connects to | Note |
|---|---|---|
| NEO-6M VCC and GND | 5V and GND | Check the module’s input range |
| NEO-6M TX | D4 | SoftwareSerial RX |
| NEO-6M RX | D3 | SoftwareSerial TX; divide to 3.3 V if the module is not 5 V tolerant |
| Button | D2 to GND | Internal pull-up |
| LCD SDA / SCL | A4 / A5 | Address 0x27 or 0x3F |
The sketch
// GPS waypoint: Uno + NEO-6M + LCD + button
// Design worksheet: libraries are TinyGPSPlus, SoftwareSerial, LiquidCrystal_I2C.
#include <SoftwareSerial.h>
#include <TinyGPSPlus.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
SoftwareSerial gpsSerial(4, 3); // RX, TX
TinyGPSPlus gps;
LiquidCrystal_I2C lcd(0x27, 16, 2);
const int BTN = 2;
const double R = 6371000.0;
const double ARRIVE_M = 10.0;
double wpLat = 0, wpLon = 0;
bool haveWp = false;
double rad(double d) { return d * PI / 180.0; }
double distanceM(double a, double b, double c, double d) {
double dl = rad(c - a), dn = rad(d - b);
double x = sin(dl / 2) * sin(dl / 2) + cos(rad(a)) * cos(rad(c)) * sin(dn / 2) * sin(dn / 2);
return 2 * R * asin(sqrt(x));
}
double bearingDeg(double a, double b, double c, double d) {
double dn = rad(d - b);
double y = sin(dn) * cos(rad(c));
double x = cos(rad(a)) * sin(rad(c)) - sin(rad(a)) * cos(rad(c)) * cos(dn);
double t = atan2(y, x) * 180.0 / PI;
return fmod(t + 360.0, 360.0);
}
void setup() {
pinMode(BTN, INPUT_PULLUP);
gpsSerial.begin(9600);
lcd.init(); lcd.backlight();
lcd.print("Waiting for fix");
}
void loop() {
while (gpsSerial.available()) gps.encode(gpsSerial.read());
if (!gps.location.isValid()) return;
if (digitalRead(BTN) == LOW) {
delay(30);
if (digitalRead(BTN) == LOW) {
wpLat = gps.location.lat(); wpLon = gps.location.lng(); haveWp = true;
while (digitalRead(BTN) == LOW) {}
}
}
static unsigned long last = 0;
if (millis() - last < 1000) return;
last = millis();
lcd.clear();
if (!haveWp) { lcd.print("Press to save"); return; }
double d = distanceM(gps.location.lat(), gps.location.lng(), wpLat, wpLon);
double b = bearingDeg(gps.location.lat(), gps.location.lng(), wpLat, wpLon);
if (d < ARRIVE_M) { lcd.print("Arrived"); return; }
lcd.print((long)d); lcd.print(" m");
lcd.setCursor(0, 1); lcd.print("Bearing "); lcd.print((int)b);
}Bearing is relative to true north, not to where you are facing, because the module has no compass; walk a few steps and use the GPS course to tell which way you are moving. TinyGPSPlus has built-in distanceBetween and courseTo functions that give similar results. SoftwareSerial at 9600 baud is fine for this module. The sketch has been proofread but not compiled on this site.
Test plan
- Fix test: take it outdoors and time how long the first fix takes; it can be several minutes.
- Save and walk: save a waypoint, walk 50 m away and compare the distance with a measuring tape or map app.
- Return walk: follow the bearing back and note how close you get.
- Stationary drift: leave it still for 10 minutes and note how much the distance wanders.
- Maths check: enter two coordinates by hand and compare with an online distance calculator.
- Obstructed test: try under a tree or beside a wall and note the loss of accuracy.
What usually goes wrong
| Symptom | Likely cause | Fix |
|---|---|---|
| Never gets a fix | Indoors or antenna blocked | Go outdoors with open sky and wait |
| No text from the module | Baud rate or wires swapped | Check 9600 baud and TX to RX crossing |
| Distance jumps around | GPS error | Average readings and widen the arrive radius |
| Bearing seems wrong | Bearing is to north, not heading | Use the GPS course while walking |
| LCD garbled | Wrong I2C address | Try 0x3F |
Upgrades
- Compass: add a magnetometer so the arrow works when standing still.
- Multiple waypoints: store several in EEPROM.
- Logging: write a track to an SD card.
- Rover navigation: steer a robot toward the waypoint, outdoors only.
Cost and parts notes
The ₹1,670 total is an illustration and does not include shipping. Use the cost calculator to compare sellers.
Common questions
How accurate is a NEO-6M?
Listings commonly quote a couple of metres in open sky, and real results vary with sky view and conditions.
Why haversine?
It gives the distance over a curved Earth without the problems of flat-plane maths.
Why does the first fix take so long?
The module has to find satellites and download their data; it is quicker after a recent fix.
Can I trust it indoors?
No. Satellite signals barely reach inside buildings.
Last reviewed: November 2026. This is a design worksheet with illustrative costs. It has not been bench-tested by this site; library names, pins and limits must be checked against your board and the current library versions, and measurements from your build are welcome.