Gravity: Analog Electrical Conductivity Sensor PRO K=1 Wiki - DFRobot

Introduction

Conductivity is the reciprocal of an object's resistivity. It represents a material’s ability to pass a current. In a liquid, conductivity is a measure of a solution’s ability to conduct electricity and can reflect the amount of dissolved or salinity of a water source, so it’s an important parameter in water quality monitoring.
DFRobot Gravity: Analog Electrical Conductivity Sensor PRO(K=1) is specially used to measure the conductivity in aqueous solutions, and then to evaluate the water quality. These conductivity sensors are often used in hydroponics, aquaculture, environmental water detection, and other fields.
As an upgraded version of the analog electrical conductivity meter, this pro version has greatly improved in probe endurance, which can be used in 24/7 conductivity monitoring. Besides, the integrated PT1000 platinum resistance thermometer makes it easier to measure the compensated temperature data.
It supports 3-5V wide voltage input, and is compatible with 5V and 3.3V main control boards. The output signal is filtered by hardware and 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 supported library comes with a calibration program to allow you to get started easily. Besides, there are practical items in the package, like calibration solution, accessory kit, waterproof connector, etc., which can help you quickly build a conductivity monitoring platform.
With this product, a controller board (such as Arduino) and the software library, you can quickly build an electrical conductivity meter, plug-and-play, no solder required. DFRobot provides a variety of water quality sensor products with uniform sizes and interfaces, which not only meet the needs of various water quality testing but are also suitable for the DIY of multi-parameter water quality testers.
This is an industrial-grade probe and can be immersed in liquid for a long time. But if you want a conductivity probe with higher accuracy or larger range, please select the laboratory probe (Gravity: Analog Electrical Conductivity Sensor /Meter V2 (K=1)).

Specification

Pinout

Electrical Conductivity Probe Pro Pinout

Label Description
S+ (EC) Probe positive electrode
S- (EC) Probe negative electrode
TEMP PT1000 RTD, not polarity sensitive

Electrical Conductivity Conversion Board Pinout

Silkscreen Label Description
- Power GND Power GND
+ Power VCC Support 3.3V-5V power supply
A Analog output Output range 0V-3V
S+ Probe positive electrode Connect to probe positive
S- Probe negative electrode Connect to probe negative

PT1000 Tmperature Conversion Board Pinout

Silkscreen Label Description
- Power GND Power GND
+ Power VCC Support 3.3V-5V power supply
A Analog output Output range 0V-3V
T+ RTD positive Connect to PT1000 RTD, not polarity sensitive
T- RTD negative Connect to PT1000 RTD, not polarity sensitive

Tutorial

Requirements

Hardware Connection

Probe - Signal Conversion Board

Probe Wire Signal Conversion Board
S+ (EC) Electrical Conductivity Board S+
S- (EC) Electrical Conductivity Board S-
TEMP PT1000 Board T+
TEMP PT1000 Board T-

Signal Conversion Board - Arduino

Signal Conversion Board Arduino UNO
Electrical Conductivity Board A1
PT1000 Board A2

The First Measurement

Connect all the parts and upload the following code.

#include "DFRobot_ECPRO.h"

#define EC_PIN A1

DFRobot_ECPRO ec;

uint16_t InputVoltage;
float Conductivity;

void setup()
{
  Serial.begin(115200);

  ec.setCalibration(1); //Replace the 1 with the calibrated K value if it's calibrated
  Serial.println("Default Calibration K=" + String(ec.getCalibration()));
}

void loop()
{
  InputVoltage = (uint32_t)analogRead(EC_PIN) * 5000 / 1024;
  Conductivity = ec.getEC_us_cm(InputVoltage);

  Serial.print("InputVoltage: " + String(InputVoltage) + " mV\t");
  Serial.println("Conductivity: " + String(Conductivity) + " us/cm");

  delay(1000);
}

The measurement data can be viewed through the serial monitor after uploading the program, and the probe is not calibrated at this time.
The default parameters: calibration factor K=1.0, temperature=25°C.

Default Calibration K=1.00
InputVoltage:    1547 mV    Conductivity:    943.29 us/cm
InputVoltage:    1547 mV    Conductivity:    943.29 us/cm
InputVoltage:    1547 mV    Conductivity:    943.29 us/cm
InputVoltage:    1547 mV    Conductivity:    943.29 us/cm
InputVoltage:    1547 mV    Conductivity:    943.29 us/cm
InputVoltage:    1542 mV    Conductivity:    940.24 us/cm
InputVoltage:    1542 mV    Conductivity:    940.24 us/cm
InputVoltage:    1542 mV    Conductivity:    940.24 us/cm
InputVoltage:    1542 mV    Conductivity:    940.24 us/cm

Temperature Calibration

This industrial electrical conductivity probe integrates PT1000 RTD that can be used to measure and calibrate liquid temperature easily. The following program adds temperature calibration to the basic measurement.
If you have another type of temperature sensor, or plan to use other temperature data sources, you can also get the temperature directly and fill it into getEC_us_cm(EC_Voltage, Temp) in Celsius (°C).

#include "DFRobot_ECPRO.h"

#define EC_PIN A1
#define TE_PIN A2

DFRobot_ECPRO ec;
DFRobot_ECPRO_PT1000 ecpt;

uint16_t EC_Voltage, TE_Voltage;
float Conductivity, Temp;

void setup()
{
  Serial.begin(115200);

  ec.setCalibration(1); //Replace the 1 with the calibrated K value if it's calibrated
  Serial.println("Default Calibration K=" + String(ec.getCalibration()));
}

void loop()
{
  EC_Voltage = (uint32_t)analogRead(EC_PIN) * 5000 / 1024;
  TE_Voltage = (uint32_t)analogRead(TE_PIN) * 5000 / 1024;

  Temp = ecpt.convVoltagetoTemperature_C((float)TE_Voltage/1000);
  Conductivity = ec.getEC_us_cm(EC_Voltage, Temp);

  Serial.print("EC_Voltage: " + String(EC_Voltage) + " mV\t");
  Serial.print("Conductivity: " + String(Conductivity) + " us/cm\t");
  Serial.print("TE_Voltage: " + String(TE_Voltage) + " mV\t");
  Serial.println("Temp: " + String(Temp) + " ℃");

  delay(1000);
}

You can view the measurement data through the serial monitor after uploading the program. The default parameter at this time is: the calibration factor K=1.0, and the temperature is compensated according to the data measured by the sensor.

Default Calibration K=1.00
EC_Voltage: 1538 mV    Conductivity: 976.46 us/cm    TE_Voltage: 783 mV    Temp: 23.02 ℃
EC_Voltage: 1538 mV    Conductivity: 976.46 us/cm    TE_Voltage: 783 mV    Temp: 23.02 ℃
EC_Voltage: 1538 mV    Conductivity: 976.46 us/cm    TE_Voltage: 783 mV    Temp: 23.02 ℃
EC_Voltage: 1538 mV    Conductivity: 976.46 us/cm    TE_Voltage: 783 mV    Temp: 23.02 ℃
EC_Voltage: 1533 mV    Conductivity: 973.29 us/cm    TE_Voltage: 783 mV    Temp: 23.02 ℃
EC_Voltage: 1533 mV    Conductivity: 973.29 us/cm    TE_Voltage: 783 mV    Temp: 23.02 ℃
EC_Voltage: 1533 mV    Conductivity: 973.29 us/cm    TE_Voltage: 783 mV    Temp: 23.02 ℃
EC_Voltage: 1533 mV    Conductivity: 973.29 us/cm    TE_Voltage: 783 mV    Temp: 23.02 ℃
EC_Voltage: 1533 mV    Conductivity: 973.29 us/cm    TE_Voltage: 783 mV    Temp: 23.02 ℃

Calibration for Higher Accuracy

Calibration is generally required to improve the measurement accuracy in practice due to quality differences among probes. The steps are as follows:

  1. Connect the EC probe to Arduino and upload the calibration program.
  2. Immerse the EC probe in a calibration solution with known conductivity, it is recommended to use a 1413 us/cm electrical conductivity standard solution for calibration. If the complimentary calibration solution runs out, purchase or prepare it according to the appendix. See the appendix for detailed specification.
  3. Check the probe and shake it slightly to remove air bubbles so as to avoid interference
  4. Input C calibration solution electrical conductivity in the serial monitor for calibration. For example, C 1413 means calibrating the probe in 1413 us/cm electrical conductivity standard solution.
  5. Record the calibration value K returned from the serial monitor. K should be close to 1.0. Please check the calibration steps if there's too much deviation.
  6. Replace K with the actual measured data in ec.setCalibration(K value) and re-upload the program to improve the accuracy of the measurement results.

It is recommended to recalibrate to maintain high accuracy when the probe is replaced or the ADC reference voltage changes. In practical use, it is recommended to write a program to store calibration values using Arduino built-in EEPROM or external SD card and read them automatically when it is powered on.

Calibration Program

#include "DFRobot_ECPRO.h"

#define EC_PIN A1
#define TE_PIN A2

DFRobot_ECPRO ec;
DFRobot_ECPRO_PT1000 ecpt;

uint16_t EC_Voltage, TE_Voltage;
float Conductivity, Temp;

void setup()
{
  Serial.begin(115200);

  ec.setCalibration(1);
  Serial.println("Default Calibration K=" + String(ec.getCalibration()));
  Serial.println("Immerse the probe in the calibration solution and enter \"C + conductivity\" to calibrate");
  Serial.println("e.g. \"C 1413\"");

  delay(2000);
}

void loop()
{
  EC_Voltage = (uint32_t)analogRead(EC_PIN) * 5000 / 1024;
  //TE_Voltage = (uint32_t)analogRead(TE_PIN) * 5000 / 1024;
  TE_Voltage = 783;

  Temp = ecpt.convVoltagetoTemperature_C((float)TE_Voltage / 1000);
  Conductivity = ec.getEC_us_cm(EC_Voltage, Temp);

  Serial.print("EC_Voltage: " + String(EC_Voltage) + " mV\t");
  Serial.print("Conductivity: " + String(Conductivity) + " us/cm\t");
  Serial.print("TE_Voltage: " + String(TE_Voltage) + " mV\t");
  Serial.println("Temp: " + String(Temp) + " ℃");

  delay(1000);
}

void serialEvent()
{
  String args = Serial.readStringUntil('\n');
  if (args[0] == 'C')
  {
    args.remove(0, 2);
    float calSoluion=args.toFloat();
    ec.setCalibration(ec.calibrate(EC_Voltage,calSoluion));
    Serial.print("calSoluion: " + String(calSoluion)+"\t");
    Serial.println("calK: "+ String(ec.getCalibration(),6));
    delay(5000);
  }
  else
    Serial.println("command error");
}

Advice for Improving Accuracy

Appendix

Prepare Electrical Conductivity Calibration Solution

1413µs/cm electrical conductivity calibration solution is 0.0100mol/L KCl standard solution. The preparation steps of the sample solution of 1000ml volumetric flask are as follows:

  1. According to the calculation, it takes 0.74551g of KCl to prepare 1000ml of 0.01mol/L KCl standard solution.
  2. Use an analytical balance to weigh 0.74551g of dry KCl.
  3. Put the weighed KCl solute into a beaker and add an appropriate amount of distilled water to dissolve KCl completely
  4. Transfer the solution along a glass rod to the volumetric flask, rinse the beaker several times with distilled water, and transfer the rinsing solution to the volumetric flask as well.
  5. When the level of the liquid in the volumetric flask is about 1-2cm away from the mark, use a dropper to add water carefully until the concave surface of the liquid is tangent to the mark.
  6. Cover the bottle tightly with a stopper, and make the liquid in the bottle be mixed well by reversing and shaking. The solution is the standard solution with a conductivity of 1413µs/cm at 25℃ in general.

The standard solution should be prepared using an analytical balance and a volumetric flask. Don't use non-precision tools such as measuring cups and graduated cylinder. An inaccurate calibration solution will seriously affect calibration accuracy.

FAQ

For any questions, advice or cool ideas to share, please visit the DFRobot Forum.

More Documents