Free US Shipping on orders over $150 with discount code "FREESHIP" at checkout

Building a Plant Watering System with an Arduino- Setting Up a Real Time Clock

June 27, 2014

We are putting together a plant watering system to be powered by an Arduino.  We have some flower boxes that get no water even when it rains, so for years I have been watering them manually.  So I figured, why not automate it?

Last year I tried using a soil temperature and humidity sensor to make a feedback loop for plant watering, but it just didn't work.  So this time, we will start by running timers that turn on our pumps at set intervals.

The Arduino has built in timing capabilities, but we wanted a solution that would be robust to power interruptions.

Enter the DS1307 Real Time Clock kit from Adafruit.  For $9, you can get an easy to solder kit that will keep time for 5 years!

Adafruit has a great overview of the kit, so I won't detail how it goes together.  It took me about 10 minutes to put it together.

Hooking it  up to the Arduino is a breeze, and there is a great library of Arduino code to get you started.  We just loaded up RTCLib, hooked up 5V and GND to the Arduino 5V and GND pins, and then SDA (Data Pin) to A4 and SCL (Clock Pin) to A5.

Assuming your Real Time Clock has never been used, the latest version of the library actually loads the time from your computer right away!

At right is a picture showing everything hooked up 


Next step, add a motor shield and pump some water!





Leave a comment

Comments will be approved before showing up.