Shop OBEX P1 Docs P2 Docs Learn Events
RC Charge Decay measurement with mv — Parallax Forums

RC Charge Decay measurement with mv

JohnR2010JohnR2010 Posts: 431
edited 2015-01-15 14:39 in General Discussion
I'm working with a TDS probe that measures the conductivity of water. I was planning on using a simple RC decay circuit to measure the probes conductance. I built a circuit and tried this and it works fairly well but the readings are not stable. I think by sending 3v through the probe instead of 750mv I'm causing the probe to heat up and give false readings. Can someone recommend a simple circuit that will allow me to use an RC decay circuit with the propeller but only send 750mv instead of the full 3v.

Little more background:
The probes spec sheet (which is just a short paragraph) states it will work with any AC millivolt signal. I have the two conductors of the probe connected to a RC circuit that is in turn tied to two pins on my prop. I reverse the polarity of the pins and I can read the RD decay just fine. But this is sending 3v through the probe's electrodes and it should be less than 1v. Other probes I have worked with operate around 750mv.

Thanks.

Comments

  • CRST1CRST1 Posts: 103
    edited 2015-01-08 06:26
    Just use two resistors and make a voltage divider on the output.
  • JohnR2010JohnR2010 Posts: 431
    edited 2015-01-08 06:55
    That was my first thought. I didn't think it would work since i would have to place the probes and the Cap in parallel to the second resistor in the voltage divider. Wouldn't the cap just end up discharging through that resistor along with the probe? I guess the discharge time would still vary might be worth a try.
  • kwinnkwinn Posts: 8,697
    edited 2015-01-08 07:18
    I suspect this divider idea will not work since you are probably using the threshold voltage of the prop pins (3.3V / 2) to measure the rc time constant. Can you post a schematic of the circuit you are using?
  • JohnR2010JohnR2010 Posts: 431
    edited 2015-01-08 08:05
    attachment.php?attachmentid=112712
    The Prop pins are on the left and the probe is on the right. The Probe has a Thermistor and two electrodes that make up the TDS probe. The Thermistor part works great at 3v, the TDS side is what I need to drive in the micro-voltage range.

    My code uses a counter to monitor the time it takes the cap to discharge through the probe (3.0v to 1.5v ). The circuit's VDD = 3v.
    911 x 297 - 92K
  • JohnR2010JohnR2010 Posts: 431
    edited 2015-01-08 08:26
    Just so we are all on the same page if I go the voltage divider route this is what I was thinking it would look like. With VDD at 3v I would have about 750mv through the probe. The probes resistance seems to swing from 5k ohm to 1M ohm. With all these resistors in the circuit (even if I use 5% tolerance) I wonder if I will get any meaningful values from the RC decay?

    attachment.php?attachmentid=112713
    918 x 327 - 104K
  • CRST1CRST1 Posts: 103
    edited 2015-01-08 11:14
    Yeh, thinking about it not sure if it will work with the cap and the prop threshold voltage.
  • JohnR2010JohnR2010 Posts: 431
    edited 2015-01-08 15:41
    I think it would work its just how reliable would it be. If I dont get any other suggestions I may give it a try and see. I prefer to keep the complexity in the software not hardware.
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2015-01-08 15:52
    My initial thought would be to setup a Sigma-Delta ADC and incorporate a portion of the Drive/Sense resistor as your water probes. Then, using the other counter detect the width of the pulse on the Sigma Delta. The signal should be close to 50/50 duty cycle all the time, but the base frequency should change on the Sigma Delta based on the change in water conductivity. - That's about the only insight I can offer.
  • kwinnkwinn Posts: 8,697
    edited 2015-01-08 19:49
    Wired like that it may work. Best way to find out is to try it with various concentrations of salt in water.
  • JohnR2010JohnR2010 Posts: 431
    edited 2015-01-12 11:59
    Beau, I'm going to hold off on going that route for now as I'm getting favorable results with my above voltage divider circuit. However, I have a lot more testing to do. I do have one question on the Sigma-Delta approach. Can this be done with an AC signal? I have to make the measurement with a 1kHz signal or above.

    Thanks very much for your response!
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2015-01-12 23:41
    Here I think is one approach that could work with sigma-delta. One Prop pin synthesizes a sine wave at 1kHz and feeds it to an RC circuit with the TDS probe. That in turn feeds into the junction of the sigma-delta. The unknown resistance determines the amount of AC current fed into the summing junction. The pasm code has to capture the amplitude or some other measure of the AC signal strength. Your unknown resistance spans a large range, 5k to 1M, you say, so that will complicate the selection of components. It might need a couple of ranges, or just focus on the important part of the range.
    attachment.php?attachmentid=112786&d=1421134312

    Another approach to the mV RC approach might be to drive a pair of prop pins in opposite phases, connected to a string of three resistors. The idea is to create a relatively small AC square wave that brackets around the ~Vdd/2 threshold of the Prop. Your unknown TDS resistance and a series capacitor also bridge across the center resistor of the string. The junction of the TDS and the capacitor feeds a prop input pin that detects when the voltage crosses the Vdd/2 threshold. The voltage at that junction is a waveform that oscillates around the threshold. The time that needs to be measured is marked with a red t. Again the wide range of TDS resistances from 5k to 1M would be a problem for good scaling.
    attachment.php?attachmentid=112787&d=1421134348
    540 x 398 - 14K
    657 x 359 - 14K
  • JohnR2010JohnR2010 Posts: 431
    edited 2015-01-13 05:36
    Tracy, first off thanks again for all the great input! I like the 2nd approach the best I'm going to bread board it and see what I get. This is perfect timing as my RC decay as drawn above is not going to work.
  • JohnR2010JohnR2010 Posts: 431
    edited 2015-01-15 14:39
    Update.

    Thanks to Tracy for his suggestion I have this circuit working. There is more testing yet to do but after a day or so of calibration (trying various resistor configurations based on my target TDS values) I have settled on this design:

    attachment.php?attachmentid=112838

    The code is pretty straight forward. I use Counter-A in NCO differential mode to generate the square wave on pins 1 and 2. I then use a couple of WAITPEQ statements to sync up Counter-B in POS detector mode to count the clock ticks it takes the signal to go from a high to a low on Pin 3. This time is directly related to the conductance of the water.

    Here is a picture of my AC square wave as it is generated by the above circuit.

    attachment.php?attachmentid=112839

    Thanks everyone for the input I think I have something I can work with now!!
    926 x 431 - 142K
    870 x 665 - 90K
Sign In or Register to comment.