PH and TDS Sensor together

Hello Guys
I am using a pH sensor and TDS sensor for my water quality monitoring project. The sensor individually are working perfect and giving correct values for pure water, but when I put them in the same water sample the ph sensor rise to 12pH (given that pure water pH is 7) and sometimes both readings change to wrong readings. I heard about using an analog isolator for this issue but I don't know how we can it should be designed to connect the sensors to it.
The data sheet for pH sensor I am using is here
[pH Sensor Data Sheet (ti.com)]
and the datasheet for the tds sensor is here
Gravity__Analog_TDS_Sensor___Meter_For_Arduino_SKU__SEN0244-DFRobot

And here is the code I am using to test both sensors:

float ph;
float SensorValue, pHvsum = 0, pHvavg = 0;
float pHVoltage, Voltage;
int numRead = 15;
void setup() {
  Serial.begin(9600);
  pinMode(A0, INPUT);
  pinMode(A1, INPUT);
}

void loop() {
  for(int i=0; i<numRead; i++){
    SensorValue = analogRead(A0);
    pHVoltage = SensorValue * (5.0/1023.0);
    pHvsum = pHvsum + pHVoltage;
  }
  pHvavg = pHvsum/numRead;
  pHvsum = 0;
  ph = -5.9613*pHvavg + 22.245;
  sensorValue = analogRead(A1);
  Voltage = sensorValue*5/1024.0; //Convert analog reading to Voltage
  tdsValue=(133.42/Voltage*Voltage*Voltage - 255.86*Voltage*Voltage + 857.39*Voltage)*0.5; //Convert voltage value to TDS value
  Serial.print(ph);
  Serial.print(" | ");
  Serial.println(tds);
  delay(2000);
}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.