Introduction: Battery Operated Drip System

About: Hi! My name is Adriaan and I am from the Netherlands. In my spare time I'm an electronics enthousiast and I design and make woodwork objects. I have a self built CNC machine at my disposal, that I demonstrate …

My aim was to create a battery operated drip system, that could easily be installed anywhere in the garden.
Once a day, for a preset number of minutes, the unit waters the plants via a little 9V operated pump that is submersed in a 20 Liter bucket.

See the picture of the end result above: the unit is screwed onto a little wooden plate, and connected to the garden fence. The bucket is situated next to it, and two little wires lead towards the submersed pump. The pump will then supply the water to a tiny hose with some dripper heads.

Extremely low power consumption
I found a link to a site that describes how to use the Atmel chip that is present in an Arduino Uno in a standalone fashion, with a library that allows for extremely low power consumption. This helped realise a design that is extremely low in power consumption. The batteries will last for a few years.

Requirements

  • The unit should be simple to operate, as simple as possible.
  • It should be portable and self contained
  • In order to allow easy installation anywhere in the garden or balcony, it should be independent of the home water system and electricity mains. Therefore, it should be battery operated with very low power consumption, in order to have a battery life of a number of years, preferrably. It should retrieve its water from a bucket or a pond.
  • It should be relatively watertight, so it can be installed anywhere outside where it rains from time to time.

Setting the number of minutes

The yellow led on the left flashes will flash after every 15 seconds. Then it will flash quickly for a number of times indicating the number of minutes the pump will be active. For example: two flashes indicate that the current set value for the irrigation durance is 2 minutes. The two buttons allow you to either increase or decrease the number of minutes to irrigate, wait for the flash while pressing the button.

Testing the unit and setting the watering time
Pressing both buttons and waiting for the time of the flash will reset the time of irrigation to the current time, and test the motor for the number of minutes that have been set. That is all!

NB. In case you were wondering why it would be necessary to await the flashing time when pressing the button or buttons: the reason for this is, that the unit is really in deep sleep and not monitoring anything between those flashes. It is however possible to remedy this by using an interrupt. For the sake of simplicity I have not been using this option in the current design, but feel free to adapt this of course ;)


NB. Drip keeps dripping? This is a common problem for drip systems that are NOT attached to an automatic tap. Because the pump is not really that powerful, there can only be so much pressure in the system, and the drip heads should be opened quite a bit. As a result the water may keep dripping even when the pump is no longer powered: when at least one of the drip heads is below the water surface in the bucket, the drip is controlled by the flow of the water still in the tubes, as opposed of being controlled by pressure. This is the effect of "communicating vessels" that you may or may not remember from physics class. The water tries to be at the same level in both vessels, except that there IS no second vessel - just the garden.

Remedy: put the FIRST drip head well above the surface of the water in the bucket. As soon as the pump shuts off, the water flow will be stopped because the first drip head will allow a bit of air into the tubes. The other drip heads may be as low as the ground or even lower, if you wish.

Step 1: Part List

Part list

  • Arduino Uno board (R2 or R3) with 28 pins Atmel chip (ATMEGA 328P), through hole, so chip can be removed from its socket
  • 16 MHz crystal and 2 ceramic capacitors of 22 pF
  • Optocoupler (I used only one channel of a ACPL-847 that I still had in stock
  • Power transistor (NPN Power darlington, for example TIP102)
  • 1/4 W resistors: 10k (3x), 220 Ohm, 470 Ohm (2x)
  • 10 uF capacitor, electrolytic
  • 3 LEDsA 2 times 1.5 V AA battery pack (for a total of about 3 V)
  • A 9 V block battery
  • two push buttons

In addition:

  • Breadboard + wire set (to be able to experiment around)
  • 9-12V mini pump, submersible - costs between 6$ to 8$ on e-bay, usually used for aquarium, plm 3W
  • irrigation pipe, several meter, fitting the drip heads
  • inline drip head, for example Gardena 4.6mm, at least 1, maximum 8 or 10.
  • end plug, fitting the irrigation line

Step 2: Get the Arduino Uno and the Software

Arduino chip "stand alone"

An example of the Atmel chip with an extremely low power consumption is given on openhomeautomation.net, click the following link by Marco Schwartz: https://www.openhomeautomation.net/arduino-battery...

Please read Marco's article first before continuing this step. See the diagram above that I nicked from Marco.

Get to know how to use an Arduino microcontroller

If you are not at all acquainted with Arduino, please consult the excellent Arduino pages on www.arduino.cc
This site contains all the information and software to run an Arduino. (Best is to buy a beginner's set with a little booklet from the market to get yourself acquainted with the Arduino. It will set you back a few bucks, but I higly recommend it - it will really help you to get to know Arduino's most important features).

Get the Arduino chip (Atmel Atmega 328P) on the Arduino Uno Board
Buy an Arduino Uno board and a connecting cable, preferrably from the original source of Arduino, if only to keep them in business.

You need an Arduino Uno with a 24 pen Atmel chip that can be removed from its socket (SMD will do you no good) can be programmed as usual on its board. When programming is done, take the Atmel chip from its socket and stick it in the board that you will use for your design.

Install the Arduino IDE

You will need the Arduino IDE, it can be download from https://www.arduino.cc/en/Main/Software

Install the software and try the "Blink" program on the Arduino Uno.

Install Jeelab

You will need the Jeelib library that allows you to put the Arduino chip to sleep with extremely low power consumption. The Jeelib library can be downloaded from Github: https://github.com/jcw/jeelib Go to this Github page and click on the "Download Zip" button on the right side of page, and install the Jeelab library in the usual way. If neccessary, consult the Arduino pages on arduino.cc to find out how to do this.

Step 3: Setup of a Stand Alone ATMEL Chip on a Breadboard

First, to allow you to play around with the design, we will setup the above schema on a breadboard.

I hope that the above schema is readable, if not, right-click on it to download it to your computer and print it out full scale on a A4 paper, by importing it into a Word document.

We will now build the schematic on a breadboard and test it, step by step:

________________________________________________________________________________

Program the Atmel chip

  1. Program the Arduino with the Blink program, replacing the port 13 by port 3 for the blinking led.
  2. Carefully remove the Atmel chip from the Arduino breadboard without bending the pins (use a small screwdriver to wiggle it under the chip, and then wiggle it upward)

________________________________________________________________________________

Create the "low power" side on the breadboard

  1. Take a breadboard. and put in on the breadboard.
  2. Now add the crystal and the two 22 pF condensators, according to the schematic (pin 9 and 10 of the chip)
  3. Connect the power lines for the VCC (pin 7, 20 and 21) and Ground (pin 8 and 22) to the chip and to the corresponding power lines on the breadboard
  4. Connect the 220 Ohm resistor and one of the LEDS to Arduino port 3 (Pin 5 of the chip). Take care to connect the plus side of the LED towards the chip.
  5. Connect the Reset pin (pin 1) via a 10K resistor to the + power line
  6. Now connect the + side to +3V of the battery pack, and the Ground to the minus side of the battery pack

The LED should now be flashing.

Congratulations, you just created your stand-alone Atmel system.

_______________________________________________________________________________________

Now make it energy efficient

However, the current program is not really that energy-efficient yet:

  • To make it more energy-efficient, use the Jeeves library by including as first line of your program: (NB. You should have added the JeeLib to your Arduino environment as described in the previous step):

#include // Low power functions library

  • Below this line, include the line to declare the watchdog from the Jeeves library:

ISR(WDT_vect) { Sleepy::watchdogEvent(); } // Setup the watchdog

  • Instead of delay(1000), use instead:

Sleepy::loseSomeTime(1000);

Of course, to make the LED burn, power is consumed. My point: let's try to reduce the burning time of the LED as much as possible. Increase the time lapse between two flashes to 15 seconds (Sleepy::loseSomeTime(15000); )

Congratulations. Now you created a flashing LED on batteries that will keep flashing for years!

Step 4: Add the Motor Control and the Push Buttons

NEVER use the 9 Volt on the Arduino directly, or it will blow the chip to never never land immediately. In order to prevent this from happening, the power part that drives the motor is seperated from the 3V circuit that drives the Atmel chip.

Add the remaining part of the schematic to the breadboard:

  1. Add the optocoupler to the breadboard
  2. Add the 9V battery, connect the battery to two other power lines of the breadboard to avoid confusion.
  3. Connect the plus side of the inputside of the chosen channel of the optocoupler (I chose channel 2) to digital pin 4 (pin 6) of the Atmel chip via a 470 ohm resistor. Connect the ground of the supply side to the minus side of the 3V battery pack.
  4. Connect the output side of this optocoupler channel, and add the transistor and the 10k Ohm resistor. BEWARE: the GND2 and the +9V in the schema refer to the contacts of the block battery. DO NOT MIX THEM UP with the power lines of the Atmel chip that you connected in the previous step.
    Add the motor and the corresponding LED (I use a red led to indicate that the motor is powered).
    Add a diode or a LED in reverse polarity over the motor, to prevent the circuit from having spikes when the motor is turned on or off.
  5. Connect the two push-buttons and the pull-low resistors to the chip: one between 1 and 2 and one button between 3 and 4. BEWARE to use the + side of the 3V battery, NOT the 9V!

Check the motor control part of the circuit

Your circuit is now complete. Making the port 4 line an output in your Arduino program and setting this port high should make the motor led burn and make your motor spin. Try this by adding this pin as an output in the setup, and setting it high and low when the LED pin in the previous step is set high or low. You can reprogram the chip by putting it back into the Arduino board. Take care to put the right pins in the right holes when you put the Atmel chip back onto the breadboard.

Check the push button part of the circuit

Use the push buttons as input: program in the setup of the Arduino program port 5 and port 6 as input. Check in the loop if port 5 or port 6 is high, and if so, set the motor line (port 4) high. Reprogram the Atmel chip, and check if the buttons work correctly.

Congratulations! Your circuit is now complete and working!

Step 5: Download and Test the Control Program

The software can be found in the file below. Download the file and test it with the circuit that you just built.

The first LED will flash once every 15 seconds.

Push down the "Up" button, and wait for this flash: a longer flash will indicate that the amount of minutes has increased. This longer flash will reappear as long as you keep the button pressed. Release the button after two of those flashes. The LED will now repeat: flash 3 times quickly and then pause for 15 seconds.

Pushing down the "Down" button will have the reverse effect. Beware that it is possible to set the number of minutes to zero, and then the LED will not flash at all.

Once every minute you will get a longer signal.

When both buttons are pressed, the motor will start running for the set amount of minutes.

If you want, you can now submerge the pump and see if it will pump the water through the pipe.

Step 6: Create and Test the Printed Circuit Board

Above, a sample setup with a printed circuit board is shown. The corresponding EAGLE files are included, as well as the PDF files for the print masks.

Good luck! I presume this step only makes sense for people already acquainted with PCB board design, and who are able to use Eagle, so I am not further explaining this process. A lot about PCB design with Eagle can be found on the internet. I am very happy with Eagle, it is free for use, but it takes quite a bit of time to get to know how to use it properly.

The masks are as crude as I could make them, in order to allow for use by not-so-experienced hobbyists who probably like to have wide wires, larger holes in the board and space in between the copper wires on the PCB in order to not screw things up too easily.

Enjoy!