Tags

, ,

I evolved the E.C Circuit and got a proto board made at Metrix Create:Space.  The kicad files are located here.  I have had a totally terrific YIPPEE! moment.  The E.C. circuit appears to be working (caveat: I am not testing accuracy only how each part of the circuit should react).

The Goal

The goal of this post is to test the stages of the analog part of the E.C. Circuit:

  • Wien Bridge Oscillator
  • Shrunken AC signal
  • Gain Loop
  • EC Voltage (ECv)

Thanks to Those That Went Before

This is the section that is so easy for me to forget.  Yet, I must never forget and always thankful for the amount I have learned about electronics from Chris Gammell’s Contextual Electronics course as well as from his mentoring.

It is an honor to stand on the shoulders of the work of Ryan (SparkysWidgets).  Ryan has open sourced the design of the minipH and miniEC.  At my skill level (about one year end), having these schematics as reference gave me a HUGE jump start in learning about pH and EC circuits.  In addition, Ryan has often spent time explaining his choices to me.  Thank you!  I encourage all to buy from SparkysWidgets/support Ryan.  I use his products.  They work very well.

Test

 
Here is an image of my test setup:
EC Test Setup
  1. EC Proto board
  2. 22KΩ resistor – represented by POT 5 and POT 6 on the schematic image below.
  3. AC Shrink POT
  4. EC signal gain loop POT
  5. 200Ω resistor used to represent an incoming reading from an E.C probe (1/200 = .005S = E.C.)

Wien Bridge Oscillator

Here is the schematic:

WienBridgeOscillatorSchematic

I started with a 50K POT for the resistor participating in the Gain Loop (shows up on the schematic as Pot5 and Pot6).  Ultimately, I found 22K to be a stable resistor value.  I then replaced the POT with breadboard resistors whose resistance measured 21.89KΩ.   Here is an image of the sinusoidal wave that is created by the Wien Bridge oscillator:

YIPPEE! IT WORKS! 

Step1WienBridge

Vpp = 1.1V with a Vmax of .54V and a Vmin of -.56V.

Shrink the AC Signal

Now that there is a voltage source to use to find the EC through an EC probe, the amplitude needs to be smaller.  This is because the next step is a gain loop where there is a variable resistance as part of the loop.  The variable resistance is the EC reading – actually, 1/conductivity = resistance so R = 1/E.C.  As conductivity gets large, the resistance shrinks.  The less resistance, the more gain.  Too much gain and the Vpp of the gain loop exceeds the rails of the op amp.  Other folks that have built E.C. Circuits – SparkysWidgets’ miniEC breakout board and the design/discussion of reading conductivity in a bath – advise on a Vpp ~= .2V.  I will use this amount for this initial test.

The image of the schematic above shows a second POT that sets the voltage divider resistance.  I used a POT so that I can adjust the amount the amount to shrink the AC signal given results from the gain loop.

I want to shrink the AC signal generated by the Wien Bridge Oscillator – which has a Vpp of 1.10V to a Vpp of .2V  => 1.1V = X(.2V) X = 5.5.  I need to set up the voltage divider such that the outgoing sinusoidal wave is 5.5 times smaller than the wave generated by the Wien Bridge Oscillator.  The top resistor (R13 in the schematic) of the voltage divider is 100KΩ. Using the voltage divider (no load) equation:

Vout = Vin(R?/(R?+100K)) => .2V = 1.1V(R?/(R?+100K)) => .2V(R?) +.2V(100K) = 1.1V(R?) => 20K = .9(R?) => R? = 22.22K.  The closest I could set the POT was 22.63K.  When I did this, I could see this image on my scope:

Step2ShrinkACSignal

 

The Vpp was .288V – a bit higher than I expected.  I attribute this to variations in the “real” resistance of the 100K SMT used for R13 as well as varying results based on where the test probes are positioned.  Moving forward, attention to test points – and ease of testing – will become a bigger factor in proto board design.  I’ve been experimenting with the “best” way to design for test points and am still evolving my skills.  It is becoming super important since observation using a DMM and/or scope is a critical aspect of testing.

Measure ECv

The exciting – and most important – step is the gain loop that is used to figure out the conductivity of a bath of water through an E.C. probe.  I discuss this in in an earlier post.  Here is the schematic for this step:

SchematicECMeasure

As you can see, measuring the E.C. revolves around the AHA! understanding that the probe can be treated in the circuit as a variable resistor.  What needs to be found is the value for the resistance introduced by the probe when the probe is in a bath of water.  The E.C. is then 1/R.

Using:

  • ReC = Resistance measured through the E.C. probe
  • POT value = Resistance the POT is currently set to

Looking at the op amp through the lens of the -Vin pin, Vin is the proportion of voltage contributed by the E.C. probe.  I will be measuring Vout and using the equations:

  • Gain = Vout/Vin
  • Gain = 1 + POT value/ReC

NewImage

The steps to calculate ECv include:

  • calculate the Known Gain by setting ReC to a known value. 
  • Calculate the Measured Gain based on the rectified ECv Vout from the gain loop op amp.
  • Calculate the E.C. by using: 1 + RPOT/ReC

Step 1: Calculate Known Gain

Let’s set the EC to a known concentration = .005S = 200Ω .  The closest I could get the POT value to 1K was 989Ω.  

Known Gain = 1 + 989/200 = 5.945

Step 2: Find Measured Gain

This is where the EC probe input is added as a resister in the gain loop.  I have a 5K POT as the known resistor within the gain loop.  Here is an image of the EC signal after it goes through the rectifier right after the gain loop op amp:

ECMeasurement

The Vrms = .726V Vin = Vout/[Known Gain] => Vin = .726V/5.945 = .122V.  

Measured Gain = Vout/Vin = .726/.122 = 5.95

Step 3: Find E.C.

Measured Gain = 1 + RPOT/ReC

ReC = RPOT/([Measured Gain] – 1) => 989/4.95 = 200Ω

E.C. = 1/ReC = 1/200 = .005S

The above is a “litmus test” to gain confidence the circuit is working at some level.  It may not take accurate measurements.  The resistor settings most likely need to be changed.  But scope exploration shows the steps are working such that the workings of the E.C. analog circuit are designed correctly.

 

 

Thanks for reading this far.  Please find many things to smile about.

 

Advertisements