Arduino Forum

Using Arduino => Sensors => Topic started by: kwoods on Jul 14, 2015, 11:03 pm

Title: Help with Ph sensor pin abbreviations
Post by: kwoods on Jul 14, 2015, 11:03 pm
Hi,

I bought a ph shield for arduino from china and i couldn't find the schematic online. The leads coming out have the following symbols. What do they stand for? I know the second G is ground and v+ is 5 volts. Not sure what the others stand for. Thanks
 
"To" - "Do" - "Po" - "G" - "G" - "V+"
Title: Re: Help with Ph sensor pin abbreviations
Post by: marco_c on Jul 15, 2015, 12:38 am
If the sensor module has an IC on it, look at the datasheet for the IC and try and trace the signals from the IC to the connector. There is usually a direct link, and the IC datasheet will have a full explanation of the signals. If you are lucky they have just called them the same thing.

It also helps if you can include a picture or a part number for the thing you are asking about.
Title: Re: Help with Ph sensor pin abbreviations
Post by: kwoods on Jul 15, 2015, 03:38 am
Here is a picture (http://image.dhgate.com/albu_786993321_00/1.0x0.jpg)
Title: Re: Help with Ph sensor pin abbreviations
Post by: DrDiettrich on Jul 15, 2015, 02:44 pm
Please try to decipher the IC IDs yourself, they are unreadable on the photo.

I'd guess that "o" means output, T might stand for temperature, P for Ph.
Title: Re: Help with Ph sensor pin abbreviations
Post by: kaz1366 on Sep 12, 2015, 01:07 am
hello kwood:

As you also buy the same ph sensor module, have spent much time searching the Internet and connect to Arduino without much luck, I managed to locate the manual for this module but the Chinese language, all you have achieved is what econtrar referred to pin:
To temperature 1
Sun: Temperature 2
Po: PH
G: ground data
G: negative or ground voltage
V +: voltage or 5V

It can be connected to analog signal card, will try to SKU #: sen0161 to see if it works I'll be posting more information to be my breakthrough.

Best Regards
Title: Re: Help with Ph sensor pin abbreviations
Post by: sonnyyu on Oct 03, 2015, 02:48 am
(http://i.imgur.com/bvEXXqF.png)

Vph-=Vzener/2

p_AOUT is output of PH. connect digital multimeter to confirm.



The diagram of board.


Title: Re: Help with Ph sensor pin abbreviations
Post by: ayafsay on Oct 20, 2015, 07:14 am
same here, i can't using that module to arduino,
Title: Re: Help with Ph sensor pin abbreviations
Post by: ayafsay on Oct 21, 2015, 08:41 am
hi, i found solution, Po is ADC output for interfacing to analog input arduino, but the problem is went PH water is low ADC output from Po is high value, and wen PH water is high ADC output from Po is low, how to reverse this in float code?
Title: Re: Help with Ph sensor pin abbreviations
Post by: OldSteve on Oct 22, 2015, 09:57 am
Do you mean this:-
Code: [Select]
// pHRead.ino

// Constants:-
const byte pHpin = A0;    // Connect the sensor's Po output to analogue pin 0.

// Variables:-
float Po;

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

void loop()
{
    Po = 1023 - analogRead(pHpin);  // Read and reverse the analogue input value from the pH sensor.
    Po = map(Po, 0, 1023, 0, 14);   // Map the '0 to 1023' result to '0 to 14'.
    Serial.println(Po);             // Print the result in the serial monitor.
    delay(1000);                    // Take 1 reading per second.
}

Reverses the analog pin input reading from '1023 to 0' to '0 to 1023', maps it between 0 and 14, then prints it to the serial monitor.
An input of 511 is neutral and will return 7.

Edit: I should add that when writing this I was assuming that the range of the pH sensor is 14. I'm fairly sure that's right.
(And I made a silly mistake at first, but all fixed now. :) )
Title: Re: Help with Ph sensor pin abbreviations
Post by: ayafsay on Oct 23, 2015, 02:21 pm
Do you mean this:-
Code: [Select]
// pHRead.ino

// Constants:-
const byte pHpin = A0;    // Connect the sensor's Po output to analogue pin 0.

// Variables:-
float Po;

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

void loop()
{
    Po = 1023 - analogRead(pHpin);  // Read and reverse the analogue input value from the pH sensor.
    Po = map(Po, 0, 1023, 0, 14);   // Map the '0 to 1023' result to '0 to 14'.
    Serial.println(Po);             // Print the result in the serial monitor.
    delay(1000);                    // Take 1 reading per second.
}

Reverses the analog pin input reading from '1023 to 0' to '0 to 1023', maps it between 0 and 14, then prints it to the serial monitor.
An input of 511 is neutral and will return 7.

Edit: I should add that when writing this I was assuming that the range of the pH sensor is 14. I'm fairly sure that's right.
(And I made a silly mistake at first, but all fixed now. :) )
Thank you sir very much, i'll try now...
Title: Re: Help with Ph sensor pin abbreviations
Post by: ayafsay on Oct 23, 2015, 04:14 pm
i got problem, went analog read 450-476-480, ph is just got 7.00
Title: Re: Help with Ph sensor pin abbreviations
Post by: OldSteve on Oct 23, 2015, 06:07 pm
i got problem, went analog read 450-476-480, ph is just got 7.00
Sorry about that. I just realised that 'map()' will not generate fractions. I only tested inputs of 0, 1023 and 511, so it looked OK.

Instead, try this:-
Code: [Select]
// pHRead.ino

// Constants:-
const byte pHpin = A0;    // Connect the sensor's Po output to analogue pin 0.

// Variables:-
float Po;

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

void loop()
{
    Po = (1023 - analogRead(pHpin)) / 73.07;   // Read and reverse the analogue input value from the pH sensor then scale 0-14.
    Serial.println(Po, 2);                    // Print the result in the serial monitor.
    delay(1000);                              // Take 1 reading per second.
}
Title: Re: Help with Ph sensor pin abbreviations
Post by: ayafsay on Oct 26, 2015, 03:57 am
Thank again @OLDStave, i'll try now...
Title: Re: Help with Ph sensor pin abbreviations
Post by: OldSteve on Oct 26, 2015, 04:05 am
Thank again @OLDStave, i'll try now...
Glad to help. Let me know how you go. This version should be much better.

And now if I ever get one of those pH modules, I'll know how to use it. :D
Title: Re: Help with Ph sensor pin abbreviations
Post by: LeCyb on Mar 02, 2016, 07:59 pm
Hi all,

First of all, I'm only speaking about the board labelled "www.auto-crtl.com" and "Logo_PHsensor v1.1". The one with only 6 pins in front of the BNC plug (not on the side) as you can see in image Pinout1.jpg.

I also bought this little board from China and it is difficult to make it working. Most topics are related to other boards (Atlas, Sparkfun, Sparky's Widgets, etc.) and nothing is working. And when the subject is speaking about the correct card, the information is incorrect or computation are made with random numbers coming from the sky.

Some words are in italic to avoid "experts" saying it's incorrect (because it is incorrect) but for our small projects and for understanding I intentionaly use those "simple" terms.

General info about pH to know

The pH is a value between 0 (acid) and 14 (basic) with a neutral value of 7.

The curve (log10) of the pH is a mix between linear and exponential as you can see in pH_curve.png. It means that you can almost measure a linear value between 4 and 9 pH. Less than 2 and more than 12 is almost impossible to determine something (too acid or too basic).

The probe is like a (tiny) battery when placed in a liquid. Depending the pH it output a positive or negative voltage of a couple of millivolts. This value is too small and other tech stuff like impedance make it unusable directly with an Arduino that's why you need an "op amp". The op amp board just convert the millivolts of the probe into to something acceptable for Arduino (positive between 0 and 5v).

There are 3 common buffer solutions used for pH measurement: pH 4.01, pH 6.86 and pH 9.18 (7.0 and 10.0 exists). I suggest the powder instead the liquid because it's cheaper, expire after longer and the powder can't be contamined (vs bottle). You should read the product instructions but usually you have to put the content of the bag into 250ml of water and stir. You can use any water with an average pH (6-8) because the powder will saturate the water at the correct pH level. I personnaly use tap water (pH 7.4) and didn't see any difference between distilled, osmosed and demineralized water. Buffers are not stable in the time, this means that you cannot keep the solution for weeks or months.

Board description


"Calibration"

A single word for many things because in our case there are 2 different calibrations. The "offset" value and the "step" value.


That's all, now you can use it with the code below.


The code

The PH_step calculation is quite simple. You take the difference between the two known voltage, in my example 2.5v@pH7 and 3.05v@pH4.01 which is -0.55v. It's the voltage range equivalent of the pH range from 7 to 4.01, which is 2.99 pH units. A small division of the voltage by pH units gives you a volts per pH number (0,1839... in my case).

The PH_probe is calculated by taking the known pH 7 voltage (2.5v) where we add some PH_step to match the probe voltage. This means that a pH of 8 have a voltage value of 2.5v (pH 7) + 0.1839 (1 unit/step); pH 9 then is 2.5v + 0.1839 + 0.1839 = 2.87v.

No magic number, no ridiculous stuff, just maths :).

If you need under and over pH 7, I suggest you have two PH_step variables. One for the lower part (use buffer 4.01) and another for the upper part (use buffer 9.16). The probe is almost linear but far from perfect and you can have a side more linear than the other.

Code: [Select]

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);
}



pH limit (Do pin)
You can adjust the pot close to the pins to adapt a pH limit. If the limit is reached, a red led on the board (near the green one) switch on/off and the Do pin pass from 3.65v to 0.77v. This can be used as HIGH or LOW values with the digitalRead() function or any other interrupt.


Temperature
The To pin should do something about temperature but I'm not mastering LM358 op amp stuff. The thermistor should adjust the pH value but didn't notice any remarkable change (liquid = 20°C, thermistor = 50°C). Anyway, at normal (18-25°C) temperature there is no pH difference with temperature compensation for a hobby purpose. For a simple aquarium you need pH between 6.5 and 7.5, then a measure variation of 0.1 or 0.2 is fine.

Title: Re: Help with Ph sensor pin abbreviations
Post by: rgonzo2 on Apr 12, 2016, 12:10 pm
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.
Title: Re: Help with Ph sensor pin abbreviations
Post by: Revolverduino on May 18, 2016, 04:42 pm
@rgonzo2: Hook your voltmeter "V+" to module "V+" and "V-" to "Po" on the module. Adjust with the pot near the BNC connector.
Title: Help with Ph &temperature sensor E-201-C pin abbreviations
Post by: JoseAngelRet on May 18, 2016, 09:20 pm
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
Title: Re: Help with Ph sensor pin abbreviations
Post by: LeCyb on Jul 26, 2016, 02:17 am
@JoseAngelRet: Scroll to the description here http://www.mini-kossel.com/Arduino-PH-Board (http://www.mini-kossel.com/Arduino-PH-Board)
Title: Re: Help with Ph sensor pin abbreviations
Post by: dlkjfoajwpoijmxlkmw on Sep 17, 2016, 09:50 pm
@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;
}


Title: Re: Help with Ph sensor pin abbreviations
Post by: suja on Nov 03, 2016, 03:21 pm
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
Title: Re: Help with Ph sensor pin abbreviations
Post by: Pipo927 on Nov 10, 2016, 04:30 pm
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?
Title: Re: Help with Ph sensor pin abbreviations
Post by: zoomx on Nov 11, 2016, 10:55 am
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.

Title: Re: Help with Ph sensor pin abbreviations
Post by: nasir955 on Dec 03, 2016, 07:48 am
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...
Title: Re: Help with Ph sensor pin abbreviations
Post by: zoomx on Dec 03, 2016, 10:53 am
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.
Title: Re: Help with Ph sensor pin abbreviations
Post by: alchafocus on Dec 05, 2016, 08:30 pm
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 ;)
Title: Re: Help with Ph sensor pin abbreviations
Post by: porlock on Dec 17, 2016, 12:00 pm
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
Title: Re: Help with Ph sensor pin abbreviations
Post by: Nemus on Apr 26, 2017, 04:51 pm
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
Title: Re: Help with Ph sensor pin abbreviations
Post by: normen on Jun 25, 2017, 12:52 pm
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);
}
Title: Re: Help with Ph sensor pin abbreviations
Post by: JohnTaylor on Jul 29, 2017, 05:28 pm
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
Title: Re: Help with Ph sensor pin abbreviations
Post by: JoeRedfish on Jul 30, 2017, 12:15 pm
Hi and thank you all,

yes and I think:

The 'To' Pin is the output for compensated reference.

Just sample this and subtract 'To' from 'Po'.

512 as subtractor is not correct.

Then map between -7 and +7

Add 7 only for printing (0-14).

For the LOG (pH<4 or >9) I must get a better solution for me.

My own pH module is shipped at the moment.

Hmmm.

Thanks Joe
Title: Re: Help with Ph sensor pin abbreviations
Post by: hamzafaiz123456789 on Aug 16, 2017, 12:58 pm
any one ! kindly i need to buy PH sensor and its probe ( all the things related to that)  to connect it with Arduino and get PH value .


Kindly send me link from where to buy ? help me its urgent . i am from Pakistan any chinees site will be my priority as shipping takes less time .
Title: Re: Help with Ph sensor pin abbreviations
Post by: wvmarle on Aug 16, 2017, 02:41 pm
Start with the usual suspects: Aliexpress and Taobao. I get most of my stuff off Taobao (but if you don't know Chinese or someone that does, better try Aliexpress instead).
Title: Re: Help with Ph sensor pin abbreviations
Post by: tigger on Aug 21, 2017, 06:40 pm
Or you could start with a pH probe on its own and a good FET op amp, dual preferably. Op amp needs to have very low bias current. Have a look at MAX407, an old amp, but good. Maxim do a nice application note that covers pH. Use one op amp to do the buffering and the other to do the gain.
Get the amp as close to the probe as possible.
From memory, each pH unit produces an output of 60-mV, temperature dependent. Output is zero at pH 7, then either + 60-mV per pH unit, or - 60-mV depending on acidity or alkalinity. With a single-sided supply (I used 3.7-V lithium) you need to offset the first amp by a simple voltage divider.
You can do the temperature compensation in software or hardware using a temperature sensor.
By getting the probe as close as possible (some probes have the amp in the cap of the probe), you do away with all the complexities of coax and can run the output down some old Black and Decker cable, so useful for remote applications.
A half AA Lithium cell could outlast the probe lifetime (draws 2.4uA) and running on a battery does away with earth loop problems.
Use the same approach for any high impedance source, including other specific ion electrodes (nitrates, fluoride etc.) as a pH probe is another specific ion electrode, specific for hydrogen ion.
Title: Re: Help with Ph sensor pin abbreviations
Post by: irfan_jamil1994 on Nov 22, 2017, 06:33 pm
hello i have also this ph sensor.
please guide me how much pins of pH sensor will connect with Arduino and what's the basic Arduino code to test the pH sensor. please guide me Thanks

Title: Re: Help with Ph sensor pin abbreviations
Post by: daph on Nov 28, 2017, 03:57 pm
Hi,

I am using this same shield to read from my pH sensor but this is the output I am getting ⸮⸮b⸮⸮b⸮⸮Q⸮⸮Q⸮⸮k on my serial monitor.

My code is:

#define pHsensorpin A0;
float pH;

void setup() {

Serial.begin(15 000);
}

void loop() {

pH= analogRead(pHsensorpin);
Serial.print(pH);
delay(10000);
}

Any idea how to get an actual value of pH out?

Any help would be much appreciated, thank you so much!
Title: Re: Help with Ph sensor pin abbreviations
Post by: wvmarle on Nov 28, 2017, 05:04 pm
Code: [Select]

Serial.begin(15 000);

Are you sure this is your code? It won't even compile like this.

Set it to a regular value, and make sure you serial monitor is set to the same speed.

Any idea how to get an actual value of pH out?
Do read the rest of this thread.
Title: Re: Help with Ph sensor pin abbreviations
Post by: DrJarold on Nov 30, 2017, 08:45 pm
Hey. I have such a module. https://www.ebay.com/itm/Liquid-PH-Value-Detection-Detect-Sensor-Module-Monitoring-Control-For-Arduino-M/172050771139?_trkparms=aid%3D111001%26algo%3DREC.SEED%26ao%3D1%26asc%3D20160727114228%26meid%3Dec72a798cb41436da9476c292f0887ce%26pid%3D100290%26rk%3D1%26rkt%3D1%26sd%3D172050771139&_trksid=p2060778.c100290.m3507

And I can not put on it 2.5V with a closed BNC connector. The minimum voltage I can set "Measure: 539   Voltage: 2.63"
Code: [Select]

#include "Arduino.h"

int ph_pin = A0; //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);
  Serial.println("");
  delay(2000);
}

What am I doing wrong?
Title: Re: Help with Ph sensor pin abbreviations
Post by: wvmarle on Dec 01, 2017, 03:54 am
What do you mean with "closed BNC connector"?

What's wrong with that voltage? IIRC the output has unity gain only, so about 58 mV per pH point. You won't run off scale. Just do a calibration with your probe, and you should be good to go.
Title: Re: Help with Ph sensor pin abbreviations
Post by: DrJarold on Dec 01, 2017, 09:43 am
What do you mean with "closed BNC connector"?
https://www.botshop.co.za/wp-content/uploads/2017/09/ph-sensor-short-circuit.jpg

https://www.botshop.co.za/how-to-use-a-ph-probe-and-sensor/
In this article it is said that when closing the contact for Ph 7 should be 2.5V I can not install so much.
Min value:
Measure: 538 Voltage: 2.627
Max value
Measure: 844 Voltage: 4.121
Title: Re: Help with Ph sensor pin abbreviations
Post by: zoomx on Dec 02, 2017, 12:32 pm
What do you mean with "closed BNC connector"?
He mean a short circuit between the two BNC contacts.
@DrJarold
measuring voltage using Arduino is not very accurate. It's better to use a multimeter as written in the article or improve Avrduino measurements powering it from the connector instead of USB from PC since the latter is noisy and usually below 5V.

Title: Re: Help with Ph sensor pin abbreviations
Post by: LukaszM on Jan 10, 2018, 02:02 pm
Hey. I have such a module. https://www.ebay.com/itm/Liquid-PH-Value-Detection-Detect-Sensor-Module-Monitoring-Control-For-Arduino-M/172050771139?_trkparms=aid%3D111001%26algo%3DREC.SEED%26ao%3D1%26asc%3D20160727114228%26meid%3Dec72a798cb41436da9476c292f0887ce%26pid%3D100290%26rk%3D1%26rkt%3D1%26sd%3D172050771139&_trksid=p2060778.c100290.m3507

And I can not put on it 2.5V with a closed BNC connector. The minimum voltage I can set "Measure: 539   Voltage: 2.63"
Code: [Select]

#include "Arduino.h"

int ph_pin = A0; //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);
  Serial.println("");
  delay(2000);
}

What am I doing wrong?
in my opinion there is an error in this script. I think that it should be
 double voltage =  measure*5 / 1024.0
instead of
double voltage = 5 / 1024.0 * measure;

multiplication is before dividing.
Ph measurement is easy it's simple linear between 4 and 7 so all we need to do is resoleve set of equations during callibration with two known solutions lets say  ph1=4.01 and ph2=7.0
   r1=analog Read At ph1
   r2=analog Read At ph2

first equation:      ph1=A*r1+B
second equation:  ph2=A*r2+B

and solution of this set of equation is
A=(ph2-ph1)/(r2-r1)
B=ph1-A*r1
 after this measured pH is
pH=A*analogRead+B

and you can use directly analogRead from Arduino software or recalculate it to voltage if you want but it's not necesery. Recalculation to voltage as I wrote before: voltage= AnalogRead*5.0 / 1024
It's important to use an average value of few analogRead values to those equations (for analogRead or voltage recalculation)

Title: Re: Help with Ph sensor pin abbreviations
Post by: wvmarle on Jan 10, 2018, 03:00 pm
double voltage =  measure*5 / 1024.0
instead of
double voltage = 5 / 1024.0 * measure;
Those two formulas give the same result.
Title: Re: Help with Ph sensor pin abbreviations
Post by: LukaszM on Jan 11, 2018, 12:25 am
Those two formulas give the same result.
Yes You are right, Sorry my mistake
Title: Re: Help with Ph sensor pin abbreviations
Post by: Coos on Jan 24, 2018, 09:14 pm
Hi All, I've got the same Ph module, and found this thread very useful!
Special thanks to LeCyb and normen!

I've got one problem though:
When I measure my aquariumwater in the tank the ph goes all over the place, from ph4 to ph8...
When I measure the same water in a cup, I'm getting a steady reading.

So something is interfering I guess...
Anyone got an idea of how to approach and solve this problem?
Title: Re: Help with Ph sensor pin abbreviations
Post by: porlock on Jan 24, 2018, 09:35 pm
ground the water in aquarium, electrical pumps and heaters can cause this.
Title: Re: Help with Ph sensor pin abbreviations
Post by: Coos on Jan 24, 2018, 09:43 pm
Do you know a simple way to do this?
Title: Re: Help with Ph sensor pin abbreviations
Post by: porlock on Jan 24, 2018, 10:22 pm
Use a titan (for salt water) on staines steel pipe, attach a ground wire to it ant connect to wall socket ground, i do it this way.

You can also find a plug and play solutions like for example this one

https://www.amazon.com/RV2735-Rid-Volt-Titanium-Grounding-Probe/dp/B0002DGSWE
Title: Re: Help with Ph sensor pin abbreviations
Post by: tigger on Jan 24, 2018, 10:59 pm
If you ran your amplifier on an isolated supply like a battery, you might get rid of problems caused by ground loops. Measuring pH is simple if you follow the rules. The electrode is a high (very) impedance source and doesn't like things like long cable runs or even being touched. You need a FET, very low bias op amp close as possible to the electrode to buffer the electrode output from high to low impedance. Look up Maxim MAX406 datasheet for an example of how to do it. You can run an op amp circuit on a 3-volt battery for at least 10 years.
One of the problems is down to the practice of supply utilities using a system called PME or Protective Multiple Earthing, where the Neutral is earthed and no earth is supplied to the property. You buy a two pin PSU (no earth) and it is connected to earth via the neutral, hence the possibility of a ground loop. In industrial situations, ground loop problems with pH are a pain and the only answer sometimes is to go for the isolated supply.
Title: Re: Help with Ph sensor pin abbreviations
Post by: agatho on Feb 06, 2018, 07:26 pm
Help me, i tried the program on page 1, i have done calibration, by short the BNC pin, and getting 2.6 v
1. after that I tried with a solution of 6.89 and can not produce 6.89 but lebh of it smpai value 7.3
2. then when trying 4.01, the resulting value is more than that 4.8

What makes me confused when the BNC probe on boar I hold, the results obtained even precision, when released value will be chaotic, what happens from my board?

I connect directly
Pin VCC to 5volt arduino mega
Pin G to Ground arduino mega
Pin P0 to A0 arduino mega

please help me, thanks
Title: Re: Help with Ph sensor pin abbreviations
Post by: wvmarle on Feb 07, 2018, 04:10 am
Apparently you missed the part of calibration where you adjust the slope and offset in your software to match the sensor's response.
Title: Re: Help with Ph sensor pin abbreviations
Post by: JohnTaylor on Feb 10, 2018, 06:14 pm
Hi all,

I think this thread is really great because it is the sole source of information on this pH sensor board. Thank you so much for contributing to it and providing so many useful details.

I'm posting here because I'm encountering an issue with the first step of the calibration. The pins are connected as follow:
- V+ to 5V
- G to the ground of the my power source and the COM port of my multimeter
- Po to the V port of my multimeter
- Do and To to nothing
In addition, I used a wire to shorten the BNC connector.

When I adjust the potentiometer by the BNC connector, nothing happens on my multimeter which continuously reads 1.88V. If I remove the wire used to shorten the BNC connector, the voltage remains the same.

Does that mean that my board is defective/broken?
Title: Re: Help with Ph sensor pin abbreviations
Post by: CrassHoppr on Apr 08, 2018, 02:19 am
Hi All, I've got the same Ph module, and found this thread very useful!
Special thanks to LeCyb and normen!

I've got one problem though:
When I measure my aquariumwater in the tank the ph goes all over the place, from ph4 to ph8...
When I measure the same water in a cup, I'm getting a steady reading.

So something is interfering I guess...
Anyone got an idea of how to approach and solve this problem?
Same problem here..  As soon as I put it in the voltage goes crazy with random values, but I can take a cup of the same water and it is fine.  like porlock I assumed this must be some piece of equipment causing it so I unplugged everything and it is still occurring.  I also notice as soon as the probe goes in the aquarium the red limit LED on the board comes on and stays on. 

Did you ever solve this issue?  I wonder if my issue can be solved by a grounding probe if it still occurs when no equipment is connected?
Title: Re: Help with Ph sensor pin abbreviations
Post by: wvmarle on Apr 08, 2018, 05:46 am
Sounds like you're having ground loop issues. Can be very hard to solve.
Title: Re: Help with Ph sensor pin abbreviations
Post by: CrassHoppr on Apr 16, 2018, 05:40 pm
Sounds like you're having ground loop issues. Can be very hard to solve.
Yes I think you are correct.  I did some testing and powered my board from a battery and while the voltage swings were higher than I liked they were no longer wildly fluctuating. 

From my research it looks like I can either try to isolate the ph probe or isolate the entire circuit.  I found some dc/dc isolated converters like this (https://ca.mouser.com/datasheet/2/670/pcn2-s-1311944.pdf) that look like they should work.  This will mean another pcb revision which is annoying, unless anyone knows of a 5v wall adapter that has an isolated converter in it?
Title: Re: Help with Ph sensor pin abbreviations
Post by: wvmarle on Apr 16, 2018, 06:57 pm
For your wall adapter: any with a transformer in it should give you full isolation.

Mind that ground loops are generally within your circuit, so through other sensors in the water (such as EC probes or temperature probes).
Title: Re: Help with Ph sensor pin abbreviations
Post by: DR2727 on Apr 22, 2018, 02:54 am
Hey guys,
Has anyone encountered an issue where the pH value keeps climbing on its own (given like a 2 min. span) and won't keep stable?
I have my probe sitting in factory calibrated 7.0 pH solution, so I know that it's not a solution issue.
Any help/advice would be great!

Here's my sketch as it is:

Code: [Select]

/* 7.0 Solution
 *  Measure: 512
 *  Voltage: 2.5
 *  PH: 7.0
 *  
 *  4.1 Solution
 *  Measure: 619
 *  Voltage: 3.02
 *  PH: 4.01
 */

int Po_Pin = A0; //Pin Po on the pH sensor board connects to Arduino pin# A0.
int Do_Pin = 2; //Pin Do on the pH sensor board connects to Arduino pin# 2.

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

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

  double voltage = 5 / 1024.0 * measure; //Digital to Analog 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.173);
  Serial.print("\tPH: ");
  Serial.print(Po, 3);

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

 
Title: Re: Help with Ph sensor pin abbreviations
Post by: wvmarle on Apr 22, 2018, 06:27 am
Most probes take that long or even longer to stabilise.
Title: Re: Help with Ph sensor pin abbreviations
Post by: DR2727 on Apr 22, 2018, 07:08 am
@Mvrale

Thank you very much for the advice.
I let my probe sit for 20 minuets and the readings seemed to stabilize.
Title: Re: Help with Ph sensor pin abbreviations
Post by: Laurencet on Jun 25, 2018, 01:13 pm
Hi All

Just bought an Arduino due that has a maximum input voltage of 3.3v, I thought the 12 bit Dac would be a bonus.
I'm guessing that there is a high chance that I could exceed the 3.3v and blow the Due,
do I need to put a 3.3v voltage regular inline to stop me blowing up the arduino?

 I'm only interested in between PH6 and PH 8


Thanks



Title: Re: Help with Ph sensor pin abbreviations
Post by: wvmarle on Jun 25, 2018, 01:58 pm
Use a voltage divider instead.

Use quality resistors for this - especially with low temperature coefficient (50 ppm or better) or your measurements will be very off when the temperature changes (this doesn't negate the temperature correction on the pH reading itself).
Title: Re: Help with Ph sensor pin abbreviations
Post by: Watcher on Oct 08, 2018, 10:25 pm
Hi all
 Veey interesting thread!

Which probe did you guys use?
There seems to be two types on ebay..a black and a bluish coloured one!
Any comments on those?
Title: Re: Help with Ph sensor pin abbreviations
Post by: wvmarle on Oct 09, 2018, 02:08 am
I got (separately) an "industrial" type probe, which is designed to be in the liquid constantly. Good change the probes you see on eBay are "lab" type probes, those can not remain in the liquid you want to test all the time. Check the description!
Title: Re: Help with Ph sensor pin abbreviations
Post by: Watcher on Oct 09, 2018, 06:24 am
I got (separately) an "industrial" type probe, which is designed to be in the liquid constantly. Good change the probes you see on eBay are "lab" type probes, those can not remain in the liquid you want to test all the time. Check the description!
I didn't see any note (https://www.ebay.co.uk/itm/Blue-Black-PH-Electrode-Probe-Liquid-PH-Value-Detection-Sensor-BNC-Module/322950904241?_trkparms=aid%3D111001%26algo%3DREC.SEED%26ao%3D1%26asc%3D20160908105057%26meid%3D41b602d4fdbd4dd39f11da0281e7ad34%26pid%3D100675%26rk%3D1%26rkt%3D15%26sd%3D142958412590%26itm%3D322950904241&_trksid=p2481888.c100675.m4236&_trkparms=pageci%3Aed5b1d34-cb7a-11e8-a5ec-74dbd1803303%7Cparentrq%3A570fd0ce1660add8e0ccf722ffeda698%7Ciid%3A1) on the description that it is not designed to remain in the liquid all the time.
But yes, I intend to use it to constantly monitor he Ph of my pool water.

Which probe did you buy ?
Title: Re: Help with Ph sensor pin abbreviations
Post by: wvmarle on Oct 09, 2018, 06:39 am
No brand... got an inexpensive one off Taobao.
Title: Re: Help with Ph sensor pin abbreviations
Post by: Watcher on Oct 09, 2018, 06:40 am
No brand... got an inexpensive one off Taobao.
Care to share the link ?
Title: Re: Help with Ph sensor pin abbreviations
Post by: wvmarle on Oct 09, 2018, 06:59 am
https://item.taobao.com/item.htm?spm=a1z0k.6846577.1997989141.5.219937dexP9meN&id=520287697860&_u= (https://item.taobao.com/item.htm?spm=a1z0k.6846577.1997989141.5.219937dexP9meN&id=520287697860&_u=)

This one.
Haven't been able to verify it against calibrated probes but it seems to do the job quite well.

I'm in the process of building my own pH amplifier (designed to amplify in the 0-1V range, instead of the 2-3V range that this pH sensor board does - that way it can be read using the internal reference for much higher resolution and accuracy). When that's done I'll be doing more thorough testing as well.
Title: Re: Help with Ph sensor pin abbreviations
Post by: Watcher on Oct 09, 2018, 08:27 pm
Opps..its all in chinese!

I try to do Google translation  but it didn't work.  I am not even able to complete a purchase!   :smiley-confuse:
Title: Re: Help with Ph sensor pin abbreviations
Post by: wvmarle on Oct 10, 2018, 04:25 am
Yes... that's Taobao. Only Chinese.

They have international shipping methods (I routinely buy from that site - shipping to Hong Kong) but you have to be able to manage the Chinese part. Google Translate helps, for everything else there's the missus :-)

Aliexpress is the international version of Taobao.
Title: Re: Help with Ph sensor pin abbreviations
Post by: Watcher on Oct 10, 2018, 06:40 am
ok thanks!

It looks like I will have to search in Aliepxress instead!

So its possible to find the same seller/ item in Aliexpress?
Title: Re: Help with Ph sensor pin abbreviations
Post by: wvmarle on Oct 10, 2018, 06:55 am
You can almost certainly find the same item from like a dozen sellers on AliExpress - but I don't expect you to find the same seller there. That said, there are many pH probes out there. Quality varies. This one I expect is of the type that gets the job done but won't have too great precision.
Title: Re: Help with Ph sensor pin abbreviations
Post by: Watcher on Oct 10, 2018, 07:50 am
Yes i understand.

In my application, it will be permanently installed on one of the swimming pool's water pipes to monitor the pool Ph on running water. The arduino will  then switch on a peristaltic pump to inject acid when needed.
Title: Re: Help with Ph sensor pin abbreviations
Post by: bjett80 on Oct 27, 2018, 07:45 pm
As was mentioned in a much earlier post, the thermistor output did not appear to be functional.

I just acquired one of these and noticed my temperature (T0) output was always at 3.47 volts, regardless of the thermistor output.

According to the schematic, the final op amp output should be a 2x multiplier using a 20k to 10k voltage divider at the output (pin 7) of the op amp.  This 20k resistor is actually a 51k resistor on my board, making the gain so high that the output is saturated at 3.47.

I was able to make the T0 output work by replacing this 51k resistor with a 20k resistor, giving me a 2.69 volt output on T0 that now changes with temperature.

The resistor in question is  labelled R22 on the schematics and is the smd resistor to the immediate left of the top right eyelet assuming the BNC connector is pointed to the right.

The original poster was from 2016 .... so I'm confused why, if this is a manufacturing error, it is still not fixed in 2018.
Title: Re: Help with Ph sensor pin abbreviations
Post by: crustyourmind on Jan 09, 2019, 08:24 pm
Hi
I 've just buy it ;)
Do you think that the PH electrod can stay all the time in the aquarium ?
Thx ;)
Title: Re: Help with Ph sensor pin abbreviations
Post by: wvmarle on Jan 10, 2019, 02:43 am
The one I linked to? Should be perfectly happy that way. It's actually the type that you have to keep wet at all times.
I've used it for a few months straight at one time, no issues. Removed again due to ongoing experimenting and tinkering.
Title: Re: Help with Ph sensor pin abbreviations
Post by: crustyourmind on Jan 10, 2019, 08:37 am
OK thanx

And finally, the temperature sensor is functional?

Thx and good day ;)
Title: Re: Help with Ph sensor pin abbreviations
Post by: wvmarle on Jan 10, 2019, 09:59 am
And finally, the temperature sensor is functional?
I may assume it is. I've never tried it as it has several issues.
1) parameters of the sensor (a thermistor) are not known, so I have no idea on the actual temperature response.
2) the signal is fed through a cascade of total three(!!) OpAmps.Too hard to figure out that that does to the signal.
3) it's measuring the air temperature rather than the water temperature.

Note that the thermistor circuit is completely independent from the pH circuit, they only share the power supply. For some reason the majority of the components on that board are in fact related to the thermistor. It's overall a quite odd and seemingly overcomplicated circuit.
Title: Re: Help with Ph sensor pin abbreviations
Post by: crustyourmind on Jan 10, 2019, 10:57 am
Thx for your answer
It's too bad that the temp sensor measure the air temperature rather than the water temp

I'll not use it. Therefor , I'll use a small LDC screen with only the PH value...

But in the comments, a buyer seem to have a temp value (the second picture of this link https://fr.aliexpress.com/item/1Set-Liquid-PH-Value-Detection-Regulator-Sensor-Module-Monitoring-Control-Meter-Tester-BNC-PH-Electrode-Probe/32805675619.html?spm=a2g0w.search0104.3.10.45996e1dtOVqSR&ws_ab_test=searchweb0_0,searchweb201602_1_10065_10068_319_10892_317_10696_10084_453_454_10083_10618_10304_10307_10820_10821_537_10302_536_10843_10059_10884_10887_100031_321_322_10103-10892,searchweb201603_6,ppcSwitch_0&algo_expid=6da752a5-1cea-4e8b-b57b-720ae8b90f9e-1&algo_pvid=6da752a5-1cea-4e8b-b57b-720ae8b90f9e (http://)
Title: Re: Help with Ph sensor pin abbreviations
Post by: porlock on Jan 10, 2019, 11:18 am
....
According to the schematic, the final op amp output should be a 2x........
Can you share schematic?
Title: Re: Help with Ph sensor pin abbreviations
Post by: wvmarle on Jan 10, 2019, 11:42 am
Schematic of that sensor board you can quite easily find online.

Do note that the pH is a bit temperature dependent so for best results use a water temperature probe (waterproof thermistor or digital D18B20 sensor).
Title: Re: Help with Ph sensor pin abbreviations
Post by: crustyourmind on Jan 20, 2019, 02:55 pm
I received this board yesterday

To calibrated it , I putted the probe in water with ph 7.2 and I calibrate the data with the blue potentiometer close to BNC

I tested in my aquarrium : 7.4, my coffee 4.9 and lemonade lemon juice 3.5

I think, it works.

Thanx for this thread ;)
Title: Re: Help with Ph sensor pin abbreviations
Post by: wvmarle on Jan 20, 2019, 03:17 pm
It works - but your calibration will be off. Water is NOT suitable for calibration, you must use a buffer solution. Preferably two.
Title: Re: Help with Ph sensor pin abbreviations
Post by: crustyourmind on Jan 20, 2019, 03:22 pm
OK thx, I'll looking for 2 buffer solutions

Now I ' try to calibrate the limit red led
Title: Re: Help with Ph sensor pin abbreviations
Post by: crustyourmind on Feb 02, 2019, 03:00 pm
I've Just tested with 2 buffer solutions received today

So at 4.01 PH, I've got theses value :  mesure 601 and voltage 2,95

The ph-step is : 2,95 - 2,5 / 2,99 = 0,15

I've adjust this var is this formula
  // PH_probe = PH7 - ((voltage@PH7 - voltage@probe) / PH_step)
  float Po = 7 + ((2.5 - voltage) / 0.18);

And it works fine

I check with the second buffer solution (6,86) and the return is 6,82, so I consider this value acceptable

A great thx for your help
Title: Re: Help with Ph sensor pin abbreviations
Post by: Krheigh on Mar 11, 2019, 11:29 pm
I have this sensor an have hard time to get it work.
I think it's broken.
No matter how many turns (both ways) I screw the pot closest to bnc I only get 4,95v out of OP pin.
Bnc shorted.