How this works is explained in this chapter with an example.
- GPS module
- senseBox JST adapter cable
A mobile senseBox has many applications. For example, would you like to measure the concentration of particulate matter, your daily route to work or school? The GPS module receives the position (longitude / latitude / high) of the senseBox. This sensor is compatible with the popular GNS systems (GPS, QZSS, GLONASS, BeiDou, Galileo) and is based on the u-blox CAM-M8Q Multi GNSS module.
In order for the GPS module to have a signal throughout the measurement period, and thus be able to request the location, you must make sure that nothing obscures the module. Ideally, you attach it outside the case for the measurement period.
For the power supply during the measurement period you can, for example, use a power bank. Some power banks turn off, if too little power is drawn (for example, when a cell phone is fully charged), so that it may happen that the power bank does not permanently power the senseBoxMCU. Before measuring, make sure that this will not be the case.
How the GPS module is programmed is exemplified by a temperature measurement. Each metric of a mobile station is uploaded along with its latitude and longitude values.
First, an instance of the sensors must be created. In addition, we define 2 more variables for latitude and longitude:
float lat; // Geographic latitude float lon; // Geographic longitudeHDC1080 hdc; GPS gps;
setup()-function we now start the two sensors.
loop()-function now queries the location of the station and uploads it to the openSenseMap together with the value for temperature..
lat = gps.getLatitude();
lon = gps.getLongitude();
temp = hdc.getTemperature();