Monitoring Water Quality Using Lots Of Sensors And Machine Learning

A portable water quality monitor

Despite great progress over the past century, more than a billion people still don’t have access to clean drinking water today. Much of the water on Earth’s surface is polluted, but it’s not always easy to tell a dirty stream from a clean one. Professional kit for water analysis can be expensive, which is why [kutluhan_aktar] decided to design a portable, internet-connected water pollution monitor.

A bowl of water with several sensors immersed in it, and a blue box connected to them
Calibrating the system using a bowl of clean water.

There is no single parameter that determines the quality of a water sample, so the pollution monitor has no less than five different sensors. These can determine the oxidation-reduction potential (a chemical indicator), the pH (acidity), total dissolved solids (mainly salts), turbidity (suspended particles) and temperature. To combine all these numbers into a simple “yes/maybe/no” indicator, [kutluhan] trained a neural network with data gathered from a large number of places around his hometown.

This neural network runs on an Arduino MKR GSM 1400 module. While not a typical platform for AI applications, the neural network runs just fine on it thanks to the Neuton framework, a software plaform designed to run machine learning applications on microcontroller systems like the Arduino. It also has a GSM/3G modem, allowing it to report the measured water quality to a central database.

All of this is housed in a 3D-printed enclosure that makes the whole setup easy to carry and operate in any location. Collecting data across a wide area should help to locate sources of pollution, and hopefully contribute to an improvement in water quality for everyone. Here at Hackaday we love citizen science initiatives like this: previously we’ve featured projects to measure things as varied as air quality and ocean waves.

9 thoughts on “Monitoring Water Quality Using Lots Of Sensors And Machine Learning

  1. What is the point of this? Both in the sense of “why does is require a neutral network to say yea/nea when water quality is a matter of whether any of the particular tests are out of an acceptable range” and “if you’re uploading your data via cellular network, why are you running a neural network on a microcontroller instead of on a server somewhere”?

    1. That sounds like it’s coming from a first world perspective, which I don’t think is necessarily the context of this. It’s sending the results back via SMS, not a modern cellular data connection. So it could be used in a region where all you may only have is an intermittent 2G connection – minimising how much data you send then becomes a priority. But also alternatively it could be sending directly to someone’s personal phone (which may not be a smart phone) – so you’d want to be sending information rather than raw data.

  2. Sadly, 3G is currently the walking dead. My understanding is that they are going to fully cut off service in the US this summer. This project will need an upgrade… and yes, waterproofing.

  3. I wonder if he is accounting temperature effects for the electrode readings. Maybe the neural net would help with that?

    I couldn’t find much info on the ORP. All that’s in the manual is that it uses a gold/platinum plates electrode and the reference electrode. I wonder if they are using calomel? Could be a potential environmental hazard itself even if small.

    1. The orp electrode uses the pH electrode half cell (not combination) reference electode. Calomel is not used, and is no longer used in modern pH electrodes.

      I know that dissolved oxygen is a critical water quality parameter oh, and a deal probe would use the same circuit as the orp with a high impedame selector swich.

  4. Its easy to imagine that this would be a low-cost, easily-deployed, safe way to measure water safety anywhere. That would be very wrong.

    Having worked with (+designed+built) water quality sensors, I would take this article with a huge grain of salt. It’s one thing to build a prototype and another entirely to build one that survives unattended in the wild and stays in calibration for long periods of time in a wide variety of environments (some of which will for instance grow biofilms on your sensors or simply cover them jn muck).

    Similarly, rely on deep learning for a safety-critical task and you have a system that’s just asking to blow up in your face, telling you that everything is fine when in fact it’s just hit a dangerous edge case that you never trained it for.

    That’s not to say this isn’t useful. Think of it like autonomy levels for cars. If this is to be used under trained human supervision for short periods of time in known (non-mucky) environment, fine (maybe). But if you’re gonna set it and forget it at the edge of some pond somewhere, that’s a much bigger challenge. I wish them best of luck!

Leave a Reply to G. GeorgeCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.