Monitoring Water Quality in Real-Time with a Color Sensor

This clever approach to water quality monitoring is a fast and relatively inexpensive way to test if water has been contaminated.

The importance of water quality

Avnet's Summer of Green Tech Design Challenge, launched on Earth Day 2023, is a collaborative event meant to bring out innovative solutions to environmental issues through the use of maker technology. As her contribution, element14 Presents host Katie Dumont wanted to create a device that could inexpensively measure water quality since spills, excess sediments, or simply a drastic change in color could all indicate a serious issue upstream. By deploying many sensors at various points along a body of water such as a river, Dumont hopes that adverse events could be detected and remedied more quickly.

How it works

Oftentimes, water quality is measured via a labor-intensive process of collecting samples, running them through a centrifuge, and then analyzing the resulting sediments for signs of hazardous compounds. While it does create accurate reports, the act of collection and analysis is costly. Dumont's project involves taking a common TCS3472 color sensing module, connecting it over I2C to an Arduino MKR WiFi 1010, and then continuously reading the color within a pipe which has water flowing through it. In this way, the board can compare the current readings to the baseline and quickly determine if the color is unsatisfactory.

Building a sampling rig

Because cloudy water is also quite dark and thus hinders the ability of the color sensor to determine what color is present, Dumont constructed the measurement part of her project from three main components. First, she cut a small hole from the top of a section of PVC pipe then attached a strip of bright white LEDs on the inside. From here, she poured a thick layer of clear epoxy resin over the LED strip to waterproof it and finally connected them to a 24V power source. The TCS3472 color sensor was sealed separately so water wouldn't leak onto the surrounding electronics.

The future possibilities

After thoroughly sealing everything up with clear epoxy, Dumont got a baseline reading by immersing the rig into a tub of fresh, clear water and noted how the values for each color were quite high, meaning that plenty of light was shining through the water and reaching the sensor. Conversely, dipping the device into a tub full of murky water due to some added coffee grounds showed a large decrease in the amount of light being picked up by the sensor.

Through this demonstration, Dumont proved how the concept could lead to a promising future for this style of water quality monitoring, and given the connectivity and edge AI options on the Arduino MKR series of boards, could tie into a much larger, distributed system later on. More information about this project can be found here in Dumont's YouTube video.

gatoninja236

IoT, web, and embedded systems enthusiast. Contact me for product reviews or custom project requests.

Latest Articles