This year I've invested in a polytunnel for the allotment that I rent in the UK, for growing vegetables. A polytunnel (PT) presents a number of challenges, particularly if - like me - you're in full time employment and can't really afford the time to visit it each morning to open the ventilation screen and close at night (depending on temperature), plus keeping the vegetables watered.
So, hello Mr Arduino Mega, and a bunch of his friends...
Basically, a Meta 2560, a Sainsmart SSD1289 display (TFT01) with an ElecFreaks shield; an 8-channel relay board, a Real Time Clock, a Temp/Humidity Sensor and a secondary power-supply. Remotely, there are two Ultrasonic ping sensors, 2 submersible pumps and a motor/worm gear box.
The gist here is that there's a solar-charged car battery that provides the main power to the board, and the secondary PSU. This PSU supplies the relay board, and the +5v for the various boards and sensors.
The RTC and Temp/Humidity sensor are on a single IIC bus (wire-wrapped from the early development phase)
Is the main interface, giving options to set the clock, control irrigation on the north, and separately south row of the PT, water-level monitoring, temperature monitoring and control, ventilation controls and info on the project.
Setting the RTC time and date. A clumsy interface but it allows for simple re-use of a button-library I knocked together for the SSD1289.
Allows for the auto-irrigation of the north face of the tunnel. This allows (in this case) a 10-minute duration for a pumped-overhead spray hose early in the morning before the sun gets up.
Same for the south face (although less on-time for this, since the spray hosed area is shorter (taking into account my IBC and workbench)
Very basic, but monitors the water level in the IBC - this is achieved by a Ping sensor set in the cap on the IBC tank, but, more interesting is the "Trend" button that provides a generic trending-store of a value over 24 hours, 30 days, 52 weeks...
9am is blank - as this is the "current" hour being sampled for min/max levels, everything to the right (10am-11pm) is yesterday's trend, with the samples to the left being today's water level. You can see that yesterday the tank started around 55% full, but it started raining around 11am, filling the tank to around 68%. The blue/red bars show min and max levels - showing a clear problem with the ping sensor and spurious readings - I need to get an oversampling filter implemented in software to avoid rogue readings.
Shows the same detail over 30 days (well about 15 of those), with a clear down-pour early May filling the IBC and a gradual decline in the water level since then, with a bit of a refill over the last couple of days.
The temperature control is pretty basic, showing the current temperature and the desired set-temperature (Top buttons are "temp -", "store", "temp +" for setting the desired temperature). Again, a nice trend button allows the temperature trends to be monitored...
...an extremely poor picture for the Vent Controls - allowing the ventilation blind to be manually raised/lowered, with min/max heights being stored to NVM, and an Auto-control (this will raise/lower the blind every 2 minutes by +/- 20% of the travel, depending on the actual vs desired set-temperature). A trend button allows the blind position to be monitored as before - daily/ monthly / yearly -not that useful except for debugging but it's essentially free to me given the generic trend software.
Is the motor/worm drive to raise/lower the blind vent, driven from two of the relays on the 8-channel control board. Another two channels control the pumps for north/south irrigation.
The dull "about" screen - mostly to offer some personal info should the whole thing get nicked and thrown onto the 2nd hand market, but also offers the curious "HBOX" (history box) window....
Which stores any startup / errors in a cyclic, 32-deep error log.