GPS and navigation lesson plan
A NEO-6M on the Uno: NMEA sentences read by hand, TinyGPS++, judging a fix by satellites, HDOP and age, the haversine distance and initial bearing, geofences with hysteresis, track logs on a microSD card, and a reverse geocache box that opens in one place on Earth.
Objectives and materials
By the end, students can
- NMEA sentences, TinyGPS++, and when to trust a fix.
- Distance and bearing, geofences, and track logs.
- A reverse geocache box that opens in one place.
Materials for the whole unit
- Arduino Uno R3
- Buzzer
- Character LCD with I2C backpack
- GPS module, NEO-6M
- LED
- microSD card module
- Pushbutton
- Resistor
Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.
What the module says
NMEA sentences, TinyGPS++, and when to trust a fix.
| Lesson | Time | What students do |
|---|---|---|
| NMEA sentencesA GPS module is a serial port that talks text. Read the NEO-6M’s sentences a line at a time with no library, check each checksum by hand, split $GPRMC into fields, and turn ddmm.mmmm into degrees. | 55 min |
|
| TinyGPS++TinyGPS++ parses every sentence for you: position, altitude, satellites, time, speed and course, each with isValid(), isUpdated() and age(). Plus why the Uno prints 38.889469, and the time zone the GPS does not know. | 55 min |
|
| Fix qualityWhen to trust a position: the satellite count, HDOP (4 over the square root of the count, here), and the age of the last reading. Three satellites are too few for a 3D fix, and a lost fix is noticed within two seconds. | 45 min |
|
Materials
- Arduino Uno R3
- GPS module, NEO-6M
Check for understanding
Each student finishes "Fix quality" on their own, without opening the hints. The simulator checks 5 of its 5 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Your trust rules".
Navigating
Distance and bearing, geofences, and track logs.
| Lesson | Time | What students do |
|---|---|---|
| Distance and bearingThe haversine distance and the initial bearing from the module to the Lincoln Memorial, written out and checked against TinyGPS++: 1294 m on a course of 269 degrees, and 2266 m against 2267 to the Capitol. | 45 min |
|
| GeofencesA circular geofence around where the module started: the module drives east at 72 km/h, the distance climbs 20 m a second, the fence trips at 100 m and sounds the buzzer, and a hysteresis band stops it chattering on the line. | 55 min |
|
| Track logsA track log on a microSD card: a CSV row of GPS time, latitude and longitude every two seconds as the module heads north at 36 km/h, opened and closed per row so a power cut loses one row, then read back. | 55 min |
|
Materials
- Arduino Uno R3
- Buzzer
- GPS module, NEO-6M
- microSD card module
Check for understanding
Each student finishes "Track logs" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "No card".
Boss project
A reverse geocache box that opens in one place.
| Lesson | Time | What students do |
|---|---|---|
| Boss: a geocache boxA reverse geocache: the box shows on its LCD how far it is from the one place it opens, logs every try to its card, refuses to judge without a fix, and lights its latch lamp and chirps only within 20 m of the Smithsonian Castle. | 55 min |
|
Materials
- Arduino Uno R3
- Buzzer
- Character LCD with I2C backpack
- GPS module, NEO-6M
- LED
- microSD card module
- Pushbutton
- Resistor
Check for understanding
Each student finishes "Boss: a geocache box" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Make it yours".
Teach this unit as a class
Start a class from this course and its 7 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.
The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.