Another Arduino pH question

I'm a Biologist trying to set up a pH meter for a lab project using the Arduino. I have a basic familiarity with electronics, but amateurish?with relatively strong Perl/Java scripting experience. I've been to the pHduino site and understand the code, but not really so much the schematics.

I'm using a std glass electrode which outputs un-amplified +/-414 mV for the full pH scale of 0-14. My plan is to connect the pos/neg outputs from the probe into the arduino's analog pin/ground.

My question concerns not so much the voltage as the impedance. The documentation for the probe says?

“The voltage signal produced by the pH electrode is a very small, high impedance signal. The input impedance requires that it be interfaced only with equipment with high impedance circuits. The input impedance required is greater than 1013 ohms. This is the reason pH electrodes do not interface directly with all equipment.”

What does this mean for interfacing it with the arduino? Do I need to put resistors inline? The technician from the purchasing site said part of the calibration process is (literally) just to short the pos/neg output wires together to get base?so I'm confused as to how this would not be considered a “low impedance) short :-/

Any suggestions greatly appreciated :slight_smile:

The atmega adc is high impedance i think but with only 414mV full scale it would be a lot better to amplify that signal using one simple op-amp that as an very very high input impedance, so it is perfect to connect your pH probe to one.

Good to know! So (for clarification), if I wanted the low resolution readings, I could directly connect the +/-414 mV output wires straight into the analog pins without worrying about the impedance or voltages damaging anything. If I wanted to increase the resolution, I could run the outputs through a an op-amp to create a larger mVoltage signal range.

Yes?

So, another question.
The output from the pH probe has two wires, and the range is -414 to +414. To get the readings correctly, do I attach the "positive" output to the pin and the "negative" output to ground? If so, how does it read "-414mV"? Do I need to set the reference to 0, or to something producing "negative 414" mV?

Thanks!

You probably have to do some diode magic so you only get the positive to analog in, the negatives have to be inverted, probably by an op-amp and either read from another pin or amplified to be under or above the other +signal and sorted by software. So you can only read base-solutions with no op-amp I think. mabie you can use 2-pin approach with 2 diodes parallel but not facing the same way and a voltage divider from either 5V out or 3.3V to negative signal, ground and arduino pin, use the 1V1 internal referance to read the analog in.

search in google: arduino reading negative voltage
and you will get the wireing for how to calculate the resistor values and connections

David

From Glass electrode - Wikipedia

All glass pH electrodes have extremely high electric resistance from 50 to 500 M[ch937]. Therefore, the glass electrode can be used only with a high input-impedance measuring device like a pH meter, or, more generically, a high input-impedance voltmeter which is called an electrometer.

Having worked with pH probes in a refinery, I can tell you that they always have to have external very very high impedance buffering and DC gain amplifiers, with manual drift adjustments. Drift is a constant battle, as well as cleaning of the probe on a regular basis and calibrating with a buffering solution. Also the pH scale is a logarithmic scale and the 10 bit A/D converter in the Arduino is probably not a good match if reasonable accuracy is needed. And last, any analog measurement that can have a valid negative value cannot be measured by an Arduino, as it is strictly a 0 to some positive voltage value (depending on reference used), no negative values allowed.

Ok to play around with, but if it's at all a serious application I think the Arduino needs lots of external circuitry help for pH measurement.

Lefty

Actually, to raise the negative voltages above zero, all you have to do is add positive voltage bias - say you added a 1 volt bias; then the readings would be in the range from 1000mv - 414mv thru 1000mv + 414mv; or 586mv thru 1414mv (approx .6V - 1.4V).

Not sure if I would do this before or after amplification; if the Arduino has the ability to detect millivolt changes (not sure), then I would just add a 3.3 volt bias and be done with it (using a 3.3 volt regulator or something). If not, then amplify it to 1-2 volts peak-to-peak, and then add the 3.3 volt bias.

Hi Cr0sh,

Thanks for the idea. I'm (at best) a beginning electronics guy, so how exactly would I do this?

Retrolefty,

Also thanks for the input. I'm using the pHduino project as a base...which offers a lot of the external hardware I think you're discussing.

Also, for this project we only need it to be very accurrate within +/- 1pH from 7.4. It's actually going to be monitoring the pH for a cell culture...so it woudl be fairly critical to know that the pH has gone from 7.35 to 7.45 ...but once the pH gets beyond 6.5 or 8.5, everything's dead anyway so we don't care :slight_smile:

My understanding is the a-to-d base 10 should be able to give us that kind of acurracy within this limited range even with a log scale, and the inacurracies that begin to stretch outside this range become moot.

Your thoughts on this would be greatly appreciated! :slight_smile:

Thanks!
Mike

OK...here's the schematic i came up with. I kluged it from stuff on the web and (according to LTspice IV) it gives me the output I need.

Simply...the signal goes in at "source_in" (green, I used a +/- 414mV sine wave to simulate the max/min voltage in range). It comes out of the op-amp amplified to a range of +/- 2.5volts (amped_out, blue).

This signal then kinda-sorta goes through another op-amp such that the signal at the diode (out_signal, red) is 0 - 5volt; which should be ideal for the arduino to sense and interpret.

Questions:

  1. Is this schematic even remotely correct?

  2. It seems I'm not really using the second op-amp (U1) like an op-amp (no +in, no signal out) but if I remove it, the system doesn't work. Should I be using something more appropriate here?

  3. I had to put a diode (D1) or LED in place simply to allow the software (LTspice IV) to show a voltage across the "out_signal" line. Presumably, the diode would just be replaced with the analog in on the arduino...however, if I put something else in place of the diode (capacitor, resistor, LED, whatever) it changes the "out_signal" wave...so am I fooling myself by thinking that I'm actually getting a 0 - 5 volt signal on that line?

Thanks and tell me if this is realistic!

Mike

Tiny point

The atmega adc is high impedance i think ...

Not quit.

According to the ATmega48PA/88PA/168PA/328P preliminary manual (doc8161.pdf) section 23.6.1 "Analog Input Circuitry"

The ADC is optimized for analog signals with an output impedance of approximately 10k[ch937] or
less.

The diagram shows the input as 1..100K ohm.

I think the very high input impedance (e.g. FET) Op amp is important for the sake of the pH probe.

If you have access to a copy of The Art of Electronics, Second Edition, I strongly recommend looking at it.
It is brilliant (and I have no financial, or other, interest in selling it other than maybe encouraging the authors to do the Third Edition)
It has extremely good sections on "Precision Circuits & Low-Noise Techniques", "Measurements & Signal Processing", "Digital meet Analog" as well as Op Amps and Active filters.

HTH
GB

Well one big fundamental problem with the circuit you have shown is due to the C1 capacitor, it is a AC only amplifier. A Ph probe generates a DC voltage that can vary over a range of DC values, but has no frequency and must be treated as a DC voltage. A capacitor can pass AC voltage, but will block any DC component of the signal.

Your application requires a DC amplifier circuit.

Lefty

Finally a fast and reasonably cheap alternative that allows immediate interfacing between Arduino and pH probe. The pH/ORP Adapter - 1130_0B at Phidgets costs 30$ and has ideal inverted signal, 525mV offset and 4.75 gain. I have to admit: I tried the self-build option and failed.
You can just connect the phidget to GND, +5V and an analogin and voila !

Awww...and I was having so much fun beating my head against this project!!

OK...over it. I'm so there

Actually, I did get the basic circuit to work, although not as predictably as expected. It was fun.

Kisses test board goodbye and pulls out credit card

Thanks pubdc!!!!

Pity you have given up :frowning:

I recently built a pH amp that gives out 0-10V
You could modify it fairly easily for use with 0-5V I think.

It was quite a bit of effort to get it working though.
The pH electrode typically have high impedance of say 50-500Mohm so you must use decent op-amps and have a buffer for your input.

Anyway goodluck, the easy way out sounds tempting.

Hey Reflexa,

I'd love to see your schematic though. I'm still interested in the solution for solution's sake (the scientist in me). I have a limited time to complete this project, so off the shelf is an advantage.

I think the biggest problem with my circuit is getting the right op amp. Right now I've tried two different high impedance JFET Opamps, and both work but not according to the spec I was shooting for.

Thanks!

If you have access to a copy of The Art of Electronics, Second Edition, I strongly recommend looking at it.

It is very likely that you will find an industrial quality answer in there. I believe at least one of the authors made measurement equipment for marine biologists and oceanographers commercially.

GB