Electronics Lab Philippines

help me calibrating my DIY ph meter

Offline dabidxon

  • **
  • 12
  • 0
help me calibrating my DIY ph meter
« on: January 02, 2012, 02:48:25 PM »
happy new year fellas,

need some help naman for calibrating my DIY ph meter. nakainterface po ito with eduino og e gizmo..

http://blea.ch/wiki/index.php/PH_Meter

eto po ung ginamit q na circuit. nageemit po kasi ng negative voltage ung ph probe na nabili namin from lineseiki. and then ungarduino(eduino) eh nagaacept lang ng voltage from 0-5 kaya po kailangan kogumawa ng circuit for offset and gain.. naguguluhan lang po ako kung kailang ko dapat iadjus ung offset or gain. kailan po ba dapat?

Code: [Select]
// change this to whatever pin you've moved the jumper to
int ph_pin = 19;
//int for the averaged readin
int reading;
//int for conversion to millivolts
float millivolts;
//float for the ph value
float ph_value;
int i;
 
// highly recommended that you hook everything up and check the arduino's voltage with a multimeter. It doesn't make that much of a difference, but
// if you want it to be highly accurate than do this step
 #define Offset 0.06
#define ARDUINO_VOLTAGE 5.0
// PH_GAIN is (4000mv / (59.2 * 7))
// 4000mv is max output and 59.2 * 7 is the maximum range (in millivolts) for the ph probe.
#define PH_GAIN 9.6525
 
void setup() {
  Serial.begin(9600);
}
 
void loop() {
  //take a sample of 50 readings
  reading = 0;
  for(i = 1; i < 50; i++){
    reading = analogRead(ph_pin);
    millivolts += ((reading * ARDUINO_VOLTAGE) / 1024);
    delay(10);
   
  }
  //average it out
  millivolts /= i;
  //convert to millivolts. remember for higher accuracy measure your arduino's voltage with a multimeter and change ARDUINO_VOLTAGE
// millivolts = millivolts + 0.02;
 
  ph_value = (millivolts  / 0.4167);
     Serial.print(reading);
    Serial.print("   ");
   Serial.print(millivolts);
  Serial.print("  ");
  Serial.print("pH= ");
  Serial.println(ph_value);
  delay(1000);
}


to po ung code na ginawa q..  nx in advance

Offline maldihtah13

  • *****
  • 4836
  • 156
  • Gender: Female
  • Everyday is a learning process so try to learn ;D
    • Blogspot
Re: help me calibrating my DIY ph meter
« Reply #1 on: January 02, 2012, 06:11:08 PM »
andito naman ang details


Offline dabidxon

  • **
  • 12
  • 0
Re: help me calibrating my DIY ph meter
« Reply #2 on: January 02, 2012, 07:40:34 PM »
naguguluhan po kasi ako meron lang po akong ph4 at ph10 na buffer solutoon d2.

kapag nacalibrate q na po uing sa ph4  then nilipat q sa ph10 again calibrate. then back to ph4 eh iba na po ulit ung reading tuwing kelan ko po ba dapat galawin ung slope and offset?

Offline motion55

  • *****
  • 3169
  • 520
  • Gender: Male
  • Been at this longer than you've been alive.
Re: help me calibrating my DIY ph meter
« Reply #3 on: January 02, 2012, 08:35:04 PM »
1. First adjust the offset so that the errror sa ph4 is opposite that sa ph10.

2. After adjusting the offset, adjust the gain to remove the error at both ends (ph4 and ph10).
"Set your mind free!"

Offline dabidxon

  • **
  • 12
  • 0
Re: help me calibrating my DIY ph meter
« Reply #4 on: January 02, 2012, 08:38:31 PM »
@ motion so kung ang reading ko sa ph4 ay 2.76 at sa ph10 ay 8.87 ung offset muna gagalawin q? o dapat lampas ng 10 ung reading q sa ph 10 na sinasabing mong opposite?

tnx po

Offline motion55

  • *****
  • 3169
  • 520
  • Gender: Male
  • Been at this longer than you've been alive.
Re: help me calibrating my DIY ph meter
« Reply #5 on: January 03, 2012, 06:02:17 AM »
Kung ang original reading sa ph4 = 2.76 and ph10 = 8.87, then adjust the offset so that ph4 = 2.76+1.18 = 3.94 and ph10 = 8.87+1.18 = 10.05.  Bale the offset needs to be upwards by 1.18. Take note that it's almost close to the nominal readings. Unless you have a precision multi-turn trimmer potentiometer, mahirap exactuhin sa 4 and 10 values. Pwede gawin sa software ito BTW.
"Set your mind free!"

Offline motion55

  • *****
  • 3169
  • 520
  • Gender: Male
  • Been at this longer than you've been alive.
Re: help me calibrating my DIY ph meter
« Reply #6 on: January 03, 2012, 09:46:24 AM »
Quote
o dapat lampas ng 10 ung reading q sa ph 10 na sinasabing mong opposite?

You are right. What I mean by opposite is kung kulang on one end, dapat lagpas sa kabilang calibration point by an equal amount.

After adjusting the offset, then the gain adjustment will simultaneously close the errors on both ends.

Kaunting Algebra lang yan, para maintindihan.
"Set your mind free!"