post for September 1st, 2014

SparkysWidgets has released a newer version of the  miniEC (product page) since I last played with this breakout board.  I ordered some of the newer versions awhile back and am finally getting around to giving the miniEC circuit a twirl!

The Goal

The goals of this post are to identify confusions I have with the 2nd stage (Gain stage) of the miniEC circuit.

Thanks to Those That Go Before

.2 VPP 

Ryan notes in his comments on the minieC

Right before the 2nd stage, this wave is turned into a small signal(about .2VPP via voltage divider) this small signal is passed into the (2nd stage) gain stage where the eC probe forms one leg of the gain divider of the op-amp  By treating the SUT as an unknown resistance in a gain loop the amount of current needed to calculate the conductivity is decreased by several factors(at least a 100x reduction)

However, I checked the chips….

Check the Chips

I am finding a big difference between hardware and software development is when attention to detail kicks in.  With hardware, I find attention to detail is extremely important early on.  For example, soldering an SMT given my skill set.  The extra time I take to clean the pads, place the chip in a way that I don’t have to handle the PCB while trying to put hot solder on a pin/pad, making sure to apply flux, cleaning off the residue after soldering is time well spent.  If I don’t do this, I end up removing and re-soldering…removing and re-soldering…With that said, even with all the prep, there are many times when my soldering needs to be redone…particular on iddy biddy sized parts.

I printed out the analog front end of v1.2 of the minieEC schematic (GitHub repository):


and checked the resistors with their values on the breakout board.  


Chips on MinieC

I saw two differences which I verified with my DMM (Extech 330):


  • R7 on the schematic calls for a 100KΩ resistor.  The value on the board is 47KΩ.
  • R9 is 1KΩ on the schematic but on the board it is 3KΩ.

.2 VPP 

Here I am confused.  R8 / R7 are used as a voltage divider to decrease the voltage going into the op amp.  Given the above, the VPP = .2 However, the LTSpice IV model

Wien Bridge Voltage Out and Stage 2 Voltage in after voltage divide

The green sine wave is the output of the Wien Bridge Oscillator step.  The VPP ~= .9V.  The blue sine wave is the input into the op amp used with the EC probe.  The VPP ~= .08V.  Given the resistor values this makes sense – .9*(4700/(4,700+47,000)) = .08V.  Yet the explanation Ryan gave for this stage noted the VPP into the second op amp should be .2VPP.  I am not sure if:

  • the .2VPP is the important value.  I found another EC Circuit (picture of schematic) that noted .2VPP and uses a 1KΩ R for R8 and a 100KΩ R for R7.  The comment near the non-inverting input of the Gain op amp  notes: “should have about .2Vpp input.  If much higher offset is difficult to null out change [R8] & [R7] as needed”

 When these values are plugged in,

VPP When R8 = 1K and R7 = 100K
the VPP into the gain op amp is too small – doing the calculation: .9*(1/101) = .008V!  I think this was a typo.  If the VPP is to be .2V, and R7 = 100K, then a value for R8 that will create a .2VPP is 30KΩ.



 The right answer will depend on the results for the E.C.  Is the value within range of those given by the EZO or TDS meter?  That’s something I need to find out.


R0 in the LTSpice simulation:

EC Probe in LTSpice

is acting as a value for an E.C. reading (see this post for an explanation). an R value of 200Ω is equal to an E.C. reading of 5mS.

When R9 is 1K, the Gain is 1+ 1000/200 = 6.  

R9 is 1K

which is “close enough” to the LTSpice IV results.

R9 is 3K

R9 = 3K

By knowing the Gain, the E.C. can be back calculated.

When R9 is 3K, the Gain is 1 + 3000/200 or 16.  So 16 = 1+3K/R0  -> R0 = 3000/15 = 200 Ω E.C. = 1/200Ω = 5mS.  Given the relationship between the resistors and the Gain, the variable resistor (R0 – representing the probe in the LTSpice model) means the Gain will vary  based on the conductivity of the bath.  The challenge then is to determine a resistor value for R9 that is within +5V and is “large enough” to get “the best” reading it can.

The question for “large enough” is answered by knowing the range of conductivity(1/R).  Given the E.C. values for vegetables and herbs located here,  The E.C. ranges between .8mS and 5mS.  Given this E.C. range, the resistance range is 1,250 to 200.  Using .step with a list command set for 200 and 1250 (see {R} at R0) and R9 at 4K:

Step with list 1250 and 200

results 4K for R9

I’m thinking a good value for R9 is around 4K.  This way, the Vpp is within 5V.

What’s Next

I need to figure out what the “best” values for the resistors are.  This is probably best done using a bread board prototype.  I’m still having trouble prototyping the Wien Bridge Oscillator.  I think my “big mistake” was using a single power supply.  There is some learning gap that I must bust through to get this going.  I should also receive the Healthy pH Shield PCBs this week.  Once I receive these I will solder on the parts and give this rev of the Shield a twirl.


Today as always – please find many things to smile about.