SOP for Calibration of SEN0169 pH Probe
Objective
Ensure that pH readings during experimentation will be fully accurate and reflect the true pH value of the probe tip environment.
Product
DFRobot SEN0169 Gravity: Analog pH Sensor (PRO)
Documentation
- Official DFRobot product page: https://wiki.dfrobot.com/sen0169/
- Official code & calibration reference: https://wiki.dfrobot.com/sen0169/docs/19888
Overview
Calibration is done by adjusting BOTH the software code on arduino IDE, as well as manually adjusting the potentiometer on the pH meter board.
- The potentiometer is the blue block close to the BNC connector (probe attachment). Note that there is a small screw at the top that must be adjusted with a flathead screwdriver
Procedure
Material Prep
- Do not wipe or rub the tip of the probe harshly
- Always rinse probe with distilled water when moving between solutions
Hardware Setup
- pH probe ↔ pH meter board via BNC connector
- pH meter board ↔ arduino via 3-pin connector
- arduino ↔ connect to laptop for power
- flash code onto arduino:
/* # This sample code is used to test the pH meter Pro V1.0. # Editor : YouYou # Ver : 1.0 # Product: analog pH meter Pro # SKU : SEN0169 */ #define SensorPin A0 //pH meter Analog output to Arduino Analog Input 0 #define Offset 0.00 //deviation compensate #define LED 13 #define samplingInterval 20 #define printInterval 800 #define ArrayLength 40 //times of collection int pHArray[ArrayLength]; //Store the average value of the sensor feedback int pHArrayIndex=0; void setup(void) { pinMode(LED,OUTPUT); Serial.begin(9600); Serial.println("pH meter experiment!"); //Test the serial monitor } void loop(void) { static unsigned long samplingTime = millis(); static unsigned long printTime = millis(); static float pHValue,voltage; if(millis()-samplingTime > samplingInterval) { pHArray[pHArrayIndex++]=analogRead(SensorPin); if(pHArrayIndex==ArrayLength)pHArrayIndex=0; voltage = avergearray(pHArray, ArrayLength)*5.0/1024; pHValue = 3.5*voltage+Offset; samplingTime=millis(); } //Every 800 milliseconds, print the state of the LED indicator if(millis() - printTime > printInterval) { Serial.print("Voltage:"); Serial.print(voltage,2); Serial.print(" pH value: "); Serial.println(pHValue,2); digitalWrite(LED,digitalRead(LED)^1); printTime=millis(); } } double avergearray(int* arr, int number){ int i; int max,min; double avg; long amount=0; if(number<=0){ Serial.println("Error number for the array to avraging!/n"); return 0; } // less than 5, calculated directly statistics if(number<5){ for(i=0;i<number;i++){ amount+=arr[i]; } avg = amount/number; return avg; } else{ if(arr[0]<arr[1]){ min = arr[0];max=arr[1]; } else{ min=arr[1];max=arr[0]; } for(i=2;i<number;i++){ if(arr[i]<min){ amount+=min; //arr<min min=arr[i]; }else { if(arr[i]>max){ amount+=max; //arr>max max=arr[i]; }else{ amount+=arr[i]; //min<=arr<=max } }//if }//for avg = (double)amount/(number-2); }//if return avg; }
CALIBRATION SOFTWARE
- Rinse probe tip with distilled water and gently dry
- Submerge tip into pH 7 solution
- Watch the terminal until a steady pH value is read
- Record steady pH value
- Determine offset
- Implement offset into .ino code
#define Offset 0.00 // change this value! - Save file and reflash the code onto the arduino
- Check that pH readings are within range of pH 7
Caliberation Hardware
- Rinse probe tip with distilled water and gently dry
- Submerge tip into pH 4 solution
- Watch the terminal until a steady pH value is read
- Adjust the potentiometer until a pH value of 4 is read
- DONE WITH POTENTIOMETER! DO NOT ADJUST ANYMORE!
- Once both sets of calibration have been completed, check back that the probe is correctly reading pH 7.0 in pH 7.0 solution and pH 4.0 in pH 4.0 solution