Go Down

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

JoeRedfish

#30
Jul 30, 2017, 12:15 pm Last Edit: Jul 30, 2017, 12:29 pm by JoeRedfish
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

hamzafaiz123456789

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 .

wvmarle

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).
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

tigger

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.

irfan_jamil1994

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


daph

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!

wvmarle

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.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

DrJarold

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?

wvmarle

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.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

DrJarold

#39
Dec 01, 2017, 09:43 am Last Edit: Dec 01, 2017, 09:54 am by DrJarold
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

zoomx

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.


LukaszM

#41
Jan 10, 2018, 02:02 pm Last Edit: Jan 10, 2018, 02:37 pm by LukaszM
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)


wvmarle

double voltage =  measure*5 / 1024.0
instead of
double voltage = 5 / 1024.0 * measure;
Those two formulas give the same result.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

LukaszM

Those two formulas give the same result.
Yes You are right, Sorry my mistake

Coos

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?

Go Up