pH Probe???
Anthony240
Posts: 24
I was wondering if Parallax sells a probe that could be used to measure pH?· I have located a circuit online that will measure small changes in voltage using RCTIME command.· This circuit can be used with probes that put out small changes in voltage, IE: a pH probe.
pH circuit I found online:· (scroll to bottom of page)
http://www.emesystems.com/BS2rct.htm
Thanks
Anthony
pH circuit I found online:· (scroll to bottom of page)
http://www.emesystems.com/BS2rct.htm
Thanks
Anthony
Comments
[noparse][[/noparse] Does the BS2p40 have an analog comparator? ]
About the only time you really need an ADC is when you want a very high precision value and/or very fast readings. In the first case unless you're placing the ADC on a well designed·mixed signal PCB, you are not going to get the precision anyways. In the second situation, what the heck are you using a basic stamp in the mix anyways?
For moderate precision, sigma delta techniques can be used.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
Post Edited (Paul Baker) : 3/21/2006 6:44:48 PM GMT
Paul,
I don't follow you on the sigma delta techniques. Could you tell me more about them?
The purpose of the op-amp in that circuit IS to amplify the millivolt high-impedance signal of the Ph Probe.
· I recall someone posting about what to do with an IC that output a voltage proportional to incident light (volts, not millivolts.)· I recommended using the output voltage to turn on a transistor, using it as a variable resistor (hence the name) in an RCTIME circuit, having done an experiment of my own and posted same.· Almost immediately,·some august individual·came along, tut-tutted and pooh-poohed and pronounced the situation a prime candidate for an ADC.· Then it turns out the guy only wanted to use the IC for dawn/dusk sensing (you don't need an ADC for that.)··
· Other situations where a high degree of resolution is thought necessary only to turn on a port-a-potty fan or·somesuch.
· Some people have grand expectations.· Y'know what I mean?·
PJ Allen, there is a difference of opinion even among experienced people, but it is more out of personal bias or inexperience with analog voltages that they "dont want to bother with it" and use an ADC. I myself thought ADCs needed to be used more often until very recently when I heard Chip explain σδ in a way I understood more clearly. He explained it when asked about ADC on the propeller.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
The voltage output from pH probes is not really that small, tenths of a volt full scale. So you might not have to sweat about the input offset voltage of the op amp. If you want the highest possible accuracy, a CMOS input CAZ amp like the LT1051 is the way to go, but then you probably would want to use an ADC instead of RCtime.
The circuit as shown works only with positive signals, which would mean Acidic pH, unless you flip the input polarity and measure basic pH. The circuit could be modified a little to cover both + and -. Sensorex pH probes are very good.
Also refer to www.emesystems.com/OL2ph.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Is the ztx1051 transistor the only one I could use? I'm not familiar with that particular transistor but I will read up on it. I ordered the S200C-BNC pH probe today from Sensorex. I am also ordering a LM6482 op amp and the ztx1051 transistor. Hopefully by the end of the week I'll be measuring pH!!!
Thanks
Anthony
You could also use a low threshold n-fet, and that would work even lower errors, but you would not notice a difference in this application.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
At the following web site, (http://www.emesys.com/OL2ph.htm) there is a sample of basic stamp code that reads a mV value and converts it to pH. This example also has a 1 Volt offset that is compensated for. Does anybody know where I can find the ADread subroutine that returns the mV value? The ADread subroutine is not shown on this page.
Thank You
Anthony
There are ways to modify the RCtime circuit at #SmallV. The easiest way is to lift the ground connection of the pH probe off ground by 0.4 volt at the input of the amplifier. That could be done with a resistor divider. Then neutral pH would give an RCtime value corresponding to 0.4 volts. Acid (pH<7) would increase the voltage at the input and decrease the RCtime value, and alkaline (pH>7) would decrease the voltage below 0.4 volts, and increase the RCtime reading. Do you see what I mean? There are less kluged ways to do it, but I think they would involve a lot more wiring, at which point you are better off with an ADC. Did you get the LM6482? It is a dual op-amp, so you could use 1/2 of it to buffer the 0.4 volt reference from the resistor divider.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Thanks
Anthony
·· Methods vary, but what I use to get a divided voltage is a multi-turn 100K potentiometer.· Then using a known IN voltage I dial-in my OUT voltage.· For example, if I want to scale 0-15V to 0-5V I would put exactly 15 volts on one end of the pot, the other to ground, the adjust the set screw until I have exactly 5V on the wiper.· This is especially useful when you have multiple channels to calibrate, which I often do.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Here is what I have in mind:
The voltage divider between the 10kohm and 866 ohm resistor should produce about 0.4 volt at the junction (866/10866 * 5 ~= 0.4). Or you could use a potentiometer there, like Chris suggested. The op-amp acts as a buffer to create a "virtual ground" at its output pin. The (-) side of pH probe attaches to that (instead of to the regular ground). The (+) side of the pH probe attaches to the input of the VCCS circuit you already have. The output when pH is zero will be near what you have as full scale now, so you may have to adjust R and C. The RCtime result will be a shorter time in acid and a longer time in alkali. The pH output voltage (~ +/- 0.4 volt) is added to the 0.4 volt offset. Is that clear?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
What I'm not too sure about is the relationship between the R and C in the circuit. I have been using a .01uF capacitor and changing the value of R. I have noticed that the bigger value of R, the longer RCtime value I get. But I haven't seen the effect of the capacitor. Using a .1uF cap I was getting similar values as when I used the .01uF cap. Any hints here?
Thanks
Anthony
The op amp and R enforce a current source of,
I = Vph / R
So, if R = 1000 ohms, when Vph = 400 mV
I = 0.4 / 1000 = 0.0004 amp = 400 microamps.
The charging of the capacitor is linear. Assume that it starts at 5 volts, and it has to charge down to 1.4 volts, the Stamp threshold.
dV/dt = I/C
dV/dt is a constant when I is a constant, so we can separate the terms:
dV = I dt / C
dt = C dV / I
t = C (5 - 1.4) / 0.0004
and if C=0.1uf
t = 0.0009 second, 900 microseconds, or 450 RCtime units on a BS2. I think I calculated that right, off the cuff. Please check it!
That is the formula you can use to choose R and C. It is best to keep the current small, in the 100 microamp range, so that the capacitor can be fully prepped to Vdd when the stamp pin is a high output. So I would choose R of around 4000 ohms. The current with pH changes will then be in the 0 to 200 microamp range. With C=0.1 uF, then RCtime result will be centered (at pH=7) at around 3600 microseconds (1800 RCtime units on a BS2).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
WOW. That really helps. You are a life saver. My project is due by the end of the month and I think that I may just get it done and all working. You have been a great help and I wanted to thank you.
I can't wait to get home tonight and try out all my new knowledge. I will let you know if I have any more problems.
Thanks
Anthony