Update of low-cost sensor software

Anticipating an increase in Arduino-based PM sensor systems, I have made an update in the low-cost sensor software code. I also shifted to another sensor identification system. So far, I used for my measurement instruments a four-letter abbreviation (e.g. SPSA for the Sensirion SPS Arduino sensor, IQAV for the IQAir Airvisual Pro), in combination with a two-digit identifier (e.g. SPSA01, SPSA02, …). This system accommodates a maximum of 100 unique identifiers per instrument type.

I have used up to 33 so far. Since my presentations in Addis and publication, some other persons and organizations have expressed their interest. We built ten sensor systems for a PhD student last June. A team at Debre Birhan University has recently built their own system according to our design. I plan to install some ten sensors in both Arba Minch and Addis Ababa the coming year. I am in discussion with universities across Ethiopia for building and/or using the sensor systems as well. Hence, I have decided to shift to the following naming convention: SPSA_XXXX (SPSA as four-letter abbreviation of SPS30 Sensirion with Arduino, XXXX being four digits).

Most recent sensor system build: SPS30 Sensirion sensor, BME280 sensor, DS3231 real-time clock and SD module connected to an Arduino Mega. The system is powered by a Li-Ion 18650 battery. See an overview of the components on this page.

The software

Apart from the naming convention, I have made the following changes versus the earlier software versions:

  • Apart from a datafile, the sensor system also creates a metadata file. In the metadata file, for every restart of the sensor system it adds a line with the time, software version, device ID, serial number of the SPS30 Sensirion sensor, and the sensors of that specific SPSA.
  • As data from the SPS30, not only PM values (PM1, PM2.5, PM4, PM10), but also particle numbers of the separate bins are saved.
  • I have included a start-up sequence: first 50 seconds of low power mode, after which 30 seconds of SPS30 cleaning mode. I introduced the low power mode for the use of a Li-Ion 18650 rechargeable battery with battery shield as power bank. When the Li-Ion battery is fully depleted, and power comes back, the sensor system at the very start draws too much power. It therefore does not manage to start at all. Instead, at the moment the power comes back, the sensor system should start at low power. Within 50 seconds, there is some charge back in the battery, with which the system can start.

You can find the sketch (Arduino software code) for the set-up here. The sketch is for the following configuration:

 * SPS030......Mega
 * 1 VCC.......5V
 * 2 SDA.......SDA (nb: with 10k pull up resistor, or other I2C sensor)
 * 3 SCL.......SCL (nb: with 10k pull up resistor, or other I2C sensor)
 * 4 Select....GND (select I2c)
 * 5 GND.......GND
 *
 * BME280......Mega
 * VIN.........5V
 * GND.........GND
 * SDA.........SDA
 * SCL.........SCL

 * SD module...Mega
 * GND.........GND
 * VCC.........5V
 * MISO........50
 * MOSI........51
 * SCK.........52
 * CS..........53
 *
 * DS3231......Mega
 * GND.........GND
 * VCC.........5V
 * SDA.........SDA
 * SCL.........SCL
 * 
 * Green LED....Mega
 * +............8 [+: longer leg]
 * -..resistor..GND [-: smaller leg]