

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 detecting the electrical conductivity of water, the sensor estimates the total dissolved solids, which is typically expressed in parts per million (ppm).
Common applications and use cases:








The TDS sensor module typically has three pins for connection:
| Pin Name | Description |
|---|---|
| VCC | Power supply input (3.3V to 5V DC) |
| GND | Ground connection |
| AOUT | Analog output signal (0-2.3V range) |
Connect the Sensor:
VCC pin to the 5V or 3.3V power supply of your microcontroller.GND pin to the ground of your microcontroller.AOUT pin to an analog input pin on your microcontroller (e.g., A0 on an Arduino UNO).Calibrate the Sensor:
Write Code to Read the Sensor:
// TDS Sensor Example Code for Arduino UNO
// This code reads the analog output of the TDS sensor and calculates the TDS value.
#define TDS_PIN A0 // Analog pin connected to the TDS sensor's AOUT pin
#define VREF 5.0 // Reference voltage of the Arduino (5V for UNO)
#define ADC_RES 1024.0 // ADC resolution (10-bit ADC = 1024 steps)
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
float voltage = (sensorValue / ADC_RES) * VREF; // Convert ADC value to voltage
float tdsValue = (voltage / 2.3) * 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 Constant Value:
Fluctuating Readings:
Corroded Probe:
Q: Can the TDS sensor measure salt concentration?
A: Indirectly, yes. The TDS sensor measures electrical conductivity, which is influenced by dissolved salts. However, it does not differentiate between specific dissolved solids.
Q: Is the TDS sensor waterproof?
A: The probe is waterproof, but the module is not. Ensure the module is kept dry during operation.
Q: Can I use the TDS sensor in hot water?
A: The sensor is rated for temperatures up to 60°C. Avoid using it in water above this temperature to prevent damage.
Q: How often should I calibrate the sensor?
A: Calibration frequency depends on usage. For critical applications, calibrate before each use. For general use, calibrate monthly or as needed.