TDS meter Arduino, water Quality monitoring Project, TDS in Water

(Last Updated On: February 11, 2020)

TDS meter

Description:

TDS meter Arduino, water Quality monitoring Project, TDS in Water– Declining water Quality has become a global issue of concern as human populations grow, industrial and agricultural activities expand, and climate change threatens to cause major alterations to the Hydrological cycle. Every year, more people die from unsafe water than from all forms of violence, including war.

Have you ever tried to find out what is the pH value and TDS value of the water you are drinking? Using a pH sensor and a TDS Sensor you can make a perfect water quality monitoring system. I have already used the pH sensor with Arduino and Nodemcu esp8266 wifi Module for measuring the water quality.


Arduino and pH Sensor getting started tutorial.

ph sensor Arduino, how do ph sensors work, application of ph meter, ph sensor calibration

Nodemcu ESP8266 Wifi Module and pH Sensor-based Water quality monitoring.

IOT Water Quality monitoring using Arduino,pH Sensor,Nodemcu ESP8266

In this tutorial, you will learn how to make a water quality monitoring system using the Gravity TDS Meter V1.0, DS18B20 Waterproof one-wire digital temperature sensor and 16×2 LCD with Arduino for measuring the TDS value. TDS stands for Total Dissolved Solids.



TDS meter

The TDS in water value as you can see on the LCD screen indicates how many milligrams of soluble solids are dissolved in one liter of water. Many TDS meters display the TDS value in ppm which stands for parts per million. In general, the higher the TDS value, the more soluble solids are dissolved in water, and the less clean the water is. Right now the water under test is excellent as the TDS value is less than 300.

During the experiment, I added the Salt to check if the TDS value will increase.

TDS meter

The TDS value starts increasing as I started adding the salt. So, using this small DIY low-cost TDS meter you can find out if the water you are drinking is clean or not.

Along with the TDS value, you can also see the EC and temperature values which I will explain in a minute. I will also explain what TDS value is good for drinking water? I will explain all the three parameters in detail.


TDS meter

You can also use a TDS pen which is quite cheap and can be used for measuring the TDS value. But, if you are planning to make a hydroponic system that maintains a certain ph level then the TDS pen will never work. Because for the hydroponic systems; you will need an automatic system that can turn on and turn off other electrical devices. Moreover, you cannot use this TDS pen in IOT based projects.

TDS meter

But this TDS Meter can be used in automatic Hydroponic and IOT based water quality monitoring systems. For the practical demonstration watch video given at the end of this article.

Without any further delay let’s get started!!!


The components and tools used in this project can be purchased from Amazon, the components Purchase links are given below:

Arduino Uno: https://amzn.to/2w5YBlb

TDS Meter V1.0 Dfrobot: https://amzn.to/2RiAN5I

TDS Pen: https://amzn.to/2vmxtyd

16×2 LCD: https://amzn.to/2QpN87P

Other components and tools:

Mega 2560: https://amzn.to/2ze1kdu

Super Starter kit for Beginners https://amzn.to/2KJvmKG

Jumper Wires: https://amzn.to/2KMoVXs

Bread Board: https://amzn.to/2MS4q8X

12v Adaptor: https://amzn.to/2Ntr6h1

PCB plate: https://amzn.to/2IUwpCt

Variable Supply: https://amzn.to/2MT4Qfj

Digital Multimeter: https://amzn.to/2Nvft9i

Vero Board / stripboard: https://amzn.to/2MTf9jD

Soldering iron kit:  “best” You guys should definitely purchase this https://amzn.to/2zfoNuJ

Solder wire: https://amzn.to/2ufUMWf

Wire Stripper: https://amzn.to/2KOqxfU

Wirecutter: https://amzn.to/2ucIq14

PCB small portable drill machine: https://amzn.to/2Nu62XF

*Please Note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!

About the Gravity TDS Meter V1.0:

TDS meter

This is the Gravity TDS Meter V1.0 Analog Sensor kit by the DFrobot which is completely compatible with Arduino. One thing that I really like about this TDS Meter is that it supports 3.3 to 5.5 Volts wide voltage input, and 0 to 2.3 Volts analog voltage output, which makes this TDS meter compatible with 5V and 3.3V control systems or boards. This comes with the plug and play type TDS probe which is waterproof and can be immersed in water for long-time measurement. This board has a working current of 3 to 6mA. The TDS measurement Range is from 0 to 1000 ppm. While the measurement accuracy is ±10% at 25 degrees centigrade.

TDS meter

While using this TDS meter you have to be careful, the probe cannot be used in water above 55 degrees centigrade.

The probe cannot be left too close to the edge of the container; otherwise, it will affect the reading.

The head and the cable of the probe are waterproof, but the connector and the signal transmitter board are not waterproof, so be careful while using this TDS meter Analog Sensor kit.



TDS Meter Pin Description/Pinout:

TDS meter

As you can see this Signal Transmitter Board has two connectors. The left one is the TDS Probe Connector and the right side connector is used to interface this module with the Arduino or any other compatible controller board. The connector pins are labeled with A which is the analog output pin and should be connected with the analog pin of the Arduino, + which can be connected with 3.3 or 5 volts, and – which is the ground pin.

Before I am going to explain the circuit diagram and programming, first I am going to explain some basic things, which I believe you should know.

TDS meter

This TDS probe has no temperature sensor, So that’s the reason I am using the DS18B20 waterproof one-wire digital temperature sensor for the temperature compensation, this is important for the accurate values. Although the temperature compensation algorithm is reserved in the sample code the default value is 25 degrees centigrade. But I highly recommend use a temperature sensor if you want accurate values.

0 ppm is considered the most ideal result. TDS meters cannot detect non-ionic particles like sugar and will not contribute to the reading. This can be practically seen in the video given at the end of this article.

This TDS meter is based on the EC “electrical conductivity and 1 EC equal approximately 900 ppm. The EC of most other metals, minerals, and salts will carry a charge. A TDS meter measures that EC level and then converts it to a TDS measurement.


You might be thinking what TDS value is good for drinking water? 

Water is considered excellent if it’s less than 300 mg/liter,

water is considered good if it’s between 300 and 600 mg/litre.

Water is considered fair if it’s between 900 and 1200 mg/litre.

Water is considered unacceptable if the value is greater than 1200mg/litre.

As per the TDS regulation, the U.S. EPA sets the maximum contaminant level for TDS at 500 ppm. The World Health Organization (WHO) sets the maximum contaminant for TDS at 1000 ppm.

Circuit Diagram:

TDS meter

A TDS probe is connected with the Signal Transmitter Board. The analog output pin of the TDS meter is connected with the Arduino’s analog pin A1. + pin of the TDS Meter is connected with the Arduino’s 5 volts, while the minus “-“ pin is connected with the Arduino’s ground.

Pin number1 and pin number 16 are connected with the Arduino’s ground. Pin number 2 and pin number 15 are connected with the Arduino’s 5 volts. Pin number 3 is the contrast pin of the 16×2 LCD and is connected with the middle leg of the Variable resistor or Potentiometer. While the other two legs of the variable resistor are connected with the Arduino’s 5 volts and ground. The RS pin of the LCD is connected with the Arduino’s pin number 10, the R/W pin is connected with the ground, the enable pin is connected with the Arduino’s pin number 9.  The data pins D4 to D7 of the LCD are connected with the Arduino’s pin number 6, 5, 4, and 3.

As you can see a 330-ohm resistor is connected between the VCC and data wires. You can also use a 4.7k resistor. The data pin is connected with the Arduino’s pin number 7. The VCC is connected with 5 volts, while the ground is connected with the Arduino’s ground.


About the PCB boards and PCBWay:

TDS meter

The PCB boards used in this project are sponsored by the PCBway Company, which is one of the most experienced PCB and PCB assembly manufacturer. They create high-quality PCBs at reasonable prices. As you can see the quality is really great, the silkscreen is quite clear the black and blue solder mask looks amazing. I am 100% satisfied with their work.

Gerber files:

Download Power supply board

Download 16×2 LCD PCB Board

High quality & Only 24 Hours Build time

TDS Meter and 16×2 LCD Interfacing with Arduino:

All the connections are done as per the circuit diagram already explained. The power supply board is used to distribute the 5V and ground wires.

TDS Meter Arduino Programming:



TDS Meter Arduino Code Explanation:

Before you start the programming, first of all, make sure you download all the necessary libraries.

Download Libraries:

#include <OneWire.h>

#include <DallasTemperature.h>

#include <LiquidCrystal.h>

// 16×2 LCD

#define rs 10

#define en 9

#define d4 6

#define d5 5

#define d6 4

#define d7 3

The rs pin of the LCD is connected with the Arduino’s pin number 10, en pin is connected with pin number 9 of the Arduino, while the data pins d4 to d7 of the LCD are connected with pin number 6, 5, 4, and 3.

LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

Initialize the library with the numbers of the interface pins.

namespace pin {

const byte tds_sensor = A1;

const byte one_wire_bus = 7; // Dallas Temperature Sensor

}

namespace device {

float aref = 4.3;

}

namespace sensor {

float ec = 0;

unsigned int tds = 0;

float waterTemp = 0;

float ecCalibration = 1;

}

These are the pins and variables.

void setup() {

Serial.begin(115200); // Dubugging on hardware Serial 0

lcd.begin(16, 2);

dallasTemperature.begin();

}

In the void setup() function I activated the serial communication for the debugging purposes. Activated the 16×2 LCD and DS18B20 temperature sensor.

void loop() {

readTdsQuick();

delay(1000);

}

Inside the void loop() function I have used only one function which is the readTdsQuick() function. This is a user defined function. This function is called after every 1 second.  The purpose of this function is to read the TDS meter and Temperature sensor and print the final values on the 16×2 LCD. So, that’s all about the programming.

For the practical demonstration watch a complete video tutorial given below. Don’t forget to subscribe to my Website and YouTube channel “Electronic Clinic”.


Watch Video Tutorial:

 

Recommended For You

About the Author: Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

1 Comment

Leave a Reply