Additional Learnings About the minieC Circuit

Tags

, ,

This post is a follow up to this post – where I dissected SparkysWidgets’ minieC circuit.

Thanks to Those that Go Before

 While this is a short post, It is important to thank exceptional folks whose sharing of their knowledge has greatly benefited my learnings.

  • @SparkysWidgets –  Thank you for your help.  You have been inspirational.  if you are interested in this stuff, PLEASE check this person out!  I will be borrowing heavily from the minieC product and schematic.  
  • The person behind this wonderful post on the electronics behind an EC sensor.
  • Chris Gammel - our very knowledgable and gifted instructor of Contextual Electronics.  A course I would highly recommend if you are interested in turning your prototypes into PCBs and learning tons about electronics along the way.  The more time I spend with Chris, the more I realize what an exceptional person – both in knowledge and in ethics – he is.  Chris is amazing at clarifying circuit concepts!
  • Mike Engelhardt – thank you for LTSpice.  What an exceptional contribution to circuit designers!

Follow Up on minieC Readings

At the end of the post I was curious about the waveform of the digital signal that comes out of the last op amp and then read by the ADC.  I thought it should look like this:

rectifiedACSignal

but it looked more like this:

minieCRectified

I brought this up with Chris during our Google Helpout (note:  I do not get paid for endorsing Chris – quite the opposite – I get a lot of value from Chris and hence pay him – you can sign up to talk with Chris via a google help out.  The link is here).

Chris asked that I try several values for C7 and then several values for R10.  

I tried 10pF, .1µF, 1µF, 10µF, and 50µF.  I ran the simulation twice.  The first time R0 – the substitute for the E.C. Probe – was set at a resistance of 200Ω.  This is about the resistance I would expect for a tomato nutrient bath.  The second time the resistance of R0 was set at 1000Ω – what I would expect for the nutrient path if the plant was lettuce.

SeveralValuesForC7

Here are the results when C7 was set at 10pF, 1µF, and 50µF:

StepSimulationCap

R0=200Ω

R0_1000_SeveralValuesC7

R0 = 1000Ω

As expected, the waveform smoothed out as the value of the capacitor got larger.  The 1µF capacitor is what is used in the minieC design.  The 10pF looks too noisy.  As R0 got larger, the smoothed out voltage value began to give a larger value.  Given this, 1µF seems like a “best” fit for this design scenario.

The next LTSpice simulation I ran was to keep the capacitor at 1µF and plot R10 values for 100Ω, 1KΩ, 10KΩ, and 100KΩ.

The first image set R0 at 200Ω (closer to the tomato range):

DifferetR10R0200

R0 = 200Ω

 In the second simulation I set R0 to 1KΩ – what I expect for lettuce:

SeveralValuesForR10R01000

R0 = 1KΩ

Given the results, it looks like Sparkyswidgets’ choice of 10KΩ for R10 makes sense.

 

That’s it for now.  A simple update to share my LTSpice results to determine the “best” values for smoothing out the DC current going into the ADC without smoothing out the value too much.  It looks like the choices made were the right ones.

 

Calibrating pH using Sparky’s Widgets minipH

Tags

,

I spent a chunk of time understanding the design of SparkysWidgets minipH breakout board.  I posted what I learned here.  My conclusion is – at least at this stage – nice design!  I’ll use SparkysWidgets minipH in my current prototype.

The Goal

The goal of this post is to get the pH readings of the miniPH as accurate as possible.

The Setup

minipHSetup

The pieces in the picture include:

  • the minipH breakout board
  • an Arduino Uno
  • a breadboard
  • jumper wires
  • pH probe and calibration solution from Atlas Scientific.   I had purchased the pH kit earlier and used it to run tests which I documented in this post.
pH Kit

While I consider the price on the high side, I am using the probe and calibration solutions from the kit because Atlas Scientific is known for quality products and I have familiarity and confidence in them based on my prior use.  

The Process

The process to reach the goal will include:

  • Understand results from running Sparky’s Widget’s minipH.ino.
  • Calibrate the readings.
  • Implement any changes to the setup and Arduino sketch that will improve the readings.
  • Document final readings.

Initial Run of minipH.ino

It was very easy to wire the prototype.  All I needed to do was solder headers onto the minipH breakout board so that the Vin, GND, and I2C (SDA and SCL) pins can be wired to the Arduino. 

I ran the sketch when the pH probe was in each of the calibration solutions and took a screen shot of the serial monitor:

pH 4

pH 7

pH 10

I was happy to find the results were reasonable since I hadn’t calibrated yet. 

Evolution of minipH.ino

minipH.ino gives me the basics of what I need to calibrate the pH voltage step and to read the pH.  I will evolve this sketch to:

  • use a state machine to handle input.  This will make the code easier to read and easier to change to different displays.  The first display I will  use is the serial monitor.
  • calibrate based on a weighted average of several readings.
  • determine if the probe needs to be replaced.
  • read the pH.  In this case there is no need to change what Sparky’s Widgets has done.
  • show the info on what was used in calculating the pH voltage step.   I will use what Sparky’s Widget has provided and add to it.
The sketch – minipH_bitknitting.ino –  is located here.

State Machine Input

I based input from a person using this system on the following state machine:

State Valid Keys or Code To Run Next State Outputs
INPUT_CHAR 4,7 CALIBRATE  
  ? HELP  
  p,P CHECK_PROBE  
  r,R READ_PH  
  <any other character> INVALID_ENTRY  
CALIBRATE -> calibrate pH INPUT_CHAR Display new slope
READ_PH -> read pH   Display pH value
HELP -> show help INPUT_CHAR Display inputs
CHECK_PROBE ->check probe INPUT_CHAR Display amount deviation and $ noise in readings
INFO ->show info INPUT_CHAR Display the params used in calculating the pH
INVALID_ENTRY ->print message, go to help HELP Display invalid entry text

Calibration

For a pH probe to match default (ideal) readings, it is assumed there is a voltage change of 59.16mV per pH unit (I’ll refer to the voltage change per pH unit as the pH voltage step.  For example – in the ideal –  a pH of 0 reads 59mV higher (0.414V) than a pH of 1 (0.355V).  One thing that has been stamped in my mind from doing pH explorations is the importance of calibration.  Each pH probe is going to measure the pH differently.  A big factor is how the voltage measurements that come in through the ADC and then converted to a pH value vary from the ideal readings.  Knowing this variance from the ideal readings allows the formula for calculating the pH to be adjusted and hence more accurate.
The sketch has two commands for calibration:
  • 4 – assumes pH probe is in a pH 4 calibrated solution.  Takes the reading and adjusts the pH voltage step to use this reading.
  • 7 – assumes pH probe is in a pH 7 calibrated solution.  Takes the reading and adjust the pH voltage step.
Here is the line of code that adjusts the pH voltage step:
 
params.pHStep = ((((vRef*(float)(params.pH7Cal – params.pH4Cal))/4096)*1000)/opampGain)/3;
 
if you find this line of code confusing – not to worry – check out this post and minipH.ino.
Values to take note of in this equation include:
  • 4096
ADCImage
as shown in the image, an ADC takes in an analog input and puts it into a discrete step.  In the case of a 12 bit ADC – which is used by the minipH – there are 4096 discrete steps – 2^12.  In comparison, the ADC on the Arduino is 10 bit. This means there are 2^10 discrete steps = 1,024 discrete steps.
  • vRef – as the shortened name implies, this is the voltage reference.  It determines the mapping between the analog and digital output.  For example, the vRef of the MCP1541 is a stable 4.096.  When a reading comes in from the ADC, it’s discreet value will be between 0 and 4095.  Which discreet value will be determined by VRef/4096.  4.096 is a great VRef for 12 bit ADCs since 4.096/4096 is 1mV.  When the VRef is 4.93V – for example what I might see when using the USB port on my Mac as a power source, the division is 4.93/4096 = .001203613 – not as even a chunking of the analog into discreet parts.  I’ll discuss this a bit more below.
  • opampGain – recall in my earlier post the first op amp was used to amplify the voltages coming in from the pH probe.  This is what the opampGain is.  In the schematic for the minipH, the op amp gain is 5.68.

 VRef

When I looked closer at the minipH breakout board, I noticed it did not include the MCP1541 as the schematic shows. The schematic seems to not be up to date with the actual minipH breakout board.  OK.  I can’t use the AREF of the Arduino, because AREF assumes the Arduino’s 10 bit ADC is being used.  This means I will use the 5V out of the Arduino as the VRef to the ADC.  Every time I have measured Arduino’s 5V out, it has been higher that 4.096, typically around 4.93.  Yet constantly measuring and adjusting the vRef variable based on DMM readings was a non-starter for me.  I could decide to use 4.93 – assuming this is “close enough” or somehow I could get the actual value of the Arduino’s 5V out.  A Google search and I have found code from a very sharp person that indeed calculates the 5V out.  How terrific is that?  I may not be capable of figuring this code on my own, but happily – this person shared!  See the readVcc() function in minipH_bitknitting.ino.

Output from the readVcc() function and my DMM got the same value – 4.94V for Arduino’s 5V out.  mV results from a few ADC readings when the probe was in the pH 7 calibrating solution:

 

ADC 4.096 4.94
2104 2.10 2.54
2106 2.11 2.54
2124 2.12 2.56
2107 2.11 2.54
2120 2.12 2.56

shows the difference when vRef is left at the default of 4.096 and not what is used when the MCP1541 is not use is about .5mV.  I had this table that maps the pH value to the expected ADC reading (shift column) in my previous post:

pH Signal(s) -(S*Gain) Shift
0 0.414 -2.179 0.339
1 0.359 -1.869 0.649
2 0.309 -1.559 0.959
3 0.249 -1.249 1.269
4 0.189 -0.939 1.579
5 0.129 -0.629 1.889
6 0.069 -0.319 2.199
7 0.009 0.009 2.509
8 -0.069 0.319 2.819
9 -0.129 0.629 3.129
10 -0.189 0.939 3.439
11 -0.249 1.249 3.749
12 -0.309 1.559 4.059
13 -0.369 1.869 4.369
14 -0.419 2.179 4.679

 Using the result from readVcc() gets a value that is closer to what I would expect to be more accurate.

 Op Amp Gain

At first I was surprised to see the opAmpGain set to 5.25 in minipH.ino.   After a closer check at the minipH schematic

minipHSchematicGain

 

the two resistors – R8 and R7 – used for the gain, I found R8 on the PCB to be 200K.  So the OpAmpGain is indeed 5.25 and not 5.7 as calculated in the previous post.

I am using a weighted average of many readings when calculating the pH voltage step.
I decided to take multiple readings and weight them because given the characteristics of the readings to aid in eliminating noise.  One spot where noise occurs when the pH probe takes the reading.  The pH probe is made of glass which isn’t that great in creating an electrical circuit.  This means it has a very high output impedance, typically around or more than 100MΩ. SpakysWidgets notes: “A typical probe has an impedance of anywhere between 50MΩ and 500MΩ, and since 100MΩ*1nA=.1v even having a single stray nano amp can throw our measurement off by almost 2 entire ph units.”  Here is the chunk of code I added to use a weighted average of multiple readings when adjusting the pH voltage step:
  int adc_result;
  unsigned long currentMillis = millis();
  lastpHCalibrationMillis = currentMillis;
  while (currentMillis – lastpHCalibrationMillis < pHReadCalibrationPeriod) 
  {       
    //get a pH reading (assumes pH probe is in a calibration solution)
    adc_result = readADC();
    float last_pH = params.pHStep;
    //modify the mV between pH readngs by the current adc reading
    if( pHCalibrating == 4 ) calibratepH4(adc_result);
    if( pHCalibrating == 7 ) calibratepH7(adc_result);
    //add the new calibration reading to the weighted average.. putting a weight of 70% on latest additions was decided as a starting place…
    params.pHStep  = .7 * params.pHStep + .3*last_pH;
    Serial.print(“pH Slope: “);
    Serial.println(params.pHStep);
    currentMillis = millis();      
  }
  //write the new pH voltage step unit to EEPROM so that it is stored in ‘permanent’ memory
  eeprom_write_block(&params, (void *)0, sizeof(params)); //write these settings back to eeprom

Replacing

 Like tires on our cars, pH probes deteriorate to the point in which they must be replaced.  Or perhaps the pH probe is not up to the job.  But how off should the pH readings be from the ideal before I must use a different pH probe?  Based on information provided in this post:
Generally speaking, when an offset of more than 30 mv (at 7.0 pH) develops or more than 2 minutes is required for a probe to stabilize in a buffer solution a probe has reached end of life or needs reconditioning.
 
Based on this sentence, there are two things I should look at to answer if I need to replace my pH probe:
  • the pH 7 reading of a calibrated solution should be 0mV.  Is the reading > 30mV or <-30mV?
  • are the pH readings within a 2 minute time below an acceptable noise threshold?
I don’t know what the acceptable noise threshold should be.  I’m thinking it should be fairly relaxed to accommodate the inherent noise of the readings.  I’ll start with 10%.  See minipH_bitknitting.ino.
TBD: code

Reading

Sending the ‘r’ or ‘R’ character to the arduino takes a pH reading.  Check out the readpH() function to walk through how the pH is calculated based a reading of the ADC.  

Reflections

My Yippee! Moment came when it appears the minipH probe worked as advertised.  It is a nice, simple design.  I was surprised to find the VREF IC was not there.  However, given the resolution of the readings, using the function to calculate the Vin seems to work fine.

What’s Next

I plan to evolve my knowledge of the minieC sensor using the same methods I used to understand the minipH sensor.  By doing so, I am gaining a practical understanding of the components in the circuit.  With perhaps op amps being the star of the show.   

 

 

Thank you for reading this far.  I hope you find many things to smile about.

 

A Salad a Day – The Charge Pump: -V(Out) and AC Noise

Tags

This post is about figuring out how much -V is being delivered by the charge pump IC to the op amp IC I used  I used in the pH Circuit I breadboarded in an earlier post.

The Goal

The goals of this post include:

  • knowing the -V rail to expect for the op amp I use in the breadboard pH circuit.
  • gaining a solid understanding of AC Coupling as it applies to detecting AC noise coming from the Vout of the Charge Pump.  I cover the Charge Pump and its pins in this post.  The V(out) of the Charge Pump is used to provide -V to the op amp in the pH circuit such that negative pH signals can be read.
  • deciding if the pH circuit needs to evolve to reduce the AC noise that is attached to the V(out).

Thanks To Those That Go Before

These folks have made a tremendous positive impact helping me learn the electronics concepts and practicalities that I needed to complete this prototype of a pH circuit.

  • @SparkysWidgets –  His phSensor schematic and blog post is all you need to get started.  Because I lack the background in electronics, I didn’t understand much of the post at first.  This got me writing out what I learned here.  This person has been exceedingly thoughtful and open with his knowledge.  Kindly (and I assume patiently!) pointing me in the right direction.  Please consider supporting his efforts.
  • Chris Gammell - our very knowledgable and gifted instructor of Contextual Electronics.  A course I would highly recommend if you are interested in turning your prototypes into PCBs and learning tons about electronics along the way.  Chris’s teaching style is exceptional.  He teaches more like a knowledgable guide.  He does first what he expects us to do, examines his mistakes, and constantly seeks and uses feedback from his students.  Chris is exceptional.  His efforts are another I highly recommend support in
  • Gabriel Anzziani – the creator of a very nicely done oscilloscope for the price.  This is the first time I used a scope.  I admire Gabriel’s ability to keep a tool simple. THANK YOU!

Debugging Tools

A challenge I have with using both tools for measuring voltage and current is receiving different readings.  It is becoming too time consuming to properly measure everything.  I will restrict voltage, current, resistor readings to coming from the EX330.  The Oscilloscope will provide a view into the noise around the signal – which means there is a voltage – time relationship / graph.

Test Scenario

To measure the amount of AC noise coming from the V(out) of the MAX1044, I disconnected the TL072 op amp from the MAX1044 on the pH circuit in order to isolate the Charge Pump from the Op Amp.

imageOfBBTestSetup

I then measured the Voltage .  The intent with adding the resistors was to add: no load, around 5mA load, and around a 10mA load.  These current values were chosen because the spreadsheet notes:

They deliver 10mA with a 0.5V output drop.

The words in this sentence lead to potentially different interpretations.  I assumed:

  • “They” means the MAX1044
  • “deliver 10mA” means UP TO 10mA
  • “with a 0.5V output drop” means any load will cause the voltage output drop to be .5 V.  Thus, the maximum value for -V(Out) = power source voltage – .5V.  Meaning a perfect Arduino Uno 5V source allows a -4.5V rail.  In a breadboard prototype the 5V source varies a bit in value – typically from 4.8 to 5.02, so the -V(out) will also vary by this amount.
Sanity check: Since I’m pairing the MAX1044 with the TL072, how much current does the TL072 need?  According to the data sheet for the TL072, Each op amp needs a max of 2.5mA.  There are two op amps, so the max needed is 5mA.  The MAX1044 can deliver this, at a cost of .5V on the -V rail.  I expect a -V rail of around -4.5V.

-V(out) Measured Results

This is what I measured:
Measured Expected Measured
R I I -V(out) Arduino V
470 -0.00745 -.00796 -3.74 4.96
510 -0.00759 -.00788 -4.02 4.96
1000 -0.00437 -.00444 -4.44 4.98
2200 -0.00211 -.00215 -4.72 4.98

I had a set of resistors I’d gotten earlier.  Convenient values to measure included 470Ω, which at 5V has a current of close to 10mA.  As well as 1K, 5mA at 5V.  Based on the data sheet’s statement: They deliver 10mA with a 0.5V output drop.

I saw a drop of 1.22V with a 470Ω resistor and .94V with a 510Ω resistor.  -V(out) gets closer to the Arduino’s 5V input power as the current is lowered.  When the resistor was 1K – which is about the load of the op amp at 5mA – the measured v(out) was -4.44 a voltage drop of -5.4 volts – in close range to: They deliver 10mA with a 0.5V output drop.

I am not sure why the -V(out) is not at the .5V drop for 470Ω and 510Ω.  I am not concerned for the pH circuit since the signal range is +/-.414V – well within the -V(out) range.

I then measured the -V(out) when the MAX1044 is connected to the TL072 and the scope is inputing an AC signal of +/- .414V.  The Voltage source (Arduino) measured 4.92.  I measured -V(out) to be -4.34, a difference of .58V – close to the .5V drop noted in the Max1044 data sheet.  This result seems to be within the range of the expected.

Now I’ll move on to measuring the AC noise on the -V(out) line.

On to AC Noise

Since this is the first time I have measured AC noise, I’m documenting what I did/learned on this process.

How I measured AC Noise

When I first looked at the -V(out) signal coming out of the MAX1044, I didn’t see any noise on the scope.  It turns out it can’t be seen on the scope because the DC signal is hogging up the display and shifting the frequency (y axis).  This seems totally rude to me…but..how to shift the focus back to the AC frequency?  The focus on the DC frequency is referred to a DC bias.  In order to analyze the AC noise, the DC signal needs to be removed from the scope’s probes.  A simple way to remove the DC signal so that I can look at just the AC noise is to use AC coupling.

To measure AC noise I will use the Xminilab oscilloscope.

The Xminilab does not have AC Coupling built in.  I’m glad it didn’t because it gave me the opportunity to get a hands on understanding of what AC Coupling is by building a simple DIY AC Coupler.  Chris figured this out and showed us how to do it in a Contextual Electronics segment.  Here is an image from the scope’s manual:

ACCouplingDIY

Ah – yes…use a capacitor to filter out a signal.  So we all set about and built our AC Coupling “dohicky” which takes the place of the switch.  Here’s mine:

ACCoupler

To get closer to how the circuit will be used, I used the AWG of the Xminilab to add a sine wave as input to the TL072 op amp’s pin 3.  Then I put the wires of the DIY AC Coupler on -V(out) of the MAX1044:

XMiniWithACCoupler

And…no need to wait for it…a YIPPEE MOMENT! I could now see the AC noise on my scope:

I measured the frequency of the AC signal to be 2.7KHz,

ACNoiseFrequency

a high frequency when compared to a 1Hz pH signal’s frequency.

The ∆V =.165V,

ACNoiseOnV-Out

3.7% noise when the -V(out) is -4.34, as measured earlier.

I can think of the following ways to lower the signal noise added by the MAX1044:

  • use a larger capacitor than the 10uF connected between -V(out) and GND
  • use the MAX1044’s BOOST mode.  The data sheet notes: Connecting BOOST to V+ increases the oscillator frequency by a factor of six.  I’m thinking what this means – please let me know if I am wrong – is the MOSFETs in the MAX1044 will open/close at a faster frequency when BOOST is connected into the circuit.  The increased frequency will cut down on AC noise.
I had a 47uF and 470uF capacitors I got as part of a pack.  Here are the measurements I got for AC noise when using each sized cap:
∆V – no BOOST ∆V – BOOST
10uF 0.12 0.06
47uF 0.05 0.05
470uF 0.025 0.025
while a higher capacitor value lowered AC noise when the BOOST pin was not used, there was not much of a difference between using a different capacitor or using BOOST mode.  The results for the 470uF – the largest capacitor – seems to benefit noise reduction on top of using BOOST mode.

Conclusions

I have increased my ability to design a more robust circuit by knowing how to analyze AC noise.  As Chris pointed out to me, even a small amount of noise will cause significant errors in reading.  Particularly since the pH signal has a small amplitude of +/-.414V.  Changes I plan to make in the pH circuit to minimize AC noise include:

  • using the BOOST mode of the MAX1044
  • increasing the capacitor located between -V(out) and GND from 10uF to around 500uF

By making these two adjustments, the ~ 2.6% AC noise of the =-V(out) decreases to ~1.3%.  Adding a higher capacitor should further eliminate the AC noise to ~ .56% based on the measurements I made.  While this is a “one of” measurement on a bread board prototype and every PCB/chip arrangement will vary the results, the general take away I have is to use BOOST mode and a larger capacitor to lower AC noise in the pH signal circuit.

What’s Next

I’m going to let my new found conclusions stew a few days before I update the pH circuit schematic.  Maybe my conclusions are ill-informed.  I am hoping one of you kind readers will point out assumptions or test methods I used that caused me to make incorrect conclusions.  After a few days I will update the pH circuit schematic.  I need to keep making progress on building the BenchBudEE, our project in Contextual Electronics.  Wow – I’m learning A LOT about soldering PCBs.  Another “learn by doing” I am happily lapping up is following the values of a sub-circuit as a solder on more parts.  For example, I’ve been following the schematic for the +12V, adding C’s, R’s, inductors, POTs, LM317 and LM337…after each addition, I check what voltage I get and compare it to what I expected to see.  It is the first time I have a strong look at reading the schematic, comparing that to the board layout, and then checking out the values on the actual PCB!  What an amazing experience.  The other great part here is seems to me that most folks taking the course are more advanced than me.  I LOVE being the least educated/skilled – I learn more and I am lucky that my classmates exuberantly share their techniques.  Chris did a great job setting up the collaborative environment to enable this incredible feedback.  I also want to make progress on the EC circuit.

A Salad A Day – Breadboard prototype of pH Circuit

Tags

, ,

It is time to try out the pH circuit on a breadboard.  

The Goal

The goal of this post is to match the signals on a breadboard circuit to those created from an LTSpice simulation of the pH Circuit.  I haven’t discussed the LTSpice simulation yet.  I hope to do that soon.  Chris uses LTSpice to simulate circuits he goes over with us in the Contextual Electronics course.  Wow – what an exceptionally useful tool!  Through building a simulation in LTSpice, I was able to significantly increase my knowledge of the inputs and outputs of the ICs.  This helped me better understand more aspects of an op amp.  I say more aspects, because I don’t have a strong grasp on all the varieties of ways an op amp can be hooked up.  There is also a concept or two of the inverted op amp that I still scratch my head about.  The best way for me to learn though is to try out what I know, build on that, and add as needed. 

Thanks To Those That Go Before 

These folks have made a tremendous positive impact helping me learn the electronics concepts and practicalities that I needed to complete this prototype of a pH circuit.

  • @SparkysWidgets –  His phSensor schematic and blog post is all you need to get started.  Because I lack the background in electronics, I didn’t understand much of the post at first.  This got me writing out what I learned here.  This person has been exceedingly thoughtful and open with his knowledge.  Kindly (and I assume patiently!) pointing me in the right direction.  Please consider supporting his efforts.
  • Chris Gammell - our very knowledgable and gifted instructor of Contextual Electronics.  A course I would highly recommend if you are interested in turning your prototypes into PCBs and learning tons about electronics along the way.  Chris’s teaching style is exceptional.  He teaches more like a knowledgable guide.  He does first what he expects us to do, examines his mistakes, and constantly seeks and uses feedback from his students.  Chris is exceptional.  His efforts are another I highly recommend supporting.
  • Mike Engelhardt – thank you for LTSpice.  What an exceptional contribution to circuit designers!
  • Gabriel Anzziani – the creator of a very nicely done oscilloscope for the price.  This is the first time I used a scope.  Chris recommended the XMinilab for the course.  I admire Gabriel’s ability to keep a tool simple. THANK YOU!

Debugging Tools

  • DMM – I used a DMM (Digital MultiMeter) to check the power values across the circuit.
  • Simulation – I used LTSpice IV on Windows to simulate the pH Circuit.  The simulation gave me more confidence on what the values should be at the important pin i/o’s in the circuit. 
  • Oscilloscope – I am new to using a scope.  I started with the BitScope 10 Oscilloscope . I found the UI and features to be overly complex and the user’s guide to not provide me with the easiest information to get me going.  Of course, this is most likely my problem because I do not understand not only the software, but how to use the scope.  Chris recommended the Xminilab XScope.  At first I was skeptical if this simple piece of hardware – more like a kit than a product – would help me.  To my  happy surprise I found the Xminilab to be incredibly easy to use and provides only the amount of information that I needed.  Powerful, yet had training wheels for folks like me.

The Circuit

Here is an image of the schematic I created in LTSpice:

PhCircuitDecouplingCapLTSpiceSchenatic Question

 A sine wave of +/- .414 is input into the non-inverting pin of the first op amp.  The output from the first op amp amplifies the signal by 5.681.  The second op amp takes in the amplified signal on its inverting pin. The output of the second op amp inverts and shifts by 2.5 the values of the sine wave.  This sine wave now has values between 0V and 5V, which will be read by the Arduino script.

Parts

I ordered “breadboard friendly” parts from digikey

Mft number

Digikey number

Qty

$

Description

TL072IP

296-14997-5-ND

1

0.70

8-DIP 2 channel TL072 op amp

MCP1541-I/TO

MCP1541-I/TO-ND

1

0.92

Through hole 4.096V VREF

MAX1044CPA+

MAX1044CPA+-ND

1

3.03

8-DIP charge pump

I had the following parts on hand:

Part Quantity
220K R 3
1K R 1
3.3K R 1
47K R 1
10uF C 2

The breadboard prototype differs from the simulation/SparkysWidgets’ schematic:

  • I did not have 3K resistors so I used 3.3K.
  • I did not put in C1 at this point.  I’ll get back to C1 in a bit.

TL072

The TL072 pin out (data sheet): 

TL072

I wanted to make sure that I wired the chip up correctly.  I created this table to give me a better feel for the purpose of each pin and how it maps to the LTSpice simulation:

Pin i/o name i/o description
1 Out Gain op amp pH_Gain
2 V(in-) Gain op amp V_negFeedback
3 V(in+) Gain op amp AWG (Arbitrary Wave Generator, Future: pH signal)
4 V- wired to to pin 5 of the MAX1044 (V- input)
5 V(in+) Shift op amp 5V with 1K and 3.3KΩ = 5*(1/4.3KΩ) = 1.163V
6 V(in-) Shift op amp output of Gain Loop, wired to pin 1
7 Out Shift op amp pH_Shift
8 V+ wired to Arduino 5V power supply (Future: AREF)

 

 

 

 

MAX1044

MAX1044 Inverted Charge Pump (data sheet):

MAX1044

The diagram shows polarized capacitors being used.  I asked Chris if it mattered whether the caps were polarized or not.  He said no – the reason they were polarized was because about 10 years ago (perhaps less) 10uF caps were not available.  I am using electrolytic caps because I have them on hand.

The description of the MAX1044’s pins: 

Pin i/o name i/o description
1 Frequency Boost Connecting BOOST to V+ increases the oscillator frequency by a factor of six. When the oscillator is driven externally, BOOST has no effect and should be left open.
2 CAP+ Connection to positive terminal of Charge-Pump capacitor
3 GND The positive terminal of the reservoir capacitor is connected to this pin.
4 CAP- Connection to negative terminal of Charge-Pump capacitor
5 VOut Negative output V. Connect negative terminal of reservoir capacitor to this pin.
6 LV Low-Voltage Operation. Connect to GND for supply voltages below 3.5V.
7 OSC Oscillator Control Input Connecting an external capacitor reduces the oscillator requency. Minimize stray capacitance at this pin.
8 V+ Power supply voltage input.

I did not use pins 1, 6, and 7. 

Bread Board Results

Here is the pH circuit on the breadboard:

PHBreadBoardLabeled

 

The important i/o points of the signal are the TL072’s pins:

  • 3 – a sine wave is input into the TL072.  A pH signal’s amplitude is +/- .414V
  • 1 – the output of the first op amp.  This is the pH signal that came in on pin 3 amplified by 5.681
  • 7 – the output that is to be read and interpreted by the Arduino.  This takes the output of pin 1, inverts the signal, and then adds 2.5 to each value so that all values are between 0V and 5V.
Successful results are the values at these pins for the simulation and bread board are close enough to feel comfortable the circuit is working as expected.

Input Signal on pin 3

A YIPPEE MOMENT! I was able to set the incoming sine wave to +/- .414V in the simulation.  With the XScope, I could get to +/- .420V.  Reading pin 3 with the scope shows the “close enough” signal going into the breadboard.

PHSignalLTSpice

pin3AWG

Output Signal on pin 1: Amplify pH signal

The output signal  amplifies the pH_signal by 220K/47K + 1 = 5.681.  e.g.: .414*5.681 = 2.359 and -.414*5.681 = -2.359

…and…ANOTHER YIPPEE MOMENT!…the results shown on the scope of the prototype are close enough to the results of the simulation.

 

PH Gain LTSpice

OutputSignalPin1

Output Signal on pin 7: Shift negative values to be above 0V

And…after a day of frustration…YET ANOTHER YIPPEE MOMENT!  The values that will be read from the Arduino:

Ph 5VLTSpice

OutputPin7

???Question: this video shows the signal jumps from positive to negative.  I expected the output to be inverted, then shifted by 2.5?  – check out triggering

Values at Each pH Level

I created a table of the values I should read off the Arduino’s analog i/o pin: 

pH Signal(s) -(S*Gain) Shift
0 0.414 -2.359 0.159
1 0.359 -2.029 0.489
2 0.309 -1.689 0.829
3 0.249 -1.349 1.169
4 0.189 -1.019 1.499
5 0.129 -0.679 1.839
6 0.069 -0.349 2.169
7 0.009 0.009 2.509
8 -0.069 0.349 2.849
9 -0.129 0.679 3.179
10 -0.189 1.019 3.519
11 -0.249 1.359 3.859
12 -0.309 1.689 4.189
13 -0.369 2.029 4.529
14 -0.419 2.359 4.859

The signal goes into pin 1 of the TL072.  The output is amplified by 5.681.  I then inverted the amplified output in preparation for the value that will be the analog input.  The Shift column adds 2.5 to each value.  The values I should read in from the analog i/o pin range from 0.159 for pH 0 to 4.859 for pH 14.

Frequency Response and the .1uF Low Pass Filter

Earlier I noted the prototype did not include the .1uF capacitor that is in the pH schematic.  I didn’t include this capacitor because – while I got the right results for the op amps’ outputs without the cap – the results were very different when I put the cap in the circuit and ran the simulation.  This image shows the pH signal input (pin 3) and the output of the op amp used to apply a gain of 5.681 (pin 1).  When I put the .1uF cap into the circuit, the hard earned 5.681 magnification of the original pH signal disappeared!

HighFrequencyNoGain

No Gain When .1uF Cap in Circuit

Chris explained to me the relationship between wave frequency and amplification.  As the frequency of a wave increases, the amount of amplification decreases.  There is a rather well known plot – the Bode plot – that is used quite a bit in areas where the frequency response is important – such as audio equipment.  Here is the frequency response (Bode plot) for my circuit when an AC analysis is run with the amplitude set to 1:

PHCircuit Freq 1K Cap BodePlot

The first thing to notice on this plot is the Y Axis (amplification of the signal) uses dB to show gain measurements.  Smart people figured out that a dB value = 20*log(vout/vin) = 20*log(Gain on circuit) = 20*log(5.681) = 15.1dB.  Perhaps the same smart folks or maybe their friends also figured out that the cutoff point in which a wave will not be able to be amplified occurs when the frequency is 3dB less than when the frequency of the wave is at 1Hz.  3dB less than 15 db is 12.  That makes the cutoff frequency to be about 7.6Hz.  In order to realize the gain, the simulation needs to be set to less than 7.6.  Also notice how the gain curve goes slightly down before a significant drop off at around the – 3dB.  Thus the full gain is only fully realized when the frequency is 2Hz or less.  A far cry from the 1KHz I naively used as an input into simulating the pH signal!

In this image, the frequency is set to 2Hz:

PHCircuit Freq 2 Cap

Here, the frequency is set to 150Hz:

PHCircuit Freq 150 Cap

Not letting the x-axis change (because of dramatic increase to the frequency), these simulated runs verify the Bode plot.  When the frequency is way small – shown here at 2Hz – the pH signal is amplified the way I want with the .1uF cap in place.  Once the frequency is increased – in this case to 150Hz – the sine wave isn’t magnified.

Wow – a little bit of insight in how a circuit designer would pick the .1uF circuit based on the expected incoming frequency and the requirement of a 5.681 gain!

What’s Next

Before I move on to testing with a pH probe instead of the AWG, I am going to understand signal noise that is occurring because of the ICs.  Chris just taught us about AC coupling and how to DIY an AC coupler for the XScope.  I’m off to do that.  I need to solder an overwhelming amount (at least for me!) SMTs to the Contextual Electronics PCB that we designed in Session 1A and now are soldering together – component by component.  Then I want to go through the same process with understanding and building an EC circuit.

 

THANK YOU for reading this far.

Please find many things to smile about.

 

A Salad A Day – Design of Sparky’s Widgets minieC

Tags

, , ,

This is a follow up to the post I did on a DIY pH Sensor.  Emboldened with the knowledge I gained, I am now going to tackle the EC circuit.  After all, the circuit is most likely pretty similar.  And once again I expect a YIPPEE! MOMENT – so much to learn.  I’m going to keep teaching myself how to fish.

The Goal

My goal with this post is to understand and explain how an EC circuit works.  There is a very good chance that you know all of this.  I write this for those of us that don’t know it but want to learn, perhaps just for this scenario.  It is one thing to learn the field of electronics.  It is another thing to learn enough to apply it to measuring the conductivity of a solution.  Hopefully you will be inspired to share what you know about this stuff.  Then all our efforts will improve in ways that is not possible when we work in isolation.

Non Goals

  • discussing what EC values mean to a plant’s health.  This is covered in other posts.
  • a working prototype.  This post focuses on getting to know the EC circuit.
  • choice of probe.

Thanks to Those that Go Before

Learning is amazing.  How extraordinary to be able to learn from others who willingly share their knowledge.  THANK YOU!  For knowledge is indeed more powerful than currency.  And community learning is indeed more powerful than a textbook.

  • @SparkysWidgets –  Thank you for your help.  You have been inspirational.  if you are interested in this stuff, PLEASE check this person out!  I will be borrowing heavily from the minieC product and schematic.
  • The person behind this wonderful post on the electronics behind an EC sensor.
  • Chris Gammel - our very knowledgable and gifted instructor of Contextual Electronics.  A course I would highly recommend if you are interested in turning your prototypes into PCBs and learning tons about electronics along the way.  The more time I spend with Chris, the more I realize what an exceptional person – both in knowledge and in ethics – he is.  Chris is amazing at clarifying circuit concepts!
  • Mike Engelhardt – thank you for LTSpice.  What an exceptional contribution to circuit designers!
  • Afrotechmods for the bandpass LTSpice simulation YouTube video.  This video makes it super simple to understand how to build a bandpass simulation in LTSpiceIV.
  • The Hydro and AskElectronics subreddits. Thank you to all the knowledgable folks who kindly share their experience and what they have learned.
Again – thank you.  What a truly amazing learning environment.

How it Works – The Science

I’m not sure if measuring conductivity (EC) was covered in my 5th grade science class like it probably was in yours.  So I wake up today after hearing the birds chirp (go Nature GO!) thinking…how the heck does a EC probe and sensor work?  Unlike me in the 5th grade, I can use the Internet and its pages and pages of information to help figure this out.  My intent is to share what I have learned and to consolidate this learning in one space.

OK.  Here it is…the one sentence that says it all: “An EC probe measures the conductivity between NaCl and water between two probes 1 cm apart. That can’t be too hard of a circuit, could it?  And besides, I’ll have tons of YIPPEE! learning moments.

In order for me to learn, I have to get a visual around the protagonist of my story – in this case the story of one EC probe’s quest to get a voltage reading from a volume of water with NaCl in it and the EC’s circuit’s aspiration to take that voltage and bring me a measurement of TDS.  And so the story begins…

The Voltage Source – Let There be Conductivity

A small voltage source is applied to the EC probe so that it can conduct electricity.

ACSignalToElectrodes

EC Probe Acting Like a Power Hungry Monster- BWA-HA-HA!!!!

Now the fun begins.  When salt is dissolved in water, it will separate into NA+ and CL- ions.  These ions conduct electricity.

I enjoyed this YouTube video showing a simple science project in which water + salt generates enough electricity to power a light.  The video does a nice job in showing at a practical level how this stuff works.

For a more detailed view I looked at a model.  Watching the running of this model was fun.  I used the  Molecular Workbench tool  and models (WARNING! This is a DOWNLOAD)  pointed out in this wonderful post on the electronics behind an EC sensor.

ACMolecularWorkBench

Electricity Fills the liquid, Exciting the Salt Molecules

The current is measured as it passes through the two plates (which are 1cm apart).

As noted here:

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.

Conductivity is the inverse of R, so in this case V=C*1/R.   Plugging in Ohms law, V = IR, V/R = I, V*C=I, C=I/V.  So conductance comes from the separation of NA+ and CL- ions when salt (NaCl) is placed in water.

Siemens and Resistance

EC is measured in Siemens (S).  As noted in this wikipedia article, Conductance (G) = S = 1/R = I/V.  I took the recommended (average between the lower and upper bounds) E.C. readings for some plants from this web page:

Plant E.C. (S) R
Bean .003 333
Carrots .0018 556
Cucumber .0018 545
Tomato .0035 286
Lettuce .001 1000
Basil .001 1000
Thyme .001 1000

The higher the E.C., the lower the Resistance.  Resistance ranges are low – for most part within the 100’sΩ.

The Circuit

As with the pH circuit, I am going to rely heavily on SparkysWidgets EC schematic and break down the circuit.  Sparky’s Widgets GitHub for the hardware part of the minieC v 1.2 is located here.

minieC12AnalogFrontEnd

The design changed from V1.0 to V1.2.  I do not have the newer PCB.  I anxiously await the availability as well as the Arduino sketch that goes with it.  This too is not available as of this writing.

I simulated the circuit in LTSpiceIV.  I found running the simulation was a great help in understanding the circuit.  The LTSpiceIV simulation file is located here.  If you wish to run the simulation, you will either need to change the op amps to a model that ships with LTSpiceIV, or place the TL072 symbol file (TL072.asy) in the …\LTspiceIV\lib\sym directory and the model file (TL072.sub) in the …\LTspiceIV\lib\sub directory.

LTSpiceCircuit

Ryan’s comments on the minieC circuit:

The analog front end is broken up into 4 main parts (well 3 really). The first part is a Wein Bridge Oscillator to create a low distortion sine wave. 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). The 3rd stage is a super diode precision rectifier which then goes into a buffer to tie off the last op-amp in the quad package.

I broke the circuit that gets the voltage readings to the ADC into 4 parts.

Part 1: Use a Wien Bridge Oscillator to Add an AC Circuit

The first part is a Wein Bridge Oscillator to create a low distortion sine wave.

You probably know – and I just learned – the Wien Bridge Oscillator is a very common circuit used to create a low frequency, low distortion sine wave.

minieCWienBridgeOscillator

Wien Bridge Oscillator circuit in minieC

I detail what I learned about the Wien Bridge Oscillator in case you are at the same stage I am – what I call the “what the heck is that?” state.

A Wien bridge oscillator revolves around an op amp whose circuit includes:

  • A bandpass filter to set up the frequency of oscillation.
  • An initial gain of close to 3 to start the oscillation.
  • Components to maintain the gain close to 1 to keep the oscillation going with peaks that are within the op amp’s rails.

Bandpass Filter

bandpass filter clips out a frequency range that will be used by the sine wave.

BandPassWave

The bandpass filter is created by

  • one R and C is arranged in serial – which blocks out low bandwidth signals from returning into the circuit (high pass filter) and
  • one R and C is arranged in parallel – which blocks out high bandwidth signals from returning into the circuit (low pass filter)
when R=R and C=C,  f = 1/(2∏RC).  The R’s and C’s do not have to be identical.  However, they sure make calculating the frequency easier when they are.
The R’s and C’s that make up the bandpass filter in the minieC has R3 = R6 = 1K and C5 = C6 = 100nF (pretty in pink).

minieCWienBoxed

applying the frequency formula: f = 1/(2∏RC) = 1/(2*3.14*1000*.0000001) ~= 1.6K

As noted here, “If the frequency is high enough (>1khz it seems) the molecules dont have time to move apart before they are pulled in the opposite direction.”  Based on this, I’m going to assume the R and C values for the bandpass filter part of the EC circuit has a good range.

LTSpice at output of first op amp: 

 

WienminieCLTSpice

 

Start the Oscillation

(the place in the schematic is identified by the blue box).

This post notes a property of Wien Bridge Oscillators:

The circuit will oscillate when the ratio [substituted minieC’s Rs] R5/ R4 is slightly greater than two.

The minieC schematic has the Gain at 1 + 22K/10K = 3.2.  Thus, R5/R4 is slightly greater than 2 making the gain slightly greater than 3.

Sustain the Oscillation

(see the two diodes identified by the green box).

This post explains what the diodes in parallel with R5 do I changed the R references to match the ones used in the minieC schematic:

In this circuit the gain of the non-inverting amplifier is controlled by the ratio of R5 to R4. Initially the gain set by R5 and R4 will be just slightly greater than 3, this will allow oscillations to start. Once the signal fed back from the output produces a waveform across R5 that approaches 0.6Vpp the diodes will begin to conduct. Their forward resistance will reduce, and because they are in parallel with R5, this effectively reduces the value of R5 and so reduces the amplifier gain.

now that we have created a power source for the EC probe…

Part 2: Shrink the Signal

this wave is turned into a small signal(about .2VPP via voltage divider)

I see from the LTSpiceIV simulation the signal created by the Wien Bridge Oscillator has a Vpp of about .8V.  The formula for Vout when a voltage divider is used (Sparkfun has a great tutorial on voltage dividers).  For example, if the Vin = .4V, the Vout given the voltage divider in the minieC schematic would be Vout = 4700/(100000*4700) x .4V = .02V

 

minieCVoltageDivide

 

Here is an image of the results of running the LTSpiceIV simulation.  The green plot is the sine wave after the voltage divider is applied.

minieCVoltageDivider

Voltage Divider

Part 3: Apply a Gain

…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).

The wave is now ready for the Gain op amp.  I don’t know if it is a common technique – but if it is not (even if it is – new to me) – I think it is quite brilliant to use the resistance of the EC probe as part of the gain calculation.

minieCProbe

Earlier in this post I discussed the relationship of resistance to the EC unit of measurement (Conductance (G) = S = 1/R).  I also showed a table of resistance values for a variety of plants:

Plant E.C. (S) R
Bean .003 333
Carrots .0018 556
Cucumber .0018 545
Tomato .0035 286
Lettuce .001 1000
Basil .001 1000
Thyme .001 1000

The gain is 1 + 1000/(a range of values ~ 200Ω-1000Ω).  For example, if I was growing carrots, I would hope the EC probe has a resistance close to 556Ω.  In this case, the gain is 1+1000/556, 2.8

556RECProbeLTSpice

Now the Vpp is very small – at 0.02V.

output2ndOpAmpminieC

I ran an LTSpiceIV simulation that stepped through values for the EC probe resistance ranging from 200 to 1000 in an increment of 100.  The green color represents plot values for 200 (around the tomato range) while the darker colors are plots for the higher values of EC Probe resistance (the lettuce, basil, thyme range).

Part 4: Prepare Voltage to be Read by ADC

The 3rd stage is a super diode precision rectifier which then goes into a buffer to tie off the last op-amp in the quad package.

As explained here, a super diode is used to convert an AC signal to a DC signal when the AC signal is very weak – as is the case here.  

 

 

SchematiceMinieClastprobeplacement

 

I do not have any experience with super diodes.  I expected the simulation to provide results similar to what I have seen for other AC signals that have been rectified:

RectifiedACSignal

I got results that looked like a sawtooth pattern for the runs from 200 to 1000 EC Probe resistance.

ECValuesNTSpiceminieC

I need to follow up because I am not sure I made an incorrect assumption, set up the simulation incorrectly, or these results are actually the right results.  One way I will follow up is to use my scope to see what outputs I get through a prototype.  To do this, I need the circuit, which I am waiting to receive a PCB from Sparky’s Widgets.  I can also build a breadboard version which I will most likely do.  I’d also like to know what you think?  Any advice?

What’s Next

I anxiously await the new version of the minieC and Arduino sketch.  Once available, I will run tests and decipher results.  I also want to add automation (pumps) to the pH sensor circuit. In the mean time, I will follow up with those wiser than I (probably YOU!) if there are changes needed to my deconstruction of an EC circuit.

 

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

 

 

 

A Salad A Day – 4th Post – DIY pH sensor

Tags

, , ,

Chris noted at the beginning of week 3 of Contextual Electronics the value of knowing the design behind a circuit versus settling for a complete solution from a 3rd party.  In my case, I constantly wonder – how the heck does the pH sensor figure out the pH?  And the complimentary question – same for conductivity!  My highest priority in my DIY hydroponics station is “support free.”  After shipping software for over 20 years, I realize this is impossible. However, it is an important principle.  It is always better to have intimate knowledge of what I am building.  Besides – it brings me a YIPPEE! MOMENT – so much to learn.

The Goal

The goals of this post include getting:

  • an intuitive feel for what measuring pH is all about.
  • a strong grasp of the parts that go into a pH measuring circuil.
  • Get you engaged so that together we can build and learn together.

Non Goals

  • discussing what pH values mean to a plant’s health.  This is covered in other posts.
  • a working prototype.  This post focuses on getting to know the pH circuit.
  • choice of probe.

Thanks to Those that Go Before

 Learning is amazing.  How extraordinary to be able to learn from others who willingly share their knowledge.  THANK YOU!  For knowledge is indeed more powerful than currency.  And community learning is indeed more powerful than a textbook.

  • EME Systems for a great article on the hows and whys of a pH circuit.
  • @SparkysWidgets –  I bought a pH circuit.  His phSensor schematic and blog post is all you need to get started.  Because I lack the background in electronics, I didn’t understand much of the post at first.  This got me writing out what I learned here.
  • The pH Pages – useful info on how to build a pH sensor.  
  • Chris Gammell - our very knowledgable and gifted instructor of Contextual Electronics.  A course I would highly recommend if you are interested in turning your prototypes into PCBs and learning tons about electronics along the way.  The more time I spend with Chris, the more I realize what an exceptional person – both in knowledge and in ethics – he is.  Chris is amazing at clarifying circuit concepts!
  • Dave Jones for his excellent videos on different aspects of stuff we need to know about electronics.  The recent one on Op Amps is terrific.
  • The Hydro subreddit.  Thank you to all the knowledgable folks who kindly share their experience and what they have learned.
  • The AskElectronics subreddit.  Thank you for answering questions that might seem obvious to you.  
Again – thank you.  It is a much better learning environment than what I remember 20 or so years ago.  At that time, it seemed we took “knowledge is power” to be ME motivated and not understand shared knowledge is far more powerful than ME knowledge.

The Parts of a pH Measuring Device

Not knowing much about the innards of a pH measuring device, I spent a bit of time reading up on what the heck makes these things work.  It turns out a pH measuring device consists of a probe and a voltmeter.  My apologies if you are rolling your eyes at this obvious conclusion.  Up until now, the pH was just a number on a spreadsheet.  Now I am constantly wondering why?  I’m loving the mix of life, chemistry, electronics, math and programming.  But there is a good chance you have already enjoyed learning all this – probably in 5th grade science… For others who didn’t learn this stuff but are now interested, I’ll summarize what I learned.

The probe  is a glass electrode.  It measure the hydrogen ion (H+ ion) concentration in a liquid.  The image and a better explanation can be found on this post.

glassElectrode

pH Probe (glass electrode)

When the probe is put into the liquid, the H+ ions move toward the glass electrode.  This creates a tiny current which is what a pH sensor measures.  More H+ ions scurrying about means a higher voltage, which means the liquid is more acidic.  Lower – more basic.  When I look at it that way, I can see the comparison between a pH probe and a battery.  Like a battery, a pH probe generates current.  A pH probe does this by getting the  H+ ions to scurry about.  

Like a battery, the voltage can be measured.  Voltage of electrodes is measured using the Nernst equation.  This equation is used to validate that a change in 1 pH unit occurs when  the voltage changes by -59.16mV.  pH values can range from 0 (high acidity) to 14 (strong base).  Given the pH range and the voltage change (59mV) per pH unit, the range of voltages the pH probe will read is: +/-7*59mV or +/-413mv.  At  pH 7 (neutral pH) the probe produces 0 volts.

When the voltage change is not -59.16 mV

There are two adjustments that must be made to get accurate readings:

  • temperature
  • probe degradation

The charts on SparkysWidgets post gives a nice visualization of the relationship between the pH values and temperature:


Temperature
The amount of volts between pH units  depends on the temperature of the solution.  -59.16 mV assumes the solution is at a temperature of 25°C/77°F.  Googling for the temperature coefficient returned  -0.1984 mV per °C. That makes the slope -54.2 millivolts per pH unit at 0°C, and -74.04 millivolts per pH unit at 100°C. 
Degradation
Like a battery, the voltage potential for the gas probe weakens over time.  An accurate reading should calibrate the pH readings to accommodate the degradation of the signal.  To calibrate, I need a solution known to be at pH 7 and one known to be at pH 4.  Every once and awhile – say every two weeks, – I must take a reading for these know solutions and adjust for temperature.  If the voltage of the known solutions is not 0 V for pH 7 and (59.16*4) .237V for pH 4, the readings need to be adjusted to these variances.

The Circuit

Requirements

Time to design the pH sensor.  The requirements include:

  • the voltage produced by the pH probe can be read from an Arduino Uno’s digital i/o pin.
  • “fairly accurate” readings.  A pH of 5 is only 59mV from a pH of 6.  That is a very small amount of differential voltage to measure accurately.  This is because the pH probe is made of glass which creates a very small electrical current.  This means it has a very high output impedance, typically around or more than 100MΩ. SpakysWidgets notes: “A typical probe has an impedance of anywhere between 50MΩ and 500MΩ, and since 100MΩ*1nA=.1v even having a single stray nano amp can throw our measurement off by almost 2 entire ph units.” In order to get a meaningful reading, the design must eliminate most noise and outside disturbances.
  • voltage measurements must be able to interpret both negative and positive voltages since the voltage difference is +/- .414V
  • low BoM.

The Design

Components

The requirements lead to the protagonists of the pH sensor being op amps.  I’ll use two:

  • one op amp will isolate the circuit that will be measured from the circuit that is providing the reading.  This will go a long way in preventing disturbances from being introduced by the pH sensor.
  • one op amp will amplify the signal so that it can be read by the Arduino’s digital i/o pin.
the most important characteristics of the op amp are in its abilities to be as “ideal” as possible when considering attributes that would introduce changes to the pH measurement:
  • low input bias – in the picoAmps
  • high input impedance – meaning the op amp will draw as little current as possible.  This will also help minimize changes to measurements because of the parts used.
I’ll also need:
  • an ADC to convert the incoming analog signal into a digital signal that can be read by the Arduino Uno. 
  • charge pump to handle the -5V readings when using Arduino’s 5V as the power supply.
  • some capacitors to filter out noise.

Design

Why reinvent the wheel?  Besides, at this point in my learning I am still being introduced to components and what they do.  I decided to learn the design of the circuit by walking through SparkysWidget’s schematic on GitHub.  In this section I will walk through the components I mentioned before.

Op Amps

 Op Amps are the central component of a pH circuit.  Their job is to:

  • adjust the pH signal so that it can be read by an Arduino (through an ADC).
  • filter out noise in the pH signal.

Adjust the Signal

The diagram I came up with helped me to understand what is going on.  Even though SparkysWidgets said these things, I didn’t grasp what was really going on until I broke the steps down.  The process helped me better understand the fundamentals of an Op Amp.  I’ll explain what is going on in each step in case it helps you.

ChangesToPHSignal

Before the voltage signal generated by those active Hydrogen ions can be read by the Arduino (and converted to digital from analog by an ADC), the tiny signal coming from the pH probe must be transformed into a value between 0 and 5V – the voltage range the Arduino will read.  The diagram shows this in three forms:

  • block – if the step was a black box, this is what it is doing
  • 101 – simplified “behind the curtain” drawing using standard drawing of a non-inverted op amp.
  • behind the curtain – pieces of the schematic come from SparkysWidgets schematic in GitHub.

1. Signal comes in from pH probe

I noted above that the signal created by the pH probe ranges from:

  • pH 0 = .414 volts
  • pH 7 = 0 volts
  • pH 14 -.414 volts

2. Amplify Signal

Googling for “gain op amp” gave me the formula for the gain:

Using the resistors in SparkysWidgets schematic, Gain = V(out)/V(in) = 1+R8/R7 = 1+4.7 = 5.7

Gain = V(out)/V(in) = 5.7.  Or V(out) = 5.7*V(in).  When the pH of the solution is 0 (strong acid), V(in) is .414.  When the pH is 14, V(in) is -.414.

So the V(out) based on V(in) and the Gain is:

V(out acidic pHs) = 5.7*.414V = 2.36V

V(out base pHs) = 5.7*-.414V = -2.36V 

3. Shift Signal

To read the voltage value from the Arduino, the range of readings must be between 0V and 5V.  One way to do this is to add 2.5V to the reading.  The V(out) values of the Gain op amp become the V(in) values for the offset op amp.  Mapping this to 5V and 0V:

V(high) = 5V = V(in acidic pHs) + V(offset) = 2.36V + 2.5V =  4.86V

V(low) = 0V = V(in base pHs) + V(offset) = -2.36V + 2.5V = .14V

The Arduino sketch will receive readings between .14V and 4.86V

Get Rid of Noise

Given the pH probe uses glass, it’s pretty hard to get a great signal.  On top of that, there is inevitably going to be some noise.  The standard way this gets handled is to put a low pass filter in the circuit at the spot it works best to pluck out the noise.  This is why SparkysWidgets schematic includes the 1uF capacitor on the gain op amp.

LowPassFilter

 

 

 I thought this explanation summarized how the capacitor is used to throw out high frequency noise:

lowPassFilterExplanation

The capacitor’s impedance decreases with increasing frequency.

ChrisDrawingOfImpedenceFrequency.png

Chris’s Drawing Helps See How a Capacitor Works In High and Low Frequency Signals

This low impedance in parallel with the load resistance tends to short out high-frequency signals, dropping most of the voltage across series resistor R1.

The spikes (noise) gets swallowed up by the capacitor since as the spike is winging through the circuit it wants to travel the path of least resistance.  When it has a choice between The path with the resistor and the capacitor with a low impedance, its going to choose the capacitor path.  

ADC

As obvious from its acronym, the ADC takes in the shifted analog signal coming from the shift op amp and digitizes so the Arduino can interpret a value.

Resolution

Most pH charts like this one need one decimal point resolution.  I want to be able to read a pH of 7 and a pH of 7.1 accurately.  I don’t need to distinguish between 7.12 and 7.13.

I noted earlier there is -59.16mV per pH unit when the temperature is 25°C.  The signal was then amplified by 5.7.  This changes the amount of voltage between pH units to -59.16*5.7= -337.212mV.  A pH value of 7.1 occurs at 33.721mV per .1 unit of pH.  Given that, an ADC with 8-bit resolution should be good enough.

Because I was following SparkysWidgets recommendation of using the MCP3221, I didn’t think to consider the Arduino”s ADC.  Luckily folks on the AskElectronics subreddit did:

[–]deadycool 3 points 19 hours ago

Why won’t You use Arduino’s analog inputs?

I’ll start with using the Arduino’s ADC and see if it is “good enough.”  For now I think it is.  Using the Arduino’s ADC will save a level of complexity since I don’t have to think about I2C or SPI to communicate with the ADC as well as lowers the BoM.

Which Communications Interface

If I were to use a separate ADC, I could use Serial, I2C, or SPI to communicate with it.  I’ve used Serial communications on an Arduino enough to feel I can get better accuracy over I2C or SPI.  I chose I2C because of this digikey search.  ADCs with the SPI interface were $1 or more than ADCs with the I2C interface.  It looks like the difference is a higher sampling rate for the SPI bus.  This makes sense because the SPI is a faster bus than I2C.  However, the sampling rate offered by ADCs using the I2C bus to communicate with an Arduino are fine for my needs.  A goal is to save on the BoM where it makes sense to do so.  In this case, using the I2C bus makes sense.

I’ll compare results using the Arduino’s analog input with the same part SparkysWidgets uses – the MCP3221.  The cost is $1.73 for a quantity of 1 on digikey.com.  The default clock speed for the I2C bus on an Arduino is 100KHz, which is plenty fast enough.  Figure 6.2 of the data sheet recommends 10K pull-up resistors for the SDA and SCL lines.

Get Rid of Noise

mash_taiters noted out a good “rule of thumb” : you should always include decoupling capacitors to the supply pins of ICs (usually 0.1uF). They are cheap, small, and will save you headaches.

These words of advice are retold in6.4.2 of the data sheet:  A bypass capacitor from VDD to ground should always be used with this device and should be placed as close as possible to the device pin.  A bypass capacitor value of 0.1 µF is recommended.  Adding this capacitor should handle any noisy spikes.  

VREF

The reasons I might wish to use a voltage reference IC include:

  • a stable reference voltage to measure the input/output voltage.
mash_taiters pointed out to me: “…Vcc [VDD] powers the ADC circuitry, whereas Vref is used as a comparison or reference for the input you’re measuring. For this reason you need to give it a very stable and accurate voltage…”
  • a simpler/more exact mapping from analog to digital.

kizzap noted: “As for Vref, the voltage you pick here can be very critical in determining the range of the signal the ADC can read. It can also dictate how difficult the maths will be in your code:
Say you have a 12-bit ADC. that means you have 4096 steps between 0Volts and Vref. if you have Vref as 5 Volts, you will get 1.2207…mV per step (ignoring INL and DNL here btw). if instead you use say a 4.096V reference, aside from it generally being more stable then a tap off your logic supply, it makes the maths much easier, as you will get a clean 1mV per division.”

I am assuming – I may be wrong – that using  VDD instead of including a voltage reference IC like the MCP1541  ok for this application. 

Charge Pump

SparkysWidgets uses the TPS60400.  The data sheet has a nice drawing of how to easily set up this chip within the circuit:

TPS60400ChargePump

 

The Schematic

I’ve concluded the schematic SparkysWidgets has provided to us is very close to what I would create given my new found knowledge.  So I’m just going to reference this one.  THANK YOU SPARKYSWIDGETS! 

Reflection

Thanks to those that have gone before, I found it wasn’t that overwhelming to build a pH sensor circuit.  The firmware still needs to be written.  This won’t be too difficult given the large amount of information folks have shared.  Amazing.

I thought I knew more about Op Amps than I did.  It took me a surprisingly long time to figure out what the op amps were doing and how they were doing it.  Even with the information SparkysWidgets provided.  My challenge is interpreting what is being said in the context of my new to circuits context.  I post this in case others might be in the same learning boat and could benefit from my interpretation.  Also, I am hoping folks will correct errors I have made or suggest improvements to be made.  That would be spectacular!

 

What’s Next

I need to prototype this circuit so I’ll be ordering parts and laying them out on a breadboard.

While I am waiting on parts, I will be delving into building an EC (conductivity) circuit.  I am assuming the two circuits will be similar and am excited to find out.

 

 

Thank you for reading this far.

 

Please find many things to smile about.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

V(acidic pH mapping to 5V) = 

0V = V(in base pHs) + V(offset base pHs) , V(offset base pHs) = 0V – (-2.36) = 2.36

 

Breaking down what is going on, an analog measurement is made then amplified.  This must mean an OpAmp is going to play an important role in the circuit.    The analog signal is converted to digital.  Seems like I’ll need an ADC.  Finally, a conversion function is needed.  Here is where the math comes in.  I am not strong at math so I thank Sparky for coming to the rescue.

By the way – if you are like me and new to using OpAmps, I highly recommend Dave Vewers’s Youtube video (TBD: link and name of video)  .  By watching this video you get the added bonus of learning what a “dill” is.

Sparky points out the pH is logarithmically proportional to the acidity – which is the activity of a hydrogen ion concentration.  A logarithmic relationship between a pH value and the activity of the hydrogen ions means:

For each pH step we see a ten fold concentration change, for example a pH of 8 has 1/10th the ion activity as a pH of 7.

No wonder my cucumber plant’s leaves turned yellow when it’s pH was off by over 1 step.  The poor plant was not able to take in the proper amount of nutrients.  I can see why maintaining the correct pH level is so important to the health of a plant.

To keep me from guessing, Sparky points out the logarithmic relationship is:

 pH = -log10(activity of the hydrogen ion concentration)

All this really means is when the concentration is greater on either side of the probe, the ion flow will induce a slight voltage between the probes electrodes, this voltage can swing both +/- which will indicate either an acid or base.


pH values can range from 0 (high acidity) to 14 (strong base).  pH 7 is in the middle.  Any pH reading < 7 is said to be acidic.  A reading > 7 is basic.  Sparky assures us a probe 

generates -59mV/pH.  Given that, the effective range is +/- .059*7  volts or +/- .413 volts.

 

But wait – temperature and using a worn down probe need to be taken account when making a reading.  I don’t know how yet.  Sparky is building up the suspense!

Build the Circuit

The OpAmp

OpAmpNonInverted

wikipedia article on op amp:

wikiOpAmp

While we were designing the thermocouple in Contextual Electronics, Chris walked us through the data sheet for an LM324 OpAmp.

  • Supply voltage: The range of voltage that can be measured.  The data sheet for the LM324 states a comfortable range of TBD – data sheet

In order to build an adequate amplifier there are a few consideration

s other then those pointed out by the ideal probe section. One consideration is the very high impedance that a pH probe has. Not only are the probes very high impedance they also are susceptible to noise, and the input stage is very vulnerable to drift/offset characteristics of the amplifiers used to interface the probe. There are a lot of Op-amps that can be chosen for the job, dont just look at the Input Impedance of the Op-Amp :)

 

A typical probe has an impedance of anywhere between 50MΩ and 500MΩ, and since 100MΩ*1nA=.1v even having a single stray nano amp can throw our measurement off by almost 2 entire ph units. The goal then is to choose an op amp that is adequate enough that will not load down the probe but that also has characteristics which will keep both the cost down and the accuracy up. When combined with the previous considerations about probe age and drift, a basic roadmap is made on how we can simply and effectively amplify and interface a pH probe signal.

 

A very basic design we can utilize is a simple unity gain amp, a buffer circuit to separate the high impedance probe from our “low” impedance multimeter. We will build this design first for a couple reasons, the first being it is an effective way to compare our probes to the ideal probe model. the second reason being its really easy to build and can take only a few seconds, and demonstrates a base for how the offset(in an inverting config) will alter the signal. While I suppose you could use an LM358 for this I would recommend at very least the ST TL072 or a CA3140 this is to be sure not to load down the probe and get false readings.


http://www.instructables.com/id/How-to-create-voltage-using-one-power-supply/

In analog synthesis, to generate almost any signal with op amps, it is necessary to have positive and negative voltages. This allows the op amp to generate a signal that spans positive and negative voltage values.



 And there it is – a YIPPEE MOMENT!

  • take an analog measurement of the voltage change two things.  Here the voltage change is between….. TBD
  • since the voltage change can be very small, magnify the change so that it can easily be read by the other chips participating in the circuit
  • convert the analog measurement to a digital measurement.
  • Apply an algorithm that takes the digital measurement and interprets it into what I am monitoring – in this case the pH value.

This is the lens through which I need to understand from a vegetable growing perspective.  The other viewpoint is the design of a pH sensor’s circuit.  As with other domains, electronic circuits has patterns.  Once I learn the pattern, I can apply this pattern to multiple scenarios.  The pattern of the pH sensor is:

  • take an analog measurement of the voltage change two things.  Here the voltage change is between….. TBD
  • since the voltage change can be very small, magnify the change so that it can easily be read by the other chips participating in the circuit
  • convert the analog measurement to a digital measurement.
  • Apply an algorithm that takes the digital measurement and interprets it into what I am monitoring – in this case the pH value.
The pattern is the one I learned in the Contextual Electronics when we designed a circuit for a thermocouple.  
 
For the pH sensor, I want to take an analog measurement of a voltage change that has units between 0 and 14.  This is not the same as what I can measure with my Arduino circuit, which is 0 to 5V.
 
 
As the SparkysWidgets post points out (and the logarithm entry in Wikipedia notes), the pH is logarithmically proportional to the acidity (activity of a hydrogen ion concentration).  SparkysWidgets tells me the relationship is:

 pH = -log10(ah)

I’ll trust this person to be right.  Sparky then goes on to say:

All this really means is when the concentration is greater on either side of the probe, the ion flow will induce a slight voltage between the probes electrodes, this voltage can swing both +/- which will indicate either an acid or base.

 

 

Speaking electronics, the pH on the left side is the voltage.

 
 

I like to divide discussion of design and functionality into:

  • The job being done.  If I don’t do this circuit, what additional work would I be doing?  The more I think of this in terms of energy I would have to spend, the more I am able to focus on the most time consuming and least desirable tasks.  I guess being lazy has its advantage when it comes to design!
  • A block diagram.  The block diagram gives me a very high level map of the modules that are needed to complete the job.   I’ll keep taking it down a level until I’m at the wire-connecting-to-chip level.
  • A Fritzing diagram.  The prototype uses a breadboard and jumper wires.  Fritzing provides a better visual and has more components for breadboard drawing than does the ECAD (?) tool I use – Kicad.  (TBD: LINK TO KICAD).

The Job

The water node reports readings and adjust the contents of three different chemistries (pH UP, pH DOWN, nutrients) in the nutrient reservoir.

The job of the water node is to :

  • report the readings of the water temperature, pH, and conductivity when it is requested.
  • Adjust the pH UP or DOWN when given a command to adjust to a pH level.
  • Adjust the nutrients when given a command to adjust to a range of PPM.

The Block Diagram

 TBD: UPDATE BEFORE POSTING

The BoM

 The price for prototype parts includes:

TBD: UPDATE FROM GOOGLE DOCS BEFORE POSTING

Part

Cost

Info

ph Kit

$105.95

See this post

EC Kit

$108.87

AtlasScientific Web Page

Water Temp sensor

$6.40

Previous post

Arduino

—-

spare parts

3 Peristaltic Pumps

$85 (3 + a little over $10 shipping)

Adafruit

3 N-channel power MOSFETs

$3.75

Adafruit

3 1N4001 Diodes

$1.50

Adafruit

1 Button

—–

spare parts

1 LED

—–

spare parts

1 1KΩ Resistor

—–

spare parts

1 4.7KΩ Resistor

—-

spare parts

Total

$307.72

 

The Fritzing Diagram

TBD: UPDATE BEFORE POSTING 

 

LED

The green LED is on when the prototype is first plugged in.  I then will use PWM to set the LED to 1/4 the full strength.  The LED will go to full strength when data is being taken or sent and then return to 1/4 full strength.

Testing the Circuit

I broke the prototype into chunks.  Testing first then adding on another chunk.

LED

 I started with the LED because this is Arduino 101 stuff.  I used the Fade sketch that comes with the Arduino IDE.

pH

I then wired up the pH sensor.  I detailed how I did this in an earlier post.  The pH circuit uses a serial interface.  This requires a TX and RX pin on the Arduino for sending and receiving data.  As shown in the Fritzing diagram, I put a yellow jumper wire between pin 13 on the Arduino and the breadboard hole. This serves as the TX line from the Arduino (RX line from the pH circuit).  A green jumper goes from pin 12 of the Arduino to the TX pin of the pH circuit.  So pin 12 is the RX pin from the Arduino. I used Atlas-Scientific’s sketch to test the circuit.  I am not testing the probe at this time – only the circuit.  I sent several of the commands listed in the Atlas-Scentific data sheet for the pH circuit.

i command (version) returns 

V4.0,8/12

EC

Next I wired up the EC sensor.  As with the pH sensor, I covered how I did this in an earlier post.  A pro of using both circuits from Atlas-Scientific is they are identical in pin outs, use a serial interface, and use the same commands.  Once I figured out how to work with the pH circuit, I already knew how to work with the EC circuit.  This allowed me to use the same sketch I used to test out the pH circuit.  The only change was setting pin 10 as the TX pin on the Arduino and pin 9 as the RX pin.

 

Now I have two chips that use the serial line to communicate.  As I pointed out in the earlier post, the serial library does not multiplex.  I’ll use a similar solution to what I did earlier.

 

Water Temperature

I wired up the water temperature sensor just as it is shown in the Fritzing diagram.  I then wrote and ran an extremely simple test sketch that just reads the temperature 5 times.  The WaterNodeTest.ino sketch can be found in the bitknitting gitHub  TBD

Pump

I have one pump set up. I’m waiting for two more from Adafruit.  All three circuits are identical.  I’ll test the other two when the parts arrive this week.  For the test of the one pump I have, I ran a very simple sketch 

How much pH Up/Down is needed per gallon?  http://generalhydroponics.com/site/index.php/resources/faqs/ph_dynamics_and_adjustment/

Answer: Start out with one milliliter per gallon. Wait 15 To 30 minutes, and test your water again. Frequently you will only need 1 to 2 ml of pH Up/Down per gallon of water. You may need additional pH Up/Down if you have hard water. The General Hydroponics Flora Series is pH buffered to facilitate keeping the pH in a favorable range.

 

 

You might consider just reading SparkysWidgets post (I’ll refer to this post as Sparky in the rest of this post.  Awkward, but I do not know the person’s name behind the post.)and ignoring the rest of this post.  It does a great job covering what a pH sensor is.  Sparky’sWidg. However, my interpretation might help others that learn through a similar lens that I use and documenting my interpretation has the added advantage of jogging my memory when I need to do so in the future.

The SparkysWidgets post (I’ll refer to this post as Sparky in the rest of this post.  Awkward, but I do not know the person’s name behind the post.) is a great source for getting the context of how a pH value is measured from the scientific and math viewpoint.

It turns out how a pH sensor gets its job done is straightforward.   A pH sensor:

  • takes an analog measurement of the voltage change between two electrodes.  This is a small value, so..
  • the measurement is amplified to be measurable within the range of +/-5V.
  • the amplified value is converted from analog to digital so that the Arduino can read the value.
  • the Arduino through an Arduino sketch reads in the +/-5V value.  
  • Calculates the pH (which includes adjustment for temperature).  As noted in this post: “The pH of any solution is a function of its temperature. Voltage output from the electrode changes linearly in relationship to changes in pH, and the temperature of the solution determines the slope of the graph.”
  • Adjust the pH based on the 
The “secret sauce” is the conversion function.

Sparky points out the pH is logarithmically proportional to the acidity – which is the activity of a hydrogen ion concentration.  A logarithmic relationship between a pH value and the activity of the hydrogen ions means:

For each pH step we see a ten fold concentration change, for example a pH of 8 has 1/10th the ion activity as a pH of 7.

No wonder my cucumber plant’s leaves turned yellow when it’s pH was off by over 1 step.  The poor plant was not able to take in the proper amount of nutrients.  I can see why maintaining the correct pH level is so important to the health of a plant.

To keep me from guessing, Sparky points out the logarithmic relationship is:

 pH = -log10(activity of the hydrogen ion concentration)

Info I got from the pH pages noted:

In theory, a pH probe produces about 59 millivolts (mV) per pH unit, and at pH 7 (neutral pH) the probe produces 0 volts. Acid pHs produce negative voltages. Basic pHs produce positive pHs.

 

pH values can range from 0 (high acidity) to 14 (strong base).  Given the pH range and the voltage change (59mV) per pH unit, I can now calcite the range of voltages the pH probe will read: +/-7*59mV or +/-413mv (.413 volts).

 

My pH sensing circuit needs to read the value the pH probe receives, magnify the reading to be within the +/-5V range, convert it to a digital signal and then then apply the conversion function.  And then – a YIPPEE MOMENT!  I can read the pH value of the nutrient bath that is feeding my vegetables.

 

 

 

 

The Circuit

I find building circuits more fun and approachable if I think of the parts as workers in a workshop.  I’m tempted to give them names like “Harry” and “Fred” but the last time I did this I got an F on a test because the teacher insisted on the Latin names for the trilobites he wanted us to identify.  So I won’t be adding this familiarity.  The workers that I need to hire to make pH sensors include:

  • Two Op Amps:
    • One Op Amp will isolate reading from measuring the voltage. Sparky notes: A typical probe has an impedance of anywhere between 50MΩ and 500MΩ, and since 100MΩ*1nA=.1v even having a single stray nano amp can throw our measurement off by almost 2 entire ph units). Because a copy of the part of the circuit that gets the reading from the pH probe is used (a unity gain buffer),   measuring the pH does not affect the reading of ion activity by the pH probe.  
    • The other Op Amp will amplify the tiny voltage change read in from the pH probe to a +/-5 v range.
  • charge pump to handle the -5V readings when using Arduino’s 5V as the power supply.
  • An ADC to convert the analog reading into a digital value that can be interpreted by the Arduino sketch.
  • Some capacitors to filter out noise.

 

 

 

Zero volts output at neutral pH (=7.0) 

Positive voltage in acids, pH<7 

Negative voltages in bases, pH>7 

Total realistic pH range is 0 to 14. 

Generates -59.16 millivolts per pH unit at room temperature (=”Nernst potential”). Note that this is a negative slope–higher pH, lower voltage. 

the full scale range is +/-0.414 volts. (+/-0.05916*7), at 25 degC. 

Temperature coefficient of the Nerst potential is -0.001984 mV per °C. That makes the slope -54.2 millivolts per pH unit at 0 degrees Celsius, and -74.04 millivolts per pH unit at 100 degrees Celsius. 

Googling for “gain op amp” gave me the formula for the gain:

A Salad A Day – 3rd Post – Change in Grow Station Design

Tags

, , ,

I just finished my last post where I discussed the system design for my grow stations.  In that post, I decided to evolve BTLE as the communication protocol between a node and the Base Station.  Then the Base Station would talk to my iPhone over BTLE and 802.11, depending on if the iPhone was in range of BTLE.  Keeping in mind that I am lazy, I’ve made one more leap in simplification of my design.  I decided the iPhone app will have the functionality of the Base Station.  Ba Ba Ba BOOMP – good bye middle man hardware!

I enjoy this phase of a project.  It is the time I reflect on how truly lazy I become, especially as I get older.  As I thought through my passion to grow 100% of our lettuce with the least amount of effort on my part, I realized collecting and analyzing sensor readings was not a high priority use case.  What was important was a plant living in an environment with the proper care and feeding.  This boils down to main functions of the water node.  Automatic adjustment of pH and nutrients plus a quick update on the sensor readings just to get a warm and fuzzy that the numbers are within a “normal range”.

By removing the Base Station:

  • The system is less expensive, simpler, and will be faster for me to build.  I will enjoy a focus on the nodes and iPhone app.
  • A significant support challenge has been minimized.  I have a lot of experience in networks not working.  Of course, anyone using an 802.11 shares my experience.  With the first design I had designed for 3 wireless RFs (RFM69HW, 802.11, and BTLE).  Then I went down to two (802.11 and BTLE).  But why stop there?  Do I really need to see what the nutrient level is on a beach?  While it certainly would be nice to get an alert if the pump stopped working when I am on vacation so that I can get someone to look into it, I’ll leave that to future versions.

The Goal

The goal of this post is to iterate on the system design of the growth station such that the iPhone incorporates the functionality of the Base Station.

Updated Lettuce Grow Station

Here is the *new and improved* block diagram.  It is far simpler!

LettuceGrowStationV2

What’s Next

My next post will cover a breadboard version of the water node!

 

Thanks for reading this.  Any feedback you have would be greatly appreciated.  Please find many things to smile about.

A Salad A Day – 2nd Post – Lettuce Grow Station Design

Tags

, , ,

In this post I’m going to go over the system design of the Lettuce Grow Station.  I will be using Arduino + sensors + wireless + iPhone app to measure and automate the growth stage of my lettuce.  I better get going since the seeds should be done with germination in a few weeks.

The Goal

The goals of this post include:

  • defining the technology of the lettuce grow station
  • moving my knowledge forward in the two areas – hardware/software and hydroponics – where my passion is focus.
  • connecting with others who share my passion from which I can learn or I can share what I have learned

The Non Goals

  • aesthetically pleasing grow station.  At some point I will address a grow station that fits into my house and is pleasing to look at.  This time around I am going for functional.  I will need to make several iterations!
  • easy to move around.  Some of the components – the nutrient bucket and LEDs – will be too heavy to move around.  At some point I’d like an AeroGrow size for growing herbs on my kitchen countertop.  In fact, I have that today!   The challenge is its ability to grow a salad a day.
  • minimizing cost over robust, quick response, and important features.

Thanks to Those that Go Before

I like to take a moment and reflect on the great works of folks that I have benefited from their knowledge.  Community learning is an incredibly positive experience.  THANK YOU!!!  For this post, I’d like to thank: 

  •  the Hydro subreddit.  Thank you to all the knowledgable folks who kindly share their experience and what they have learned.
  • Chris Gammel - our very knowledgable and gifted instructor of Contextual Electronics.  A course I would highly recommend if you are interested in turning your prototypes into PCBs and learning tons about electronics along the way.  There is no way I would be able to get this far without Chris’s class and his recommendations/insights.
  • Adafruit, SparkFun, and OshPark for making it so easy for us DIY’rs.  The amount of learning material these companies provide is staggering.  They are all so approachable.  Very prompt and helpful in replies.

The Lettuce Growth Station

Ah yes, begin with the end in mind.  In my last post, I started my germination station.  Now I am excited to tackle getting to this:

ButtercrunchLettuce

Did you see the rainbow and bright lights?  Me neither.  But I do see a magnificent head of butter crunch lettuce grown through hydroponics methods.  This is what my grow station needs to be able to do.  I am not sure what I am doing (advice craved!).  There will be many iterations.   But the reward for building a grow station that can grow lettuce like this is quite tasty.

The Features

I am lazy.  Thus the #1 feature is saving me time.  From my previous attempts at hydroponics, I found the following:

  • maintaining the right pH for a plant is extremely critical.  If not, the plant will not be able to take in food.  Since I like to anthropomorphize my protagonist – in this case a head of lettuce – I imagine the lettuce is like me.  Extremely grumpy when not fed correctly.  Only it gets worse.  The poor plant is reliant on me to feed it with the right nutrients.
  • maintaining the right nutrient level is tricky.  While I’ll be taking conductivity readings and adjusting the nutrients accordingly, the conductivity readings cannot tell me which nutrients are deficit.  What if the poor lettuce is lacking nitrogen yet I decide to blast it with potassium?  What kind of a grower AM I?  Someone should probably call the plant police on me!
  • The amount of light is very important.  My lettuce plants will need appropriate levels of LUX and PAR lighting.  I like LED lighting.  High powered LEDs let out a lot of light and are more efficient than others.  I’m ok with paying more – although I am also interested in the difference between DIY LED fixtures and buying an equivalent.
  • The care and maintenance of the water part of the lettuce grow station requires the most amount of time.  I’ll focus on minimizing this.
  • I will be adding more stations.  After all, what is a salad without tomatoes?
  • I want to view and control my grow station from my iPhone.  My new friends can talk to me at anytime from anywhere.
  • I want the system to be responsive. When I ask for a reading from my iPhone I don’t want to wait very long to get a response from the Base Station.

The Building Blocks

I’ve divided the system components of the Lettuce Grow Station into three functions:

  • Grow – these blocks include the lighting and the hydroponics system.  The hydroponics system includes the parts where the plants grow and a reservoir that holds the water mixed with nutrients that the plants will feed from.
  • Control – the control blocks receive readings for conductivity, pH, and water temperature and send this information to my iPhone.
  • Interact – I view and act on the readings from an iPhone app that I will write.
LettuceGrowStation

Grow

In this section I’ll give a high level explanation of the details of components in the Grow boxes.

LED

The requirements of the LED fixture includes:

  • Enough light for the plants to go through a healthy grow and flower growth cycle
  • Ability to automate time on and time off 
  • optimized for energy savings (ongoing effort)

I am not quite sure what the “best” LED fixture is for my needs so I’ve been exploring several potentials.  I measured the lumens  using a  LX1010B Light Meter.  I measured the PAR value using the DIY PAR meter I  purchased awhile back.


* *

AeroGrow  LUX: 7,000 PAR: 180 µmolphotonsm-2s-1

T5  LUX: 13,000 PAR: 247 µmolphotonsm-2s-1

* *

UFO – 135W LUX: 30,000 PAR: 680 µmolphotonsm-2s-1 90W: 670 µmolphotonsm-2s-1

DIY LEDGroupBuy Fixture LUX: 91,000 PAR:650  µmolphotonsm-2s-1

I took the LUX measurement at 5″ below the center of each light.  Lumens will be greater for full spectrum lights.  Lights like the UFO – that have light in the blue and red wavelengths – will have less lumens but should have a higher PAR since the energy from the blue and red wavelengths are absorbed the most by plant leaves.  For this reason, many see PAR readings a better representative of a light’s usefulness for plant growth.  However, I do not have a PAR meter I am comfortable is accurate yet and I do not have a spectral distribution of these lights.

PAR values are measured in µmolphotonsm-2s-1.  I am still learning about PAR values and how much is enough for each type of plant.  Also, I am not sure the DIY PAR meter has accurate results.  Actually, I assume inaccuracy so I am using the DIY PAR meter readings to get a general idea and to also spark me into taking better light measurements.

Back to the amount of LUX…

superAngryGuy had a great posting in the hydro subreddit on the amount of LUX a plant should get:

LUX

Comment

15,000 – 20,000

the lower end of what we want for veg growth

35,000 – 40,000

what we want to try to hit for flowering

75,000 or so

it’s pointless to go beyond this level of light intensity, saturation level

It looks like our seed starters have enough light.  The AeroGrow keep pumping along growing a small amount of mint and basil.  The UFO’s should be fine for lettuce.  The high LUX measurement of the DIY LEDGroupBuy fixture makes it a better choice for my next project – A Salad A Day -> Tomatoes.  Of course, the light can be adjusted to fit within a reasonable range as needed.

I bought a UFO 135W from eBay for $102.50.  I was curious how the PAR compared to the 90W UFO I had previously bought from eBay for $62.96.  It turns out the light values are very close.  The 90W was a good deal.  It looks like prices have gone up since I purchased.

The DIY LEDGroupBuy Fixture is something I put together using the circuit I discussed in an earlier post.  I did not include an Arduino.  I just plug it in with a timer and off it runs.  I bought two Lumia 5.1, 1 48W power supply, and 10 LDD-700Hs from LEDGroupBuy  This cost me roughly $358 – which I’ll roughly associate with 2 UFOs – means each light cost $358/2 = $179.  Higher than what I will pay moving forward.  I might try buying just CREE LED arrays instead of the customized Lumia 5.1’s.  The price will be much lower.   

Light Meter

For now I will use the meters that I have, adding an apogee to calibrate the PAR levels.

Hydro System

I recently built a system that I’m going to try out:

hydroSystem

 

The components that make up the hydro system include:

  • 2 4″ x 4″ x 48″ vinyl fence post. I got these at Home Depot but can’t find them online. 
  • 4 4″ x 4″ end caps
  • 2″ net pots.  A net pot will be used to hold each plant.   Once the plants I am germinating grow roots, I will put the rock wool into a net pot and then place the net pot in one of the holes.
netPot
  •  1/4″ PVC tubing to get the nutrient enriched water from the main tube to the top of the net pot.

quarterinchtubing

 

 

  • 1/2 inch outer diameter, 5/8″ inner diameter tubbing from SunlightSupply to go from the nutrient bucket and act as the main feeder to the per net pot tubing.  The nutrients initially are pumped into this tubing and go to the end of the post.  Along the way the nutrients is distributed to each net pot through the smaller diameter tubing.  The tubing is very flexible to accommodate bends that I’ve got to make to get the tube to the top of the post.
halfinchTubing

Water Node

The job of the water node is to :

  • send the readings for the water temperature, pH. and conductivity upon the request of the Base Station.  
  • Respond to pH UP and DOWN adjustment commands sent from the Base Station.
  • Respond to nutrient adjustments when sent from the Base Station.
The water node will consist of a PCB, a water proof case, a probe for measuring the pH level, a probe for measuring the conductivity level, and a probe for measuring the water temperature.
I will use the same sensors that I used in my water node prototype.   This includes:
The parts of the PCB will include:
  • Parts such as the ATMega328P to run the Arduino Sketch.
  • a wireless chip capable of communicating with the Base Station that is within eye sight at a maximum of 100′ away.
  • the pH sensor circuit + connection for the probe
  • the conductivity circuit + connection for the conductivity sensor’s probe
  • a water temperature sensor
  • a pump and tubing for pumping pH UP when the Base Station tells the water node the pH level is too low
  • a pump and tubing for pumping pH DOWN when the Base Station tells the water node the pH level is too high
  • a pump and tubing for pumping more nutrients into the nutrient reservoir when the Base Station tells it to add a specific amount of nutrients.

Control

 The job of the Base Station is to:

  • Request and receive sensor readings from water nodes.
  • Send commands to a water node to adjust the pH and/or nutrients (as needed).
  • Respond to requests from the mobile client.

Water Node to Base Station

Up until now, I have been exploring 433MHz solutions, in particular the RFM69HW and most recently the RFM85.  Earlier, I explored other RF alternatives for node to Base Station communications.  Then I created a BoM for a RFM69HW breakout board which showed the price for a RFM69HW to be $3.85.  This got me looking at the RFM85 – which should :-) work, but I have not tried yet.  I can get the RFM85 for $.90.  This is a very low cost option.  But then….Adafruit came out with their Bluetooth breakout board – Bluefruit LE.  I had snubbed my nose at BTLE mostly because of chip cost.  Yet, after all my trials and tribulations with different chips I’m rethinking my current plan and will determine if BTLE – specifically the nrf8001 chip from Nordic Semiconductor.  This is the BTLE used in Adafruit’s Bluefruit.  Yes, the chip costs more.  However, having worked in distributed systems for decades and then doing these in-home RF experiences gives me the background to have confidence that a big part of system maintenance and debugging will be communications.  So now I’ll rationalize my reasons for BTLE being the better in-home RF with the following reasons:
  • BTLE has more momentum than other RF solutions I have been exploring.  There are already consumer devices that use BTLE.  I can’t say the same for RFM69HW.  This means a bigger developer community which means more robust chips and firmware.
  • Interoperability with other devices that use BTLE will be easier since the lower levels of communications are the same. I would focus on the application level communications.
  • There are multiple supplier of BTLE chips.
  • Because of a larger market and aging of BTLE, chip prices will go down.
  • BTLE has a robust set of features such as RSSI, making it an easier and more robust in-home wireless protocol yet is not as heavy weight as 802.11.
  • Lady Ada – whom I respect for her ability to select chips and trends – has jumped in with her Bluefruit offering.  If it is good enough for Lady Ada….
  • I have written iOS apps that use BTLE between the iPhone and an Arduino.  The APIs keep improving.  BTLE is integrated very nicely into the iOS app ecosystem.
  • My requirement of 100′ between a node and a Base Station can be met with BTLE.  According to the wikipedia article on BTLE, the maximum distance is 160′.  I don’t assume my testing will achieve this range.  However 160′ is  60% greater distance than what I have specified- which should be plenty of room to meet the average communications.
  • The power requirements for BTLE seem “reasonable.”  I have not tested, however I am encouraged by results documented in papers such as this one from Microsoft Research and UW

BLE achieved lower power consumption (10.1 uA, 3.3 V supply at 120 s interval), compared with ZigBee (15.7 uA), and ANT (28.2 uA). 

Base Station to iPhone

There are two iPhone to Base Station interactions.  The first occurs when my iPhone is – you guess it! – 100′ or less from the Base Station.  I’ll use BTLE for that.  The second occurs when I have my iPhone at another location.  For this I need Internet connectivity.  I will use the ever so popular 802.11 Internet wireless protocol to enable this feature.  I like the BTLE for local because there will be a better response time going directly to the iPhone instead of going through the internet.  I like the 802.11 because it allows the Base Station to be positioned near the nodes while at the same time giving me “anytime/anywhere” access to the nodes.

Interact

I will write an app for my iPhone that receives sensor data from the Base Station and sends commands to the Base Station.  I have written many iOS apps in the past so I am confident on how I go about this.  I have yet to design the interface.  This is something I will wireframe soon.  I have always found in distributed system designs such as this (well actually more complicated) that putting off what I see on the phone’s display, what buttons I can push, robustness, and response speed makes for a much less desirable system.

 

What’s Next

I will keep iterating on the design.  Please let me know what can be better – or share your thoughts.  I am learning as I am going and crave advice.

I just got my new soldering station.  A YIPPEE! moment.  I’ll be practicing my SMT soldering techniques on some practice boards.

I will start putting together a prototype of this system in time for the plants currently enjoying their spa time in my Germination Station.

I’m thinking about starting an Open Source PAR Meter project based on the effort and conversation on this forum thread.

 

Comments Since the Original Post

from Jmadman311 via /r/hydro/ sent 4 hours ago

Hey MK, had some comments while I was reading.

I better get going since the seeds should be done with germination in a few weeks.

Lettuce germination should be done in 2-3 days and maybe after 7-10 days it would be ready for transplant into a system, not a few weeks!

maintaining the right nutrient level is tricky. While I’ll be taking conductivity readings and adjusting the nutrients accordingly, the conductivity readings cannot tell me which nutrients are deficit. What if the poor lettuce is lacking nitrogen yet I decide to blast it with potassium?

Adjusting the EC of the solution and keeping it constant (I believe I grew my lettuce at 0.5-0.6 EC) is all you need to do. To tell what nutrients are in deficit you need some very expensive and complicated ion-sensitive sensing equipment, which, given that you write that you are lazy, are likely beyond the scope of your project. It’s also worth mentioning that they are completely unnecessary. That sort of thing would be appropriate for a massive-scale commercial grower who was optimizing the economics of his operation by making sure the plants had exactly the nutrients they needed. For a simple home grow of lettuce, using a vegetative-style nutrient where the N>P and K is decently high (I think I used 3-2-5), you’ll be fine.

High powered LEDs let out a lot of light and are more efficient than others. I’m ok with paying more – although I am also interested in the difference between DIY LED fixtures and buying an equivalent.

Again, if you are lazy, building a DIY LED is going to be beyond your scope. :) I did it, but it took a huge amount of effort in finding the right parts and doing the construction. On the other hand, the purchase price for LED lighting is really, really high if you don’t make it yourself. (But still pretty high if you make it yourself. I made a light that outputs around 10,000 lumens and it cost me around $300.)

The requirements of the LED fixture includes:

Enough light for the plants to go through a healthy grow and flower growth cycle Ability to automate time on and time off 

You’re growing lettuce which you don’t want to go through a flowering cycle. And automating time on/off is a simple $10 light timer from Home Depot/etc.

As for the construction of the system, looks like you’ve got the right parts. For the electronic control, I’m really interested in it. I’d love to eventually set something up with a similar pH/EC sensor with automated control of pH. Very cool stuff.

 

[–]Jmadman311 1 point 1 day ago

No problem, I am by no means an expert but I am happy to share some of my experiences.

In my experience, when I would put a small group, say 20 lettuce seeds, between two layers of paper towel saturated with water, in a ziploc plastic bag, on a heated germination mat, I was getting close to 100% germination in 2 or 3 days. I do believe that lettuce seeds do not have great longevity; so it’s possible that if your seeds are old, or were not stored at low temperature, they may have low viability.

My LED light utilized the peaks in the action spectrum of chlorophyll, with LEDs just at 447.5nm and 655nm from Luxeon. It put out about 10,000 lumens with a 70/30 red/blue intensity ratio. I successfully grew tomatoes with this light. There were 18 total LEDs. Check out a vid I took when I first finished it:

https://www.youtube.com/watch?v=kt1SgFc60PM

 

[–]Jmadman311 1 point 20 hours ago

luxeonstar.com, their star-shaped coolbase ones, deep blue and deep red.

 

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

 

 

A Salad A Day – 1st Post – Lettuce Germination Station

I’m starting “A Salad A Day” project.  I’ll start with a lettuce station.  Comments are most welcome! I am hoping to get your feedback on what you would like to see and/or how what improvements I should make.  Better – how about you starting your own lettuce station and we compare results along the way?  

LettuceForEveryDay

Source: Kratky Discussion, Big Plans, and Hydroponic Seedlings

 

The Goal

The goals of this project are to provide:

  •  100% of my daily lettuce usage.  I have a salad a day.  We also use lettuce in other meals, most notably as a hamburger topping.  
  • learn a lot about two of my passions – gardening and hardware/software.  This is where I could use your help.  I may have passion but I lack knowledge.  I am new to electronics, hydroponics – especially when it comes to nutrients.  The plants I have grown hydroponically have been at best OK, but not nearly as magnificent as I see pictures of from the hydroponics folks on the /r/hydro subreddit.  I just made my first PCB board with a tremendous boost in knowledge from Chris Gammel and his Contextual Electronics course.  

The goal of this post is to get to start the Lettuce Germination Station.

Thanks to Those that Go Before

 An extroardinary aspect of the Internet is its enablement of community learning.  Frontrunners in this community who put the love of each one of us before the love of money.  They are proving that a person can make more than a decent living while at the same time sharing what they learn as well as learn from others.  Twenty years ago, we were not as forthright with our knowledge.  This proprietary culture bent us in the direction of greed – always wanting more for ourself.  I thank all of you who passionately learn and share what you learn.  THANK YOU!

For this post I would like to thank in particular the Hydro subreddit.  Thank you to all the knowledgable folks who kindly share their experience and what they have learned.

Growth in Two Stages

I am separating the lettuce growth cycle into two stages.  

The first stage is the growth period between planting the seed and transplanting the seed into the hydroponics station.  

seedGermination

Stage 1: Germination

I’ll refer to this as the GERMINATION STATION.  

The second stage is growing the lettuce plant into a tasty star of my salad.

ButtercrunchLettuce

Step 2: Growing UP

 I’ll refer to this stage as the GROW STATION.

Germination Station

I’ll be able to build the germination station in less than an hour because I have all the pieces to get going.

Lighting

For lighting during the first stage, I will be using the T5 setup I discussed in this post and compared its light measurements with other light setups I had at the time in this post.   It has been awhile since I purchased, but I recall the cost being around $50 at Home Depot.

 

TFLighting

mhpgardener pointed out in this youtube video that seed starts do not need the pricier LEDs.  This makes sense since the leaves are not that big and the main goal is to grow healthy roots.  

Seeds

Great plants start with great seeds. 

LettuceSeeds

I’ll be trying Seattle Seed Company’s Buttercrunch Lettuce seeds.  One seed pack costs $3 + tax.  For me this came to $3.29 (our sales tax is currently 9.5%).  I’m estimating there are around 50 seeds in a packet.  I’ll be planting 2 seeds at a time.  This makes the cost per planting to be $3.29/25 or $.13 per planting.

I support a local company that wants to provide a quality experience.  More and more I find myself searching out our local small businesses to put a face behind a product. Something I don’t get in the larger chains.  Also, I like the idea of supporting our local economy.  With that said, I’ll keep an eye for how many seeds actually make it to the next stage.  It will be an ongoing dance between the seeds I use as well as honing my skills in growing from seed.  I’d love to hear where you get your seeds and how well they have done for you.

I’m starting with Buttercrunch.  I plan to open our pallet to a variety of lettuce types once I have a better feel for growing a continuous crop of lettuce.

Plant Starters

There are many different materials I could use for plant starters.  For now, I’ve chosen to use Grodan’s rock wool plant starters.  A sheet of 98 costs $16.21 + sales tax.  The total comes to $17.75 or $17.75/98 $.18 per planting.

rockwoolStartersFromGrodan

 As Grodan points out:

The most important quality a high grade Rockwool should have is uniform wetting. The Rockwool should wet easily but not remain water-soaked.

Dome House

I bought this dome awhile back at a nearby hydroponics store.  

GerminationStation

 

They cost a little less than $20.  I ended up using a Jiffy starter pack enclosure I recycled that had cost me $5.  

jiffyStarterPack

It should be good enough.

 I also use a heat mat which I’ve had for awhile.  The heat mat adds about $20 to the cost.  The final part is a timer.  The cost was with sales tax came to $11.94.

Nutrients

Once the plant has cotyledons, I am going to introduce nutrients at 1/4 strength.  I am not sure 1/4 strength is the best amount. My intent is to provide the growing plant with just enough food to thrive but not too much to kill it.  How and what nutrients I use will be something that will evolve over time as I learn from both growing and what others are doing.  I had purchased pH Perfect Sensi Grow because their claim sounds too good to be true (and you know what they say – “If it sounds too good to be true, it probably IS too good to be true.”  It has also been said “A sucker is born every day.”  It wouldn’t be the first time I wear the shame of sucker if marketing claims don’t reflect reality :-) ).  Their claim:

If you use any pH Perfect base nutrient as directed, you will never again have to monitor and adjust your pH.

YOWZA!!  or as I like to say a YIPPEE! moment.  Since supplying my family with our lettuce needs will be chock full of learning, I will boldly start believing in this statement.  I’ll come back and compare with other nutrients and methods over time.  I paid $33.64 for 1Liter.  I haven’t thought of a good way to break down the amount of nutrient per plant.  I’m going to make a guestimate of $.05 per plant for nutrients during germination.  The cost of nutrients will be something I hope to understand better as I gain more experience.

I won’t take pH measurements, but will take nutrient (i.e.: conductivity, or EC level) measurements.   I bought this inexpensive TDS Tester for $17.07 with tax.  It seems to work pretty well.  Also, it seemed that several on the hydro subreddit used this tester with success.

Energy

I do not have an accurate measurement of KWH for the T5.  I will start recording this when it is time to turn on the light – around 3 to 5 days after putting seeds into the rock wool.  Most likely it will be the biggest recurring cost.

Approximate Cost of Germination Station

One time cost:

Part Cost
T5 lighting $50
Dome Home $5
Heat mat $20
Timer $12
TDS Tester $17.01
TOTAL $104.01

The price of the parts add up quickly. No surprise the largest cost is for lighting.  I like that I don’t have to use more expensive LEDs for seed starting. On the positive side,  all the parts can be used again.

Recurring cost:
Part Cost
Buttercrunch lettuce seeds $0.13
Rock wool starters $0.18
Nutrients $0.05
Energy TBD
TOTAL $0.36

I am curious to know the energy costs.  As I noted earlier, energy is probably the biggest recurring cost.  Also, the $0.36 assumes 100% of the plants make it to salads and hamburger buns.  This is unrealistic.  I’ll adjust as I see how many plants survive.

Time To Start

And off I go.  I planted approximately 24 seeds in 12 rock wool starter cubes.  I’ll add a post as the plants and I continue our journey.

What’s Next

I’ll get started on setting up the Growth Station in the next post.  This will include Arduino + wireless to sense and automate plant care.  I will be relying on several of the project I have discussed in earlier posts.  Hopefully, I’ll get to a system that will allow me to be lazy yet well stocked with tasty lettuce.

Comments Since Posting

I’m thrilled to hear about similar projects as well as different aspects to compare contrast.  Here are some of the comments:

theUrbanGreenhouse 1 point 4 hours ago

I plan on doing the same thing pretty soon. Just bought a little 8×6 greenhouse for the backyard and got some more material for vertical systems. You’ll be a little ahead of me so I’ll be looking forward to some updates.

Two things I can add right now: My energy cost for running two T5 fixtures for a month using an 18-6 lighting schedule was just under $4. I know we have different cost/kwh but that should give you some sort of guesstimate. Also, lettuce has very easy nutrient requirements so when it comes to introducing nutes definitely go easy on them, maybe even a bit less than 1/4 strength. I remember my 1/4 strength of the GH Flora line was a lot higher eC than the 1/4 strength of the Canna AquaVega.

 


[–]contentkaiser 1 point 5 days ago

This is exactly what I do (off-season) with my hydro set-up! You are working with a much smaller scale system, but it’s still a fun experiment. I’d recommend throwing in a tray of sprouting seeds (don’t even need light/nutes) and a tray of microgreens in perlite under one of your fluorescent tubes – that’ll give you some low maintenance variety and some nutritive additions.

If you’re feeling super adventurous – you can also keep a plastic tote underneath your hydro system w/ mealworms in it, just add vegetable waste and kitchen scraps (dry) and dry mealworms to put on your salads for a little protein.

 

]Jmadman311 1 point 5 days ago

I’d be very surprised if you got an accurate pH and that it would stay stable over time. pH is one of the most important things to control and you should consider getting a cheap meter to do so!!

Also, did you soak your rockwool before use? I have read that the pH of the rockwool environment tends to be quite high, above 8, unless the cubes are pretreated by soaking them in a mild acid like l

 

[–]mikeg53 1 point 4 days ago

Cool. Look forward to it.

As a point of reference, my 446g romaine head fed 4 people with nice size salads on Saturday.

It took 104 days from seed planting to eating. This guy was in the middle of the garden and I neglected to cut him when he really needed to be – it was ready in 75-80 days, the last 4 weeks didn’t do much for growth except make an even more dense center pack of leaves.

https://www.icloud.com/photostream/#A5532ODWwbPe2;567E3D49-EEF9-401E-AC7E-F5C032537E54

 
 
 

 

[–]RamblingMutt 1 point 4 days ago

I just started growing lettuce as well, as an experimentation chamber to hopefully move onto a large NFT system. The seeds have but a few wee roots right now.

http://imgur.com/HSDK53o

Fidget likes to watch the bubbles, which I know don’t really need to be on but I like it to look all sciency.

emon juice.

In any case I’m looking forward to more updates!

 

 

 

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

 

 

 

 

 

Final board check of RFM69HW Breakout Board before Manufacturing

Tags

, , ,

I was watching a video for the Contextual Electronics course I am taking.  This one covered using a free DFM tool, freeDRM.   The freeDRM tool would most typically be used by an Advanced Circuits  customer.  I am using it as a free tool in the way Chris did – as a sanity check.

The thing I need to keep in mind is the design rules are different for Advanced Circuits and OshPark.  Advanced Circuits’ design rules are discussed in this document.  The design rules from OshPark are more important since this is where the board will be fabricated.  From the OshPark Design Rules web page:

  • 6 mil minimum trace width
  • 6 mil minimum spacing
  • at least 15 mil clearances from traces to the edge of the board
  • 13 mil minimum drill size
  • 7 mil minimum annular ring

I plotted the Gerber files and ran freeDRM on them to see if the tool detects any design errors…and…

there were errors I needed to fix.   What this pointed out to me was the importance of setting the Design Rules to those of the fabrication company.

Design Errors

There were two sets of design errors that were considered “show stoppers”:

  • the drill size and diameter of many of the vias.
  • the track width of several traces.

 

I made a mistake on the diameter and hole size of most of the vias.  The error results for this are listed here.  The text in the error report notes: Requirements:We require a minimum of .005” annular ring for vias…

OshPark’s minimum annular ring is 7 mils – 2 mils larger.

 

ViasNotMeetingDRC

via size errors

I am very happy the tool caught these errors.  While at the same time I feel like banging my head on the desk for making this avoidable error.

The reason?  I did not set the design rules correctly!  Here is what I was using before I fixed the via size errors:

DesignRulesBefore

hmmm…not good. Most of the vias use the default settings.  Why is the trace width 4 mils when OshPark clearly notes a 6 mil minimum trace width?  Why is the minimum via drill size 5 mils when OshPark states the minimum drill size should be 13 mils.  Finally, why is the via diameter 13 mi?  The minimum defaults should be a via diameter of 27 mils (7 mil annular ring*2  + 13 mil drill size = 27 mils).  From what I can tell it means I was clueless about the importance and setting of design rules prior to laying down vias and tracks.  Hopefully, knowledge means I won’t repeat this mistake on my future PCB layout efforts.  

I updated the design rules to be:

DesignRulesAfter

I ran the FreeDFM tool a few more times until I got a YIPPEE! moment:

 freeDFMNoShowStoppers

Now I’m not sure about the “Problems Automatically Fixed.”  I’m going to ignore these for now.  I think I’m ok at this point for fabrication.  I am sure I will find out soon enough if I am not! 

 

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



Follow

Get every new post delivered to your Inbox.