ph meter circuit
Greg LaPolla
Posts: 323
I am using the attached circuit. This is from Tracy Allens website. I have the circuit on a breadboard but my readings are not what they should be. One of the components has been discontinued. The CA3160 is no longer available according to digikey so I purchased a CA3140. The specs are different so I am not sure how to compensate for them. My other issue is with the LM385-1.2. How should the FB pin be connected in this case. Currently FB is connected back to the - pin.
Differences between the 3140 and 3160 are as follows:
slew rate on the 3160 is 10V/us
slew rate on the 3140 is 9V/us
input bias on the 3160 is 5Pa
input bias on the 3140 is 10Pa
voltage input offset on the 3160 is 6000uV
voltage input offset on the 3140 is 2000uV
Also I an using 220K resistors because I don't have any 221K's. I dont think that would make as big a difference as I am seeing.
Placing the probe in a glass of water (ph is 7.01 according to my bench meter) I get a reading of .84 volts, that is the highest I can get by adjusting rt1. I should be able to adjust to 1 volt.
Is this wrong because of the resistors or the differences between the op amps?
(Hopefully Tracy is lurking about )
Differences between the 3140 and 3160 are as follows:
slew rate on the 3160 is 10V/us
slew rate on the 3140 is 9V/us
input bias on the 3160 is 5Pa
input bias on the 3140 is 10Pa
voltage input offset on the 3160 is 6000uV
voltage input offset on the 3140 is 2000uV
Also I an using 220K resistors because I don't have any 221K's. I dont think that would make as big a difference as I am seeing.
Placing the probe in a glass of water (ph is 7.01 according to my bench meter) I get a reading of .84 volts, that is the highest I can get by adjusting rt1. I should be able to adjust to 1 volt.
Is this wrong because of the resistors or the differences between the op amps?
(Hopefully Tracy is lurking about )
Comments
The slew rate difference is minimal, and since this circuit is basically measuring a DC voltage it is not really a concern.
The input offset voltage is less (better) on the 3140, so I do not think that is the problem.
The input bias current is twice that of the 3160 and may be the problem, but it would depend on the impedance and output signal of the ph probe.
First verify that the power supply voltages are good and that output voltage of the 3140 is close to 0V when the input is shorted.
Then make sure that the output from the Vref op amp can be adjusted from -1.2 to -0.8V.
Then connect a 1 meg or so pot across the +-5V supplies and use the wiper output as input to the 3140 to verify that the output tracks the input voltage. If it does then add a 1 meg series resistor and see if you get close to the same min and max voltages.
If all the above checks outthe electronics should be working.
Thanks for the input, I found 2 issues, first I had to un-jumper fb to - on the lm385. Then I crossed on of the 220K with a 20K. The circuit is now working almost as expected, I can seem to adjust the output to 1 volt when the prob is in 7 ph test solution. It keeps bouncing between .999 and 1.001 I think this may just be the breadboard connections causing this.
Greg
Is it normal to see this while reading a ph probe. I have tried a 2 second interval on the adc and I still get very erratic behavior.
would placing an cap of say 100u or so smooth this out without sufficiently skewing the results ?
here is the code its very simple:
If you are breadboarding the ADC it may be noise pickup. ADC chips generally have a high impedance input which makes them
susceptible to noise pickup, so the pc board layout needs to be done properly. They do not work well on breadboards of any kind.
A capacitor very close to the input pin would help, as would averaging several readings.
Most likely it is 60Hz noise being picked up and the ADC is taking a reading at different points on the resulting signal.
What ADC are you using, and how fast can it sample?
I am using a TLV2543(spec sheet attached). I also have 2 thermistors attached, and I don't see this fluctuation with them.
Greg
If you have access to a scope check the signal at the ADC pin and also see how fast you are accessing the ADC to get some idea of how many readings per second from the ph channel.
I have the parallax scope, I am still learning how to use it. I attached a screen shot of it. That is a reading without a cap attached.
I tried a .01, .1,1 and a 10. The 10uf cap will smooth it out fairly well, however the scope is nearly flat when a cap is attached.
What kind of readings do you get with the 10uF in?
Is this circuit laid out on a pc board or built on some type of prototyping board?
Is there anything nearby that is generating a 40KHz signal?
here is a shot with the 10uf cap attached. I am doing this on a pe board.
I also noticed that the scope is picking up some noise even when the board is not powered up.
The only thing around is wireless keyboards.
Greg
In any case breadboarding analog circuits is a problem.
You really need to make a pc board and pay close attention to the layout. I'm not an analog expert but you should:
- Bring the signal in as close as possible to the ADC pin and go directly to the pin (no trace winding an inch or two around other signal lines).
- Surround the input pins and traces with as much grounded copper as possible.
- Separate the analog and digital parts of the circuit on the board (analog on one end of the board, ADC in the middle, digital on the other end).
- Provide separate power supplies for the analog portion if possible, or filter the power to the analog portion very very well.
- Put bypass capacitors near the power pins of all the chips.
One of the chip makers (analog devices I think) had an excellent application note on laying out a pcb for adc`s and precision analog circuits. Take a look on the internet
I picked up a little project board at radio shack and soldered this thing together (See attachment). It now looks very clean in the scope.
Almost a flat line with a little blip every now and then. The problem is now that the voltage adjust when shorted is 1.159 to 2.130.
I cant get it to 1V. I have picked up some 20K's and put them in place to the 22K's, that brought me closer.
Pin5 on the lm358n puts out -1.905 to -2.868. Not even close to -1.2 to -0.8V that you said it should be. The only other difference is the 220K resistors.
Do you think 221K is going to bring it down enogh to make a difference?
I guess I need to understand this a bit better mathematically.
Greg
phil
it measures -2.8. If I jump fb to - it will drop to .8 volts.
Greg
Pin 2 should be connected to ground. Pin 3 should connect to the
junction of RT1 and R1. Leave Pin 1 unconnected or you can tie it to
Pin 2.
When you have it hooked up correctly you should measure about
-1.2 volts from Pin 2 to ground.
Where is the 'fb' pin you mentioned?
phil
Post Edited (phil kenny) : 7/30/2009 1:37:53 PM GMT
the - pin goes to ground, the + pin goes to the 7660 pin 5 via a 20K resistor
That what I got from the schematic. Do I have it backwards?
Greg
You are using both a + 5 volt supply AND a - 5 volt supply.
When using a negative power supply the orientation of the LM385
must be reversed. This isn't spelled out in the data sheet, so
your confusion is understandable.
Pin 2 (what you are referring to as the + pin) must go to a
more positive voltage than Pin 3 (what you call the - pin).
In this case Pin 2 must be connected to ground.
Pin 3 must go to a voltage more negative than Pin 2.
If you reverse he polarity of the LM385 in your schematic,
then the circuit will function correctly.
phil
Post Edited (phil kenny) : 7/30/2009 3:19:18 AM GMT
tried it both ways, even got a new 385, no go either way reversing it just changes the the sign from plus to minus on the meter.
If you reversed it at some point you may have damaged the LM385.
The LM385 in the circuit with FB connected to the - terminal should draw about 150uA. Not having FB connected may account for the noise and instability.
I should have looked at the data sheet instead of assuming it was a 2 terminal reference. Sorry about that.
The junction of R1-RT1 should be at about -1.24V from common, and the voltage on the wiper of RT1 should be adjustable from approximately -1.24 to -0.8 volts.
If you do not have -1.24V at the R1-RT1 junction you have a problem. Most likely the LM385, but possibly wiring or the components connected to the wiper of RT1.
Measure the voltage at both the junction of R1-RT1 and the wiper while adjusting RT1 over its entire range. The voltage at the junction of R1-RT1 should not change much.
You are correct. I tried it again with your suggestion and all the readings are correct. however, I still cannot zero it out with the center probe pin grounded out.
the reading on my meter is 81.9mv to .479v. could this be the difference between the 3140 and 3160 causing this?
digikey has some 221K resistors, I am going to order a few in the morning.
Pin 2 of LM358b should be very close to 0V.
With the input shorted pin 7 (output) of the CA3140 should be very close to 0V.
The output on pin 1 of LM358b should track the output of pin 7 of LM358a but be of opposite polarity.
ie if pin 5 is - 0.9V then pin 7 should be -0.9V and pin 1 of LM358b should be +0.9V
Measure and record the voltages on these pins with pot RT1 at both ends of it`s range.
Pin 7 & 5 follow each other pretty close.
Pin 2 is -380mv
pin 6 (pin 7 is +5V) on ca3140 is -.770v constantly when shorted, when not shorted its -4.6 volts
pin 1 on the lm258b dos not track, ie if pin 7 is -1.24v pin 1 will be +.480v
Something else that is interesting that may be related:
measuring all the 220K resistors related to the ca3140 give a reading of 161K if I disconnect R6 from ground then they all read 219K.
Greg
I have to go back and read through this whole thread, but it looks like you are getting a lot of good advice. That circuit on my web site was adapted from one in Don Lancaster's CMOS cookbook. As you noticed, the CA31xx series is old news. These days I would choose one of the many other CMOS op-amps that are on the market. The LM385 is still a great little reference, and it should indeed be giving you a stable reading.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
I found this chip TLE2141IP from TI, It is supposedly a direct replacement for ca3160. I ordered one today from digikey.
I still haven't got my head wrapped around this circuit completely. Thankfully there are a lot of very knowledgeable people here to help.
Greg
> Pin 2 is -380mv. Good. That is about what I would expect if pin 7 of the LM358 is at -0.8V.
> pin 1 on the lm258b dos not track, ie if pin 7 is -1.24v pin 1 will be +.480v. I think this is good. Pin 7 goes through R3 to the inverting input of LM358b.
If pin 7 goes from -0.8 to -0.9V then pin 1 should go 0.1V more positive. Double check that that happens.
I suspect the problem is in the area of the CA3140. An offset of 0.77V is pretty high with 0V input (shorted). First thing to check is the power supply.
Make sure the +- 5V levels are closely matched (+5.0 and -5.0 not +5.2 and -4.75). A 5 to 10mV difference is ok, but hundreds of mV is not .
If the power supplies are ok measure the voltage on both sides of R4. The voltage on the left should be twice the voltage on the right.
If that is the case the problem is almost certainly with the CA3140 side. Check the voltage at the junction of R6-R7. It should be about half the output
voltage of the CA3140.
If the voltage on the right of R4 is higher than on the left the problem is most likely with the LM358 side.
> measuring all the 220K resistors related to the ca3140 give a reading of 161K if I disconnect R6 from ground then they all read 219K.
This is normal. The rest of the circuit is affecting the measurement. Removing R6 from ground reduces that somewhat.
Double check all your connections and clean off as much flux and such as possible from the board. It looks like you have some leakage on the CA3140
causing the -0.77V offset and the RT1 adjustment is not enough to balance it out.
The power supplies are off a little the output of the 7660 is -4.75 the +5v rail is 4.96v This is off because my battery is getting low, They are usually both 4.96. I'll pick a few more 9v tonight at the store. I also just
bought a professional developer board today (yeah deal of the day!)
I brushed the board down with nail polish remover last night before I posted just to make sure [noparse]:)[/noparse]
So with the center pin shorted we have
The junction of R6-R7 is -173.5mv
The output of pin 6 on the ca3140 is -.759v.
right side of r4 is -365.5mv the left is -.749 volts
Is this looking like the 3140 is having issues ?
I ordered a couple of TLE2141IP today.
Greg
If adjusting RT1 over it's entire range results in the voltage on pin 1 of the LM358 changing by .4 volts that circuit is working. The problem is that if the 3140 is putting out -.759 volts instead of 0V the output from pin 7 of the LM358 is not enough to cancel it out and bring the output on pin 1 of the 358 to 1V.
The best it can do is bring it to about +.4V.
In a perfect situation the output of the 3140 should be 0V with the input shorted, RT1 should adjust the output on pin 7 of 358a between -0.8 and -1.2V and the output on pin 1 of 358b should go from +0.8 to +1.2V.
I got the new tle2141IP chip today to replace the ca3140. Success!!!! the output now adjusts from .8 to 1.2 volts.
One other Issue I Found, When I adjust to 1 volt using my meter, the ADC is reading 1230. shouldn't the ADC be reading 1000 ?
Greg
Post Edited (Greg LaPolla) : 8/3/2009 9:38:28 PM GMT