Honours Thesis: Development of an IoT System for Environmental Monitoring

Honours Thesis: Development of an IoT System for Environmental Monitoring

2020, Nov 02    

Use of the Internet of Things (IoT) is poised to be the next big advancement in environmental monitoring. We present the high-level software side of a proof- of-concept that demonstrates an end-to-end environmental monitoring system, replacing Greater Wellington Regional Council’s expensive data loggers with low-cost, IoT centric embedded devices, and it’s supporting cloud platform. The proof-of-concept includes a Micropython-based software stack running on an ESP32 microcontroller. The device software includes a built-in webserver that hosts a responsive Web App for configuration of the device. Telemetry data is sent over Vodafone’s NB-IoT network and stored in Azure IoT Central, where it can be visualised and exported.

While future development is required for a production-ready system, the proof-of-concept justifies the use of modern IoT technologies for environmental monitoring. The open source nature of the project means that the knowledge gained can be re-used and modified to suit the use-cases for other organisations.

My honours thesis was submitted in partial fulfilment of my Bachelors degree at Victoria University of Wellington. The project was done as a peer project: My teammate, Jolon Behrent, worked on the hardware and electronics side, while I did the software side. My biggest project to date, I spent ~700 hours total on the project and the thesis is a whopping 18,000 words. You can download the thesis here.

I will update this page to links to the source code when we get the go-ahead to publish it.


Web App Demos

The thesis doesn’t contain any demonstrations of the web app side of the software in use. Here are some quick videos showing off the main use-cases of the web app, running off the ESP32’s webserver:

“Regular Mode” - Connect, Read and Transmit Data

Regular mode has three main functions.​ The first is to connect to a WiFi hotspot.​ After it has done this, it takes some readings from the connected sensors, as well as the battery.​ It then logs the data to an SD card, and then transmits the data to azure iot central over wifi.​ Let’s see what this looks like in action:

“Configure Mode” - Update, Calibrate and Test

The second mode – configure mode – is used to update the device settings, calibrate the sensors, and even send raw SDI-12 commands to the sensors to be able to test and debug them.​ When configure mode is started, it starts up a WiFi access point, which the user connects their device to.​ It also starts up a webserver, which serves up a React based web app.​ React is a popular web framework that allows us to have modern web features, such as live-reloading the page without refreshing it, and building a web site using modular components which allow for code reuse and testability.​

This demo shows me going into the “device settings” screen, changing the device name and making the device start reading it’s sensors at 10:10pm. Once I’ve done that, I can save the settings, and after a few seconds you’ll see the name being updated at the top.​

Creating a New Sensor

Firstly, I push a button to create a new sensor. This sensor is a temperature and humidity sensor.​ Then, I set some basic config such as changing the sensor address and changing the bootup time.​

Lets say I only care about the temperature, so I set the number of readings to take to 1, and then I change the name and index of the reading to take.​ This sensor is off by about 1 degree, so I calibrate it with the offset field.

SDI-12 Monitor

For the second example, I’m showing how the user can input manual SDI-12 commands to configure and debug a connected sensor.​ The user firstly needs to put the device into Maintenance Mode. This boots up all the connected sensors, and allows the monitor to start sending commands.​ Firstly the user sends 1M!, which measures the data, and then enters 1D0! Which reads the data, in the same way that regular mode does it.

Managing, Exporting and Visualising the Data in IoT Central

Once the data has been sent by the device in regular mode, it gets stored in Azure IoT Central.​ IoT central is a platform that allows us to do everything from manage the network of connected iot devices,​ Visualise and perform analytics on the data as it comes in, and even export the data to long term storage and in-depth analytics software.​

Here’s a demonstration that shows our data has been recorded inside azure, and we can do some basic analytics on the data.​ This graph shows the water temperature over a period of time, which I’ve expanded to three days.​ I can change the recording interval to look at a smoother version of the graph, and see the data at particular points.​