Measurements in Addis Ababa

With help of Tofikk Redi (Ethiopian Meteorology Institute, EMI), I have installed three low-cost self-assembled low-cost sensors and one IQAir Airvisual Pro at the monitoring station of EMI in Addis Ababa. Tofikk will irregularly download and share the data, but I also want to find out how the set-up is working for a longer period without regular checkup. As for the data itself, I am interested in the intercorrelation as well as the correlation with the IQAir instrument under concentration levels in Addis Ababa. Also, I hope to compare data of my sensors with the Beta Attenuation Monitor (BAM) at this site. The BAM is a reference-grade PM monitor. The BAM at this site is currently not operational, but EMI expects it to be back in business within the coming months.

Installation of low-cost sensor systems at the EMI monitoring station in Addis Ababa.
EMI monitoring station in Addis Ababa

Kitchen validation measurements

With help of my colleague Dagmawi Matewos, I have installed two measurement boxes filled with instruments in the university campus kitchen. In my courses and research I use low-cost measurement instruments, for which the lower costs usually comes at a cost of quality.  Validation is therefore important. We installed the instruments in this kitchen to validate the instruments under high and variable concentration circumstances. In this kitchen, food is prepared for students at various fire pits.

The following instruments are installed across two boxes:

  • Four self-developed PM2.5 sensor systems (ASPM);
  • Six UCB-PATS+ PM2.5 sampling instruments;
  • Ten IQAir Airvisual Pro instruments (measuring PM2.5 and CO2);
  • Ten Lascar EL-USB_CO carbon monoxide sensors;
  • Three UPAS gravimetric PM2.5 sampling instruments.
Measurement box
Validation preparation
Instruments
Kitchen measurements
previous arrow
next arrow

All PM2.5 measurements will be compared with each other. The ASPM, PATS and IQAV measure continuously (at a frequency of <20 seconds). The UPAS instrument is used to collect filters for gravimetric analysis, and can be considered as golden standard for PM2.5 measurements. Hence, instruments can be evaluated based on intra-correlation (how well do they compare to their own type), inter-correlation amongst low-cost sensor types (comparing ASPM with PATS and IQAV, and vice versa), and correlation to the reference (UPAS).

For CO2 and CO I only have one instrument, so for those there is only intra-comparison possible. We have installed an additional six IQAV instruments in a student dormitory, to specifically test the instrument under varying CO2 concentrations.

LoRa gateway installed

Mekuanint Hailemichael, a colleague of Arba Minch University (senior network manager) has installed a LoRa gateway at a high building of the Nech Sar Campus of Arba Minch University. Installation of the gateway is part of our research project titled “Determining the feasibility and reliability of a do-it-yourself air quality sensor network in Arba Minch, Ethiopia.”.

The building with the gateway is in the middle of Arba Minch, at Nech Sar Campus.

We are planning to install and test multiple Arduino-based particulate matter (PM) sensor systems in Arba Minch. Apart from testing their operationality and data quality, we want to test the possibility of real-time online data through LoRa functionality. The sensor systems transmit small packets of data over a frequency of 868 MHz. A well-positioned gateway can receive this data and put it online. For this purpose, Mekuannint (co-investigator in the research project) has installed a Lorank-8 gateway together with antenna and lighting protection. It is connected to the Arba Minch University network.

Arduino PM sensor system 3/3: sensor data online

In a series of three posts, I share my road towards a PM sensor system with help of Arduino and the SPS30 Sensirion PM sensor. This third post: getting the PM sensor data available online.

Preferably, the measurement data is available real-time online. With the setup of the previous post, we can only access the data by getting it from the SD card. To an Arduino system, a WiFi module can be added to provide online functionality. However, in and around Arba Minch the availability of WiFi is unreliable and limited. I therefore chose to add LoRa (Long Range) functionality to the sensor system, to get the PM sensor data available online.

With LoRa, small packets of data are sent over frequencies of around 433 or 868 MHz. On this frequency, data can be sent over large distances (10+ km). A receiver with internet connection (‘gateway’) can pick up these transmissions and put them online. For small-scale and personal projects, TheThingsNetwork provides network servers for these transmissions for free. In this way, only at one position (the gateway) internet is needed, while within range of that gateway sensor systems can transmit their data.

1 Materials

Individual sensor systems get LoRa functionality through a Dragino LoRa shield. Apart from that, a gateway is needed to receive the data transfers of individual sensor systems. I bought this gateway.

2 Software

To run the LoRa transmission on an arduino board, I used the LMIC arduino library. Apart from that, I created an account on TheThingsNetwork. On that account, I registered an application, and under that application, I registered individual sensor systems as devices.

3 Connections

I mounted the LoRa shield on an Arduino Mega, and connected the SPS30 Sensirion, SD module and DS3231 to the Arduino Mega according to below connections.

SPS030......Mega
1 VCC.......5V
2 SDA.......SDA
3 SCL.......SCL
4 Select....GND
5 GND.......GND

SD module...Mega
GND.........GND
VCC.........5V
MISO........12
MOSI........11
SCK.........13
CS..........53

DS3231......Mega
GND.........GND
VCC.........5V
SDA.........SDA
SCL.........SCL

I had difficulty in getting both the LoRa shield and the SD module to work. Somehow, the communication over MISO/MOSI disturbed each other. While for the default SD library, on the Arduino Mega pins 51-53 are used, I managed to get it working by using SoftwareSPI of the SDfat library and using pins 11-13.

4 Sketch

I used the following sketches for the components:

I combined these sketches to create a full sketch that operates all parts together. In that sketch, for every individual sensor system I had to provide the TheThingsNetwork device’s NwkSKey, AppSKey and DevAddr.

Show code of the whole sketch

5 Operation

In The Things Network, I activated the Storage Integration. In Python I wrote a script that, when ran, downloads the data from TheThingsNetwork, saves it locally as a csv file, creates a graph, and uploads this graph to a website. See the code below.

Downloading the data

Creating a graph

Uploading the graph

This all resulted in a graph on my website, provided that I had a sensor system running, a gateway connected to the internet, and the Python code running.

Arduino PM sensor system 2/3: sensor data on an SD card

In a series of three posts, I share my road towards a PM sensor system with help of Arduino and the SPS30 Sensirion PM sensor. This second post: storing the data on an SD card.

In the previous post I described how I got the sensor data on my computer. Preferably, measurements are done without continuously having a computer around. I wanted to add local data storage to the sensor system with a memory (micro SD) card.

1 Materials

Next to the setup part 1 materials, I bought the following materials:

I found out that for a memory card, it was better to have a relatively small card (< 1GB). Furthermore, after running into battery failure of the real-time clock multiple times, I learned that the DS3231 charging system could destroy non-rechargeable batteries. To resolve this, the charging circuit had to be disabled (for example by removing resistor 201 from the DS3231 shield).

2 Software

Both the real-time clock and the SD card work with libraries that by default are included in the Arduino IDE installation. Additional software was not needed.

3 Connections

I made the following connections between the Aduino Mega and the SD and real-time clock modules:

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

I also put the micro SD card in the SD module.

4 Sketch

I used the following sketches for the components:

In the below sketch, these are combined.

See sketch

5 Operation and next

After uploading the sketch to the Arduino board, it started to collect data and store it on the SD card. I could get the data from the SD card. This is already sufficient for many measurement projects, but online real-time data would be even nicer. Post three: adding LoRa functionality to the sensor system.

Arduino PM sensor system 1/3: sensor data on a computer

In a series of three posts, I share my road towards a PM sensor system with help of Arduino and the SPS30 Sensirion PM sensor. This first post: getting the sensor data on a computer.

Nowadays, more and more Do-It-Yourself air quality sensors come available. A huge advantage of this is the price: while plug and play particulate matter (PM) instruments are (at least) 300, PM sensors can already be bought for under 20. The two main disadvantages are 1) you have to build it yourself, and 2) the reliability of the instrument might be unknown.

Because of the cost-advantage, I chose to discover these options, despite of the two disadvantages. Across three posts, I describe the development of a PM sensor system, based on the Sensirion SPS30 PM sensor, with help of Arduino. For me, the starting point was absolutely zero knowledge on this topic, hence the posts will cover the full learning curve. If you have more knowledge on this topic, it might well be that you can give me relevant advice on how to improve the eventual sensor measurement set.

1 Materials

Below a list of materials, with links to randomly selected suppliers.

2 Software

I installed the Arduino IDE, downloaded a SPS30 library, and placed it in my Arduino folder (Documents/Arduino/libraries).

3 Connections

The SPS30 has five pins: GND, SEL, SCL, SDA and VCC. I connected these pins according to the below schematic (where the two 10K resistors are connected to the SDA and SCL wiring and 5V as ‘pull-up resistors’).

4 Starting the sensor

I connected the Arduino board to my laptop, and in the Arduino IDE, I selected the right COM port (Tools -> Port).

In the example sketch sps30/Example1_sps30_BasicReadings, I edited the following in the sketch:

  • Line 161: #define SP30_COMMS I2C_COMMS

I uploaded the sketch, clicked on the serial monitor and put the baud rate on 115200. After hitting enter, I get PM readings on my screen.

5 What’s next?

Now I have PM data on the screen. The data is out there: but how to save it? Post two: storing the data on an SD card.