Saturday, 23 January 2016 08:05

DIY Arduino-based automatic watering system controller

Written by
Rate this item
(1 Vote)

And here is my homemade automatic watering system controller!

There'll be a few schematics as I designed the controller in a modular way. It's convenient because if sometime I'll want to improve something - I'll not to redo everything.

Now then, let's see what are the parts of the controller.

Arduino Leonardo. Homemade.

For those who doesn't know, Arduinos are such small PCBs with a microcontroller that you can program to perform almost any electronic tasks. It's programmed in a much simplified language, which has a lot of ready libraries for any possible need. There's also a huge set of tutorials. So, even a complete novice (like me just a pair years ago) can start to learn electronics with Arduino.

I made this PCB as an experiment a long ago.

 Homemade Arduino Leonardo schematic

I made the source files in Proteus (as well as all the rest) basing on official schematic from https://www.arduino.cc/

The links for download are below. As I designed it on a single-sided PCB - so the pins layout does not match the official.

There was some trouble with the bootloader - so I uploaded the scethces to it with USBasp programmer.

If someon will want to replicate my controller - there's two options. Or you may make the same custom Arduino Leonardo - or you may buy standard one, but you'll to re-route the main PCB.

Main controller PCB.

The main PCB of the automatic watering system controller is designed double-sided. I produced it by popular laser-iron method.

Automatic garden watering controller schematic

Automatic garden watering controller schematic

As you can see, there's a lot of different connectros on this PCB.  In substance, it's mostly just a trace from Arduino pins to other components connectors - that are mostly placed on their own small PCBs. So, You'll need such a connectors:

There's also a 6 transistor keys (Q1 - Q6) on a main PCB. They drive a current to the solenoid valves. You may use any N-channel MOSFETs or NPN bipolar transistors which allowed voltage is more then 30 V and that can drive 1A or more current. I use BD135. Before this there was MOSFETS - but they pass off.

The 74HC595 shift register IC is used to handle voltage levels on bases of 6 transistors using just 3 Arduino pins. It communicates with the microcontroller via SPI bus.

Connectors J14 - J16 are not used for now - but in future they may be used for some analog sensors. They are connected to ground via a transistor, which base is controlled by Arduino pin. In this way it's possible to turn these sensors off from Arduino program and save some energy.

Real-time clock (RTC) DS1307 module

I made this module by myself - but it's easier to by one in any electronics store. The RTC is needed to store (and continue to count) the data about time - even if the main power supply is turned off. For this reason, it is powered not just from common +5V, but also from a 3V lithium cell battery. DS1307 consumes very low power - so this battery lasts for years.

 Nokia 5110 LCD screen

It's a very popular screen in DIY projects and is sold in most of the electronics stores. It has a 84x48 resolution, and there's several Arduino libraries for this LCD. I modified one of those libraries and wired the LCD to the ICSP header of Arduino Leonardo. The modified library is provided with other code files.

The voltage allowed for LCD inputs is 3.3V - and Arduino outputs are 5V. To adapt the voltage levels, I made a simple level converter PCB based on a resistive divider. There's also a 3.3V linear stabiliser for LCD power supply.

The keyboard

The keyboard has 5 buttons. But I wanted to use just 3 Arduino pins for it - so the buttons are intricately connected with outputs through diodes.And then the program in Arduino evaluates the combination of high and low levels on keyboard outputs - and determins which button is pressed at the moment.

Here is the video where you can look at it:

But all that described above - is just a pile of iron without a microcontroller program.

I have been writing it  long while and stoically, re-writed some pieces of code, learning C++... And I did it! It works!

The program realises the possibility to allow / deny the automatic watering and filling the water tank. I can specify the watering at certain days of week, the total time of irrigation and the time for every solenoid valve separately. The time can be adjusted as well. It seems like it works without considerable bugs. At least, when I am not at the place - the garden is watered and the water tank gets full.

In the next video you can see the menu and simple tests of my automatic watering system controller.

And the demonstration of  all the system at my country house will be in the next post.

And this link lets you to download the schematic and program of all that I described here: https://drive.google.com/folderview?id=0B-L3FpybzEsjR2JsYU5BaGlieFU&usp=sharing

Read 4797 times Last modified on Sunday, 24 January 2016 21:46
Login to post comments