Shop OBEX P1 Docs P2 Docs Learn Events
TDS Sensor to Propeller — Parallax Forums

TDS Sensor to Propeller

JohnR2010JohnR2010 Posts: 431
edited 2014-12-18 07:32 in General Discussion
I'm looking to interface with a TDS (Total Dissolved Solids) sensor http://www.eseasongear.com/hmdispdusepr.html. I would like to us a simple RC circuit and counter to read resistance / conductance of the water if possible. I knew I couldn't use straight DC for the reading and the reason (I thought) was if I used DC the probes would start to deteriorate due to electrolysis. As I have read more the inductance needs to be read from a 1khz or greater signal to keep from breaking down the molecules in the water. So does anyone have thoughts on how to go about this with a counter or two?

My current setup has the TDS probes tied to two pins of the Propeller (with a cap and a current limiter). I take one reading with Pin 1 attached to a counter and Pin 2 set to Vss then the next reading with Pin 1 set to Vss and Pin 2 attached to the counter. This works I do get a fairly stable time reading that appears to vary with the quality of water but before I start down the road of calibration I want to address the 1Khz requirement. Is there a counter mode I'm missing that may help me here? This has to be AC cant be pulsed DC.

Comments

  • kwinnkwinn Posts: 8,697
    edited 2014-12-17 10:05
    You posted "the inductance needs to be read from a 1khz or greater signal". Did you mean conductance? If so the propeller can easily toggle two pins at frequencies well above 1KHz using PASM. As long as the power to the propeller is isolated from ground or the water the alternating signal between the two pins will be AC with respect to the water. For measuring the resistance try a small capacitor between the two signal pins, charge it by putting 0 on one pin and 1 on the other, then measure how long it takes for the high pin to discharge through the water by changing the high pin to an input.
  • JohnR2010JohnR2010 Posts: 431
    edited 2014-12-18 04:25
    Upon further consideration I think what I'm doing with the two pins and the counter (as described in my previous post) is one AC cycle and I would think that would qualify as an alternating signal. I just need to make sure the cap charge time is quick enough to allow for a 1Khz signal.

    kwinn, thanks for your post. As I said in my original post I'm already driving the pins of the probe in opposite directions with a counter counting the time for a cap to discharge. I don't see the need to write this in PASM I would think I could easily achieve 1KHz with a counter and SPIN.
  • JohnR2010JohnR2010 Posts: 431
    edited 2014-12-18 07:32
    Did some more calculations this morning and my SPIN method that is toggling the pins is completing in 20816 clock cycles. At 70Mhz according to my math that calculates out to 3.3kHZ and that is over 3 times faster than the 1kHZ requirement. So I'm going to go with my original code and start the calibration process.

    Asked and answered. Sorry to waste anyone's time.
Sign In or Register to comment.