Electrical conductivity (EC) measurement is the backbone of water quality monitoring. Whether you are testing drinking water purity, optimising hydroponic nutrient solutions, monitoring aquaculture tank conditions, or checking industrial process water, a conductivity sensor (also called a TDS meter or EC meter) gives you critical information about dissolved ionic content. India’s water quality issues—high TDS groundwater in Rajasthan and Gujarat, fluoride contamination in Telangana, saltwater intrusion in coastal areas—make EC/TDS monitoring deeply relevant for both urban and rural communities.
This comprehensive guide covers the physics of electrical conductivity in water, how to build your own DIY conductivity cell, interface it with Arduino, convert EC readings to TDS in ppm, calibrate your system, and implement complete water quality monitoring projects.
Understanding EC and TDS
Electrical Conductivity (EC)
Electrical conductivity measures how well a water sample conducts electricity. Pure distilled water is a very poor conductor; adding dissolved ionic compounds (salts, acids, bases) dramatically increases conductivity because ions carry electrical charge through the solution. EC is measured in Siemens per centimetre (S/cm) or more commonly in:
- μS/cm (microsiemens per cm): For low-conductivity water (drinking water: 100–800 μS/cm)
- mS/cm (millisiemens per cm): For higher conductivity (seawater: ~53,000 μS/cm = 53 mS/cm)
- EC (sometimes just a number 1.5, 2.0 etc.): Commonly used in hydroponics (mS/cm)
Total Dissolved Solids (TDS)
TDS measures the total concentration of dissolved substances in water, expressed in ppm (parts per million) or mg/L. Unlike EC which measures ion mobility, TDS technically includes all dissolved solids—ionic and non-ionic. However, in practice, almost all dissolved solids in natural water are ionic, so TDS is closely correlated with EC:
TDS (ppm) ≈ EC (μS/cm) × Conversion Factor Conversion factors by water type: Natural water (rivers, wells): 0.5–0.7 (typically 0.64) Drinking water: 0.5–0.65 Hydroponic nutrient solution: 0.7–0.8 Seawater / brine: 0.55–0.7 Example: EC = 500 μS/cm → TDS ≈ 500 × 0.64 = 320 ppm
Water Quality Standards (India)
| Parameter | BIS IS 10500 (Drinking Water) | Acceptable Limit |
|---|---|---|
| TDS | <500 ppm (desirable <300) | <2000 ppm permissible |
| EC | <780 μS/cm | <3000 μS/cm |
| WHO Guideline TDS | <600 ppm (palatability) | No health guideline set |
How Conductivity Sensors Work
A conductivity sensor consists of two or more electrodes (typically stainless steel or graphite) immersed in the water sample. A known voltage is applied between the electrodes, and the resulting current is measured. By Ohm’s Law, resistance = voltage/current. The conductivity is the reciprocal of resistance, corrected for the cell geometry:
Conductivity (S/cm) = Cell Constant (cm⁻¹) / Resistance (Ω) Cell Constant = Electrode Distance / Electrode Area Small cell constant (0.1 cm⁻¹): for pure water (low EC) Large cell constant (10 cm⁻¹): for very saline water (high EC)
AC Excitation — Why Not DC?
Critical design point: conductivity cells must use AC (alternating current) excitation, NOT DC. DC causes:
- Electrolysis: Breaks water into hydrogen and oxygen at the electrodes
- Electrode polarization: Ion depletion zones form near electrodes, reducing apparent conductivity
- Electrode corrosion: Rapid degradation of stainless steel electrodes
AC excitation (typically 1–10kHz square wave or sine wave) prevents all these effects. Quality TDS/EC sensor modules for Arduino always include an AC generator circuit internally.
Types of Conductivity Sensors
Two-Electrode Sensors
The simplest design. Works well for low to medium conductivity (<10 mS/cm). Susceptible to polarization at high conductivity or with very pure water. The DFRobot gravity TDS sensor uses this principle. Most Arduino-compatible modules are two-electrode designs.
Four-Electrode (Toroidal) Sensors
Two current-carrying electrodes drive AC through the solution; two voltage-sensing electrodes measure the resulting potential drop. Because the sensing electrodes carry no current, electrode polarization is eliminated. Used in industrial sensors and high-accuracy instruments. More expensive but far more stable over time.
Inductive/Toroidal Sensors
No direct electrode contact with the liquid. Two coils induce and measure current in the solution through electromagnetic induction. Completely non-fouling, ideal for highly corrosive chemicals and food-grade applications. Very expensive; used in industrial process control.
Common Arduino-Compatible Modules
- DFRobot Gravity TDS Sensor (SEN0244): 0–1000 ppm, 3.3–5.5V, I2C + analog output. Most popular in India for hobbyist use.
- DFRobot EC Sensor Kit (DFR0300): 0–20 mS/cm, includes probe. Better for hydroponics and full water quality work.
- Budget TDS modules: Available at ₹150–₹400, no official datasheet. Output 0–3.3V. Often inaccurate but useful for relative comparisons.
Key Specifications
| Parameter | Budget TDS Module | DFRobot Gravity TDS |
|---|---|---|
| Operating Voltage | 3.3–5V | 3.3–5.5V |
| Output | 0–2.3V analog | 0–2.3V analog |
| TDS Range | 0–3000 ppm | 0–1000 ppm |
| Accuracy | ±15% | ±10% F.S. |
| Operating Temperature | 0–60°C | 0–55°C |
| Response Time | <2s | <2s |
| Cost in India | ₹150–400 | ₹800–1500 |
Building a DIY Conductivity Cell
You can build a simple conductivity cell from readily available materials:
Materials
- 2× stainless steel bolts/screws (M4 or M3, food-grade 316L if possible)
- Plastic housing (2cm × 2cm PVC pipe end cap works well)
- Epoxy resin to fix electrode spacing
- Insulated wire to connect electrodes to circuit
- 1kΩ resistor (sense resistor)
- Arduino and small signal AC source (555 timer or Arduino digital pin via capacitor)
Construction
- Drill two holes in the plastic housing, 1cm apart (centre-to-centre)
- Insert stainless steel bolts, securing with epoxy so they cannot move
- Expose 5mm of bolt surface on the liquid-contact side; insulate the rest
- Solder connecting wires to the bolt heads (outside the housing)
- Seal with waterproof epoxy
Simple DIY Measurement Circuit
Arduino D3 (PWM) ─── 10kΩ ─── Electrode 1
|
Water sample
|
Electrode 2 ─── 1kΩ ─── GND
|
Arduino A0
Principle: PWM signal drives AC through water via electrodes.
Voltage at A0 depends on water resistance (inverse of conductivity).
This is a simplified approach - commercial modules have better AC generation.
5V 12V Soil Moisture Sensor Relay Control Module
Conductivity principles also apply to soil — this moisture sensor with relay is perfect for automated irrigation triggered by soil EC/moisture readings.
Arduino Wiring and Circuit
DFRobot Gravity TDS Sensor Wiring
| Module Pin | Arduino Connection |
|---|---|
| VCC (Red) | 5V |
| GND (Black) | GND |
| A (Analog Out) | A1 |
Ensure the probe cable is away from high-current wires (motors, relay coils) which can introduce noise into the analog reading. The TDS sensor output is 0–2.3V (not the full 0–5V range), so the ADC reading tops out around 470 counts out of 1023 even at maximum TDS.
Arduino Code with EC to TDS Conversion
Basic TDS Reading with Temperature Compensation
#define TDS_PIN A1
#define TEMP_PIN A0 // Optional: connect LM35 or NTC thermistor
const float VREF = 5.0; // Arduino reference voltage
const float SCOUNT = 30; // Number of samples to average
const float EC_FACTOR = 0.64; // EC to TDS conversion factor
int analogBuffer[30];
int analogBufferIndex = 0;
float averageVoltage = 0;
float tdsValue = 0;
float temperature = 25.0; // Default 25°C
void setup() {
Serial.begin(115200);
Serial.println("TDS Meter Initialized");
Serial.println("Temp(C) | EC(uS/cm) | TDS(ppm) | Quality");
}
// Read water temperature from LM35 (10mV/°C)
float readTemperature() {
float voltage = analogRead(TEMP_PIN) * (5.0 / 1023.0);
return voltage * 100.0; // LM35: 10mV per degree Celsius
}
// EC to TDS conversion with temperature compensation
float ecToTDS(float ec_uS, float temp) {
// Temperature compensation: EC25 = EC_measured / (1 + 0.02 * (temp - 25))
float ec25 = ec_uS / (1.0 + 0.02 * (temp - 25.0));
return ec25 * EC_FACTOR;
}
String getTDSQuality(float tds) {
if (tds < 50) return "Pure (RO/distilled)";
if (tds < 150) return "Excellent (spring water)";
if (tds < 300) return "Good (municipal water)";
if (tds < 500) return "Acceptable (BIS limit)";
if (tds < 900) return "Poor (high mineral)";
if (tds 40U) {
analogSampleTimepoint = millis();
analogBuffer[analogBufferIndex++] = analogRead(TDS_PIN);
if (analogBufferIndex == SCOUNT) analogBufferIndex = 0;
}
static unsigned long printTimepoint = millis();
if (millis() - printTimepoint > 800U) {
printTimepoint = millis();
// Median filter for noise rejection
int sortedBuffer[30];
memcpy(sortedBuffer, analogBuffer, sizeof(analogBuffer));
// Simple bubble sort
for (int i = 0; i < SCOUNT - 1; i++)
for (int j = 0; j sortedBuffer[j+1]) {
int t = sortedBuffer[j]; sortedBuffer[j] = sortedBuffer[j+1]; sortedBuffer[j+1] = t;
}
// Use middle 20 values (reject outliers)
long sum = 0;
for (int i = 5; i < 25; i++) sum += sortedBuffer[i];
averageVoltage = (sum / 20.0) * (VREF / 1024.0);
temperature = readTemperature();
// EC calculation: voltage to EC (from sensor datasheet polynomial)
float compensationCoefficient = 1.0 + 0.02 * (temperature - 25.0);
float compensationVoltage = averageVoltage / compensationCoefficient;
// Polynomial to convert voltage to TDS (ppm) at 25°C
float tds25 = (133.42 * compensationVoltage * compensationVoltage * compensationVoltage
- 255.86 * compensationVoltage * compensationVoltage
+ 857.39 * compensationVoltage) * 0.5;
float ec_uS = tds25 / EC_FACTOR; // Convert back to EC for display
Serial.print(temperature, 1); Serial.print(" C | ");
Serial.print(ec_uS, 0); Serial.print(" uS/cm | ");
Serial.print(tds25, 0); Serial.print(" ppm | ");
Serial.println(getTDSQuality(tds25));
}
}
OLED Display TDS Meter
#include <Wire.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
#define TDS_PIN A1
const float VREF = 5.0;
void setup() {
Serial.begin(9600);
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.setCursor(0, 0);
display.println("TDS Meter v1.0");
display.println("Zbotic.in");
display.display();
delay(2000);
}
void loop() {
long total = 0;
for (int i = 0; i < 50; i++) { total += analogRead(TDS_PIN); delay(2); }
float avgV = (total / 50.0) * (VREF / 1024.0);
float tds = (133.42 * avgV * avgV * avgV - 255.86 * avgV * avgV + 857.39 * avgV) * 0.5;
float ec = tds / 0.64;
display.clearDisplay();
display.setTextSize(2);
display.setCursor(0, 0);
display.print("TDS:");
display.print((int)tds);
display.println(" ppm");
display.setTextSize(1);
display.setCursor(0, 32);
display.print("EC: "); display.print(ec, 0); display.println(" uS/cm");
display.setCursor(0, 44);
if (tds < 300) display.println("Quality: GOOD");
else if (tds < 500) display.println("Quality: ACCEPTABLE");
else display.println("Quality: POOR");
display.display();
delay(1000);
}
Calibration with KCl Solutions
Proper calibration is essential for accurate TDS/EC readings. Potassium Chloride (KCl) solutions are the international standard for calibrating conductivity meters:
Preparing KCl Calibration Standards
| Standard | KCl concentration | EC at 25°C | TDS approx. |
|---|---|---|---|
| Low Standard | 0.0745 g/L in distilled water | 100 μS/cm | 64 ppm |
| Mid Standard | 0.745 g/L in distilled water | 1000 μS/cm | 640 ppm |
| High Standard | 7.45 g/L in distilled water | 10,000 μS/cm | 6400 ppm |
Pharmaceutical-grade KCl (potassium chloride) is available at chemists for ₹50–₹100 per 100g. Weigh accurately using a digital scale, dissolve in fresh distilled water (available at pharmacies and car battery shops for ₹20/litre).
Calibration Procedure
- Prepare your 1000 μS/cm standard (745mg KCl in 1L distilled water)
- Allow sensor and solution to equilibrate at 25°C (or measure temperature)
- Record ADC value in the standard solution
- Record ADC value in pure distilled water (EC ≈ 0)
- Use two-point linear calibration:
EC = (ADC - ADC_zero) × (EC_standard / (ADC_standard - ADC_zero)) - Update the calibration constants in your code
DHT11 Temperature and Humidity Sensor Module
Pair with your TDS sensor for complete water quality station — temperature affects EC readings, and ambient humidity monitoring is key for greenhouse water management.
Temperature Compensation
Water conductivity changes approximately 2% per degree Celsius. Without temperature compensation, a reading taken in summer (water at 30°C) will read 10% higher than the same water in winter (20°C). All serious EC/TDS measurements must be temperature-compensated:
// Temperature compensation formula (reference temperature 25°C)
float compensateEC(float ec_measured, float temperature) {
return ec_measured / (1.0 + 0.02 * (temperature - 25.0));
}
// Example:
// Measured EC at 30°C = 520 μS/cm
// Compensated EC25 = 520 / (1 + 0.02 × (30-25)) = 520 / 1.10 = 473 μS/cm
// Report as: 473 μS/cm @ 25°C
Add an NTC thermistor (10kΩ, B=3950) or LM35 temperature sensor to your setup. Measure water temperature with the thermistor submerged near the TDS electrodes. Apply the compensation formula before any TDS conversion.
Water Quality Project Applications
1. Home Water Quality Monitor
A pocket-sized Arduino Nano + TDS sensor + LM35 + OLED display in a waterproof case creates a useful tool for testing tap water, filtered water, and bottled water. Display TDS, EC, temperature, and quality rating. Build cost: ₹800–₹1,200.
2. Hydroponic Nutrient Monitor
Hydroponic plants are sensitive to nutrient solution EC. Too low = nutrient deficiency; too high = nutrient burn. An automatic EC controller with dosing pump feedback can maintain EC between target values. Different crops need different EC ranges: leafy greens (0.8–1.2 mS/cm), tomatoes (2.0–3.5 mS/cm), strawberries (1.0–1.4 mS/cm).
3. Aquaculture Salinity Monitor
Brackish water fish farming (prawn, tilapia) requires precise salinity control. EC/TDS sensors can track salinity in parts per thousand (ppt): 1 ppt ≈ 1500–2000 μS/cm. Automated alerts when salinity drifts outside acceptable range prevent fish kills and production losses.
4. Borewell Water Quality Mapping
Many Indian homes rely on borewells with high TDS due to geological factors. A GPS-tagged TDS monitoring device can map borewell water quality across a neighbourhood, identifying areas with fluoride or salt contamination requiring treatment. Data shared on community platforms helps prioritize water treatment infrastructure investment.
5. RO Water Purifier Monitor
Home RO systems should produce water with TDS below 50 ppm. Install TDS sensors on both inlet and outlet of the RO membrane to calculate rejection percentage. When rejection drops below 80%, the membrane needs replacement. An automatic alert prevents continued use of a faulty RO system.
6. Wastewater Treatment Monitoring
Small-scale wastewater treatment plants (STP/ETP) in apartments and hotels need to verify that treated water meets discharge standards. An Arduino EC/TDS logger with SD card data logging provides a continuous compliance record for CPCB inspection and operator monitoring.
INA219 I2C Bi-directional Current/Power Monitor
Monitor the power consumption of your water quality station’s pump and sensors, optimizing battery life for remote deployments.
Frequently Asked Questions
EC (Electrical Conductivity) is the raw physical measurement in μS/cm or mS/cm. TDS (Total Dissolved Solids) is a derived value obtained by multiplying EC by a conversion factor (typically 0.5–0.7). EC is the more scientifically precise parameter. TDS in ppm is more intuitive for non-technical users and is commonly displayed on consumer water quality meters. Both sensors measure the same thing (dissolved ion concentration) using the same principle.
Water’s ion mobility increases with temperature—ions move faster in warm water. This means a given concentration of dissolved solids will show higher EC at higher temperatures. The relationship is approximately 2% per degree Celsius. Always report EC/TDS readings with temperature compensation to 25°C (written as EC25 or TDS@25°C) for meaningful comparisons.
Extremely low TDS water (below 10 ppm, such as RO-DI or distilled water) is actually not ideal for long-term drinking. WHO and various health experts recommend TDS of 100–300 ppm for regular drinking water—minerals like calcium, magnesium, and potassium are beneficial and also improve taste. Very pure water can leach minerals from your body and has a flat, unpleasant taste. Most RO systems include a post-mineraliser stage to add back beneficial minerals.
Seawater has EC around 53,000 μS/cm (53 mS/cm) and TDS around 35,000 ppm (35 ppt). This is far beyond the range of typical Arduino TDS sensors (0–1000 ppm range). You need a high-range conductivity sensor (range up to 100 mS/cm) and a different cell constant. For seawater work, use an Atlas Scientific EC probe or similar with appropriate range.
Rinse the probe with distilled water after every use and store dry. For regular use, clean with dilute white vinegar (5% acetic acid) monthly to remove calcium and mineral deposits. If black deposits (organic fouling) appear, clean with dilute bleach (1%) and rinse thoroughly. Never scrub the electrode surfaces with abrasives — this changes the cell constant and requires re-calibration.
BIS IS 10500 (India’s drinking water standard) sets the desirable limit at 500 ppm TDS and the permissible limit at 2000 ppm (where no better source is available). WHO guidelines suggest palatability is affected above 600 ppm. Water above 1200 ppm has a noticeably salty or mineral taste. Many Indian cities have municipal water at 200–400 ppm, while groundwater in parts of Rajasthan, Gujarat, and Andhra Pradesh exceeds 2000 ppm due to geological salt deposits.
Conclusion
Conductivity and TDS sensors put professional-grade water quality assessment in the hands of makers, students, and environmental activists. With a ₹400 Arduino module, a calibration solution prepared from pharmacy-grade KCl, and the code in this guide, you can build a water quality monitor that rivals instruments costing tens of thousands of rupees in measurement capability—if not in absolute accuracy.
Remember the essentials: always use AC excitation (commercial modules handle this), compensate for temperature, calibrate with known standards, and clean your probes regularly. With these practices, your DIY conductivity sensor will deliver reliable, meaningful water quality data for drinking water safety checks, hydroponic automation, aquaculture monitoring, and environmental compliance projects.
Build Your Water Quality Monitor
Explore Zbotic’s wide range of sensors, temperature modules, and measurement tools for your DIY water quality project.
Add comment