Wish List 0

Tds Sensor Meter For Water Quality

Rs. 370.00 Rs. 422.00

  • Product Code: SEN-TDS
  • SKU -
  • Availability: In Stock
  • Price in reward points: 1
  • For Bulk Order 9962060070
    Quick support on WhatsApp (+919962060070) only between morning 11am-4pm, no call will be answered

The Grove – TDS Sensor detects the Total Dissolved Solids (TDS) degrees in the water which may be used to signify the water high-quality. The Grove – TDS Sensor can be applied in water first-rate applications consisting of TDS meter, nicely water, aquarium, hydroponics, and so forth.


It helps 3.Three/5V input voltage and 0 ~ 2.3V Output Voltage making it clean to be well suited with all Arduino Boards. The sensor also offers a water-resistant probe, making the trying out technique a good deal less complicated to handle.


What is TDS and why need to you care: 


TDS = Total Dissolved Solids, is a measure of the dissolved blended content of all inorganic and natural materials found in water. Typically, the better the TDS fee, the greater substances dissolved in water. Hence, higher stages of Total Dissolved Solids (TDS) can suggest that water has greater contaminants that can pose fitness dangers.


Features:

1. Analog Signal, easy to implement

2. Power indication LED

3. Support 3.3/5V Input Voltage

4. Good Arduino Compatibility

5. 0 ~ 2.3V Output Voltage can be easily implemented in 3.3/5V control system

6. Waterproof TDS Probe



SPECIFICATIONS
Input Voltage                    3.3/5V
Output Voltage                   0 ~ 2.3V
Working Current                  3 ~ 6mA
TDS Measurement Range            ~ 1000ppm
Waterproof Probe Cable Length    60cm
Connection Interface             XHB 2.54mm 2P

OVERVIEW
Input Voltage  3.3/5V
Output Voltage  0 2.3V
Working Current  3  6mA
TDS Measurement Range  0  1000ppm
-Power indication LED
-Analog Signal, easy to implement
-Waterproof TDS Probe



PACKAGE INCLUDES:

1 PCS x Tds Sensor Meter Water Quality Test

1 PCS x 20cm Grove Cable

1 PCS x Waterproof TDS Probe

//SOURCE CODE TAKENF ROM BELOW LINK

//https://wiki.dfrobot.com/Gravity__Analog_TDS_Sensor___Meter_For_Arduino_SKU__SEN0244

/***************************************************

 DFRobot Gravity: Analog TDS Sensor / Meter For Arduino

 <https://www.dfrobot.com/wiki/index.php/Gravity:_Analog_TDS_Sensor_/_Meter_For_Arduino_SKU:_SEN0244>


 Created 2017-8-22

 By Jason <jason.ling@dfrobot.com@dfrobot.com>


 GNU Lesser General Public License.

 See <http://www.gnu.org/licenses/> for details.

 All above must be included in any redistribution


 /***********Notice and Trouble shooting***************

 1. This code is tested on Arduino Uno and Leonardo with Arduino IDE 1.0.5 r2 and 1.8.2.

 2. More details, please click this link: <https://www.dfrobot.com/wiki/index.php/Gravity:_Analog_TDS_Sensor_/_Meter_For_Arduino_SKU:_SEN0244>

 ****************************************************/


#define TdsSensorPin A1

#define VREF 5.0      // analog reference voltage(Volt) of the ADC

#define SCOUNT  30           // sum of sample point

int analogBuffer[SCOUNT];    // store the analog value in the array, read from ADC

int analogBufferTemp[SCOUNT];

int analogBufferIndex = 0,copyIndex = 0;

float averageVoltage = 0,tdsValue = 0,temperature = 25;


void setup()

{

    Serial.begin(115200);

    pinMode(TdsSensorPin,INPUT);

}


void loop()

{

   static unsigned long analogSampleTimepoint = millis();

   if(millis()-analogSampleTimepoint > 40U)     //every 40 milliseconds,read the analog value from the ADC

   {

     analogSampleTimepoint = millis();

     analogBuffer[analogBufferIndex] = analogRead(TdsSensorPin);    //read the analog value and store into the buffer

     analogBufferIndex++;

     if(analogBufferIndex == SCOUNT) 

         analogBufferIndex = 0;

   }   

   static unsigned long printTimepoint = millis();

   if(millis()-printTimepoint > 800U)

   {

      printTimepoint = millis();

      for(copyIndex=0;copyIndex<SCOUNT;copyIndex++)

        analogBufferTemp[copyIndex]= analogBuffer[copyIndex];

      averageVoltage = getMedianNum(analogBufferTemp,SCOUNT) * (float)VREF / 1024.0; // read the analog value more stable by the median filtering algorithm, and convert to voltage value

      float compensationCoefficient=1.0+0.02*(temperature-25.0);    //temperature compensation formula: fFinalResult(25^C) = fFinalResult(current)/(1.0+0.02*(fTP-25.0));

      float compensationVolatge=averageVoltage/compensationCoefficient;  //temperature compensation

      tdsValue=(133.42*compensationVolatge*compensationVolatge*compensationVolatge - 255.86*compensationVolatge*compensationVolatge + 857.39*compensationVolatge)*0.5; //convert voltage value to tds value

      //Serial.print("voltage:");

      //Serial.print(averageVoltage,2);

      //Serial.print("V   ");

      Serial.print("TDS Value:");

      Serial.print(tdsValue,0);

      Serial.println("ppm");

   }

}

int getMedianNum(int bArray[], int iFilterLen) 

{

      int bTab[iFilterLen];

      for (byte i = 0; i<iFilterLen; i++)

      bTab[i] = bArray[i];

      int i, j, bTemp;

      for (j = 0; j < iFilterLen - 1; j++) 

      {

      for (i = 0; i < iFilterLen - j - 1; i++) 

          {

        if (bTab[i] > bTab[i + 1]) 

            {

        bTemp = bTab[i];

            bTab[i] = bTab[i + 1];

        bTab[i + 1] = bTemp;

         }

      }

      }

      if ((iFilterLen & 1) > 0)

    bTemp = bTab[(iFilterLen - 1) / 2];

      else

    bTemp = (bTab[iFilterLen / 2] + bTab[iFilterLen / 2 - 1]) / 2;

      return bTemp;

}

Expected Results

After uploading the sample code, open the serial monitor of the Arduino IDE. Then insert the TDS probe into the water, and gently stir it. Then wait for the reading to be stable, and you will get the TDS value of the water.

TdsShowNumber.png


Advanced Tutorial

Through the basic tutorial the TDS value of the liquid can be easily measured. However, due to the individual differences of different TDS probe, differences of the main control board, and no onboard temperature compensation, the measured value can have some errors.Therefore, to obtain a more accurate TDS value, calibration is required before measurement. In addition, it is recommended to connect a temperature sensor for temperature compensation to improve accuracy. Normally, the TDS value is half of the electrical conductivity value, that is: TDS = EC / 2. The wiring diagram is same as the basic tutorial. During the calibration, a liquid solution of known electrical conductivity or TDS value is needed, such as 1413us/cm standard buffer slution. If converted to a TDS value, it is about 707 ppm.The TDS value can also be measured using a TDS pen if you do not have a standard buffer solution. The following will demonstrate how to calibrate.


Download and install the DFRobot Gravity TDS Sensor Library . How to install Libraries in Arduino IDE?


Sample Code

/***************************************************

 DFRobot Gravity: Analog TDS Sensor/Meter

 <https://www.dfrobot.com/wiki/index.php/Gravity:_Analog_TDS_Sensor_/_Meter_For_Arduino_SKU:_SEN0244>


 ***************************************************

 This sample code shows how to read the tds value and calibrate it with the standard buffer solution.

 707ppm(1413us/cm)@25^c standard buffer solution is recommended.


 Created 2018-1-3

 By Jason <jason.ling@dfrobot.com@dfrobot.com>


 GNU Lesser General Public License.

 See <http://www.gnu.org/licenses/> for details.

 All above must be included in any redistribution.

 ****************************************************/


 /***********Notice and Trouble shooting***************

 1. This code is tested on Arduino Uno with Arduino IDE 1.0.5 r2 and 1.8.2.

 2. Calibration CMD:

     enter -> enter the calibration mode

     cal:tds value -> calibrate with the known tds value(25^c). e.g.cal:707

     exit -> save the parameters and exit the calibration mode

 ****************************************************/


#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);

}

15 days 

Write a review

Please login or register to review