Automatic Garden Waterer | 3D Printed | Arduino

by DIY Machines in Circuits > Arduino

17228 Views, 188 Favorites, 0 Comments

Automatic Garden Waterer | 3D Printed | Arduino

Instructables Cover Card.jpg
Screenshot 2019-09-23 at 21.27.43.png
Screenshot 2019-09-23 at 21.27.22.png
Screenshot 2019-09-23 at 21.29.55.png

I'm a keen gardener but watering your plants by hand during dry spells takes some time. This project frees me from watering, so I can work on my other projects. It's also great at taking care of the garden whilst you're away from home, and the plants benefit from the more regular watering.

It's powered by a USB port so that you can connect it to various sources of electricity. Such as an outdoor power socket or USB powered battery with integrated solar recharging. You can also customise at what time, day or night, your plants are watered. I currently have mine watering the hanging baskets twice a day. Once in the morning before sunrise and then they get topped up again just after

Video

Make your own Automatic Garden Waterer - 3D Printable | Elegoo Arduino | DIY

If you prefer to follow along with a video then I have made one which you can watch, otherwise read on...

Bill of Materials

Screenshot 2019-09-23 at 20.02.59.png
Screenshot 2019-09-23 at 20.04.15.png
Screenshot 2019-09-23 at 20.04.04.png
Screenshot 2019-09-23 at 20.03.55.png
Screenshot 2019-09-23 at 20.03.47.png
Screenshot 2019-09-23 at 20.03.39.png
Screenshot 2019-09-23 at 20.03.26.png
Screenshot 2019-09-23 at 20.04.57.png
Screenshot 2019-09-23 at 20.04.41.png
Screenshot 2019-09-23 at 20.04.32.png

You'll need a few things to build one of your own:

■ Elegoo Arduino Nano (x1): https://geni.us/ArduinoNanoV3

■ Servo (x1): https://geni.us/Servo

■ Real time clock (x1): https://geni.us/DS3231-RTC

■ Hoselock compatible connector (x2): https://geni.us/hose-connectors

■ Wire: https://geni.us/22AWGWire

■ Hoselock compatible inline valve (x1): https://geni.us/hozelock-valve

■ Nuts and Bolts - M3 x 10 (x3): http://geni.us/NutsAndBolts

■ ABS Filament: https://geni.us/ABS-Filament

■ Long Usb cable (x1) https://geni.us/LomgUSBMiniB

■ USB wall plug (x1) https://geni.us/USBWallPlug

If you would prefer to use PLA filament I have good success with this one:

■ PLA Filament: https://geni.us/PLAFilament

3D Printed Parts

Screenshot 2019-09-23 at 20.10.24.png
Screenshot 2019-09-23 at 20.10.15.png
Screenshot 2019-09-23 at 20.10.01.png
Screenshot 2019-09-23 at 20.05.23.png

There are three printable parts to this project. The inner and outer case and 'the coupling'.

You can download the 3D models here: https://www.thingiverse.com/thing:3875075

I have printed all of my parts using ABS plastic. You could use PLA or PETG but just know that PLA is the most likely to degrade in outdoor conditions or inside a greenhouse. In the images are the three 3D prints I did as well as the setting that I used for each.

Connect the Servo

Screenshot 2019-09-23 at 20.27.44.png
Screenshot 2019-09-23 at 20.27.38.png
Screenshot 2019-09-23 at 20.27.32.png
Screenshot 2019-09-23 at 20.27.03.png
Screenshot 2019-09-23 at 20.26.48.png
Screenshot 2019-09-23 at 20.26.19.png

I'm going to be soldering all of my connections in this project as I will be permanently installing this into my garden. If you prefer you can use jumpers and a breadboard to make the same connections as I have with the one in the photo.

There is a circuit diagram available here if you prefer them: https://diymachines.co.uk/projects/automatic-arduino-based-garden-waterer.html

First we can strip the plug of the end of the servo wire and solder this directly to the nano. There are three wires on mine, the red and brown wires are attached to the power and ground so I will attach these to the Arduino's 5V and ground connections. This leaves the orange wire which is our signal wire. This needs to be connected to digital 9 on the Arduino.

Connect RTC

Screenshot 2019-09-23 at 20.31.55.png
Screenshot 2019-09-23 at 20.31.45.png
Screenshot 2019-09-23 at 20.31.37.png
Screenshot 2019-09-23 at 20.31.28.png
Screenshot 2019-09-23 at 20.31.11.png
Screenshot 2019-09-23 at 20.31.06.png
Screenshot 2019-09-23 at 20.30.52.png
Screenshot 2019-09-23 at 20.30.18.png
Screenshot 2019-09-23 at 20.30.04.png
Screenshot 2019-09-23 at 20.29.58.png
Screenshot 2019-09-23 at 20.29.43.png

Now we can turn to the Real Time Clock or 'RTC' as it is often shortened too. We will be using four pins. You will need to prepare four 7cm long lengths of wire for this.

As before the ground lead is connected to ground and VCC to same 5V power supply the servo was just connected to. The SDA pin connects to A4 on the Arduino and SCL to A5.

Uploading and Customising the Code

Screenshot 2019-09-23 at 20.33.11.png
Screenshot 2019-09-23 at 20.32.22.png

Use a USB cable to connect it to your PC and open the Arduino IDE.

You can download the Arduino IDE here: https://www.arduino.cc/en/main/software

This project uses the handy DS3231 Simple library:- https://github.com/sleemanj/DS3231_Simple Please follow the instruction on installing this provided on the libraries page

And the code for the project can be found here: https://diymachines.co.uk/projects/automatic-ardu...

Before you upload the project main code you need to set the time on your DS3231. Once you have connected it as shown and have installed the DS3231_Simple library (see above) go to 'File' >> 'Examples' >> 'DS3231_Simple' >> 'Z1_TimeAndDate' >> 'SetDateTime' and follow the instructions in the example to set the date and time on your RTC

In the main loop of the code are two IF statements which check the time and then initiate the watering sequence for a specified amount of time. The conditional check of the IF statements checks to see if the value of the hours and minutes from the clock match what we have set here. If they both match then the 'Open Valve' function runs, followed by a delay.

This delay (set in thousandths of a second) determines for how long the water is allowed to flow through the hose to your plants. You can have as many of the statements in the main loop of the code as you need.Just copy and paste them whilst updating the conditions of the IF statement and duration of watering (the delay between opening and closing the valve).

Fit the Valve

Screenshot 2019-09-23 at 20.46.42.png
Screenshot 2019-09-23 at 20.46.20.png
Screenshot 2019-09-23 at 20.46.02.png
Screenshot 2019-09-23 at 20.47.39.png
Screenshot 2019-09-23 at 20.47.28.png
Screenshot 2019-09-23 at 20.47.17.png
Screenshot 2019-09-23 at 20.47.09.png
Screenshot 2019-09-23 at 20.48.39.png
Screenshot 2019-09-23 at 20.48.22.png
Screenshot 2019-09-23 at 20.48.07.png

Once you have finished programming your watering schedule we can disconnect it from the computer and begin to complete the assembly.

Use one of the M3 bolts and nut to secure the servo into position as shown in the photo. We only need to secure one of the holes to hold it sufficiently.

The servo should have come with an assortment of arms that fit to it. We want to fit the straight armed one. When we turn the circuit off after uploading the code the servo should have been left in the valve closed position. So when we fit the arm you want it to be vertical.

Now rotate it 90 degrees anti-clockwise until it is horizontal. Slide in the inline valve and fit the coupler we printed onto the servo arm. The next bit does require quite a bit of force but you need to rotate the valve towards the coupling whilst pulling it away from the servo. It will take force to pop it into place, but we only need to do this once.

Connect the Cable and Attach the Cover

Screenshot 2019-09-23 at 20.50.51.png
Screenshot 2019-09-23 at 20.50.28.png
Screenshot 2019-09-23 at 20.49.53.png
Screenshot 2019-09-23 at 20.49.17.png

I'm going to use a 10m long USB lead to connect it to my outdoor power socket to power mine. Let's connect the Arduino end of the cable now and finish of the enclosure.

I've soldered my connections directly to the board so I'm just going to squeeze my electronics into place inside the enclosure. If yours is on a breadboard you can use the self adhesive backing to hold it in place on the ledge provided.

There are two screws that need to be inserted to complete the housing. This should keep it fairly weather resistant whilst kept upright. If you wanted to secure it to a plank or floor there are two screw holes (one underneath the inline valve and one inside the enclosure - you would need to secure these to something before proceeding with the assembly as they cannot be accessed afterwards.

Connect It Outside

Screenshot 2019-09-23 at 21.01.41.png
Screenshot 2019-09-23 at 21.01.29.png
Screenshot 2019-09-23 at 21.01.18.png

Let's now take our project to the garden.

I will install the project between my tap and hanging baskets. Earlier I installed a drip irrigation kit by Hoselock to each of my hanging baskets. This is the one I've been using with good success: https://geni.us/Hozelock-Irrigation

Now we attach this to our hosepipe between the tap and irrigation kit using the two of the quick fit connectors.

I powered mine with the long USB cable connected to an outdoor socket.

Project Complete!

Screenshot 2019-09-23 at 21.24.29.png
Screenshot 2019-09-23 at 21.24.50.png

And that's it, my hanging baskets will now take good care of themselves until early Winter. :)

Thanks for taking a look at my tutorial. I hope you've enjoyed this project. If you have please think about checking out some of my other projects, don't forget to subscribe to DIY machines on here and YouTube and share this project with anyone you know who might like to build one of their own.

Otherwise until next time chow for now!


Subscribe to my Youtube channel: https://www.youtube.com/channel/UC3jc4X-kEq-dEDYhQ8QoYnQ?sub_confirmation=1

Support me on Patreon: : https://www.patreon.com/diymachines

FACEBOOK: https://www.facebook.com/diymachines/