Header Ads Widget

Interfacing TDS sensor with Arduino program

 hi friends in this section we learn about the Interfacing TDS sensor with Arduino . this TDS sensor is help to measure the total dissolved solids in water. 

fore more information  about TDS click here  

Tutorial video :





Interfacing TDS sensor with Arduino program :

#include <EEPROM.h>
#include "GravityTDS.h"
 
#define TdsSensorPin A1
GravityTDS gravityTds;
 
float temperature = 13,tdsValue = 0;
 
void setup()
{
    Serial.begin(9600);
    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);
}

if you have any doubts about this project comment on my YouTube channel i will respond as well as possible .

Post a Comment

0 Comments