I’ve separated the pH and EC circuit into two shields.  As I play around with the different PCB builds, I’m thinking this kind of help when hydroponically growing herbs and vegetables is simplified when there is one shield instead of two.  Also, there was significant noise when connecting the BNC connectors to wires.  So I decided to mount the BNC connectors on to the shield.  Here are sketch up drawings of the analog (pH, EC, temperature measurement) and digital (pumps) side: Analog Side of Ladybug Shield Digital Side of Ladybug Shield

# The Goal

The goal of this post is to go determine if the three analog signals (pH voltage, EC voltage, and thermistor voltage) will work when the design uses a common VGND.

# The Signals

The circuit design calls for a 5V power source.  There are two major AC signals the power source must accommodate:

• The pH voltage reading
• The EC voltage reading
Since the readings can be negative, the circuit raises up the GND so that one power source – 0V to 5V – is used.

## VGND

VGND is used for both the pH and EC signals so that a single 5V power source can be used for the op amp rails.  In the EC circuit, a 1K/1K voltage divider set VGND to 2.5V. In the pH circuit, VGND is set to .45V.  Will the pH circuit work if VGND is lifted to 2.5V?

### EC Signals

The amplitude of Vout is determined by the gain loop and the amplitude of Vin+.  The gain is determined by a fixed resistor value – here 1K and the variable resistance introduced by the EC probe reading.  The amplitude of Vin+ is determined by shrinking the AC signal created through a previous Wien Bridge Oscillator circuit.  From measurements, Vin+ maximum amplitude given the current design is = .28V. The challenge with this design is the gain can force Vout to be off rails, i.e.: the AC Signal’s amplitude is greater than 5V.  For this reason, I limit the EC readings this circuit will handle to be those needed to grow healthy herbs and vegetables.  I included a table in a previous post that lists the Siemen and Resitor values for several plants.  The range of resistor values for ReC that this circuit will focus on is 100Ω to 1.2KΩ.

Here are the results of an LTSpice simulation of the EC Signal when the EC probe/variable resistor = 100Ω => S = 1/100 = .01S (the wave with the largest amplitude) through ReC = 1.5KΩ => S = 1/1500 = .000666667S The EC signal fits will within the range when VGND = 2.5V.  In fact, it would be better if the signal was spread out more on the vertical.  This means the gain on Vout could be larger.  Recall that Vin+ is around .28Vpp.  To be conservative, I’ll use a Vin+ with a higher Vpp of .28Vpp. R2 in the schematic represents the known resistor in the gain loop.  At 1K and a lower resistance reading of 200Ω for the E.C. probe, the gain is 1+1000/200 = 6.  For now I’ll keep R2 at 1K.

### pH Signal

As shown in the LTSpice simulation results: The amplitude of the pH signal is .415V.  Thus the pH Signal will fit within the 5V rail when the VGND is equal to 2.5V.

The Thermistor readings will be relative to GND and not VGND.  So they too will work in this circuit design.

## Do They Fit?

Yes indeedy!  All three analog readings can be made when VGND = 2.5V.

This has been a simple check.  Now its time to combine the designs into one kicad schematic and layout.