Wheatstone Bridge and the Basic Stamp
Anthony240
Posts: 24
All,
I am trying to get measurements of salinity and pH of a saltwater fish tank.· I have decided not to use the 555 timer to measure freq. but to go with the wheatstone bridge.· The bridge will enable me to measue small changes of resistance in the water.· I have made a few charts of resistance vs salinity and resistance vs pH.· I am trouble hooking the bridge up to the basic stamp and making the basic stamp display the changes in resistance.· Anybody got any ideas on how to make this work?
Thank You
Anthony
I am trying to get measurements of salinity and pH of a saltwater fish tank.· I have decided not to use the 555 timer to measure freq. but to go with the wheatstone bridge.· The bridge will enable me to measue small changes of resistance in the water.· I have made a few charts of resistance vs salinity and resistance vs pH.· I am trouble hooking the bridge up to the basic stamp and making the basic stamp display the changes in resistance.· Anybody got any ideas on how to make this work?
Thank You
Anthony
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Im looking at resistance values from 40-100K
These resistance values give salinity values from 0 - 250ppt
and pH values from 1 - 10
Anthony
Do these values have a linear correspondence?
What sort of resolution are you hoping for?
How are you currently measuring the resistance? (<--Any worries about false readings due to an unwanted galvanic effect?)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
· Why can't you hook up your sensor as a Resistor in an "A circuit" (see RCTIME in PBASIC Help)?
· You will have to know the value of the Capacitor used.· The RCtime units returned = 635 * R(kohms) * C(uF).· As in the example, using a 10K and a 0.1uF it is RCTIMEunits = 635*10*0.1.· That example uses those values because the actual RCTIMEunits are 635.
· So, 635 = 635*10*0.1
······· 1 = 10 * 0.1
· So, what if you KNEW that you had a 0.1uF and your RCTIME units came back consistently with 675?· What would the resistance be (if you didn't know it)?
····· 675 = 635 * x * 0.1
··· 1.063 = x * 0.1
····10.63 =·x
· So, the unknown resistance then was/is 10.63kohms.
··
Post Edited (PJ Allen) : 3/3/2006 10:33:18 PM GMT
Im not familiar with how the A Circuit works and I could not find much on the net about it. Could you explain how I could use that circuit to get my measurements?
Thanks
Post Edited (PJ Allen) : 3/6/2006 6:57:35 PM GMT
I'll try it tonight.
RCTIME units returned = 600 * R (Kohms) * C (uF)
= 600 * .240Kohms * .1uF
= 14
I'm getting 1 as a result of RCTIME. This is just an example with a 240ohm resistor but the same applies for all small resistances. The way I figure, if I get 1 as a result of RCTIME then I should have a 16ohm resistor where my probe would be. This indicates that I should be able to measure very small resistances. Anybody got any ideas why my numbers are not working out right? When I put my probes in the circuit and put the probes in water I get 1 as a result of RCTIME which is why I believe that I need to be able to measure small resistances. I would appreciate any help on this subject.
Thanks
I can't answer your question directly, but I'm reasonably sure you can find the answer here in these extended applications notes on RCTIME:
http://www.emesystems.com/BS2rct.htm
My guess is you may be reaching the limits of the RCTIME command. These limits will vary based on which PBASIC Stamp you are using.
Thanks go to Dr. Tracy Allen for all of those excellent Stamp Applications Notes.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
I'd suggest padding up the sensor with a metal-film resistor, in series,·to keep it from bottoming out.·
1K, 2K?
Metal-films are·least subject to change with temperature.
Anthony
The formula you are using to calculate the time assumes that the capacitor is first charged all the way up to 5 volts, but that is not true when you have a low value resistor. Look at the circuit:
When the I/O pin is high, the 220 ohm resistor and your sensor form a voltage divider, and the voltage at the junction will be 5 * (R / (R+220)) volts. If R=220 ohms, that is only 2.5 volts. That is the starting voltage on the capacitor, and when the I/O pin becomes an input, it discharges down to the 1.4 volt Stamp threshold much faster than your formula predicts. If your resistance is less than 85 ohms, the voltage is already less than the threshold and the RCTIME will time out immediately (and return a value of 1).
You might be tempted to remove the 220 ohm resistor. That will help a little bit, but you won't be home free. The output of the Stamp has an internal resistance that is nonlinear, but effectively around 50 ohms.
The upshot is that you have to stick with higher values of resistance for RCTIME, or do some extra tricks.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Example:
I put my probe in the water and BS puts out a value of 31ohm for R.
G=1/R
=1/31
=0.03225
=32.25mS
In this case I don't really care about the .25 so I just need the BS to read out 32mS
I have looked all throught the BShelp and could not find any operation to do this type of math. I even tried to to 31^-1 but could not get that to work either. Could anybody explain how to do this type of math?
Thanks
G = 1000/R
...to get your answer in mS?
You could even do...
G = 10000/R
...to at least get the tenths place.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 3/9/2006 3:29:00 PM GMT
If you could, please, post your code and layout. I would find it VERY helpful in a few things I'v poked my head into. And I'm sure I wouldn't be the only one. That is, if you get a chance to.
THanks!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Just tossing my two bits worth into the bit bucket
KK
·
I'm not quite done with the code yet. When I get it done and fully working then I will post it.
Anthony