Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. My Project
  3. Battery-powered irrigation controller

Battery-powered irrigation controller

Scheduled Pinned Locked Moved My Project
47 Posts 13 Posters 17.6k Views 14 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • scalzS Offline
    scalzS Offline
    scalz
    Hardware Contributor
    wrote on last edited by scalz
    #6

    @user2684
    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.

    1 Reply Last reply
    0
    • U user2684

      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

      gohanG Offline
      gohanG Offline
      gohan
      Mod
      wrote on last edited by
      #7

      @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.

      U 1 Reply Last reply
      0
      • gohanG gohan

        @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.

        U Offline
        U Offline
        user2684
        Contest Winner
        wrote on last edited by
        #8

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

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Samuel235
          Hardware Contributor
          wrote on last edited by
          #9

          @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?

          MySensors 2.1.1
          Controller - OpenHAB (Virtual Machine)
          Gateway - Arduino Mega MQTT Gateway W5100

          1 Reply Last reply
          0
          • U user2684

            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):

            • http://www.ebay.com/itm/Plastic-Toilet-Closestool-20mm-Male-Thread-Bi-stable-Pulse-Solenoid-Valve-/162277805621?hash=item25c882ce35:g:DCcAAOSw3ihXTc9L
            • http://www.ebay.com/itm/Toilet-Closestool-20mm-Male-Thread-Bi-stable-Pulse-Solenoid-Valve-DC-3-6-/332118670306?hash=item4d53d0bbe2:g:ll8AAOSwA3dYlHDN

            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 (http://www.instructables.com/id/H-Bridge-on-a-Breadboard/?ALLSTEPS) 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:

            • https://www.aliexpress.com/item/2-DC-motor-drive-module-reversing-PWM-speed-dual-H-bridge-stepper-motor-Mini-victory-L298N/32648692160.html?spm=2114.13010608.0.0.lvAQ6C

            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.

            Thanks

            gohanG Offline
            gohanG Offline
            gohan
            Mod
            wrote on last edited by
            #10

            @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 (http://www.instructables.com/id/H-Bridge-on-a-Breadboard/?ALLSTEPS) 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.

            1 Reply Last reply
            0
            • scalzS Offline
              scalzS Offline
              scalz
              Hardware Contributor
              wrote on last edited by scalz
              #11

              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 :)

              gohanG 1 Reply Last reply
              0
              • scalzS scalz

                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 :)

                gohanG Offline
                gohanG Offline
                gohan
                Mod
                wrote on last edited by gohan
                #12

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

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  Samuel235
                  Hardware Contributor
                  wrote on last edited by
                  #13

                  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 :)

                  MySensors 2.1.1
                  Controller - OpenHAB (Virtual Machine)
                  Gateway - Arduino Mega MQTT Gateway W5100

                  1 Reply Last reply
                  0
                  • U Offline
                    U Offline
                    user2684
                    Contest Winner
                    wrote on last edited by
                    #14

                    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 (https://www.mysensors.org/download/node-manager) I have the following configuration:

                      nodeManager.setBatteryMin(3.2);
                      nodeManager.setBatteryMax(4.6);
                      nodeManager.setBatteryInternalVcc(false);
                      nodeManager.setBatteryPin(A1);
                      nodeManager.setBatteryVoltsPerBit(0.00459433);
                      
                      nodeManager.setSleep(SLEEP,1,MINUTES);
                    
                      // open valve 1
                      nodeManager.registerSensor(SENSOR_LATCHING_RELAY,6);
                      // close valve 1
                      nodeManager.registerSensor(SENSOR_LATCHING_RELAY,7);
                      // open valve 2
                      nodeManager.registerSensor(SENSOR_LATCHING_RELAY,8);
                      // close valve 2
                      nodeManager.registerSensor(SENSOR_LATCHING_RELAY,9);  
                    

                    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 (https://www.mysensors.org/controller/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):

                    0_1495272963282_Untitled.png

                    0_1495273153423_Untitled1.png

                    1 Reply Last reply
                    0
                    • gohanG Offline
                      gohanG Offline
                      gohan
                      Mod
                      wrote on last edited by
                      #15

                      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?

                      U 1 Reply Last reply
                      0
                      • gohanG gohan

                        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?

                        U Offline
                        U Offline
                        user2684
                        Contest Winner
                        wrote on last edited by user2684
                        #16

                        @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.

                        1 Reply Last reply
                        0
                        • gohanG Offline
                          gohanG Offline
                          gohan
                          Mod
                          wrote on last edited by
                          #17

                          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)

                          U 1 Reply Last reply
                          0
                          • gohanG gohan

                            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)

                            U Offline
                            U Offline
                            user2684
                            Contest Winner
                            wrote on last edited by
                            #18

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

                            1 Reply Last reply
                            0
                            • gohanG Offline
                              gohanG Offline
                              gohan
                              Mod
                              wrote on last edited by
                              #19

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

                              U 1 Reply Last reply
                              0
                              • gohanG gohan

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

                                U Offline
                                U Offline
                                user2684
                                Contest Winner
                                wrote on last edited by
                                #20

                                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

                                1 Reply Last reply
                                0
                                • TmasterT Offline
                                  TmasterT Offline
                                  Tmaster
                                  wrote on last edited by Tmaster
                                  #21

                                  That's an interesting project!
                                  how are these valve working after almost a month of work?some bi-state valves have reputation of get stuck opened or closed. They are cheap enough to i like them if the don't get stuck :)

                                  And what about time to control the valvs. Are you requesting from gateway?
                                  For power you can use a 4v or 5 v solar panel to charge 1 li-io cell with this charge regulators((https://cdn.instructables.com/FSH/L5F0/IO0G95Y5/FSHL5F0IO0G95Y5.MEDIUM.jpg?width=614)) if regular batteries have poor life, and of course you can hide battery box under a flat rock or a tile because sun heat.

                                  There are common 9v valves that are bi-state as well ,like the ones used on rain bird 9v programmers

                                  my irrigation controller (24v Ac controlled by 5v Dc) its about to be presented here as well soon :) i'm finishing tests on attached sensors and stability tests and upload on emoncms.com

                                  i'm a arduino fan .Even sometimes don't undestanding how to use it :P

                                  U 1 Reply Last reply
                                  0
                                  • TmasterT Offline
                                    TmasterT Offline
                                    Tmaster
                                    wrote on last edited by Tmaster
                                    #22

                                    And about selenoids ,this is how i control them:
                                    0_1495452921961_upload-d313d700-aca7-4ad8-8a3d-94079bc0972a

                                    on arduino pwm pins you can define how much voltage you send to solenoid with "analogwrite" .
                                    You can use any mosfet or transistor that can handle the 3.5v 1a(buy double or triple value of curente for safe)

                                    i'm a arduino fan .Even sometimes don't undestanding how to use it :P

                                    1 Reply Last reply
                                    0
                                    • TmasterT Tmaster

                                      That's an interesting project!
                                      how are these valve working after almost a month of work?some bi-state valves have reputation of get stuck opened or closed. They are cheap enough to i like them if the don't get stuck :)

                                      And what about time to control the valvs. Are you requesting from gateway?
                                      For power you can use a 4v or 5 v solar panel to charge 1 li-io cell with this charge regulators((https://cdn.instructables.com/FSH/L5F0/IO0G95Y5/FSHL5F0IO0G95Y5.MEDIUM.jpg?width=614)) if regular batteries have poor life, and of course you can hide battery box under a flat rock or a tile because sun heat.

                                      There are common 9v valves that are bi-state as well ,like the ones used on rain bird 9v programmers

                                      my irrigation controller (24v Ac controlled by 5v Dc) its about to be presented here as well soon :) i'm finishing tests on attached sensors and stability tests and upload on emoncms.com

                                      U Offline
                                      U Offline
                                      user2684
                                      Contest Winner
                                      wrote on last edited by
                                      #23

                                      @Tmaster actually I came real here just a few days ago so difficult to say right now. I did notice though a couple of situations in which the command was not executed (which is really annoying since having irrigation going for hours would create a lake :P) but I'm not sure if it is because of the valve or some missing messages from the radio (since quite away from the gw). I was also evaluating a bunch of "close" commands sent periodically by the controller to be sure the valve does not stay open forever but it is not very clean.

                                      Yes, the open/close logic is in the controller which is sending out a turn on/off message during the scheduled timeframes (https://sourceforge.net/p/my-house/forum/general/thread/2d98b751/).

                                      Thanks for the advise regarding the batteries. I'm noticing when the valve toggle a huuuge impact on the battery. After a few tests changed from 4.5v to 3.8v. If confirmed, I will be obliged to move to a rechargeable solution.

                                      Do you have a link of those 9v valves you are using? Just to have a good backup solution in case my approach would somehow fail ;-)
                                      Regarding the solenoid, I'm using the following to control it from the arduino: https://www.aliexpress.com/item/2-DC-motor-drive-module-reversing-PWM-speed-dual-H-bridge-stepper-motor-Mini-victory-L298N/32648692160.html and seems to work just fine.
                                      Thanks

                                      1 Reply Last reply
                                      0
                                      • TmasterT Offline
                                        TmasterT Offline
                                        Tmaster
                                        wrote on last edited by Tmaster
                                        #24

                                        i think that AA batteries hardly approach the 1A discharge if its your selenoid rate.
                                        Another thing you can change is NEVER trust on a incoming signal to shutdown you valve. if power fails or signal is missing ,you selenoid will be open all life because gw never send the signal in time .

                                        what i did is: call time from GW , store it on irrigation node ,and then after time out(2 hours) it shuts off alone .in fact i don't have any code to control valves from gw . Gw only receive status for domotics. all time for valves On and Off its on the node.
                                        See the timeaware sensor example to know how get time from gw and how handle it
                                        you can just use for ex:
                                        if(hour()==09) { //if its 9 hour AM TURN ON
                                        digitalwrite (valve, HIGH)
                                        }
                                        if(hour()==10) { //if its 10 hour AM TURN OFF
                                        digitalwrite (valve,LOW)
                                        }

                                        Or on shutdown implement a "time out"timer (if millis have been passed turn off) like on "blink without delay" example

                                        https://github.com/mysensors/MySensorsArduinoExamples/blob/master/examples/TimeAwareSensor/TimeAwareSensor.ino

                                        i'm a arduino fan .Even sometimes don't undestanding how to use it :P

                                        U 1 Reply Last reply
                                        0
                                        • TmasterT Tmaster

                                          i think that AA batteries hardly approach the 1A discharge if its your selenoid rate.
                                          Another thing you can change is NEVER trust on a incoming signal to shutdown you valve. if power fails or signal is missing ,you selenoid will be open all life because gw never send the signal in time .

                                          what i did is: call time from GW , store it on irrigation node ,and then after time out(2 hours) it shuts off alone .in fact i don't have any code to control valves from gw . Gw only receive status for domotics. all time for valves On and Off its on the node.
                                          See the timeaware sensor example to know how get time from gw and how handle it
                                          you can just use for ex:
                                          if(hour()==09) { //if its 9 hour AM TURN ON
                                          digitalwrite (valve, HIGH)
                                          }
                                          if(hour()==10) { //if its 10 hour AM TURN OFF
                                          digitalwrite (valve,LOW)
                                          }

                                          Or on shutdown implement a "time out"timer (if millis have been passed turn off) like on "blink without delay" example

                                          https://github.com/mysensors/MySensorsArduinoExamples/blob/master/examples/TimeAwareSensor/TimeAwareSensor.ino

                                          U Offline
                                          U Offline
                                          user2684
                                          Contest Winner
                                          wrote on last edited by user2684
                                          #25

                                          @Tmaster that's a very good advice, especially if keeping it open for too long could create any damage. But I'd rather keep the logic on the controller otherwise I'd need to flash a new sketch on a weekly basis. The timeout approach would probably be more close to my requirements, even if millis() doesn't work for sleeping nodes, I can still work with the time as you suggested.
                                          Another issue I'm experimenting with this valve is the loss of pressure, which is of course expected but it is so strong I cannot cover my garden correctly :-/ So an alternative I was evaluating is to hack my legacy irrigation controller which is very basic but I need to find a way to handle the rotary encoder. But on the same time I don't want to move away so soon from those valves ;-)

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          21

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.1k

                                          Posts


                                          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • MySensors
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular