DFRobot Gravity: analog electrical conductivity meter V2 is specially used to measure the electrical conductivity of the aqueous solution, and then to evaluate the water quality, which is often used in water culture, aquaculture, environmental water detection and other fields.

This product, as an upgraded version of electrical conductivity meter V1, greatly improves the user experience and precision. It supports 3~5v wide voltage input, and is compatible with 5V and 3.3V main control board; The output signal filtered by hardware has low jitter; The excitation source adopts an AC signal, which effectively reduces the polarization effect, improves the precision and prolongs the life of the probe; The software library uses a two-point calibration method, and can automatically identify the standard buffer solution, so simple and convenient.

With this product, main control board (such as Arduino) and the software library, you can quickly build an electrical conductivity meter, plug and play, no welding. DFRobot provides a variety of water quality sensor products, uniform size and interface, not only meet the needs of various water quality testing, but also suitable for the DIY of multi-parameter water quality tester.

Conductivity is the reciprocal of the resistivity, which is related to the ability of the material to carry the current. In the liquid, the reciprocal of the resistance, the conductivity, is the measure of its ability to conduct electricity. Conductivity is an important parameter of water quality. It can reflect the extent of electrolytes present in water.

The probe is a laboratory-grade probe. Do not immerse in liquid for a long time. Otherwise this will shorten the life of the probe.
Platinum black layer is attached to the surface of the sheet metal in the probe. It should avoid any object touching it. It can only be washed with distilled water, otherwise, the platinum black layer will be damaged, resulting in the inaccurate measurement.


Board Overview

Num Label Description
1 - Power GND(0V)
2 + Power VCC(3.0~5.0V)
3 A Analog Signal Output(0~3.4V)
4 BNC Probe Connector


This tutorial will demonstrate how to use this electrical conductivity meter for calibration and measurement. Please read each step carefully.

1. In order to ensure the measurement accuracy, it is strongly recommended to add a temperature sensor to measure the temperature and achieve automatic temperature compensation. DS18B20 waterproof temperature sensor can be used.
2. Before measuring another liquid, be sure to wash the probe and absorb residual water-drops with paper to prevent contamination of the liquid. You can flush the probe with distilled water.


Connection Diagram


To ensure accuracy, the probe used for the first time, or used for a period of time, needs to be calibrated. This tutorial uses two-point calibration and therefore requires standard buffer solutions of 1413us/cm and 12.88ms/cm. The following tutorial shows how to operate two-point calibration.




Sample Code

Please download DFRobot_EC Library first,then install it. How to install Libraries in Arduino IDE

 * file DFRobot_EC.ino
 * @
 * This is the sample code for Gravity: Analog Electrical Conductivity Sensor / Meter Kit V2 (K=1.0), SKU: DFR0300.
 * In order to guarantee precision, a temperature sensor such as DS18B20 is needed, to execute automatic temperature compensation.
 * You can send commands in the serial monitor to execute the calibration.
 * Serial Commands:
 *   enter -> enter the calibration mode
 *   cal -> calibrate with the standard buffer solution, two buffer solutions(1413us/cm and 12.88ms/cm) will be automaticlly recognized
 *   exit -> save the calibrated parameters and exit from calibration mode
 * Copyright   [DFRobot](, 2018
 * Copyright   GNU Lesser General Public License
 * version  V1.0
 * date  2018-03-21

#include "DFRobot_EC.h"
#include <EEPROM.h>

#define EC_PIN A1
float voltage,ecValue,temperature = 25;
DFRobot_EC ec;

void setup()

void loop()
    static unsigned long timepoint = millis();
    if(millis()-timepoint>1000U)  //time interval: 1s
      timepoint = millis();
      voltage = analogRead(EC_PIN)/1024.0*5000;  // read the voltage
      //temperature = readTemperature();  // read your temperature sensor to execute temperature compensation
      ecValue =  ec.readEC(voltage,temperature);  // convert voltage to EC with temperature compensation
      Serial.print("^C  EC:");
    ec.calibration(voltage,temperature);  // calibration process by Serail CMD

float readTemperature()
  //add your code here to get the temperature from your temperature sensor


Q. How long does the probe need to be calibrated?
A. The calibration interval is determined by the frequency of use. Normally, you can calibrate it once a month. If used frequently, it can be calibrated once a week. When calibrating, fresh standard buffer solution is recommended.
Q. How to achieve automatic temperature compensation?
A. The temperature compensation algorithm has been integrated in the DFRobot_EC library.You only need to transfer the voltage and temperature to float readEC (float voltage, float temperature) at the same time, to obtain the electrical conductivity with temperature compensation.
Q. During the calibration, is it necessary to complete two points calibration? Can I complete only one point calibration?
A. The two points calibration must be completed because the two points respectively correspond to standard buffer solution 1413us/cm and 12.88ms/cm. The two points calibration ensure the accuracy of the entire measurement range. Therefore, two points calibration must be completed.
Q. During the first calibration, the calibration always failed. What could be the reason?
A. When calibrating, the relevant parameters are stored in the specified position in EEPROM. If other data previously saved in the same position in EEPROM, there may be a conflict, resulting in an inability to calibrate properly. Use the following code to erase the contents in the specified position in EEPROM. Run it once, then upload the sample code again to restart the calibration.
    #include <EEPROM.h>
    #define KVALUEADDR 0x0A
    void setup(){
        for(byte i = 0;i< 8; i   ){
          EEPROM.write(KVALUEADDR i, 0xFF);
    void loop(){
For any questions, advice or cool ideas to share, please visit the DFRobot Forum.

More Documents

DFshopping_car1.png Get Gravity: Analog Electrical Conductivity Sensor /Meter V2 (K=1) from DFRobot Store or DFRobot Distributor.

Turn to the Top