Go Down

Topic: Help with Ph sensor pin abbreviations (Read 66541 times) previous topic - next topic

rgonzo2

Can I get a step by step how to hook this sensor up, Mine does not seem to work. I tried adjusting the voltage and it doesn't move from 2.46v.

Revolverduino

@rgonzo2: Hook your voltmeter "V+" to module "V+" and "V-" to "Po" on the module. Adjust with the pot near the BNC connector.

JoseAngelRet

Hi there,


I bought a ph & temperature shield (E-201-C) from lei-ci.com,  for arduino from china and i couldn't find the schematic online.
The leads coming out have the following symbols: T2, T1, Po, Gnd, Gnd, Vcc
What do they stand for?
I Need help to conect to Mega 2560 or Uno r3 shield.
Tal for help.

Compre un sensor de PH y temperatura con placa E-201-C desde lei-ci.com.
No puedo encontrar el esquema el├ęctrico de la placa que tiene 6 pines en el lateral.
necesito ayuda para poder conectar a placa Mega 2560 o UNO R3.

MUCHAS GRACIAS

LeCyb

#18
Jul 26, 2016, 02:17 am Last Edit: Jul 26, 2016, 02:23 am by LeCyb
@JoseAngelRet: Scroll to the description here http://www.mini-kossel.com/Arduino-PH-Board

dlkjfoajwpoijmxlkmw

@LeCyb
Great info. But, I found that I get one value with the BNC shorted and a different value with a probe in 7.0 solution. In short I just measured my raw input in 7.0 solution and then the raw input in a 4.01 solution and mapped the outputs..
Yes, it's a linear map not log, but that should be close enough for me.

765 and 665 are the analog reads in 4.01 and 7.01 solutions.

Code: [Select]


void loop() {
     float mappedv = mapfloat(analogRead(0), 765, 665, 4.01, 7.01);   // Map the '0 to 1023' result to '0 to 14'.
     Serial.println(mappedv);
     delay(100);
}

float mapfloat(long x, long in_min, long in_max, long out_min, long out_max){
 return (float)(x - in_min) * (out_max - out_min) / (float)(in_max - in_min) + out_min;
}



suja

int ph_pin = A7; //This is the pin number connected to Po

void setup() {
  Serial.begin(9600);
}

void loop() {
  int measure = analogRead(ph_pin);
  Serial.print("Measure: ");
  Serial.print(measure);

  double voltage = 5 / 1024.0 * measure; //classic digital to voltage conversion
  Serial.print("\tVoltage: ");
  Serial.print(voltage, 3);

  // PH_step = (voltage@PH7 - voltage@PH4) / (PH7 - PH4)
  // PH_probe = PH7 - ((voltage@PH7 - voltage@probe) / PH_step)
  float Po = 7 + ((2.5 - voltage) / 0.18);
  Serial.print("\tPH: ");
  Serial.print(Po, 3);

  Serial.println("");
  delay(2000);
}


Using this code, i m not getting results
pH 20, etc is shown in serial monitor

Pipo927

Hello guys,
Im using the Logo_PHsensor V1.1, for a final project on my university
Im having a problem, i have a box full of water and i'm trying to produce a solution to use on a hidroponic system buti have a ph probe and 2 pins conected to arduito to read de EC of the solution inside the box.
My problem is, everytime i have EC reader and the Ph probe inside the water, im getting a value of PH higher and higher along the time. IF i took the EC reader of the box, it get a value completly diferent and stable.
Any help?

zoomx

You can't measure EC and pH at the same time in small water because the EC probe insert some small current that affect pH measurement. You have to turn EC off while taking pH measurement. Maybe you can put the two probes away from each other.


nasir955

hello guys, can i get some help from you? i'm doing project ph control system, by using ph probe. this is my coding
/*
 # This sample code is used to test the pH meter V1.0.
 # Editor : YouYou
 # Ver    : 1.0
 # Product: analog pH meter
 # SKU    : SEN0161
*/
#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);
  pinMode(8,OUTPUT);
  pinMode(7,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();
  }
   if(pHValue >= 7.00)
{
digitalWrite(7,HIGH);
}
if (pHValue <= 5.50)
{
digitalWrite(8,HIGH);
}
else
{
  digitalWrite(7,LOW);
  digitalWrite(8,LOW);
}
}
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;
    }
    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<min){
        amount+=min;        //arr<min
        min=arr;
      }else {
        if(arr>max){
          amount+=max;    //arr>max
          max=arr;
        }else{
          amount+=arr; //min<=arr<=max
        }
      }//if
    }//for
    avg = (double)amount/(number-2);
  }//if
  return avg;
}"
and my problem is, the output pin 7 only produce 1.5v, which cannot control the relay 5v...
can anyone help me with it? i want that the output 7 is 5v, which can control relay...

zoomx

It seems an hardware problem or you have a pH value that oscillate around 7.
In the latter case put a delay of about one second at the end of the loop and check again.

alchafocus

hello guys, from @LeCyb code, how should i code in order to add a second PH_step variables ? i have add the first which is the 4.01 and i want to add the 9.16. I need to measure from 4 to around 8 of PH. Thankyou ;)

porlock

You should notice that there is only approx. 2V for all 0-14 PH scale, that is not very accurate, voltage distortion about 10mV can change the overall PH value about 0,1PH

So .. main question it is possible to increase the phmeter voltage output range to 0-5V

Nemus

hy
im using this Logo_PHsensor v1.1 for my project but want to interface with PIC16f4550 can any1 help me out how do l do that im writting my code in microC

normen

The code from LeCyb works great, thanks a lot! Calibration values for me were almost the same, using 17 for the step divider and 2.62 for the pH7 value gives me very accurate readings.

However the variation within the data is too big to only use single data measurements. I added a rolling average to get a proper and relatively static reading:

Code: [Select]

float water_ph = 7; // variable to store average pH
float N = 20; // do average over x measurements

// exponentially weighted moving averge
double approxRollingAverage(double avg, double new_sample) {
    avg -= avg / N;
    avg += new_sample / N;
    return avg;
}

void loop(){
  //.... get Po like in normal code

  water_ph = approxRollingAverage(water_ph, Po);
}

JohnTaylor

Hi all,

Thank you for creating this topic with so much useful information. This is the only detailed explanations for the "Logo_PHsensor v1.1" board I have found in English on the web. Thanks a lot, especially to LeCyb. Now, I know why the red LED turns on and off when I turn the pot by the pins!

That being said, I'm struggling getting my board working. When I apply 5V between V+ and G, the green LED turns on so that's good. Now, when I measure the voltage between Po and the second pin G and change the resistance of the pot by the BNC connector, I always measure 1.85V (+/- 0.04V) no matter what is connected to the BNC connector (a short, open circuit or the black pH probe). The symptom seems to be very similar to the one from rgonzo2, except the difference in voltage.

Does that mean that the board is not working correctly?

Thanks,

John

Go Up