Update March 2017
The RTC and DHT libraries are notorious for creating problems as there are so many of those libraries around carrying the same name. Therefore, In Step 17 I have linked to codebender where you can find the code with the proper libraries.
However, codebender is closing down, so I also added a zip file with the code and libraries, but I kept the libraries local, with the INO file, as not to overwrite your existing libraries.
I have been using Attiny chips for irrigation tasks in my garden, but having plans to build a greenhouse, an Arduino seemed to be the way to go as it has more ports. I know, there are many 'Garduino' type projects already, including ones that twitter the state of your plants, but I just wanted something more basic, so, what does an anal retentive Asperger do in such a case: build something myself.
No use of course to spend 23-25 euro's for an Arduino Uno and then still have to add a shield for peripherals: seemed a bit overdone and as I have built various 'arduino's' already, I decided to just get the chip, a crystal, and 2 capacitors + some more stuff and build the entire thing on an Archer experiment board that I bought 20 years ago but has been idle all that time (radioshack partno 276-168). The Archer experiment board has islands with 3 holes and 2 seperate tracks (Vcc and Gnd) snaking in between. Of course it can also be done on regular strip board, perfboard or one can make a PCB for it.
Note At the time I wrote this, it was economical to build an 'Arduino' yourself with a bare chip. However, as prices of Arduino clones have dropped considerably, it now in fact is much smarter to get an Arduino Pro Mini clone and add the required hardware to that
In the end I decided I needed to have the following functions
List of materials
Atmega 328 here to burn bootloader yourself or buy one preprogrammed
1x 28 pins IC foot narrow (or 2x 14 pins ic foot)
2x 22 nF (often carries '223' imprint)
1x 10 k (brown-black-orange)
1x 100nF (often carries '104' imprint)
1x momentary make switch
perfboard This is what I used because I had that laying around idle for years already
NOTE:an attractive alternative is a cheap arduino clone such as the Pro mini or Pro Micro that can be had for a few dollars at e.g. Dealextreme.com or at AliExpress (currently 1.50 Euro)
16x2LCD CG046-3007 A00, but any other will do.
1602 I2C module
1x 7805, isolated
2x 100uF (16 V en 25 Volt)
1x 1 k resistor (brown-black-red)
1x psu connector
Note: Consider getting a plug in USB charger with a cord and forget about making your own PSU
1x DHT11 moisture sensor (e.g. from dealextreme)
1x make push button
1x throw switch
1x buzzer (I use the CMB-06, a triggerable buzzer) ($2.99) but use any other buzzer you have or are comfortable with e.g. this one. Aliexpress has some buzzers that literally cost dimes
1x NPN transistor (e.g.BC547)
1x 330 Ohm (orange-orange-brown)
2x 10k (Brown-black-red)
4x330 Ohm (orange-orange-brown)
4x8pin dil foot
4x2pin screw connector (mains voltage)
1x 5pin female printheader
1x 5pin male header 90degrees angle
ALTERNATIVELY: buy a ready made 4 channel mechanical relay for just about the same price as loose parts for the SSR, such as this one, or an even cheaper one.
bits and bolts
a couple of different colour wires, some print headers, four 3mm bolts and nuts, some 2.5 mm bolts and nuts, 4 spacers
solder tin, solder iron.
I have used Cinch plugs for connection... but actually these are hard to solder.
I use two casings:
one for the processor and most of the peripherals (I use a plastic box that contained screws: 9x12x4.5 cm)
one for the SSR's (I used a Tic-Tac peppermint dispenser The bigger one for 100 mints: 8.5x2x5 cm)
Before I describe the construction I will discuss the individual items:
An Atmel 328 with an Arduino bootloader is used. That makes for easy adaptation and uploading of the program. It will be a "bare bones" setup with no USB entrance, but simply with the TTL Rx and Tx signals on a header. Consider using a cheap Arduino pro mini, pro micro or Arduino nano
Simply a 7805 circuit fed from a wallwart. No 3.3 Volts will be necessary Consider buying a ready to use cheap 5 Volt USB charger
Humidity and temperature sensor
A DHT11 sensor will provide that. It is a 3 pin sensor of which the data can easily be read by the Arduino. There is a library available.
Simply read as an input to set various functions in the software
An LDR read by an analogue port. It basically is there to determine if it is day or night. This allows for extra light when the days are too short or to perform certain functions different at day or might(such as different day and night temperature, no irrigation at night etc)
Soil Moisture sensor
This sensor, read by an analogue port will give information about the humidity of the soil and signal the processor it is time to irrigate. There is an entire science on DIY soil moisture sensors. I will just be using the classic '2 nails' approach. The software and hardware will allow for the current through the sensor to be switched off, thus delaying corrosion.
This sensor checks if the water reservoir is still full. A simple float switch will suffice
used to give signals, e.g. if the water reservoir is empty. I use an old CMB-06 that has a trigger, meaning it can be triggered with a small current while it can get its main current directly from the power supply lines.
Solid state relays
I use 4 solid state relays to switch a fan, a pump, a heater and the lights. The solid state relays are separated from the processor print out of safety precautions. Consider using a cheap 5Volt 4 relay board