Anyone with experience designing a conductivity meter with an AVR?

Go To Last Post
15 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am trying my hand at designing such a device that would be used to calculate approx TDS (Total Dissolved Solids).  I thought I had this all figured out and have built some hardware and written some code but I'm feeling like my understanding in regards to measuring conductivity using a commercial conductivity cell (probe) leaves a little to be desired.

 

Hopefully, someone is an expert in regards to this topic and can offer some advice.

 

Thanks

Jim

Largo, Florida

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not an expert, but provide a link to your commercial cell...

 

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One of these maybe:

 

https://www.atlas-scientific.com...

 

They make an interface kit for it as well:

 

https://www.atlas-scientific.com...

 

I use their temperature probes and those work very well, so I would think that these two items would fit your needs right away. 

 

North East Jim

If you want a career with a known path - become an undertaker. Dead people don't sue! - Kartman

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for commenting.  Let me give everyone a few more details.

 

I am using a inexpensive, commercial, cell made by HMdigital.  The model is the SP-5.  I've attached what little data they provide

and a photo.

 

These conductivity cells are characterized with a 'conductivity constant' value and in the case of the SP-5, it is 0.67.  For these probes to be

used properly they are inserted into a plastic 'T' fitting.  Fluid would flow through the 'T' with the probe inserted into

the middle section, and the fluid flowing 'between' the two metal sensors tips.  There is also a thermistor mounted inside for temperature

compensation.  However, I am not doing any temp compensation at the moment as all tests are being done at room temp (24C).

All of my testing is being done using a laboratory (NIST calibrated) conductivity solution of 1413 uS/cm.

 

So, my understanding from my reading would be if you had this probe properly to an instrument that could accurately measure conductivity

(such as an accurate ohm meter) then with fluid flowing through the cell, measure the conductance and multiply by apply the cell constant to

get the conductivity of the fluid.  I am not seeing this at all.  I am so far off that I must be not be understanding this concept properly.

 

I was hoping someone here would have some knowledge of this matter as I must be 'missing-the-boat' somewhere.

Any comments are appreciated.

Jim

Conductivity Cell

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How do you have it setup?

(Schematic would be helpful.)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Max Signal Strength of 20mA. Does this mean that the sensor outputs a 0 to 20 mA signal or 4mA to 20mA signal? What conductivity reading does this 20mA correspond to?

 

Does the supplier suggest an interface configuration? Is it as  simple as a 250 ohm resistor across an ADC's input with 5 volt upper range?

 

Did you try using a DC multimeter to measure the output signal? Is it a current?

 

Lots of question with implied suggestions.

 

 

Off to bed for me.

 

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have no idea how exactly it works. However, I do know chemistry, so I can tell you that it can't use DC, this would cause electrolysis, degrading the probe and giving false measurements because of the chemical reactions going on.

Therefore, I believe an AC current is injected between 2 electrodes. Water has a high dielectric constant, so this forms a capacitor and AC can go through. You calibrate the impedance for pure water. For water with dissolved electrolytes, a parallel path exists for the current (resistor in parallel with the capacitor), so the impedance will drop.

 

So try with a meter that uses AC. Maybe a capacitance meter?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here is the basic topology of my approach.  I understand the issues regarding electrolysis issues with scale buildup so I use two A/D port pins on

an Xmega128 processor.  I configure pin A as an output pin which I drive High.  The B pin is configured as an A/D input.  I make my reading then reverse

the direction (B as output and A as A/D input) for another reading.  This effectively reverses the polarity on the sensor contacts preventing scale.  I average

the A/D values and have derived a closed loop equation for calculating the conductance of the load (resistor OR conductivity cell). This shows to be very

accurate for a conductance from < 100 uS to > 3000 uS.  However, this is when reading a known resistor value.  I figured, from my reading, that when

the conductance cell is attached, that a simple conversion factor (Conductivity Constant) would suffice to convert to the correct value.   I am not getting

data that makes any sense.

 

Anyone know where my thought process has fallen off the wagon???

 

Thanks

Jim

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for this advice.  Although I thought that my method was essentially measuring the conductance relative to ac (just a low freq however) I figured I would make some external measurements to see if I really understood everything.   As I suspected, I don't.   

 

I just used an adjustable AC supply from about 1 to 5 VAC and measured the AC current.  Using a calibrated solution (NIST cert) of 1413 uS/cm, I get numbers that do not seem to correlate within reason.  There also seems to be a non linear component that I wasn't expecting.

 

 

Here are my results.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

 

Voltages above approx 2v cause electrolysis. This is a likely cause for the nonlinear behaviour you are observing. Use something like 100mV AC instead.

 

I did a conductivity meter once with an atmega32. It needed just 2 caps and 2 resistors and was able to measure capacitance for a body fat meter. 

 

OUT1 --- C ---- R ----- SENSOR ----- R ----C ---- OUT2

                       |         |                   |

                   ADC1   ADC2           ADC3

 

OUT1 and OUT2 are driven complementary at say 100Hz.

 

Current is measured by measuring the difference of ADC1 and ADC2. Measure at say in the middle of each OUT phase.

Voltage across the sensor by measuring the difference between ADC2 and ADC3. Preferably at the same time as the current measurement. You can't do them together but you can alternate the measurements for all cycles.

Combining the measurements for both phases will give you peak current and peak voltage.

Here comes the catch: since it's an AC measurement the current will be phase shifted with voltage. It's caused by the presence of capacitance in the circuit -AND- in the sensor. A so called double-layer will form at the sensor-fluid interface.

So expect a non linear response then you measure with different solution concentrations. Also, measure temperature because https://en.wikipedia.org/wiki/Nernst_equation.

 

See also: http://www.avrfreaks.net/forum/split-conductivity-meter-how

 

Good luck ! I want to build one to to monitor our descaling system

 

Regards,

 

Arian

 

JWA Systems
Rietgors 16
8121 JZ Olst
0629025089

 

Last Edited: Mon. Mar 20, 2017 - 08:51 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jwasys1 wrote:
Voltages above approx 2v cause electrolysis. This is a likely cause for the nonlinear behaviour you are observing. Use something like 100mV AC instead.

I concur with jwasys1.

 

In general, as far as the apps I have done, indeed you want a push-pull AC driving.  [We've done several series of controller families using "twin electrode" probes, with and without temperature probe.]

 

Then we have an RMS circuit for the return signal.

 

Now, in this particular sires of real-world apps, we gave up on doing "absolute" measurements ending up with mS or uS or such -- too many variables.  If e.g. monitoring the concentration of acid in a large batch of fluid, the starting dilution water conductivity (i.e. hard water) might be more than the additional conductivity from the acid.  And indeed, you mentioned "dissolved solids" or similar impurities.  Then add the non-linear effects of temperature...

 

So in practice we end up with a unitless scale -- think 0-100 or 0-1000.  The setpoint might be "44" with no direct relation to siemens.  The concentration of acid is determined to be right via titration or similar methods.  Then if the probe is reading "44" or whatever, that is then used as the setpoint.

 

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jim, (OP),

 

Does the probe's manufacturer have an Application Note on the preferred interface circuitry?

 

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Manufacturer website http://www.tdsmeter.com/

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

Actually, the topology diagram that I posted was proposed by HMdigital.  Back in the early days of the design they sent me a version of that diagram and that is what I am using.  As far as electrolysis, I do take that into account by reversing the polarity in that diagram, over time.  The readings only occur over about a 3/4 second rate.  Current flows in one direction, a reading is acquired, the current then flows in the opposite direction and a second reading is taken.  Both of these readings take about 5mSec each.  The remaining time there is no current flowing.

 

I've viewed the HMdigital probe outputs with an oscilloscope and they appear to be doing the same thing.  I see pulses in the 2V range at a period of about 1second.  So, I am sure that what I'm doing is similar to what HMdigital is doing.  I just don't understand the non-linear behavior that I am seeing.

 

With this method I am achieving very accurate measurements  of < 1% up to about 2000uS.  This is of course using resistors instead of the conductivity cell.  I don't need a very wide range of dynamic range and if the accuracy is something like +/- 10%, from 2000 uS to say 10 uS I would be happy. As far as temperature compensation, most companies appear use a simple 2%/C linear relationship and that would be adequate for our measurements also.

 

What I figured I would do would be to derive a conductivity cell constant using a calibrated 1413 uS, measure another constant using 83 uS solution and derive a simple linear curve between two to derive the 'non-constant' conductivity constant... I am going to be talking with the Korean engineers from HMdigital to get their input on this issue.  If anyone is still interested, I can post what I learn from them.

 

Take care all -

Jim

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello Jim,

 

I am interested in any progress you make.

 

Regards,

 

Arian