Tags

Today’s Post: August 27, 2014

I am building a Healthy EC Arduino Shield.  This shield is a complement to the Healthy pH Shield.  I started using Sketchup in my design workflow – what a terrific 3D modeling application! There are a lot of models for Arduino folks.  I started the image below with a shield and a few components I found within the model library.

Sketchup Of Healthy EC Shield

The Healthy EC Shield will measure the E.C. of a nutrient bath. If more nutrient is needed, the shield will tell a pump to add more nutrients. I am stacking the E.C. Shield on top of the Healthy pH Shield in order for it to use the Healthy pH:

  • The 5V regulated Wall Wart power supply.
  • The Temperature measurement circuit and firmware.

The Goal

The goal of this post is to introduce the design of the Healthy E.C. Shield I am working on.  If I’m really successful some of you will want to share improvements to this work! 

Thanks To Those That Go Before 

For this project I wish to thank:
  • Chris Gammell.   Chris has empowered me with the mind set and abilities I need to build the circuits – going from design to Gerbers.  I would never have been able to build this shield within this timeframe without Chris.  I have a habit of listening daily to passages from Proverbs.  There are many passages about the importance of knowledge. Here’s one that summarizes why paying Chris the small amount of money he requests for what I receive is an honor: Proverbs 8:10 – 11: Take my instruction instead of silver, and knowledge rather than choice gold, for wisdom is better than jewels, and all that you may desire cannot compare with her.  Perhaps the most surprising and wonderful gift Chris has given me is the confidence to do electronics at a level that I did not think was possible within a year.  Chris doesn’t assign a learning profile.  Rather he assumes his teaching and a student’s determination will make it possible to climb most electronic mountains.  This was tested when he had our Contextual Electronics class soldering 0603 SMTs and his creative method for soldering on the MCP3901 on the bench buddy.  Chris brings with him a talented group of individuals who take his course, listen to his podcasts, read his blog posts.  Talented individuals who have taken the time to help me – such as the folks that were in my Contextual Electronics course.
  • Ryan (SparkysWidgets).  I have poured many hours into learning how Ryan put together the schematics for the minipH and miniEC.  If he had not made these open sourced I would not think it possible to design the Healthy pH shield.   Ryan is extremely giving in sharing his supreme knowledge about analog circuits.  I use the minipH within a breadboard prototype to control the pH of a 3 gallon bath.  His work has been instrumental in my understanding of a pH circuit and how to go about designing one.  My goal of building the Healthy pH shield would be far (far) more difficult if Ryan had chosen not to publish the schematics.  Ryan’s additional insights go above and beyond what I could wish for.

Open Source Hardware

I use:

  • LTSpice IV for circuit modeling
  • Sketchup for 3D modeling 
  • kicad for schematic design and board layout.  
The files are located here.  I would GREATLY APPRECIATE feedback/improvements!

Thoughts on the Design

EC Circuit – Op Amp

The EC Circuit (kicad file EC.sch) uses three op amps.  My PoR – it is not uncommon for me to change to another part as I learn more – is to use Microchip’s MCP6244 (data sheet, digikey.com page).  I am concerned this chip might not be available in quantities in the future.  After contacting digikey.com over email and receiving this reply: Thank you for contacting Digi-Key with your inquiry. As far as I can tell neither the manufacturer nor Digi-Key intends to discontinue the MCP6244-E/SL. The part that we have in stock is packaged in tubes. 57 to a tube. That is why there are no price breaks over 100 pieces. If larger quantities are required we also offer the T&R packaging under Digi-Key part number MCP6244T-E/SL-ND. Which can be ordered in multiples of 2600. It is a non-stocking part for us so you obviously need to plan ahead for a manufacturing run. OK, so I’ll keep using the MCP6244 in this design.  I use the MCP6241 in the design of the Healthy pH which gives me the benefit of already being familiar with the chip’s design and pin out.

Input Bias

When I was designing the (first iteration of) the Healthy pH Shield, I took a look at longer look at the acceptable Input Bias (IB) of the op amp to use in the design.  I figured a really low IB would be awesome.  However, it would end up driving up the BoM.  On the other hand, if the IB is too high, it will be impossible to get readings.

At this point I am making a leap of faith in believing the acceptable IB will be similar to a pH meter’s.  I should look at this more closely.  Here is my rationale based on my design of the Healthy pH Shield:

In TI’s app note, the writer notes (1.3):…even a small input-bias current can produce a large voltage error when injected into the very high impedance of a pH electrode…They go on to recommend the LMP7721 (digikey page) which costs $11.17 @ 1 quantity (OUCH!). The IB is indeed low at 3fA.  But is this low of an IB current required?

The resolution required of the pH sensor is .1 pH value.  A pH reading is based on a line from +/-.414 with a (calibrated) slope of 59.16mV when the temperature is 25˚C and the probe is working perfectly.  This gives me an estimate for how much IB can be tolerated in the Lettuce Buddy design.  The circuit needs to detect differences of at most 5.9mV.  I’ll allow 2.5mV noise (after calibration and temperature adjustment). Using I=V/R and assuming R = 500MΩ, IB = 2.5mV/500MΩ = .0025V/500,000,000Ω = 0.000000000005A = 5pA.  If I assume the output impedance of the probe is 1GΩ, the maximum acceptable IB is 2.5pA.Thus any op amp with an IB <= 2.5pA will work.

Offset Voltage

I’m less concerned about the input offset voltage.  The Input offset voltage will get calibrated out.  To calculate the slope, the probe is calibrated by measuring readings in a solution that is at 10pH and then 7 pH.  The slope is then calculated between these two points.  This gives a value “around” 59.16mV – based on the quality/age of the probe, the temperature of the bath, and  the offset voltage.

Use Three Op Amps

While the part I am using has 4 op amps, I will only be using 3.  The concern here is there might be voltage leakage on the (inverting and non-inverting) inputs of the op amp.  The voltage could leak its way through the op amp.  By doing so, the readings are no good.  This is why a 10K pull down resistor is placed between the inverting and non-inverting inputs of the third op amp in EC.sch.

Measuring Conductivity

An E.C. value tells us how conductive a nutrient solution is.  

As noted in this post on the miniEC circuit – EC is measured in Siemens (S) – a measurement of conductance.  
From information in this post:
Conductivity is an index of how easy it is for electricity to flow. In water, it is the ions that pass electricity from one to the next. This means that the more Na+ and Cl- contained in water the more electricity is carried, and the higher the conductivity.

Conductance comes from the separation of NA+ and CL- ions when salt (NaCl) is placed in water.

Conductivity is the inverse of R.   Plugging in Ohms law, V = IR, V/R = I, V*C=I, C=I/V.  

Thus one goal of the E.C. hardware and firmware is to find out the amount of resistance in the nutrients and convert it to an E.C. value.

Given an E.C. value, we can go to a chart that gives us a range of acceptable values for a particular plant.

To illustrate the application of E.C/Conductivity in hydroponics, I took the recommended E.C. range from this web page for popular plants:

Plant

E.C. (mS)

R (Ω)

Lettuce

0.8 – 1.2

1,250 – 833

Tomato

2.0 – 5.0

500 – 200

Cucumber

1.7-2.5

588 – 400

Basil

1.0 – 1.6

1,000 – 625

The better the conductivity, the lower the resistance.  Tomatoes seem to have one of the best conductivities.  I’m guessing this means there are more nutrients (or denser?) for tomatoes. 

Choosing a Probe to Match the Conductivity

A term that comes up with E.C. measurement is K (the cell constant).  According to this post:

The cell constant, K, is equal to the distance in cm between the probe’s electrodes divided by the surface area of the electrodes in cm2. For solutions with low conductivities the electrodes can be placed closer together or made larger so that the cell constant is less than one. This has the effect of raising the conductance to produce a value more easily interpreted by the meter. The reverse also applies, in high conductivity solutions, the electrodes are placed farther apart or made smaller to reduce the conductance of the sample. By using the appropriate probe, K=0.1 for low conductivity solutions, K=1 for normal solutions and K=10 for high conductivity solutions, accurate measurements across the full range of conductivity values can be made.

While any conductivity probe can be used with the Healthy EC Shield, I will start out using a conductivity probe with a K value of 0.1 based on the chart provided by Atlas-Scientific (p. 7) and the explanation above (For solutions with low conductivities the electrodes can be placed closer together or made larger so that the cell constant is less than one. This has the effect of raising the conductance to produce a value more easily interpreted by the meter).

K Value

Accurate Reading Range

Resistance Range

0.1

0.0005mS to 50mS

2MΩ to 20Ω

1.0

0.005mS to 200+mS

200KΩ to 5Ω

10

0.01mS to 1S

100KΩ to 1Ω

 

The Side Effects of Injecting a Current

In order to get a reading, an E.C. circuit injects a small amount of current into the nutrient.  A side effect of this is a pH reading taken while the current is being injected will be disturbed.  So don’t take a pH reading at the same time an E.C. reading is taken.  I’ll be handling this in the firmware.

The Importance of Temperature

The firmware must take the temperature of the nutrient bath into account when figuring out the E.C.   I thought this post gives good advice:

The effect of temperature on conductivity readings depends on the solution being measured. The effect is greatest in low ionic strength (low conductivity) solutions. A general rule to follow is there will be a 2% change (increase)/˚C

Adding Nutrients

After the firmware takes a reading, it determines how much (if any) nutrients need to be added to the bath.  One of the things I will be iterating on is when and how long to turn the pump on and off.  My tests will be focused on the range of E.C. values for lettuce.

Next Steps

I have an EZO-EC breakout board from Atlas-Scientific that I am going to test calibrating and getting readings.  A future post will describe what I did.

 


Advertisements