Hydroponics monitoring with EC and pH sensors using Arduino is the backbone of successful soilless farming. Hydroponics is growing rapidly among Indian urban farmers, hobbyists, and rooftop growers in cities like Bangalore, Mumbai, Hyderabad, and Pune — where land is limited but water-efficient, high-yield growing methods are in demand. The two most critical parameters for hydroponic success are Electrical Conductivity (EC) — a proxy for total dissolved nutrients — and pH, which controls nutrient uptake. This guide shows you how to build a complete Arduino-based monitoring system for your hydroponic setup.
Table of Contents
- Why EC and pH Monitoring is Critical
- Components and Cost Breakdown
- Wiring the pH Sensor
- Wiring the EC Sensor
- Complete Arduino Monitoring Code
- EC and pH Targets for Indian Crops
- Automated Nutrient Dosing
- Frequently Asked Questions
Why EC and pH Monitoring is Critical
In hydroponics, plants receive all nutrients dissolved in water. Two parameters control whether those nutrients are actually available to plants:
- Electrical Conductivity (EC, mS/cm): Measures total dissolved solids in the nutrient solution. Too low (below 1.0 mS/cm) means nutrient deficiency; too high (above 3.5 mS/cm) causes osmotic stress (nutrient burn). EC is measured with a conductivity electrode and expressed in millisiemens per centimetre (mS/cm) or parts per thousand (ppt).
- pH (5.5-6.5 optimal for hydroponics): Controls which nutrient forms are soluble and absorbable. At pH below 5.5, iron and manganese reach toxic levels and calcium/magnesium become unavailable. Above pH 7.0, phosphorus, iron, manganese, and zinc precipitate out and become unavailable. Hydroponic pH drifts continuously as plants absorb ions and as CO2 from plant respiration acidifies the solution.
Without monitoring, pH and EC drift outside acceptable ranges within 24-48 hours in an active hydroponic system. Daily manual testing with a handheld meter is the minimum; automated monitoring with Arduino alerts you the moment parameters drift, preventing crop losses.
Components and Cost Breakdown
- Arduino Uno or Nano (₹200-400)
- pH sensor module (pH-4502C with glass electrode probe) (₹200-500)
- EC/TDS sensor module (TDS-meter sensor board or DFRobot gravity EC sensor) (₹200-500)
- DS18B20 waterproof temperature probe (for temperature compensation) (₹80-150)
- 16×2 LCD with I2C backpack (₹100-200)
- Active buzzer (for out-of-range alerts) (₹20-50)
- pH buffer solutions 4.0 and 7.0 (₹100-200)
- EC calibration solution 1413 µS/cm (₹100-200)
- Small enclosure (₹100-200)
Total cost: approximately ₹1,200-2,400 for a monitoring-only system. Add a peristaltic pump module (₹500-1,500) and pH Up/Down solutions for automated correction.
Wiring the pH Sensor
// pH-4502C to Arduino
// VCC -> 5V | GND -> GND | PO -> A0
// Do NOT connect 12V even if the board has a 12V input header
// Temperature compensation from DS18B20 on digital pin 2
Calibration is essential before use. Prepare pH 4.0 and 7.0 buffer solutions (dilute one sachet in 250mL distilled water each). Record ADC readings in each buffer and calculate slope and intercept as described in the pH section. Hydroponic solution calibration should be redone monthly as electrode reference junction slowly contaminates with nutrient solution.
Wiring the EC Sensor
Simple TDS sensors (like the TDS-2 or TDS-3) use two platinum probes to measure conductivity. The analog TDS sensor board outputs 0-2.3V proportional to TDS (0-1000 ppm). The DFRobot Gravity EC sensor is more accurate and temperature-compensated.
// TDS/EC Sensor to Arduino
// VCC -> 5V | GND -> GND | A -> A1
// Temperature compensation is critical for accurate EC readings
// EC changes approximately 2% per degree Celsius
// Measure temperature with DS18B20 and apply correction:
// ECcompensated = ECraw / (1 + 0.02 * (temperature - 25.0))
Complete Arduino Monitoring Code
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#define PH_PIN A0
#define EC_PIN A1
#define TEMP_PIN 2
#define BUZZER 8
// pH calibration (update after calibration)
float phSlope = -0.0178;
float phIntercept = 11.86;
// EC calibration (TDS sensor: 0.5 is a common conversion factor)
const float TDS_FACTOR = 0.5; // ppm to EC: EC(mS/cm) = ppm / 500
// Alert thresholds for hydroponics
const float PH_LOW = 5.5, PH_HIGH = 6.5;
const float EC_LOW = 1.0, EC_HIGH = 3.0; // mS/cm
LiquidCrystal_I2C lcd(0x27, 16, 2);
OneWire oneWire(TEMP_PIN);
DallasTemperature tempSensor(&oneWire);
float readPH() {
long sum = 0;
for (int i = 0; i < 30; i++) { sum += analogRead(PH_PIN); delay(10); }
float v = (sum / 30.0) * (5.0 / 1023.0);
return constrain(phSlope * v + phIntercept, 0, 14);
}
float readEC(float temp) {
long sum = 0;
for (int i = 0; i < 30; i++) { sum += analogRead(EC_PIN); delay(10); }
float v = (sum / 30.0) * (5.0 / 1023.0);
float rawTDS = (133.42 * v*v*v - 255.86 * v*v + 857.39 * v) * 0.5;
float rawEC = rawTDS / 500.0;
// Temperature compensation
return rawEC / (1.0 + 0.02 * (temp - 25.0));
}
void setup() {
Serial.begin(9600);
lcd.begin(16, 2);
lcd.backlight();
tempSensor.begin();
pinMode(BUZZER, OUTPUT);
}
void loop() {
tempSensor.requestTemperatures();
float temp = tempSensor.getTempCByIndex(0);
float ph = readPH();
float ec = readEC(temp);
bool alert = (ph PH_HIGH || ec EC_HIGH);
// Display on LCD
lcd.setCursor(0, 0);
lcd.printf("pH:%.2f EC:%.2f", ph, ec);
lcd.setCursor(0, 1);
lcd.printf("Temp:%.1fC %s", temp, alert ? "ALERT!" : "OK ");
if (alert) {
tone(BUZZER, 1000, 200);
Serial.printf("ALERT! pH:%.2f EC:%.2f T:%.1f
", ph, ec, temp);
}
delay(5000);
}
EC and pH Targets for Indian Crops
| Crop | pH Range | EC (mS/cm) |
|---|---|---|
| Leafy greens (spinach, methi) | 6.0–7.0 | 1.0–2.0 |
| Tomato | 5.8–6.5 | 2.0–4.0 |
| Capsicum (Bell Pepper) | 6.0–6.5 | 1.8–3.0 |
| Strawberry | 5.5–6.5 | 1.0–2.0 |
| Herbs (basil, coriander) | 5.5–6.5 | 1.0–1.8 |
| Cucumber | 5.8–6.0 | 1.8–2.5 |
Automated Nutrient Dosing
Extend the monitoring system with automated pH and nutrient correction using peristaltic pumps. Peristaltic pumps (₹300-800 for small 12V models) can precisely dose small amounts of pH Up solution (potassium hydroxide or sodium silicate), pH Down solution (phosphoric or citric acid), and nutrient concentrate without contaminating solution reservoirs.
For safe automated dosing:
- Dose small amounts (1-5 mL) then wait 5-10 minutes for mixing before re-measuring
- Set maximum doses per correction event to prevent overshooting
- Log all dosing events to track nutrient consumption rate
- Add a maximum daily dose safety limit to prevent catastrophic over-correction from sensor failure
Frequently Asked Questions
How often should I change the nutrient solution in a hydroponic system?
Change the complete nutrient solution every 7-14 days for most systems. As plants absorb specific nutrients at different rates, the EC value drops but the solution composition becomes imbalanced — top-off with fresh water maintains EC but creates nutrient imbalances over time. A weekly complete change prevents salt and pathogen build-up. For large systems, a partial change of 25-30% weekly is more practical and economical.
Can I use regular Indian tap water for hydroponics?
Indian tap water (municipal supply) typically has pH 7.0-8.5 and EC 0.3-0.8 mS/cm. The alkalinity (bicarbonate content) causes pH to drift upward rapidly in hydroponic systems — a common frustration for beginners. Reverse osmosis water (near-zero EC, pH ~7.0) or rainwater gives the most stable starting point. If using tap water, let it stand 24 hours to off-gas chlorine (which kills beneficial microorganisms), then adjust to your target pH before adding nutrients.
My EC reading seems to increase even though I am not adding nutrients. Why?
EC increases when water evaporates from the reservoir, concentrating the dissolved salts. This is the most common cause of EC increase without additional nutrient addition. Top up with plain water (not nutrient solution) when EC rises above target to restore water level. Monitor the ratio of water added between full changes — if you are topping up more than usual, plants are consuming less nutrients, possibly indicating light deficiency or temperature stress.
What nutrient solutions are available in India for hydroponics?
Several Indian companies produce hydroponic nutrient solutions: Hoagland solution components are available from laboratory chemical suppliers. Commercial hydroponics nutrients: Urbangro nutrients (Bangalore), Growee nutrients, and VPK hydroponics nutrients (Mumbai) produce two-part and three-part solutions formulated for Indian water chemistry. International brands (General Hydroponics, Canna) are available through specialised importers at higher cost. For beginners, start with a complete two-part nutrient kit (Part A + Part B) which provides all macro and micronutrients in the correct ratio.
Add comment