Thursday, December 28, 2006

An old swamp cooler made the greenhouse usable during the summer. The electric oil filed radiator keep the greenhouse warm this winter. Although we insulated on side of the roof the heating bill have become too much so we moved all the plants except water lilies in to the house yesterday.

Saturday, October 28, 2006

Update


Update: The summer is over and once more I am depending on the WX175 to keep plants from freezing.

I have rewritten the GUI in a more OOP style. It now includes a tab-ed pane that allows you to switch between various controls. The code as with the earlier version is MS C#. In time it may be moved to a Linux server using mono the pd C# clone. The red background indicates that the greenhouse heater is on. It would show blue if the cooler was on. In the tab-ed pane there are boxes that indicate how long the heater and/or cooler ran and how much it cost to run. In this case 36 cents. Above the boxes there are ON/OFF buttons which are active when the control program is paused. Click on the image for a larger view.

I have started a project to replace the WX175 with a custom controller. The plan is to have the control logic local to the controller rather then depend on a remote PC. This will make the system more dependable. The PC will still set the program parameters and log information to the database. The local control logic may be limited to a sanity check on received commands and a limp mode program for use when the PC becomes unavailable.

Current plans are to run as much of the automation as possible from one or more 12V auto or deep cycle marine batteries. In the event of a AC power failure this will allow the system to control the more passive things linke vents and shades, and most importantly an alarm.

Saturday, May 06, 2006

Updated Graph


Several days of temperature data. The blue lines that come down from the top indicate the cooling fan is running. The lines that come up from the bottom indicate when the heater is on. I was in the process of working out the heating hystersis (sp?). Ended up at 1 degree (was 5 to start with). The heater is switched on and off more frequently but the temperature only varies by a bit over 1 degree. Sweet.

Friday, April 28, 2006

Door Sensor

It has been raining on and off for the past 24 hours. So far we have about .70 inches. We are quite dry so I hope we get about 2 more inches of gentle rain.

At any rate I figured it was about time to add a sensor to let the system know when the door was open or closed. It would be a bad thing to turn on the fans when the door was closed. It would also be nice if the system could alert me that I needed to open or close the door for temperature control. Yup some things are still quite manual.

The obvious choice would be to use a reed switch, neither I or the local Radio Shack have one. I was thinking about using a limit switch but the door is a bit sloppy and the switches I have do not look moisture proof. I settled on using an old mercury switch salvaged from a blower fan. These are simple devices. When the mercury cover the contacts the circuit is closed.


The sensor mount is little more then two bits of wood attached to a strap hinge. The switch is attached to one of the sticks with electrical tape.

When the door is opened the heavy end swings down causing the mercury to run away from the contacts.

When the door closes it pushes the sticks in which tilts the mercury switch and contact is made.


The tape is used to position the switch an angle that will cause the desired murcury flow.

That is all.

Wet bulb humidity sensor


Robert Graham describes (with pictures) how to measure humidity with a couple of DS18S20 sensors, a fan and some PVC pipe. Here on the Wet Bulb Humidity page.

This "modern" way requires a humidity sensor and another sensor (DS2438) to meaure voltage and temperature. See this.

A more complex experiment on the subject can be found at Thermistor Psychrometer Lab.



Philip Gladstone's version of a shade. This one is made of plastic bowls costing less then $1 each.

Tuesday, April 25, 2006

Graphing


I spent some time working on the graphing. Added background color and a line for freezing and another where cooling starts (hardcoded at 80 for now).

Sunday, April 23, 2006

ZedGraph and using time for the X axis.

The article regarding ZedGraph is

A flexible charting library for .NET


ZedGraph uses a variation of the C# DateTime type called XDate.
The current scheam is to leave all dates in C# DateTime type and
the convert them to XDate for graphing.

In mysql the date/time field is
of type datetime and has a default value of 0000-00-00 00:00:00

In C# use the type DateTime.

DateTime timeStamp;

To format it for the mysql query use.

timeStamp.ToString("yyyy-MM-dd HH:mm:ss")
see Parsing Dates and Times in .NET
The code to get the timeStamp back into a C# DateTime type is

MyCommand.CommandText = "SELECT * FROM Temperature ORDER BY idx";
OdbcDataReader MyDataReader;
MyDataReader = MyCommand.ExecuteReader();
while (MyDataReader.Read())
{
string a = MyDataReader.GetString(4); // where the datetime value is in the 5th position
System.IFormatProvider frmt = new System.Globalization.CultureInfo("en-US", true);
DateTime dt = DateTime.ParseExact(a, "yyyy-MM-dd HH:mm:ss", frmt);
....
}

To get ZedGraph setup to use time on the x axis.

// get a reference to the GraphPane
GraphPane myPane = zg1.GraphPane;

// Set the Titles
myPane.Title = "Temperature Data";
myPane.XAxis.Title = "Time";
myPane.YAxis.Title = "Temperature";
myPane.XAxis.Type = AxisType.Date;

There are other options regarding what one can set for x-axis and time but the one line is all you should need if you are feeding it time in the XDate format.

Tuesday, April 18, 2006

The Greenhouse.

The Greenhouse is 8 wide, a bit less then 10 feet long and 9 feet tall at the peak. The roof starts at the 5 foot mark which makes for a steep pitch.

I was delighted when my realtor informed us that the property included a greenhouse. What she failed to say that it had seen better days. It was covered with sun scorched PVC punched full of holes by a nasty hailstorm. We bought the place anyway, and the greenhouse has become another project.

Tucked up in the garage rafters I found enough PVC material (PALRUF) to cover the badly dammaged south side of the roof. I am in the process of patching the remaining holes. A patch is cut to cover the hole and glued in place with clear silcone. There is no hurry to finish the work in that the danger of frost has past and the holes provide additional venting. Which is a great segway to the next topic.

I would like to keep the greenhouse running most of the year. Our area gets frequent wind and some hail. Keeping a few pond plants in the greenhouse would protect them from the weather.

In the summer that requires cooling. Currently I open the door in the AM and close it at dusk. A small fan hangs in the doorway and is controled by computer. There are also 2 SMALL vents under the peak of the roof on each end. It could be better.

The first upgarde will be shade cloth. Charley's Greenhouse and Garden has online help for building a shade cloth setup that rolls up when not needed. You can find the PDF for the 'general idea' here.

For Active cooling I am thinking about building a evaporative or swamp cooler into part of the far wall. Perhaps automate the vents to open when cooling starts. As a last resort a mister could be used, but the water has a high mineral contentent. If it did not plug the mister it would coat everything in white/gray gunk.

The most expensive upgrade will be the replacement of the PVC with double wall polycarbonate. The current structure goes down to outside air temperature at night. If the unit was tighter and had some R value the pond would help moderate the temperature.

Originaly the greenhouse had two benches to hold pots. One was removed to make roof for this pond aka horse tank.









April 19, 2006

After a week with the lows above 50 it frooze last night. I found a bit of ice this AM. The outdoor sensor's low was 26.8F. The pond air temp got down to 35.7F. The 9 degree diff was enough to keep the plants in the greeenhouse safe. We covered the outdoor strawberry bed that my SO planted last weekend.