Battery-powered irrigation controller

  • Hi, this is still a work in progress but I wanted to share the approach I'm aiming to for a battery-powered irrigation controller in case can be useful to somebody else.

    Since I have no way to power a device in my garden, I cannot use neither an electrovalve nor a traditional relay controlling a valve (would drain the battery while staying on).

    I then found the following solenoid valves which works at a low voltage (3.6V) and requires just a pulse to switch (you may find the same also on amazon):

    The principle behind is to switch with positive/negative pulses which I've discovered means simply connecting the two wires to vcc and gnd to open and reverse the wires to close.

    All good but when I tried to control this with two arduino pins, there was no way to have it working and the reason simply is the solenoid requires a LOT of current (I've measured between 0.6 and 1A) which is of course way more than what the board the provide.

    After some googling I've discovered I needed a H-bridge ( to control programmatically the valve. I've tried building mine on a breadboard with different transistors/resistor but the valve didn't switch due to a massive voltage drop. Once gain due to the current draw.

    I then bought the following and everything looks working just fine:

    I still need to build the rest but this looks like the easy part since I just need to connect the arduino board to IN1 and IN2 and use simple HIGH pulse to open or close.


  • Mod

    can't you use a regular relay and a small solar panel to keep battery charged?

  • Using a solar panel can be for sure a good alternative but I wanted something without this requirement since where I have to put this I don't have a good exposure and I'm always afraid the battery cannot recharge in a good way.

  • Mod

    Is the node going to sleep?

  • Absolutely, otherwise cannot survive for long I'm afraid. I'll put it to sleep for e.g. 5-10 minutes and with smart sleep I'll send the on/off command when online, at least this is the plan

  • Hardware Contributor

    that's a cool project :+1:
    I have built a device like this, batt operated custom board, but not finished sw and enclosure for the moment (too much projects). I'll use it in my garden soon as seedling has started too here.
    I also have solar charging option on my board.

  • Mod

    @user2684 can't you use like 4 relays to supply voltage with different polarity? 2 give pulse for opening and 2 give pulse to close. Maybe not as neat and tidy as the H Bridge but it may do the job without voltage drop.

  • @gohan you're right, a set of relays could definitely do the job, good alternative thanks for the advice!

  • Hardware Contributor

    @gohan - I'm struggling to determine why you would prefer to use 4 relays rather than a H-Bridge. If the device is a simple pulse activated device then i don't see any reason to use a relay over a H-Bridge. Is there a specific reason why you would and i'm not aware of that characteristic?

    Or am I not following your project plans properly?

  • Mod

    @Samuel235 it is in the first post where he is saying the H bridge didn't work
    @user2684 said in Battery-powered irrigation controller:

    After some googling I've discovered I needed a H-bridge ( to control programmatically the valve. I've tried building mine on a breadboard with different transistors/resistor but the valve didn't switch due to a massive voltage drop. Once gain due to the current draw.

  • Hardware Contributor

    In my circuit, I'm not using h-bridge nor relays and i can also control higher voltage solenoid valves like rainbird.. (i'll post my project later),
    but imho, I think the H-bridge should work, that depends on resistors values or the circuit was not optimized. 4 relays is a bit gorgeous maybe, but if it works, then it's the most important :)

  • Mod

    @scalz sometimes you've got to use what is available and 4 relays usually are laying around somewhere :D

  • Hardware Contributor

    Well I brushed over that because i don't see how a H-Bridge wouldn't work due to high voltage drops. They use these ICs for motors and are fine with that and hence why I kind of brushed over that first point.

    I was thinking more in terms of a new product being made for people, relays wouldn't be the best option for a few reasons, one being cost. However, if its just a few products for yourself then its fine obviously :)

  • Just to share how the finished project looks like in the picture below. I'm powering it with 3 AA batteries (4.5v) since the solenoid valve would not trigger when below 3v. In the picture you can see on the right side the pro mini and the RFM69 radio, on the left the H-bridge module in red and a mini board with a voltage regulator to provide 3.3v to the arduino and the radio and a 1M/300K voltage divider to feed an arduino's analog pin. I have two valves connected to the H-bridge so I'm using 4 pins to control them (pulse on/pulse off for valve 1, pulse on/pulse off for valve 2). On the code side, with NodeManager ( I have the following configuration:

      // open valve 1
      // close valve 1
      // open valve 2
      // close valve 2

    The board sleeps for one minute, then reports back (with smart sleep of course) and the controller sends a SET message with payload 1 to the relevant child id to control the valves when instructed. On this side with myHouse ( I can activate it manually or schedule the duration of the irrigation for each zone.

    Here's the pictures (as you can clearly see I'm really bad with hardware so I tend to wire everything up without soldering so I can reuse all the components if needed or, more likely, if the project fails :P):



  • Mod

    Don't worry about the wire mess, it is normal when building a prototype (breadboards and jumper wires exist for a reason :) )
    So the node every minute checks if any commands have been sent to switch on or off the valves, right? How much battery life are you getting? I guess it will depends on how much time the valves are on. In theory you could swap the AA batteries with a 18650 to save some space, right?

  • @gohan that's correct, I'm using exactly the same principle in my boiler controller with the sensor checking in periodically for new commands since battery powered. I do expect a decent battery life since the valves I'm using are pulse-based so it doesn't matter for how long they stay on (as in my boiler controller I'm using a latching relay and since January moved from 3v to 2.75 now.). And yes, 18650 would be ideal for this project. Only concern with that battery is that when the solenoid triggers, it draws a lot of current and I'm not 100% sure a rechargeable battery is as good as a standard one to handle it.

  • Mod

    as rule of thumb 18650 can deliver continuous 2C, so they could take a higher load for a brief moment (depends how long those valves take to open or close)

  • @gohan thanks good to know, I will give it a try, a 3 AA pack is actually using too much space!

  • Mod

    Remember that lithium batteries suffer heat, so put the box in shade :)

  • Oh didn't know that, I'll stay with the 3 AA batteries then for now since the box is in full sunshine and can become pretty hot during summer time at this latitude ;-) Thanks

Log in to reply

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.