Skip to content

spectralliaisons/gps-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gpstracker

Solar-powered GPS tracker that displays user's track, saving it to kml file on sd card. Running on Adafruit Feather M0 Adalogger.

SD Card file organization:

Updated: 2018.10.03 Current track is named "TRK0000.TXT". Current map is named "GPSTEST.TXT".

Upon board initialization, directories are created for year/month/day; e.g., September 1st, 2018 is 2018/09/01/. Within the day directory, each board initialization creates an indexed folder; e.g., "00000001/". Within this folder are indexed logs:

  • "BATTERY.TXT" : a log of timestamped battery voltage (csv)
  • "LOGFILE.TXT" : a log in case board crashes; what would be console output when board is connected to Arduino IDE is logged here.

proof of concept: print gps coordinates

an image examplar

displaying the initial section of the Russian River East Fork from SD card

Only locations visible on-screen are drawn. Concentric circles indicate distance from current location (at center). an image examplar

overview

minimum viable product:

Solar-powered GPS tracker that displays user's track, saving it to kml file on sd card.

goal features:

  • draws other kml tracks on sd card (different color than curr track)
  • [ ] can scroll touchscreen by 'dragging' (WON'T DO: Adafruit TFT display draws too slowly for this!)
  • can zoom in/out (display units change from feet to miles when zoomed out sufficiently)
  • concentric circles centered on user location denoting distances
  • SD card not required for displaying battery and GPS data
  • LEDs for solar state: charging and done (refer here. look for "https://learn.adafruit.com/usb-dc-and-solar-lipoly-charger/using-the-charger")

materials

microcontroller

sensors

interface

COMPARE TO:

power

steps

wiring

  • hook up materials.

Arduino IDE Setup

boards

  • Tools > Boards Manager:
  • Arduino SAMD Boards
  • Adafruit SAMD Boards

libraries

  • copy Adafruit_GPS to Documents/Arduino/libraries/
  • Tools > Manage Libraries >
  • Adafruit HX8357
  • Adafruit STMPE610
  • Adafruit GFX
  • RTClib by Adafruit

reinstalling Arduino

  • delete:
  • App
  • Documents/Arduino
  • Documents/Arduino15 (why is this not always existing? it needs to be deleted...)

GPS

  • print current gps coord on screen

SD

basic gps polling

  • poll gps every n seconds & write to csv: p0,p1,p2,...
  • read from SD & display most recent locations
  • can insert / remover SD card while board is running without a crash

write kml

  • write & read from kml file instead of csv

RAM test (read large kml)

Adafruit Feather M0 Adalogger has "256KB of FLASH + 32KB of RAM". kml files often exceed 32KB. Test reading a large file like this 715KB one.

KML will be stored on the SD card. You probably want to read the file in small chunks, keeping only points whose lat, lng coords translate to pixels that are visible on the display. This may not efficiently support map scrolling, as the entire kml would need to be re-processed only to use most of the same points as before.

Maybe another file on the SD card is a list of coords sorted such that those closest to the current GPS position are first. When a current location is obtained, all list elements increase by one position? This assumes you're moving slow enough to not jump many points, right?

Or maybe your track on the SD card remains CSV and powering off or pressing a button formats it as KML, or maybe offload this to a python script run on the user's computer; this would be easier to parameterize.

display gps track

  • translate gps coords to screen pos (user's current location is screen center)
  • filter current track gps coords to only points that are visible on screen
  • draw circle for all visible gps points
  • draw lines connecting all visible gps points