DO Probe Sensor For Arduino
DO Probe Sensor For Arduino
Dissolved oxygen refers to the extent of free, non-compound oxygen present in water or other liquids. it’s one of the foremost
important parameters when assessing water quality due to its influence on the organisms living within a body of water. A DO
level that’s too high or too low can harm aquatic life and affect water quality.
The Gravity Analog Dissolved Oxygen Sensor from Graylogix is one of the most popular and best Dissolved Oxygen Sensors that
are available in the market. The Analog dissolved oxygen sensor kit from Graylogix is compatible with Arduino, ESP8266, ESP32,
STM32 microcontrollers & Raspberry Pie. The product is used to measure the dissolved oxygen in water, to reflect the water quality.
It is widely applied in many water quality applications, such as aquaculture, environment monitoring, natural science, etc.
Dissolved oxygen refers to the level of free, non-compound oxygen present in water or any other liquids. The non-compound
oxygen, or free oxygen (O2), is oxygen that’s not bonded to any other element. Dissolved oxygen is the presence of the free O2
molecules within the water. The bonded oxygen molecule in water (H2O) is in a compound and does not count toward DO levels.
One can imagine that free oxygen molecules dissolve in water much the same way salt or sugar does when it’s stirred.
Dissolved oxygen enters the water through the air or as a plant byproduct of photosynthesis. From the air, oxygen can
slowly diffuse across the water’s surface from the surrounding atmosphere, or be mixed in quickly through aeration. Dissolved
oxygen is also produced as a waste product of photosynthesis from phytoplankton, algae, seaweed, and other aquatic plants.
Dissolved oxygen levels may be affected by a variety of natural factors, some of which include:
Aquatic life (more aquatic life = less DO)
Decomposition levels (decomposition processes consume oxygen, resulting in less DO)
Body of water type (running streams dissolve more oxygen than still water)
Altitude (high altitude = less DO)
The Dissolved Oxygen Meter (DO meter) measures the amount of oxygen dissolved in an aqueous solution. The dissolved oxygen
meter is of 3 different types & made using the following sensors.
Galvanic dissolved oxygen sensors
Polarographic dissolved oxygen sensors
Optical dissolved oxygen sensors
Galvanic DO sensors consist of two electrodes: an anode made up of Silver and cathode Made up of Gold. Both of these electrodes
are immersed in electrolytes (inside the sensor body). An oxygen permeable membrane separates the anode and cathode from the
measured water.
The permeable membrane allows oxygen from the sample water to diffuse into the sensor, where it is reduced at the cathode. This
chemical reaction produces an electrical signal, which travels from the cathode to the anode and then into the dissolved oxygen
measuring instrument. Consumption of oxygen at the cathode creates a pressure difference across the membrane that varies based
on the partial pressure of oxygen in the sample. Therefore, as oxygen concentration increases, partial pressure and the rate of
diffusion also increase, and the current to the instrument increases proportionally.
Before getting the Dissolved Oxygen Sensor probe to work, you need to prepare the probe. For preparing the probe you need to
prepare the KCL solution. You need to dissolve the KCL Crystals of approximately 2 grams with 26 grams of Water.
For a new dissolved oxygen probe, 7.5% KCL solution should be added into the membrane cap first as the filling solution. To do
that follow the following steps.
Remove the membrane crown,
Place the DO membrane on the cap and fix the crown to the electrolyte tube covering one side of the membrane.
Make sure that there is no wrinkles in the membrane and that is does not get punctured or damaged.
Unscrew the membrane cap from the probe and fill about 2/3 volume of the cap with KCL solution.
Make sure the probe is in a vertical position with respect to the horizontal plane.
Carefully screw the cap back to the probe. It would be nice if a little bit of solution overflows out of the cap to ensure the probe is
fully filled with KCL solution and there are no air bubbles in it.
7.5% KCL solution acts as good electrolyte in DO Probe. Presence of any other salt in the electrolyte solution may damage the
probe.
The electrode tube should not contain any air bubble, if it is present it will cause fluctuations in the readings
2 Page
When screwing the cap back to the probe, the probe should be in a vertical position with respect to the horizontal plane to avoid
creating bubbles in the filling solution.
Here is a circuit diagram for interfacing dissolved Oxygen Sensor with Arduino Board. First, connect the probe to BNC
connector on the signal converter board.
The Signal Converter Board works at 9V. Connect signal converter board VCC pin to 9V Battery and Connect the GND to GND.
Similarly, connect the output Analog pin to A1 of Arduino Board.
The signal converter board is already calibrated to zero.
If you are using the Sensor for the first time or the sensor is used for a long time then you need to calibrate the probe for accuracy.
There are two methods for calibrating the sensor:
Single-point calibration: only calibrate the saturated dissolved oxygen at a fixed temperature, suitable for use when the temperature
is stable.
Two-point calibration: calibrate the saturated dissolved oxygen at different temperatures, you can calculate the temperature
3
But prefer the first method, i.e Single-Point Calibration as it is the easiest method.
Measure the temperature of the liquid and note it down, the output values are directly proportional to the temperature of the liquid.
Since the measurement is based on the diffusion process the agitation of the solution is must. Hand shaking of the solution may not
give the accurate readings. Magnetic stirrer is recommended for this process. Movement of the solution should be about 2 ft/sec for
accurate measurement.
Once the calibration factor is achieved, you can make your own Dissolved Oxygen Meter.
The following code below can be uploaded to Arduino Board to make you own dissolved Oxygen Meter. Change the following line
in the code like temperature and calibration voltage. The calibration is done at 25°C and it is preferred to do the calibration at this
temperature.
4
Here is a complete final code, you can upload it directly to the Arduino board.
#include <Arduino.h>
#define DO_PIN A1
#define VREF 5000 //VREF (mv)
#define ADC_RES 1024 //ADC Resolution
//Single-point calibration Mode=0
//Two-point calibration Mode=1
#define TWO_POINT_CALIBRATION 0
#define READ_TEMP (25) //Current water temperature ℃, Or temperature sensor function
//Single point calibration needs to be filled CAL1_V and CAL1_T
#define CAL1_V (1455) //mv
#define CAL1_T (25) //℃
//Two-point calibration needs to be filled CAL2_V and CAL2_T
//CAL1 High temperature point, CAL2 Low temperature point
#define CAL2_V (1300) //mv
#define CAL2_T (15) //℃
const uint16_t DO_Table[41] = {
14460, 14220, 13820, 13440, 13090, 12740, 12420, 12110, 11810, 11530,
11260, 11010, 10770, 10530, 10300, 10080, 9860, 9660, 9460, 9270,
9080, 8900, 8730, 8570, 8410, 8250, 8110, 7960, 7820, 7690,
7560, 7430, 7300, 7180, 7070, 6950, 6840, 6730, 6630, 6530, 6410};
uint8_t Temperaturet;
uint16_t ADC_Raw;
uint16_t ADC_Voltage;
uint16_t DO;
int16_t readDO(uint32_t voltage_mv, uint8_t temperature_c)
{
#if TWO_POINT_CALIBRATION == 00
uint16_t V_saturation = (uint32_t)CAL1_V + (uint32_t)35 * temperature_c - (uint32_t)CAL1_T * 35;
return (voltage_mv * DO_Table[temperature_c] / V_saturation);
#else
uint16_t V_saturation = (int16_t)((int8_t)temperature_c - CAL2_T) * ((uint16_t)CAL1_V - CAL2_V) / ((uint8_t)CAL1_T -
CAL2_T) + CAL2_V;
return (voltage_mv * DO_Table[temperature_c] / V_saturation);
#endif
}
void setup()
{
Serial.begin(9600);
}
void loop()
{
Temperaturet = (uint8_t)READ_TEMP;
ADC_Raw = analogRead(DO_PIN);
ADC_Voltage = uint32_t(VREF) * ADC_Raw / ADC_RES;
Serial.print("Temperaturet:\t" + String(Temperaturet) + "\t");
Serial.print("ADC RAW:\t" + String(ADC_Raw) + "\t");
5 Page
After uploading the code, you can open the Serial Monitor and you will see the following logged value in Serial Monitor.
The dissolve oxygen value may differ depending upon the parameters like Aquatic life, Elevation, Salinity (saltiness), Temperature,
Turbulence & Vegetation. For measuring the water quality, you can measure the Water Ph, Turbidity, TDS & Temperature as well.
You can add Ph Sensor, Turbidity Sensor, TDS & Temperature Sensor to this circuit.
Technical Specifications
Range 0 to 20.0 ppm
Resolution 0.1 ppm
Accuracy +/- 0.2 ppm to +/- 1 count
DO Sensor Amperometric Gold/Silver Membrane type
PCB Analog output
Power 9 Volts battery
Standard Accessories
DO Electrode 1 No
Signal Converter Board 1 No
Instruction Manual 1 No
DO Membranes Set (4 Nos.)
Potassium Chloride Crystals 2 grams
6 Page