Introduction
This experiment shows how to measure the Total Dissolved Solids (TDS) in water to assess its purity using a TDS sensor.
Components Needed
- TDS Sensor
- Arduino
- Jumper Wires
Circuit Setup
- Connect the TDS sensor’s VCC and GND pins to the 5V and GND on the Arduino.
- Connect the sensor's output pin to an analog input pin (e.g., A0) on the Arduino.
The TDS sensor measures the concentration of dissolved solids in water, which is an indicator of water purity.
Code for TDS Measurement
Upload the following code to your Arduino to measure TDS levels:
const int tdsPin = A0;
void setup() {
Serial.begin(9600);
}
void loop() {
int tdsValue = analogRead(tdsPin);
Serial.print("TDS Level: ");
Serial.println(tdsValue);
delay(1000);
}
Explanation
The TDS sensor measures the electrical conductivity of water, which is proportional to the concentration of dissolved solids. The Arduino processes this signal and provides the TDS level.
Troubleshooting
- If readings are unstable, check the sensor’s connections and calibration.
- Make sure the sensor is clean to avoid inaccurate readings.