Lesson plan

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.

3 chapters, 7 lessons, about 6 hours, on the Arduino Uno R3. Every lesson runs in the browser, with nothing to install.

The unit

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.

Chapter 1. About 2 h 35 min

What the module says

NMEA sentences, TinyGPS++, and when to trust a fix.

LessonTimeWhat 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
  1. Run it: the sentences
  2. What each sentence says
  3. Split the RMC
  4. Degrees and minutes
  5. No fix
  6. Why read them by hand once
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
  1. Run it: a parser
  2. Satellites and altitude
  3. Time from the sky
  4. Valid, updated, and how old
  5. Start moving
  6. Local time
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
  1. Run it: a good fix
  2. Too few satellites
  3. A clear sky
  4. Lose the fix
  5. Your trust rules

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".

Chapter 2. About 2 h 35 min

Navigating

Distance and bearing, geofences, and track logs.

LessonTimeWhat 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
  1. Run it: how far, which way
  2. Check it against a library
  3. Initial bearing
  4. Move the module
  5. A new target
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
  1. Run it: home is where it starts
  2. Moving away
  3. Over the line
  4. The buzzer
  5. Hysteresis on the line
  6. A tighter fence
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
  1. Run it: start a track
  2. Three rows
  3. Read the track back
  4. From CSV to a map
  5. A denser track
  6. No card

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".

Chapter 3. About 55 min

Boss project

A reverse geocache box that opens in one place.

LessonTimeWhat 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
  1. Run it: a box that opens in one place
  2. The first try
  3. The screen
  4. No fix, no answer
  5. Arrive
  6. Make it yours

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".

Your class

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.