QUICK PROJECT DESCRIPTION
- PROJECT OBJECTIVE: Build an automated watering system for your garden that decides, based on soil humidity, temperature and time, when to water your plants.
- HARDWARE REQUIREMENTS: Provided in the Mango Labs Mechatronics Maker Kit: Arduino-compatible board, USB cable, RTC module, SSR module, temperature sensor, RGB LED module, 2 x 10K resistors, 16 male to male jumper cables, 2 male to female jumper cables, mini breadboard, 12v power supply.
Additional hardware: computer, electrovalve (I used a washing machine valve that is easy to find), 2 male plugs, 1 female plug, glue gun, 2 galvanized nails, thin solid core wire (stripped telephone or network cable), 16 AWG cable (length will depend on your installation. Vulcanized/outdoor cable or terminals would work fine), CR2032 coin battery, small star screwdriver, pliers/crimper.
- SOFTWARE REQUIREMENTS: Arduino environment (or online editor). Download the RTC library here. Unzip and paste the folder in the Arduino libraries folder. It’s in the same location as your default sketches. You can look it up under File/Preferences Sketchbook location.
- KNOW-HOW REQUIREMENTS: Basic Arduino environment knowledge (learn more here). Basic electrical skills.
The crucial part for this project is the solenoid valve / electrovalve. I have found out that washing machine valves are that the easiest to source and to set up.
It doesn’t matter what model you get. What is important is to check if it will be easy for you to connect it to your water supply. Washing machine electrovalves come with a threaded inlet side where you connect it to your supply with a standard washing machine hose, which has the same threading and size as most garden spouts. So that should make things easier.
Once you have your electrovalve you have to attach some cables to it. Choose cable that is long enough to enable you to place your electronics at safe distance from the water. If you have a soldering gun, you can solder the cable to the terminals. For insulating the terminals I recommend shrink-wrap tubing.
If you don’t want to solder you can also crimp a terminal and connect it to the electrovalve. I suggest shrink-wrapping the whole terminal.
At the other end of the cable you have two choices. You can connect one lead to the solid state relay and go from there to your plug and connect the other lead of the electrovalve to the plug. Take care to strip only a small amount of insulation from the cables you are connecting to the relay board.
Otherwise, I would recommend connecting a male plug to the electrovalve and a female one to the SSR module and screw them both to a board (as on the Bluetooth-controlled slow cooker Lab Idea).
For your soil humidity sensor you need two galvanized nails 4 inches or more. At the top you have to wrap some copper cable to connect it to your Arduino-compatible board. Solid core cable works better; if you are placing your electronics some distance away from your garden and water (which would make sense) you could use solid core telephone cable. Strip a good length of insulation away from your wire.
Coil it a couple of times around your nails and twist it to secure it.
You should insert them in the soil 2.5 cm apart.
Follow the diagram to wire the circuit and take special care in checking that all the wiring that goes to mains is OK. Upload the sketch from here or copy the code below to your Arduino-compatible board. Time will automatically be set on the RTC board so be sure to have the coin battery already installed; this way, it won’t reset when you unplug it. Unplug the USB and plug the power supply to your Arduino-compatible board to perform a last check.
It’s a good idea to protect your electronics from water. A fast and cheap way to do it is to put everything in a plastic container.
Connect your electrovalve to your water supply. Using a washing machine hose worked for me.
You could also use a hose clamp and a regular hose.
I connected the other end of the washing machine hose to the bronze coupling of my garden hose (in order to extend the range) and added a packing to get a tight fit.
Pin your nails in the garden, plug the12v power supply to your Arduino-compatible board, plug your electrovalve to the SSR controlled female plug, plug your SSR to mains and you should be done.
The system checks for normal conditions for every sensor at startup and will light the LED red if something is wrong (it will also send a message through the serial port indicating if there’s a problem in a specific sensor). Every six minutes it will check the input variables (and blink white) to decide if watering is needed.