Quo Vadis ? Stories from a home laboratory

11Apr/113

Automated irrigation

After successfully monitoring the plants water levels and needs for some period now, it was finally the time to automate the process of watering as well. The idea was to implement a simple drip watering system with one single water source. Each of the three existing plants would be irrigated proportionally, based on its demands. During the period of couple of weeks, all necessary components arrived and the system was ready to be built.

The main part of the system is a water pump. This is a small 300 l/h submergible electric pump. This was good choice because of its low flow and the fact it can be easily put inside the water tank in the corner of the room.

Water pump

In order to transfer water from the water pump to each of the plants, I needed some drip tubing (pipes) and drip emitters (sprinkles). I found a very good irrigation set from GARDENA in my near hardware store.

GARDENA - Micro-Drip-System

Assembling the tubing was really easy. Using only scissors I was able to build the skeleton that was later carefully placed inside the every pot.

Watering System - Skeleton Full

Watering System - Skeleton

After removing upper layer of the ground, the skeleton is positioned in every pot. This was good opportunity to exchange existing ground with a new one. In addition whole tubing system was carefully fixed on the floor in order to avoid loose ends and potential leakage.

Tubes and emitters in the pot

Floor and wall installation

In the other corner of the room I found a great place for watering tank. The water tank is cheap plastic container I found in the store. Couple of holes was drilled so pump power cord and tubing can enter the tank. The tank can hold approximately 6l of water and this should be enough for 1.5 months of watering.

Water tank

The heart of the watering system is control unit. The unit is connected to nearby power outlet. It consists of three parts: AC-DC adapter, JeeNode with RF12 wireless module and 220V relay. AC-DC adapter provides 5V current for operation of JeeNode and the relay. The relay controls the output plug in which the water pump is plugged. There is additional switch that can override the running state of the pump and status LED.

Control Unit

Although the control unit can run the whole system by itself, the idea was to integrate it into existing home automation system. The control unit is wirelessly controlled by central JeeNode connected to the home server.

Wireless communication between central JeeNode and Jeenode in the controll unit has been implemented using existing RF12 library for Arduino platform. In order to establish stable wireless control, acknowladgement mechanism has been used when sending commands:

bool WaterPump(byte on)
{
  int sendRetries=5;
  long initTimeOut = 2000;
  long ackTimeout = 1000;
  
  bool ack = false;
  byte retry = 0;
  
  while (!ack && retry<sendRetries)
  {
      long initStartTime =  millis();
      long initTime = 0;

      while (!rf12_canSend() && (initTime <= initTimeOut)) 
      {
        rf12_recvDone();
        initTime = millis()-initStartTime;
      }
      
      if (initTime>initTimeOut)
      {
        Serial.println("Init FAILED");
        return false;
      }
      
      char data[1];  data[0] = on;
      byte header = RF12_HDR_ACK;
      header |= RF12_HDR_DST | 2;
      rf12_sendStart(header, data, 1);
    
      long ackStartTime =  millis();
      long ackTime = 0;
      while (!ack && (ackTime < ackTimeout))
      {
        ackTime = millis() - ackStartTime;
        if (rf12_recvDone()) {
            byte n = rf12_len;
            if (rf12_crc == 0)
            {
                int hdr = (int)rf12_hdr;
                ack = (hdr == 130);
            }
        }
      }
      
      if (!ack)
        retry++;
  }
  
  Serial.print("[");Serial.print((int)retry);Serial.print("/5]");
  return ack;
}

Home server exposes functionality for initiating watering to water level monitoring system; this enables automatic watering in case the plants need attention and owners (me and my wife) are not around or totally forgot about the plants. Another expansion point is iPhone/iPad application, which enables controlling watering pump over the internet. As the final touch, the watering events are also posted onto plant's Facebook profile.

For the end, here is demonstration video of the watering system:

© 2011, https:. All rights reserved.

44,589 total views, 4 views today

Comments (3) Trackbacks (0)
  1. I love it! Especially the jeeNode integration.

  2. Da li se pre pustanja u opticaj predvideo proveru sistema na poviseni pritisak u mrezi?
    Sta ako ti se zapuse dizne i popusti ti neki spoj?! Docekace te podignut parket do sredine sobe i nadrkani komsija od ispod!
    Da li si dao uslov da voda bude mekana, bez mogucnosti stvaranja kamenca? Destilovanu vodu ne mozes da koristis jer nije pogodna za biljke.
    Sta ako neko ode na tri meseca od kuce, a koficence se isprazni od polivanja, a delom od isparavanja? ;o)

    • Sistem nije povezan na mrežu, tako da tu nema problema.
      Komšija nije ni provalio 🙂
      Kamenac je problem, to moram da rešim.
      Komšinica (ne ona od dole) je tu da pripomogne.


Leave a comment

No trackbacks yet.