Posts

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.

Personal exposure exceeding guideline values

For the 10 participants of a pilot study, personal exposures to Carbon Monoxide (CO) and PM2.5 concentrations exceed guideline values. You can read more about these measurements on the project page.

Guideline values

The World Health Organization (WHO) advises a PM2.5 guideline of 25 μg/m3 as 24-hour average (source), while Ethiopia uses a guideline value of 65 μg/m3 as 24-hour average (Guideline Ambient Environment Standards for Ethiopia, 2003).

For CO, guideline values are given at shorter time average periods, as health effects from CO can be more direct. Both the WHO and Ethiopia use guideline values at averaging periods of 15 minutes, 30 minutes, 1 hour and 8 hours of respectively 90, 50, 25 and 10 PPM.

Measured CO exposure

During the 24-hour measurements, peaks up to 400 PPM were measured. The figures show the measured CO concentration as boxplots for each of the participants, without and with values outside the whiskers.

24-hour average concentrations are below 6 PPM, and for all participants 75% of all data is lower than 5 PPM. There are however peak concentrations of sometimes up to 400 PPM.

To compare the measured concentrations to guideline values, we have to use 15 minute, 30 minute, 1 hour and 8 hour average concentrations. Each of these time averaging period have their own guideline value. To compare them in one graph, the below graph shows the highest average value of each of these time periods, relative to the guideline value for that averaging period. Averaging concentrations higher than 100% imply that the concentration exceeds the guideline value.

CO maximum average concentrations, relative to the respective guideline values.

Measured PM2.5 exposure

Comparing the measured PM2.5 exposure to the guideline value is more straightforward. Below figure shows the 24-hour average concentrations combined with the guideline values.

PM2.5 24-hour average concentrations.

At all households, the WHO guideline value (25 μg/m3) is exceeded. Only for the participant from household 6, the Ethiopian guideline value (65 μg/m3) is not exceeded.

However, during the 24-hour periods there is a large variability. Periods of relatively low concentrations are mixed with moments of high concentrations. Below figures show the CO and PM2.5 concentration during the whole period, for each of the participants.

TimePlot-HH01
TimePlot-HH02
TimePlot-HH03
TimePlot-HH04
TimePlot-HH06
TimePlot-HH07
TimePlot-HH05
TimePlot-HH08
TimePlot-HH09
TimePlot-HH10
previous arrow
next arrow
 
TimePlot-HH01
TimePlot-HH02
TimePlot-HH03
TimePlot-HH04
TimePlot-HH06
TimePlot-HH07
TimePlot-HH05
TimePlot-HH08
TimePlot-HH09
TimePlot-HH10
previous arrow
next arrow

Air pollution courses 2019

From October 2019 – January 2020 I offered two air pollution courses to four sections of students. I offered the course Air, Noise and Soil pollution to year 4 Water Supply and Environmental Engineering students (three sections; 150 students). I offered the course Atmospheric Chemistry and Air Pollution to year 2 Meteorology and Hydrology students (29 students). For both courses, I used 50% for student air pollution research projects. 33 groups studied a self-selected topic with respect to PM2.5, CO and/or CO2 concentrations on or around campus. They collected a combined 17,431 data points across various scenarios.

Course outline

I spread out the courses over approximately 12 weeks. I used fifty percent of the course time for ‘normal’ course contents: lectures on seven chapters, tests, and a written exam. Those activities were spread out over the whole semester. Simultaneously, the students used the other fifty percent for various parts of research projects. The first four weeks, students (with knowledge from the first lectures) selected topics and worked on a measurement plan. The students chose topics like ‘CO2 concentration in and outside a dormitory’, ‘CO concentration in a kitchen during cooking’, ‘PM concentration close to a generator’, etcetera.

Part of the measurement plan was to select measurement instruments and measurement times. In total I had 6 Lascar El-USB-CO, 6 UCB-PATS+, and 6 IQ Air Airvisual Pro instruments available. Students could select the instruments and use them across a period of four weeks. Between weeks 8-11, students analyzed their data and wrote a report. In the final week, all groups gave a small presentation on their research project.

Research and experience

This project was new for the students. Most courses are theory-based and lecture oriented. While uncertain at the start, students clearly liked the challenge and the opportunity to study air pollution themselves rather than only learn about it from lectures. On beforehand, colleagues warned me about giving instruments to students. However, the students rewarded me with their motivation for the trust I put in them. They returned all instruments in good working order. I am glad the instruments were put to good use, rather than only being on display. The students’ work gave me access to air pollution measurements across various scenarios – with some very high concentrations. I am planning to analyze the data of the students combined, and most likely will apply this teaching method in my future courses as well.

[UPDATE]: data collected by the students during these courses have been the basis for two publications:

For the second publication, three students from the courses were co-authors.

Students measure high concentrations

Outdoor concentrations of PM2.5, CO and CO2 are generally about 10 μg/m3, 0.3 PPM and 450 PPM, respectively. However, close to air pollution sources and/or with circumstances of little ventilation, concentrations can be much higher. This is also witnessed by students of Arba Minch University. So far, they have set records of measured concentrations at 1,800 μg/m3 PM2.5 ( coffee ceremony) 1,040 PPM CO (student’s cafeteria kitchen) and 4.200 PPM CO2 (a closed dormitory with students present).

A student measuring PM2.5 during coffee ceremony

The measurements

33 groups of students from Arba Minch University (Bachelor studies Meteorology & Hydrology, year 2, and Water Supply & Environmental Engineering, year 4) are conducting a small air pollution measurement research.

New Year’s Eve concentrations

Happy new year! On September 12, 2019, according to the Ethiopian calendar, a new year (2012 according to the Ethiopian calendar) has started. While in Ethiopia a change of years is not (yet) celebrated with much fireworks, it is thoroughly celebrated with delicious meals on New Year’s day. Of course, these meals will be prepared on the day before. Many of these meals are cooked on biomass fuel. This was visible on our Home Measurements location (see this project page for more information).

PM2.5 measurements
At the Home Measurements location PM2.5 is measured since August 23. The below graph shows half-hour averages between 17:00 and 2:00 (the next day) for August 23 – September 10, versus September 11 (New Year’s Eve).

On New Year's Eve the average concentration between 17:00 - 2:00 was 64 µg/m3, while on the other evenings this ranged from 10 - 39 µg/m3. Half-hour average PM2.5 concentrations were significantly higher on New Year's Eve than on any other evening (t(df:27)>=2.356, p<=0.013).

Doro Wot
The higher concentrations counted for something: on New Year's day we could enjoy delicious Doro Wot (chicken stew) at some of Arba Minch's most welcoming family homes.

First measurement location

The first measurement location has been installed. An IQAir AirVisual sensor is placed at the front of the house of Geertje and Jan Dirk Dingemanse in Arba Minch, Ethiopia. With its user-friendly interface, the installation consists merely out of supplying power and Wi-Fi. If electricity is available, continuous measurements of PM2.5, CO2, Temperature and Humidity are conducted and logged. The time series will give an insight in the air quality, weather conditions and availability of electricity.

A description of the measurement location and realtime measurement data can be viewed on this page. On the same page, the time series data will (irregularly) be made available for download.

Measurement location