Projects and News
03-30-2022

GSM & SMS Enabled AI-driven (TinyML) Water Pollution Monitor

 

The state of the environment has now become a growing concern, and water scarcity is among the most alarming issues, both on international and local levels. Since water is constantly polluted with chemicals, plastic, and other contaminants, it can cause different threats not only to the global population, but also to animals, plants, and marine life, putting their health in danger. 

 

Project Overview

To solve the issue at least at the local level, it’s decided to create a budget-friendly device to forecast water pollution levels, based on research papers. It was decided to utilize oxidation-reduction potential (ORP), pH, total dissolved solids (TDS), and turbidity measurements denoting water pollution (contamination).

Since water pollution levels can depend on various phenomena, it’s impossible to interpret it accurately only having limited data without applying complex algorithms. Therefore, it was decided to build an artificial neural network and train it using the experimentally assigned pollution classes to predict water pollution levels based on ORP, pH, TDS, and turbidity measurements.

 

Procedure

To collect data from water resources in the field to create a valid data set, it was decided to employ an Arduino MKR GSM 1400 compatible with GPRS. To obtain ORP, pH, TDS, and turbidity measurements, DFRobot water quality sensors and a DS18B20 waterproof temperature sensor were connected to the MKR GSM 1400. Then, an SH1106 OLED display was added to monitor the data collected in the field.

After transmitting data over GPRS successfully, a web application was developed in PHP to log the transferred data in a CSV file before building and training a neural network model. Then, the web application was tested on an Apache server hosted on my Raspberry Pi 4.

Since the MKR GSM 1400 is not widely preferred to run neural network models, most platforms and official TinyML libraries do not support it. As such, it was decided to use Neuton, because this platform supports almost every available microcontroller on the market to run TinyML models effortlessly. 

After completing the dataset, the artificial neural network (ANN) model with Neuton was created  to make predictions on water pollution levels (classes) based on ORP, pH, TDS, and turbidity measurements. As labels, for each data record there were employed experimentally assigned water pollution classes while collecting data in the field:

  • Clean
  • Risky
  • Polluted

 

Outcomes

After training and testing the neural network model, it was uploaded and executed on the MKR GSM 1400. Therefore, the device was enabled to detect precise water pollution levels (classes) by running the model independently. Also, after running the model successfully, the MKR GSM 1400 was employed to transmit the prediction (detection) result to a given mobile number via SMS.


You can find more details about coding, logging data over GPRS, building an artificial neural network model with Neuton, and running it on the MKR GSM 1400, in the article by Kutluhan Aktar.


Want to create your own project? Try Neuton for free right now!

Stay updated, join the community
slack