problem interfacing the pH probe using TL072 op amp for amplification.

Hey guys. I have been working on a water quality monitoring system using arduino. But i have not been able to get a proper output from the pH sensor even after using an amplifier circuit using the TLO72 which has been repeatedly suggested on the internet.

I have made the circuit given in this site: arduino ph probe interface - Sparky's Widgets

I have changed the resistor values a little but made sure the gains are almost similar based on this.

I came across some places where they suggested i use a map function for this. But I m not sure how to.

Please correct me where I have gone wrong.

I ve included the code used for this here:

const int analogInPin = A2; //from amplifier circuit.
float avgValue;
float buf[10],temp;
void setup() {
Serial.begin(9600);
}

void loop() {
for(int i=0;i<10;i++)
{
buf*=analogRead(analogInPin);*
_ Serial.print(buf*); // to get a glimpse of what values i m reading._
_
Serial.print(" ");*_

* delay(10);*
}
for(int i=0;i<9;i++)
{
* for(int j=i+1;j<10;j++)*
* {*
_ if(buf*>buf[j])
{
temp=buf;
buf=buf[j];
buf[j]=temp;
}
}
}
avgValue=0;
for(int i=2;i<8;i++)_

_avgValue+=buf;
avgValue/=6;
Serial.print(" pHVol=");_

_float pHVol=avgValue5.0/1024; // ADC_

Serial.print(pHVol);
float phValue = -5.7 * pHVol+21.34; // pHVol to pH conversion. please correct this too if i am wrong.
Serial.print(" pH = ");
Serial.println(phValue);

delay(1000);
}


pHtl072.ino (849 Bytes)

Please use code tags for posting code.
Please post your circuit diagram. Or you really have a dual power supply? They're rare. Even so you'd end up with negative output values, and that's an issue in itself..
pH amplifiers on breadboards won't work well. At the very least you have to solder them on perfboard or stripboard, but for stable results you need a PCB.

pH probes need ultra high impedance amplifiers, not a TL072 which has too much bias current (0.2nA is
very high for a pH sensor).

pH probes have a layer of glass acting as part of the circuit, with a resistance around 10^9 ohms. So any
input current to the opamp will have a large effect on the measurement. This means only MOSFET
input opamps are usable.