

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 sensor estimates the total dissolved solids, which is typically expressed in parts per million (ppm).








The TDS sensor module typically has a 3-pin interface for connection to a microcontroller. Below is the pin configuration:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply input (3.3V - 5V DC). |
| 2 | GND | Ground connection. |
| 3 | AOUT | Analog output signal proportional to the TDS value. |
The sensor probe is connected to the module via a dedicated connector, and the module processes the signal from the probe to provide an analog output.
Connect the Module:
VCC pin to the 5V pin of your microcontroller (e.g., Arduino UNO).GND pin to the ground (GND) of your microcontroller.AOUT pin to an analog input pin (e.g., A0) of your microcontroller.Place the Probe:
Calibrate the Sensor:
Read the Output:
AOUT pin corresponds to the TDS value. Use the microcontroller to convert this voltage into a ppm value using the appropriate formula.Below is an example code to interface the TDS sensor with an Arduino UNO:
// Include necessary libraries
#define TdsSensorPin A0 // Define the analog pin connected to the TDS sensor
#define VREF 5.0 // Reference voltage of the Arduino (5V for UNO)
#define ADC_RES 1024.0 // ADC resolution (10-bit ADC = 1024 levels)
float tdsValue = 0; // Variable to store the TDS value
float voltage = 0; // Variable to store the sensor output voltage
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
pinMode(TdsSensorPin, INPUT); // Set the TDS sensor pin as input
}
void loop() {
int sensorValue = analogRead(TdsSensorPin); // Read the analog value
voltage = (sensorValue / ADC_RES) * VREF; // Convert ADC value to voltage
tdsValue = (voltage / VREF) * 1000; // Convert voltage to TDS (ppm)
// 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
}
Inaccurate Readings:
No Output or Fluctuating Values:
Module Overheating:
Sensor Not Responding:
Q: Can the TDS sensor measure salinity?
A: While the TDS sensor indirectly measures salinity, it is not specifically designed for this purpose. Use a dedicated salinity sensor for precise measurements.
Q: How often should I calibrate the sensor?
A: Calibration frequency depends on usage. For critical applications, calibrate weekly; otherwise, monthly calibration is sufficient.
Q: Can I use the TDS sensor in hot water?
A: The sensor operates within 0°C - 60°C. Avoid using it in water outside this range to prevent damage.
Q: Is the probe safe for drinking water?
A: Yes, the stainless steel probe is safe for use in drinking water analysis.