Categories
TUTORIALS

Is the clear water you see really clear? —— Let Turbidity sensor tell you.


Introduction

SEN0189 – Gravity: Analog Turbidity Sensor for Arduino

This tutorial covers how to use Gravity: Analog Turbidity Sensor for Arduino, whose type is SEN0189 on the basis of . Turbidity is an essential matric that measures the clearity of the water, which is one characteristic of water quality. There are plenty of particles in rivers or lake in real life, like clay, silt, soil, tiny inorganic and organic matter, algae, dissolved colored organic compounds, plankton and other microscopic organismsand so on.

The work logic of the sensor is to measure the amount of light that is scattered by material in the water. When a light is shined through the water the sensor pluged in, the light would be scattered through particles inside. The higher the intensity of scattered light, the higher the turbidity. The turbidity will be measured in nephelometric turbidity units (NTUs). In real life of the river, during periods of low flow, most rivers shows the color of green with lower turbidity, usually less than 10 NTUs. During rainstorm, particles from the surrounding land are washed into the river, blending the river in muddy conditon, and has much higher NTUs output.

Overview of the sensor

In this case,the turbidity sensor can detect suspended particles in water by measuring transmittance and scattering rate which changes with the amount of total suspended solids(TSS) in water. This type of sensor have both analog and digital signal output modes. You can fine more reference on the sensor on its datasheet.

The sensor kit is composed of :

  • 1x – Turbidity sensor adapter
  • 1x – Turbidity sensor probe
  • 1x – Turbidity sensor cable
  • 1x – Gravity analog sensor cable

Other required components are :

  • Arduino Elegoo Uno R3
  • LCD1602 Module
  • Potentiometer(10k)
  • x 830 tie-pointsBreadboard
  • x M-M wires (Male to Male jumperwires)
  • SEN0189 – Gravity: Analog Turbidity Sensor

With both analog output mode and digital output mode, there are two key notes when using the turbidity sensor:

D/A Output signal switch

First, the “D/A” output signal switch. Here A refers to Analog Signal Output, the higher the turbidity water is, the lower output value it will be. And D refers to Digital Signal Output, which can output either high or low levels based on the threshold adjusted by potentiometer. Considering the both output method, the corresponding code has a little bit different. If we only want to sense the turbidity and output the value in serial monitor, we can simply wire the sensor to Arduino, like the connection diagram as below. As we can see, there are overall three pins extends from the signal connector Board (the middle element that connects two parts), where black pin connects to the GND, red pin connects to 5V, and blue pin connects to A0, remeber it and we will use that in following steps.

Output Display on LCD module

In order to make the value of turbidity more intuitive, instead of serial monitor, we can also display the value on the LCD screen. The LCD display needs six Arduino pins which are set to be outputs, and also need 5V and GND connection, that’s why we need broad band, since we need to connect LCD with turbidity sensor at the same time. Here’s the diagram of LCD module with broadband, we will have to combine the two diagram in the following steps.

Wiring diagram

We now, with the help of braodband, have to combine the two diagram together, since both the LCD module and turbidity needs 5V pin but there is only one 5V pin in Elego Uno R3, we will connect it with breadboard. And here is the supposed diagram and the picture of wiring.

Code

The code for turbidity sensor has two version, one focus on analog output, the other uses Digital output mode.

Example 1- Analog output

Example 2 – Digital output

The code for LCD module is as below,with which we will use the library called “LiquidCrystal.h”.

Now we can combine the two sensor together, to reach the final code:

From the code we can see that, the LCD uses six pins (7,8,9,10,11,12) as output, while the turbidity sensor with the output from A0.

After we upload the code and finish the wiring shown above, it’s time to try the sensor and measure the clearity of different water sample!

Reference:

  1. Elegoo Arduino tutorial lesson 15.
  2. https://wiki.dfrobot.com/Turbidity_sensor_SKU__SEN0189
  3. https://how2electronics.com/diy-turbidity-meter-using-turbidity-sensor-arduino/

Leave a Reply

Your email address will not be published. Required fields are marked *