Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Notes: For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.
Electrical conductivity measurement plays a critical role in water quality monitoring, hydroponics, aquaculture, and environmental testing. The EC Sensor Arduino combination provides an affordable yet accurate solution for quantifying dissolved ions in water. After integrating these sensors into numerous water monitoring projects, I’ve found them remarkably capable when properly calibrated and implemented.
This guide covers everything needed to build a functional conductivity meter using Arduino, from understanding the measurement principles to implementing temperature-compensated code examples.
What Is Electrical Conductivity?
Electrical conductivity (EC) measures a solution’s ability to conduct electrical current. Pure water conducts electricity poorly, but dissolved ions like salts, minerals, and nutrients dramatically increase conductivity. The more dissolved ions present, the higher the conductivity reading.
EC is essentially the reciprocal of electrical resistance. While resistance measures how much a material opposes current flow, conductivity measures how easily current passes through. In liquid solutions, conductivity reflects the concentration of electrolytes present in the water.
Why Measure Electrical Conductivity?
Application
Purpose
Typical EC Range
Drinking Water
Purity assessment
50 – 500 µS/cm
Hydroponics
Nutrient concentration monitoring
1000 – 3000 µS/cm
Aquaculture
Fish tank water quality
100 – 2000 µS/cm
Swimming Pools
Chemical balance verification
1000 – 4000 µS/cm
Wastewater
Treatment process control
500 – 20000 µS/cm
Soil Testing
Salinity assessment
Variable
In hydroponics, EC monitoring is essential because it directly indicates nutrient concentration in the growing solution. Too low means plants aren’t receiving adequate nutrition; too high can cause nutrient burn and root damage. Similarly, in aquaculture, stable EC helps maintain healthy conditions for fish and other aquatic life.
Understanding EC Units
Electrical conductivity is commonly expressed in several units:
Unit
Symbol
Relationship
Siemens per centimeter
S/cm
Base unit
Millisiemens per centimeter
mS/cm
1 mS/cm = 0.001 S/cm
Microsiemens per centimeter
µS/cm
1 µS/cm = 0.001 mS/cm
Parts per million
ppm
Approximate: 1 mS/cm ≈ 500-700 ppm
Most EC Sensor Arduino modules report values in mS/cm or µS/cm. The conversion to ppm (also called TDS – Total Dissolved Solids) involves a conversion factor that varies depending on the specific ions present. A commonly used factor is 0.5 to 0.7.
How EC Sensors Work
EC sensors measure conductivity by passing a small electrical current between two or more electrodes immersed in the solution. The amount of current that flows depends on the ion concentration between the electrodes.
Two-Electrode vs Four-Electrode Methods
Most affordable EC Sensor Arduino modules use a two-electrode design. Two metal plates (typically stainless steel or platinum-coated) serve as both the excitation source and measurement points. When voltage is applied, current flows through the solution, and the resulting voltage drop indicates conductivity.
More sophisticated industrial sensors use four electrodes. Two outer electrodes supply excitation current while two inner electrodes measure voltage. This configuration eliminates errors from electrode polarization and contact resistance, providing higher accuracy across wider measurement ranges.
The Cell Constant (K)
The cell constant represents the geometric relationship between electrode spacing and surface area. It’s expressed in cm⁻¹ and affects the measurement range.
Cell Constant
Measurement Range
Application
K = 0.1
0.5 – 400 µS/cm
Ultra-pure water
K = 1.0
10 – 20000 µS/cm
General purpose, hydroponics
K = 10
1 – 200 mS/cm
High conductivity solutions
For most Arduino projects involving drinking water, hydroponics, or aquarium monitoring, K=1.0 sensors provide the optimal range and are the most commonly available.
EC Sensor Arduino Module Specifications
Understanding your sensor’s specifications ensures proper implementation and accurate results.
DFRobot Gravity EC Sensor V2 Specifications
Parameter
Value
Operating Voltage
3.0V – 5.0V
Output Signal
Analog (0 – 3.4V)
Measurement Range
1 – 20 mS/cm (K=1.0)
Measurement Accuracy
±5% F.S.
Operating Temperature
5°C – 40°C
Probe Type
Laboratory grade
Interface
Gravity 3-pin analog
Board Dimensions
42mm × 32mm
EC Sensor Module Pinout
Pin
Label
Function
1
VCC
Power supply (3-5V)
2
GND
Ground reference
3
Signal
Analog output voltage
The analog output voltage is proportional to the conductivity of the solution. Higher conductivity produces higher output voltage, which the Arduino’s ADC converts to digital values for processing.
Wiring EC Sensor to Arduino
The basic wiring for an EC Sensor Arduino setup requires only three connections.
Basic Wiring Connections
EC Sensor
Arduino Uno
VCC
5V
GND
GND
Signal
A1
Complete System with Temperature Compensation
For accurate EC measurement, temperature compensation is essential. Add a DS18B20 waterproof temperature sensor to your setup:
Component
Arduino Uno
EC Sensor VCC
5V
EC Sensor GND
GND
EC Sensor Signal
A1
DS18B20 VCC
5V
DS18B20 GND
GND
DS18B20 Data
D2
4.7K Resistor
Between Data and VCC
Temperature compensation is critical because conductivity increases approximately 2% per degree Celsius. Without compensation, a reading taken at 30°C would differ significantly from the same solution measured at 20°C.
Installing EC Sensor Arduino Libraries
The DFRobot EC library simplifies calibration and measurement significantly. Install it through the Arduino Library Manager.
Required Libraries
DFRobot_EC – Main EC sensor library
OneWire – For DS18B20 temperature sensor
DallasTemperature – Temperature sensor interface
EEPROM – Stores calibration values
Installation Steps
Open Arduino IDE
Navigate to Sketch → Include Library → Manage Libraries
Search for “DFRobot_EC” and install
Search for “OneWire” and install
Search for “DallasTemperature” and install
The DFRobot_EC library stores calibration parameters in Arduino’s EEPROM, so calibration persists across power cycles.
Calibrating the EC Sensor Arduino
Proper calibration is essential for accurate EC measurements. The sensor requires two-point calibration using standard buffer solutions.
Required Calibration Solutions
Solution
EC Value
Purpose
Low Standard
1.413 mS/cm
Lower calibration point
High Standard
12.88 mS/cm
Upper calibration point
These standard solutions are available from sensor suppliers or scientific supply companies. Keep them sealed when not in use, as evaporation can change their concentration.
Two-Point Calibration Procedure
Upload the calibration code to Arduino
Open Serial Monitor at 115200 baud
Rinse probe with distilled water and dry with lint-free tissue
Type “enterec” to enter calibration mode
Immerse probe in 1.413 mS/cm solution
Wait for readings to stabilize (approximately 30 seconds)
Type “calec” to calibrate the low point
Rinse and dry the probe
Immerse probe in 12.88 mS/cm solution
Wait for stable readings
Type “calec” to calibrate the high point
Type “exitec” to save and exit calibration mode
The library automatically identifies which standard solution the probe is in and applies the appropriate calibration.
EC Sensor Arduino Code Examples
Let me share the code patterns that have worked reliably across my projects.
Basic EC Measurement with Temperature Compensation
EC probes require proper care to maintain accuracy and longevity.
Handling Guidelines
The platinum black coating on quality EC probes is delicate. Never touch the electrode surfaces with fingers or abrasive materials. Clean only with distilled water and allow to air dry or use lint-free tissue.
Storage Recommendations
Storage Duration
Method
Short-term (hours)
Keep in distilled water
Long-term (days+)
Store dry in protective cap
Extended storage
Recalibrate before use
Important Precautions
Laboratory-grade probes should not remain submerged continuously. For 24/7 monitoring applications, use industrial-grade probes specifically designed for continuous immersion. The platinum black layer can degrade if left in solution indefinitely.
Useful Resources for EC Sensor Arduino Projects
Resource
URL
Description
DFRobot Wiki
wiki.dfrobot.com
Official documentation and tutorials
DFRobot_EC Library
github.com/DFRobot
Arduino library source code
Arduino Reference
arduino.cc/reference
Programming documentation
Seeed Studio Wiki
wiki.seeedstudio.com
Grove EC sensor guide
Cave Pearl Project
thecavepearlproject.org
In-depth EC measurement theory
Component Sources:
DFRobot (dfrobot.com) – Gravity EC Sensor kits with calibration solutions
Seeed Studio (seeedstudio.com) – Grove EC Sensor Kit
Arduino Store (store.arduino.cc) – Official sensor availability
Amazon – Various compatible modules
FAQs About EC Sensor Arduino Projects
Why does my EC Sensor Arduino show different readings at different temperatures?
Temperature significantly affects electrical conductivity. Ions move faster in warmer water, increasing conductivity approximately 2% per degree Celsius. Without temperature compensation, a solution measuring 2.0 mS/cm at 25°C might read 2.4 mS/cm at 35°C despite no change in actual ion concentration. Always use a temperature sensor alongside your EC probe and apply the compensation algorithm included in the DFRobot_EC library for accurate, comparable readings.
Can I use the same EC Sensor Arduino setup for both hydroponics and drinking water testing?
Yes, but you may need to consider the measurement range. A K=1.0 sensor covers 1-20 mS/cm, suitable for hydroponics nutrients (typically 1-3 mS/cm) but potentially too insensitive for ultra-pure drinking water (50-500 µS/cm). For drinking water testing, a K=0.1 probe provides better resolution at lower conductivity levels. However, for general household tap water quality assessment, a K=1.0 probe works adequately.
How often should I calibrate my EC sensor?
Calibrate your EC sensor before first use and whenever readings seem inconsistent with expected values. For regular use, calibration every 1-2 months maintains accuracy. If you notice drift in readings, visible contamination on the probe, or have stored the sensor for an extended period, recalibrate before taking measurements. Keep calibration solutions sealed and replace them if they appear contaminated or have been open for more than six months.
My pH and EC readings change when both sensors are in the same solution. What’s happening?
This common issue results from electrical interference between sensors. When both pH and EC probes share the same solution, ground loops and stray currents can affect readings, particularly the high-impedance pH sensor. Solutions include using isolated signal conditioners, switching sensors on/off alternately rather than simultaneously, maintaining adequate physical distance between probes, or using optically isolated interface boards. The DFRobot library includes timing that helps minimize this interference.
What’s the difference between EC and TDS measurements?
EC (Electrical Conductivity) directly measures a solution’s ability to conduct electricity, expressed in mS/cm or µS/cm. TDS (Total Dissolved Solids) estimates the mass of dissolved substances per unit volume, expressed in ppm (parts per million) or mg/L. TDS is calculated from EC using a conversion factor that varies depending on the dissolved substances (typically 0.5-0.7). EC is the actual measured value, while TDS is a derived estimate. For hydroponics and aquarium use, either unit works as long as you’re consistent.
Conclusion
The EC Sensor Arduino combination provides an accessible path into electrical conductivity measurement for water quality monitoring, hydroponics, aquaculture, and educational projects. With proper calibration and temperature compensation, these affordable sensors deliver accuracy sufficient for most non-laboratory applications.
Start with the basic code example to verify your hardware functions correctly, then implement temperature compensation for accurate, repeatable measurements. Remember that calibration is essential, probe care affects longevity, and temperature has a significant impact on readings.
For comprehensive water quality monitoring systems, consider combining EC measurement with pH and turbidity sensors to create a complete solution that provides multiple indicators of water condition. The standardized interfaces from manufacturers like DFRobot make building multi-parameter systems straightforward.
Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Notes: For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.