hmeter

(Hydro Meter)

A hydroponic garden monitor and datalogger.

screenshot

Overview

See the current project status at the Sourceforge page.

The motivation for this project comes from the fact that I have a small hydroponic vegetable garden growing outside.  I'm growing tomatoes, squash, zucchini, and cucumbers.  As the plants grow, they increasingly need frequent nutrient and water refills.  The pH and TDS (or electroconductivity) have to be controlled and maintained for optimum growth.  The nutrient reservoir must not run dry.  The temperature of the water should be under 75 F if at all possible.  A handheld meter is the traditional tool to keep track of the nutrient condition.  I wanted something more sophisticated, and hmeter is what I came up with.  

The idea is to use a small data acquisition device outside in the garden which measures the system parameters and feeds this data, via RS232 serial line, to a webserver running inside.  The webserver hosts a site which shows current garden conditions, such as pH, EC/TDS/CF, air and water temp, reservoir depth, light intensity, and even fan operation and AC power usage.  This data is fed into GNUPlot to generate graphs of recent (24 hour, 7 day) conditions.  Additionally, this data is crunched to compute other useful information, such as day/night length, nutrient/water usage over time, minimum/maximum high and low temperatures, and other information.  If I can get the power down low enough, the acquisiton device will run for the season on a single battery.

An additional feature is the use of the PC to check whether any of the measurements are outside of a preset range.  The user can then be notified automatically via email or text page.  

Other features include a notes page where journal entries can be entered.  These are automatically timestamped and posted to the webpage.

Of course, the webpage does not have to be publicly accessible. It is likely I would make my page visible only on my home lan.  

I plan to have online sensor calibration, a webcam-based time-lapse photo page, and a few other things. 

Data acquisition

The data acquisition box has to do some signal conditioning, ADC, and serial comm.  I chose to use a Microchip PIC to do this.  I chose the 16F88 because of its price ($2.50), 10-bit ADC channels, UART, and the good development support available for PICs.  (It helped that I've done half a dozen small PIC projects before.)

The idea was to be able to use any standard pH probe and a cheaper two-electrode EC probe.  Additionally, I wanted to support a good quality commercial probe.  I have a Hanna meter, and want to support its HI-1285 probe.  (The HI-1285-5 has pH, EC, and temperature sensors).  Motorola makes a nice piezo-resistive MEMS pressure sensor.  They sell on eBay for about $10 for three sensors.  This sensor connected to an open-ended airline tube inserted into the reservoir can measure water depth with a resolution of about 3mm.  A CdS cell measures light intensity, and NTC thermistors measure temperature.  I wanted to accept a digital tach signal to measure fan speed, in case a fan was in use.

The circuit uses several op-amps, including an ultra-high input impedance op-amp for the pH sensor, allowing the use of both amplified or unamplified pH probes.  I added a shift register to support a standard LCD panel for future use.

The full schematics will be posted.  I used the evaluation version of Protel99 to draw the schematics.  I'd appreciate hearing about any decent open-source alternatives for schematic capture...  I'm still fine tuning some of the circuits.  

The complete PIC code is in CVS.  Parts of it came from PICList (www.piclist.com), and credit is given for those parts.  The code doesn't have a license included in it yet, but everything is released GPL.  The schematics are released GPL as well.

I have plans for a future circuit to measure AC power usage and feed that to the data acq. device as well.

Software

screenshot
The server-side software is implemented almost entirely in shell scripts right now.  It is not yet complete.  I have some basic screens working, and a very rudimentary calibration script. 

I hope to be actively developing this over the next few months.  I'm accepting offers of help, if anyone is interested. In time I'll write some docs and improve this page.

You can browse the source code on Sourceforge.

Click here to see a sample of what some of the pages will look like. The actual numbers are incorrect, as the code which creates these pages is still under development.

Next project: Automation!

I've started working on the next stage of this project in parallel. The goal of this one is to automate the addition of nutrients and the filling and flushing of the reservoir.

Click here
for details.




Brian Kuschak
bkuschak at yahoo dot com