Documents Download link:
Note:
TDS probes cannot be used in water above 55 °C.
The TDS probe should not be placed too close to the edge of the container, as it will affect the display.
The head and lead of the TDS probe are waterproof and can be immersed in water, but the connection interface and the signal adapter board are not waterproof. Please pay attention to use.
Product Features:
1. Wide voltage operation: 3.3~5.5V
2. 0~2.3V analog signal output, compatible with 5V, 3.3V two control systems
3. The excitation source is an AC signal, effectively preventing probe polarization
4. Waterproof probe for long-term immersion in water
5. compatible, easy to connect, plug and play, no soldering required
Technical specifications:
Signal adapter board:
Input voltage: 3.3~5.5V
Output signal: 0~2.3V
Working current: 3~6mA
TDS measurement range: 0~1000ppm
TDS measurement accuracy: ±10% F.S. (25°C)
Size: 42*32mm
Module interface: XH2.54-3P
Electrode interface: XH2.54-2P
TDS probe:
Number of probes: 2
Overall length: 83cm
Connection interface: XH2.54-2P
color: White
Other: Waterproof probe
Package includes:
1 x TDS signal adapter board
1 x Waterproof TDS probe
1 x Analog sensor line
source code:
#define TdsSensorPin A1
#define kValue 1.8 //kValue = value of calibrator TDS / measurement to get TDS
#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++)< span=””></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*kValue; //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; span=””></ifilterlen;>
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;
}
Connection Photo