TDS sensor interface with arduino nano

TDS sensor interface with arduino nano

In this article we will learn how to interface arduino with TDS sensor.
In the last post we will learn how to interface arduino with RTD sensor. You can visit our website,
I hope you appreciate my work, let’s discuss about today’s project.

What is TDS sensor?

TDS sensor detects the total dissolved solids (TDS) levels in the water which can be used to indicate the water quality. TDS sensor can be applied in water quality applications such as TDS meter, well water, aquarium, hydroponics, etc.

Components which we use in this project are below:

  1. Arduino nano
  2. TDS sensor
  3. Push button
  4. 9V battery
  5. LCD display
  6. Connecting wires

Diagram of this project is below:

TDS sensor interface with arduino nano
TDS sensor interface with arduino nano

Construction of TDS sensor interface with arduino nano:

  • Connect +ve point of the TDS sensor with 5V point of arduino nano
  • Connect GND point of TDS sensor with GND point of arduino nano
  • Connect signal point of TDS sensor with A1 point of arduino nano
  • Connect the D2 point of arduino with the DB7 point of LCD
  • Connect the D3 point of arduino with the DB6 point of LCD
  • Connect the D4 point of arduino with the DB5 point of LCD
  • Connect the D5 point of arduino with the DB4 point of LCD
  • Connect the D6 point of arduino with the E point of LCD
  • Connect the D7 point of arduino with the VDD point of LCD
  • Connect the (K-, DB3, RW, VSS) points with each other through the GND point of arduino
  • Connect VO point of LCD with 5V point of arduino nano
  • Connect the 1 terminal of push button to the Vin point of arduino nano
  • Connect the other terminal of push button with the +ve terminal of 5V battery
  • Connect the –ve terminal of 5V battery with the GND point of arduino nano

Working of TDS sensor interface with arduino nano:

A TDS (Total Dissolved Solids) sensor is used to measure the concentration of dissolved solids, such as salts and minerals, in a liquid solution. To interface a TDS sensor with an Arduino Nano, you’ll need the sensor itself, an Arduino Nano board, some wires, and a basic understanding of Arduino programming.

Applications of TDS sensor interface with arduino nano:

  1. Research and Education
  2. Home Brewing
  3. Water Quality Monitoring
  4. Aquarium Control
  5. Swimming Pool Maintenance

Advantages of TDS sensor interface with arduino nano:

  1. Cost-Effective
  2. Compact Size
  3. Easy to Program
  4. Data Logging
  5. Real-time Monitoring

Program code of this project is below:

#include <EEPROM.h>

#include “GravityTDS.h”

 

#define TdsSensorPin A1

GravityTDS gravityTds;

 

float temperature = 25,tdsValue = 0;

 

void setup()

{

Serial.begin(115200);

gravityTds.setPin(TdsSensorPin);

gravityTds.setAref(5.0);  //reference voltage on ADC, default 5.0V on Arduino UNO

gravityTds.setAdcRange(1024);  //1024 for 10bit ADC;4096 for 12bit ADC

gravityTds.begin();  //initialization

}

 

void loop()

{

//temperature = readTemperature();  //add your temperature sensor and read it

gravityTds.setTemperature(temperature);  // set the temperature and execute temperature compensation

gravityTds.update();  //sample and calculate

tdsValue = gravityTds.getTdsValue();  // then get the value

Serial.print(tdsValue,0);

Serial.println(“ppm”);

delay(1000);

}