

A TDS (Total Dissolved Solids) sensor measures the concentration of dissolved solids in water, providing an indication of water quality and purity. It is widely used in applications such as water filtration systems, aquariums, hydroponics, and environmental monitoring. By measuring the electrical conductivity of water, the TDS sensor estimates the total amount of dissolved ions, such as salts, minerals, and metals, in parts per million (ppm).








Below are the key technical details and pin configuration for a typical TDS sensor module:
The TDS sensor module typically has three pins for connection:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply input (3.3V to 5.0V DC) |
| 2 | GND | Ground connection |
| 3 | AOUT | Analog output signal, proportional to the TDS value (connects to an ADC pin) |
Connect the Sensor:
Place the Probe:
Calibrate the Sensor:
Read the Output:
Below is an example code to interface the TDS sensor with an Arduino UNO:
// Include necessary libraries
const int TDS_PIN = A0; // Analog pin connected to the TDS sensor's AOUT pin
float voltage; // Variable to store the sensor's output voltage
float tdsValue; // Variable to store the calculated TDS value in ppm
const float VREF = 5.0; // Reference voltage of the Arduino (5V for UNO)
const int ADC_RES = 1024; // ADC resolution (10-bit for Arduino UNO)
void setup() {
Serial.begin(9600); // Initialize serial communication
pinMode(TDS_PIN, INPUT); // Set the TDS pin as input
}
void loop() {
int sensorValue = analogRead(TDS_PIN); // Read the analog value from the sensor
voltage = (sensorValue / float(ADC_RES)) * VREF; // Convert ADC value to voltage
tdsValue = (voltage * 1000) / 2; // Convert voltage to TDS value (calibration factor: 2)
// Print the TDS value to the Serial Monitor
Serial.print("TDS Value: ");
Serial.print(tdsValue);
Serial.println(" ppm");
delay(1000); // Wait for 1 second before the next reading
}
Note: The calibration factor (2 in this example) may vary depending on the sensor model and water sample. Adjust it for accurate results.
Inaccurate Readings:
Fluctuating Values:
No Output or Zero Reading:
Corroded Probe:
Q: Can the TDS sensor measure salinity?
Q: Can I use the TDS sensor in hot water?
Q: How often should I calibrate the sensor?
Q: Can I extend the probe cable?