Forum >Is my circuit board in the Analog pH Meter kit defective?
ArduinoGeneral

Is my circuit board in the Analog pH Meter kit defective?

userHead Leff 2015-09-21 23:55:49 17937 Views8 Replies

This article is supposed to check whether the pH sensor circuit board in the two PH meter kits: Analog pH Meter Pro and Analog pH Meter Kit.

Some users found very strange readings of their ph liquor even after they follow the wiki steps, i.e. after Zero Adjustment. It might be the circuit board is defective. Now let's take a look at how to confirm it, very simple.

Requirments:

Steps
NOTE: Make sure the Arduino controller can suply good 5V voltage to the board.

STEP 1 If you have checked the 5V voltage supply from Arduino was no problem. Then short circuit the circuit board input with a metal tweezers( or a wire) to simulate that the PH=7.0 and the voltage reading should be 2.0V.

STEP 2 Connect the circuit board to Arduino Uno on A0. (if you use Leonardo, note if the switch for buttons on board was ON)

STEP 3 Upload the sample code on the wiki, or copy from here.
 

Code: Select all#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 ArrayLenth  40    //times of collection
int pHArray[ArrayLenth];   //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==ArrayLenth)pHArrayIndex=0;
      voltage = avergearray(pHArray, ArrayLenth)*5.0/1024;
      pHValue = 3.5*voltage+Offset;
      samplingTime=millis();
  }
  if(millis() - printTime > printInterval)   //Every 800 milliseconds, print a numerical, convert the state of the LED indicator
  {
   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;
  }
  if(number<5){   //less than 5, calculated directly statistics
    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;
}



STEP 4 Open the serial monitor, choose "9600" baud rate. Then if your readings are:"2.0V, PH=7.0(6.9~7.1)" like below, it proves that the board is good. Or if your readings are not stable or not around 2.0V, ph=7.0, then the circuit board is defective.
 

2018-01-20 18:11:01 how if it reads Voltage:5.00 pH value: 17.50
is it defect ?
userHeadPic ryanthe
2016-08-15 23:09:44 Hi

Did you wash the pH electrode when you put the PH meter into different solution? And could you provide me some pictures about the process and result of the circuit board test? I want to be more accurate to judge of the board.
userHeadPic Wendy.Hu
2016-08-13 03:35:48 Hello,

Yes i did put my probe into some solution and the pH value is change but it can't be stable and always decreasing. So i have to talk to product page for a replacement? Thanks Wendy.Hu
userHeadPic Utomo Aditya
2016-08-12 03:11:46 Hai,

yes i have done the following instruction and i get strange ph readings (voltage around 3-4v ph=12-13). Is there any ideas what wrong with mine? Thanks :'(
userHeadPic Utomo Aditya
2016-08-11 21:55:11 Hello,

Did you check your circuit board using the above method?
userHeadPic Wendy.Hu
2016-08-11 06:54:50 Hello there, i have a problem with my ph sensor readings. I've uploaded the program but it shows the voltage is up to 3v or 4v, and the ph readings became so high. Please help me, what i have to do. Thanks :'( userHeadPic Utomo Aditya
2016-01-18 18:34:06 At once you will see the reading. userHeadPic Leff
2016-01-08 10:49:36 Once 5V power is applied the sensor, in general how much time do you have to wait until get stable readings? userHeadPic ric.vendrame