This week we worked on adding GPS to our Open Source Environmental Air Quality unit.
Tools we used in this project
In addition to the tools used in Newsletter #1, also added the following two items:
- Adafruit Mini GPS breakout board, $29.95
- 4-pin JST PH to JST SH cable (2nd short cable to daisy-chain the boards together)
- Optional: Lithium Ion Battery Pack - 3.7V 6600mAh $24.50
Step 1: GPS breakout board
For GPS tracking, we opted to use the Adafruit Mini GPS PA1010D - STEMMA QT. This is a very small board (1 inch x 1 inch) with a GPS sensor and STEMMA QT connectors, which means there is no soldering required. You can easily connect it to the PyGamer and BME688 board with a second JST PH cable. In the picture below we have the GPS in-between the PyGamer and the BME688 board, but you can also switch the order so its after the BME688 board, the order doesn't really matter. We have been slowly moving most of our projects to using the STEMMA/QT QWIIC system as they are really convenient.
Step 2: Update PyGamer firmware
Next we made changes to our PyGamer firmware to include the data from the GPS board. The firmware communicates with the GPS sensor via the Adafruit_GPS library. This library can be installed using the Library Manager in the Arduino IDE as described in the previous post. We modified the firmware so that the display cycles through 3 screens:
- Screen 1: IAQ (Index of Air Quality) and SIAQ (static IAQ), Temp, Press and Humidity
- Screen 2: Date, Time, GPS Latitude & Longitude
- Screen 3: System Info. Battery and MicroSD file status (is it writing to file)
From the data shown on Screen 2, the GPS is returning a value of
- LAT = 34 09.4207 N; LON = 118 05.4043 W
We can input these values into Google Maps to confirm the location of the device and it does indeed show the correct location at IO Rodeo.
Now we can co-locate our environmental data (IAQ value, Temp, humidity and pressure) with location, date and time of day.