Gardena water timer controller using Arduino Uno

15

In this post I will show how to drive a water valve from a Gardena water timer/computer using Arduino Uno.

The controller I used in this example is – or better say was – a T14E model, but any other controller with the same water valve will work.

Gardena T14e water timer

Gardena T14e water timer

The idea came when my dog decided to take one of the water timers as his toy, and chewed it beyond recognition. The electronics and the case were completely damaged, but I was able to recover the water valve. So, why not try to control it with an Arduino? The are vast possibilities to explore: using a real-time clock to control it as the original electronics worked, or control it via wi-fi, etc.

Gardena water valveAs you can see in the above picture, the water valve uses a RCA connector for the control signals. I used the original electronics from another sprinkler to determine how it works, and the waveforms look like this:

Initially, I thought this is simple: a 9V negative pulse should have opened the valve, while a 9V positive pulse should close it. I used an Ardumoto shield to replicate this, but when doing extensive tests I went into trouble: some old valves open correctly, but they don’t close. Back to measurements, this time with the original controller and the valve connected. The results show for opening that a 500ms negative pulse is applied, and the voltage across the valve is about 7V. Considering the internal resistance of the valve winding, it looks that for opening there’s a 10-ohm series resistor in circuit working as a current limiter. For closing the series resistor is 100 ohms.

After many tries, I ended up with the following schematic:

Gardena valve circuit

Arduino water timer schematic

With respect to the RCA sleeve, to turn on the water a 9V negative pulse with a duration of 500ms is applied. To turn the water off a positive pulse of 150 ms is applied to the center pin. The simplest way to replicate this is to use an H-bridge, such as the Ardumoto shield, but with a twist: a circuit made from two resistors and a diode is inserted in series with the valve.

The circuit works as follows: for opening the valve, the diode D1 is open, so the current flows both through the R1 (10 ohm) resiohmsr and R2 (1oo ohm) resistor. The voltage drop across the valve is about -7V. When closing the valve, D1 is blocked, and current flows only through R2. Voltage across the valve is 2.5 V. A little higher than the original controller, but it works fine.

The following code demonstrates how to turn on and off the water:

If things are not working either reverse the pins for the valve, or change in the code the dir_a from HIGH to LOW and from LOW to HIGH.

Revision history:

[19 June 2015] I tried this code with two old Gardena valves, which have been used for about 4 years in an area with hard water. It opens the valves correctly, but they don’t close. Funny though, with the original electronics the valves work fine. I’m still investigating this issue and I hope to have a solution in a few days.

[14 July 2015] It seems that the valves close fine if they are placed in series with a 56 ohm/2W resistor. Also opening works fine if a 10 ohm / 2w resistor is placed in series with the valve. I’ve captured a few more waveforms with the original controller.

[17 July 2015] Finally found a solution that works, and it requires only 3 extra parts. I have edited some parts of this post and inserted a short explanation of how this works. No changes were made in the code.

Share.

15 Comments

  1. Thank you for this nice little code.
    I’m new in the world of arduino and I want to connect the old gardena system (9V, as yours) with the new one (24V). So I need to modify your code that a 24V input signal will start your code. Can’t be that hardt, I guess 🙂 .
    What kind of H-Bridge do you use?
    Found a cheap one named “L298N Dual H-Bridge Stepper Motor Driver Controller Module Board”. Will this one working with your code?

    Thanks and greetings from Germany

    Chris

    • I have no experience with the 24V Gardena systems, so I can only speculate based on the similarity with the 9V system. Assuming there’s the same command logic, the command for starting the sprinkler will be a negative pulse of 24V, and the command to turn off the sprinkler will be a positive 24V pulse.
      If this is the case, what you will need is a pair of optocouplers and some MOSFETs.

      The values for the current limiting resistors are for TLP 621. If you use another model of optocoupler you will have to recalculate their values. R5 and R6 are not critical. You may even choose not to use them and connect the optocouplers directly to the Arduino pins.

      When there’s no input, both optocouplers are closed and you will find 5V (logical 1) applied to Arduino pins 2 and 3. Note that these are pins having external interrupt function.
      When a negative pulse is applied, the current flows through opto2, R2 and D2. At this point the phototransistor inside Opto 2 opens, and on Arduino Digital pin 3 you will have 0V (logical 0).
      When a positive pulse is applied, the current flows through opto1, R1 and D1. At this point the phototransistor inside Opto 1 opens, and on Arduino Digital pin 2 you will have 0V (logical 0).

      For the code I suggest using external interrupts. The interrupts should be triggered on falling edge, so in the code I will have something like this:

      See http://www.arduino.cc/en/Reference/AttachInterrupt for more info about interrupts. So, in the ISR routine I will do something like this:

      The H bridge onboard the Ardumoto shield is L298N, so I know it works fine.

      If you need more detailed explanations, please don’t hesitate to comment.

      Regards,
      Teodor

  2. I so verry much hope you find a solution.

    Your solution is about the first ever try to get this Gardena valves working.

    I have the same problem as you with the two old valves; Starting 9opening0 the valve is no sweat. But: It never closes.

    Hope you find a solution. !!

    Regards,

    RadioRon.

  3. Hi,

    Just starting to look for a way to control these 9v Gardena valves. Tanks for your work. Planning to use a L293D.

    Instead of adding resistors, would it be possible to use analogWrite to generate the right voltage ?

    Steph

    • Hi Steph

      The PWM approach will not work. I already tried it. I think the valve require a steady magnetic field, while when using PWM the magnetic field fluctuates too much.

  4. Zac Kornilakis on

    Thank you for sharing! I plan to build this project but as I like to use ESP8266 instead of arduino, I was wondering if someone has already build it and like to share it.

  5. Your recipe does not work for me using a 9v gardena valve driven by a L9110 and ESP8622.

    Also looking at your code I am starting to believe this is never actually worked for you either.

    Looking at your close procedure:
    By applying HIGH , HIGH you stop the H bridge wait 150ms and then you reverse polarity permanently 🙂 which has nothing to do with your pulse from the diagrams.

    // turn on sequence
    digitalWrite(dir_a, HIGH); // set to turn off
    digitalWrite(pwm_a, HIGH); // apply pulse
    delay(150);
    digitalWrite(pwm_a, LOW); // turn off pulse

    All H briges out there have the following table of operation similar to the following:

    H H stop
    H L forward
    L L stop
    L H reverse

    • If you look on the schematics of the Ardumoto shield you’ll notice that it has an extra 74HC1G04 inverter circuit. This means that only forward and reverse commands are possible. Stop is not implemented.
      (see https://www.sparkfun.com/datasheets/DevTools/Arduino/Ardumoto_v13.pdf)

      In my code if I drive dir_a high, this means that IN1 is high and IN2 is low. If dir_a is low then IN1 is low and IN2 is high.

      If you wish to do this project without the Ardumoto shield and you wish to drive the L9110 directly you will need to drive IA and IB pins directly. Code will be something like this:

      digitalWrite(pin_INA, HIGH); // apply pulse
      digitalWrite(pin_INB, LOW);
      delay(150);
      digitalWrite(pin_INA, LOW); // turn off pulse
      digitalWrite(pin_INB, LOW);

      Note that L298N has three control pins per channel, while L9110 has only two.

      • Thanks for your fast reply, I am not familiar with the ardumotor sheilid, makes sense if the dir is inverted. I was thrown off by the lack of symmetry in the pin positions.

        I managed to find a sequence that worked for me and is very different. I am using NodeMCU Esp-12E with the L9110 H-bridge module. I have followed the diode / resistor bridge as described in the article.

        The pulses I produce go from -9v to +9v and vice versa (and not via 0v) and I noticed that after a few seconds after the pulse I can disengage the H-bridge but not immediately.

        The sequence that opens the valve for me is:

        pwm.setduty(speedPin, 1023);
        gpio.write(directiondPin,gpio.LOW);
        tmr.delay(750)
        pwm.setduty(speedPin,0);
        gpio.write(directiondPin,gpio.HIGH);

        and the close is slightly longer wait reverse pulse:

        pwm.setduty(speedPin, 0);
        gpio.write(directiondPin,gpio.HIGH);
        tmr.delay(1200)
        pwm.setduty(speedPin,1023);
        gpio.write(directiondPin,gpio.LOW);

        I wish I had a oscilloscope to show the waveform :(.

  6. Thanks a lot for the valuable information Teodor.
    What changes to schematic and code if we use only Arduino uno (without Ardumoto shield)?

    • Hi

      You will need an H-bridge IC. Either the L298 as in the Ardumoto, or any H-bridge IC that can handle at least 1A. Changes to the code have to be made according to the logic of the chosen H-bridge, as many of those have their own logic. It also pays off to notice that without the inverter IC on the Ardumoto you will need three Arduino pins to drive the H-bridge.
      So, if you tell me which H-bridge IC you have chosen, I can help you a little bit with the code.

  7. Hi, and thanks for sharing a very interesting project with us!

    I have to say that stumblinig upon this project of yours, gave me inspiration to automate my gardening system based on the on the rather “old fashioned” T14e. This rather than investing in half smart systems that can not even be a part of the IOT.
    So in that said,I have a couple of ideas that I would like to share with you;

    –to simplify the interface to the T14e I will design an adaptor with a casde that can hold the Arduino and also open up fo a couple of aditional features that I believe could add further value to a project like this.
    —- On off switch for verifying functionality of the circuit.
    —- Adding the possibility of connecting a cheap turbine flow meter to visualise The actual flow rate (easy enough expanded to totalising).
    —- Wifi communication to central raaspberry pi for IOT cappability.

    As I am new into the Arduino world I might be overseeing some obstacles with regards to the what capabilities that lays into this system, but to me it seems to be capable of taking these functions onboard.
    It would be very interesting to hear your thoughts on this Teodor.

  8. I am exploring this area and find most solenoids are 21-24V AC. Power needs to be kept on to keep valve open.
    The 9-12V DC solenoids will likely be latching and so use much less power.
    The expectation is for a positive pulse to open and stays open with power removed until a reversed or negative pulse is applied to close.
    Two very different critters.

Leave A Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.