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.
  • Andreas MenzelA Andreas Menzel

    @user2684 hi,
    Thank you for sharing your project here!!! I've been looking quite a long time until I found it :)

    I have a question regarding safety problem. In case the battery drops after opening below the voltage needed to close it again the water would not stop. Do you have an idea how to solve this problem?
    Or do you just replace the batteries "early" enough?

    skywatchS Offline
    skywatchS Offline
    skywatch
    wrote on last edited by skywatch
    #38

    @Andreas-Menzel That is an old thread, but my thoughts would be to send battery level back often enough so you have time to change it, or better yet send battery level and add solar panel to recharge battery. A lot will depend on usage frequency, temperature, levels of sunlight etc...

    You could also add a flow sensor or pressure switch to alert you if the water does not turn off.

    1 Reply Last reply
    1
    • Andreas MenzelA Andreas Menzel

      @user2684 hi,
      Thank you for sharing your project here!!! I've been looking quite a long time until I found it :)

      I have a question regarding safety problem. In case the battery drops after opening below the voltage needed to close it again the water would not stop. Do you have an idea how to solve this problem?
      Or do you just replace the batteries "early" enough?

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

      @Andreas-Menzel I personally tend to replace the batteries early enough. I also have at the controller level a couple of safety checks with are ensuring 1) the "close" message is acknowledged by the sensor and if not resend it again 2) a humidity sensor in the ground checking if it is still irrigating after e.g. 2-3 hours the valve is supposed to be closed.
      I've noticed if the battery is almost over and unable to close the valve once, it will likely succeed when retrying. Then of course batteries have to be changed.
      Over the years I've refined this old project over and over mainly making the capacitor bigger since the valve would otherwise drain so much current to dramatically shorten the battery's life. But this is still border line for the capability of a battery powered sensor I believe.

      chamroeun ouC Andreas MenzelA C 3 Replies Last reply
      1
      • U user2684

        @Andreas-Menzel I personally tend to replace the batteries early enough. I also have at the controller level a couple of safety checks with are ensuring 1) the "close" message is acknowledged by the sensor and if not resend it again 2) a humidity sensor in the ground checking if it is still irrigating after e.g. 2-3 hours the valve is supposed to be closed.
        I've noticed if the battery is almost over and unable to close the valve once, it will likely succeed when retrying. Then of course batteries have to be changed.
        Over the years I've refined this old project over and over mainly making the capacitor bigger since the valve would otherwise drain so much current to dramatically shorten the battery's life. But this is still border line for the capability of a battery powered sensor I believe.

        chamroeun ouC Offline
        chamroeun ouC Offline
        chamroeun ou
        wrote on last edited by
        #40

        @user2684 I am also planning to build latching valve controller. But my valve is 2" to 4" and Its coil specifications are as follow:
        V: 6-20Volt DC (optimal is above 9volt)
        Capacitance Required: 4700uF
        Coil inductance: 90mH
        Pulse duration: 20 to 200mili seconds.

        Do you think h-bridge will work or do you have a better suggestion for this? My goal is also to run the controller on battery and place in farm so it must be waterproof.

        skywatchS G 2 Replies Last reply
        0
        • U user2684

          @Andreas-Menzel I personally tend to replace the batteries early enough. I also have at the controller level a couple of safety checks with are ensuring 1) the "close" message is acknowledged by the sensor and if not resend it again 2) a humidity sensor in the ground checking if it is still irrigating after e.g. 2-3 hours the valve is supposed to be closed.
          I've noticed if the battery is almost over and unable to close the valve once, it will likely succeed when retrying. Then of course batteries have to be changed.
          Over the years I've refined this old project over and over mainly making the capacitor bigger since the valve would otherwise drain so much current to dramatically shorten the battery's life. But this is still border line for the capability of a battery powered sensor I believe.

          Andreas MenzelA Offline
          Andreas MenzelA Offline
          Andreas Menzel
          wrote on last edited by
          #41

          @user2684 @skywatch thank you for your feedback! :)

          1 Reply Last reply
          0
          • chamroeun ouC chamroeun ou

            @user2684 I am also planning to build latching valve controller. But my valve is 2" to 4" and Its coil specifications are as follow:
            V: 6-20Volt DC (optimal is above 9volt)
            Capacitance Required: 4700uF
            Coil inductance: 90mH
            Pulse duration: 20 to 200mili seconds.

            Do you think h-bridge will work or do you have a better suggestion for this? My goal is also to run the controller on battery and place in farm so it must be waterproof.

            skywatchS Offline
            skywatchS Offline
            skywatch
            wrote on last edited by
            #42

            @chamroeun-ou If you need to reverse polarity then a H bridge would be good - I would aim for 12V (maybe a lead acid battery with solar panel and small charge controler). This assumes a coil pules reversal to change over the relay, if it is dual coil relay then it will be different, but we don't have that info. Also note the coil resistance and therefore current needed. A 6681FNG H bridge would be good as it is rated up to 15V and handles 1A with ease...

            1 Reply Last reply
            0
            • chamroeun ouC chamroeun ou

              @user2684 I am also planning to build latching valve controller. But my valve is 2" to 4" and Its coil specifications are as follow:
              V: 6-20Volt DC (optimal is above 9volt)
              Capacitance Required: 4700uF
              Coil inductance: 90mH
              Pulse duration: 20 to 200mili seconds.

              Do you think h-bridge will work or do you have a better suggestion for this? My goal is also to run the controller on battery and place in farm so it must be waterproof.

              G Offline
              G Offline
              Gilles BILLARD
              wrote on last edited by
              #43

              @chamroeun-ou said in Battery-powered irrigation controller:

              @user2684 I am also planning to build latching valve controller. But my valve is 2" to 4" and Its coil specifications are as follow:
              V: 6-20Volt DC (optimal is above 9volt)
              Capacitance Required: 4700uF
              Coil inductance: 90mH
              Pulse duration: 20 to 200mili seconds.

              Do you think h-bridge will work or do you have a better suggestion for this? My goal is also to run the controller on battery and place in farm so it must be waterproof.

              HI,
              I'm doing quite the same project at the moment; I ordered H bridge and also some flow detectors to check if the bistable valve is really in the desired position ( open not to see a desert, closed not to flood everything)
              Powered by 1 solar panel + 9v batteries + load controler + step down converters for Arduino and radio.

              1 Reply Last reply
              0
              • U user2684

                @Andreas-Menzel I personally tend to replace the batteries early enough. I also have at the controller level a couple of safety checks with are ensuring 1) the "close" message is acknowledged by the sensor and if not resend it again 2) a humidity sensor in the ground checking if it is still irrigating after e.g. 2-3 hours the valve is supposed to be closed.
                I've noticed if the battery is almost over and unable to close the valve once, it will likely succeed when retrying. Then of course batteries have to be changed.
                Over the years I've refined this old project over and over mainly making the capacitor bigger since the valve would otherwise drain so much current to dramatically shorten the battery's life. But this is still border line for the capability of a battery powered sensor I believe.

                C Offline
                C Offline
                ciaocibai
                wrote on last edited by
                #44

                @user2684 I've just been tinkering on a project like this, so happy to find this and learn from you. Wondering if you've made any significant changes to your circuit and code that you could share so we can learn from your updated experience. How long at you getting from 3AA batteries typically? Love the project.

                U 1 Reply Last reply
                0
                • C ciaocibai

                  @user2684 I've just been tinkering on a project like this, so happy to find this and learn from you. Wondering if you've made any significant changes to your circuit and code that you could share so we can learn from your updated experience. How long at you getting from 3AA batteries typically? Love the project.

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

                  Hi @ciaocibai, no big changes to the code, maybe just MY_SMART_SLEEP_WAIT_DURATION_MS set to 1000 to ensure the valve is not impacting receiving/transmitting when triggering. All the rest is the same, just using the latest version of NodeManager. Ah, I also added a push button for turning irrigation on/off directly from the device.
                  Difficult to say regarding battery usage: since I've placed it far away I had to do some changes in the radio management piece which is draining battery considerably. With this setup 3 AA batteries last for around 2 months which is nothing but I believe this is mainly due to the radio settings.
                  Just for reference this is the latest version of the code:

                  
                  
                  /**********************************
                   * MySensors node configuration
                   */
                  
                  // General settings
                  #define SKETCH_NAME "Irrigation"
                  #define SKETCH_VERSION "3.2"
                  //#define MY_DEBUG
                  #define MY_NODE_ID 6
                  
                  // RFM69 radio settings
                  #define MY_RADIO_RFM69
                  #define MY_IS_RFM69HW
                  #define MY_RFM69_NEW_DRIVER
                  #define MY_RFM69_ATC_MODE_DISABLED
                  #define MY_RFM69_TX_POWER_DBM (10)
                  #define MY_RFM69_MAX_POWER_LEVEL_DBM (10)
                  
                  // Advanced settings
                  #define MY_BAUD_RATE 9600
                  #define MY_SMART_SLEEP_WAIT_DURATION_MS 1000
                  #define MY_SPLASH_SCREEN_DISABLED
                  #define MY_SIGNAL_REPORT_ENABLED
                  
                  /***********************************
                   * NodeManager configuration
                   */
                  
                  #define NODEMANAGER_DEBUG ON
                  #define NODEMANAGER_INTERRUPTS ON
                  #define NODEMANAGER_SLEEP ON
                  #define NODEMANAGER_RECEIVE ON
                  #define NODEMANAGER_DEBUG_VERBOSE OFF
                  #define NODEMANAGER_POWER_MANAGER OFF
                  #define NODEMANAGER_CONDITIONAL_REPORT OFF
                  #define NODEMANAGER_EEPROM OFF
                  #define NODEMANAGER_TIME OFF
                  #define NODEMANAGER_RTC OFF
                  #define NODEMANAGER_SD OFF
                  #define NODEMANAGER_HOOKING ON
                  #define NODEMANAGER_OTA_CONFIGURATION OFF
                  #define NODEMANAGER_SERIAL_INPUT OFF
                  
                  // import NodeManager library (a nodeManager object will be then made available)
                  #include <MySensors_NodeManager.h>
                  
                  /***********************************
                   * Add your sensors
                   */
                  
                  //PowerManager power(5,6);
                   
                  #include <sensors/SensorBattery.h>
                  SensorBattery battery;
                  
                  #include <sensors/SensorSignal.h>
                  SensorSignal signal;
                  
                  #include <sensors/SensorInterrupt.h>
                  SensorInterrupt button(3);
                  
                  #include <sensors/SensorLatchingRelay2Pins.h>
                  SensorLatchingRelay2Pins valve(5,6);
                  
                  /***********************************
                   * Main Sketch
                   */
                  
                  void toggleValve(Sensor* sensor) {
                    valve.toggleStatus();
                  }
                  
                  // before
                  void before() {
                  	
                    /***********************************
                     * Configure your sensors
                     */
                  
                    // battery sensor
                    battery.setMinVoltage(3.2);
                    battery.setMaxVoltage(4.6);
                    battery.setBatteryInternalVcc(false);
                    battery.setBatteryPin(A0);
                    battery.setBatteryVoltsPerBit(0.00459433);
                    battery.setReportIntervalMinutes(30);
                  
                    //signal sensor
                    signal.setReportIntervalMinutes(30);
                  
                    // button
                    button.setInterruptHook(&toggleValve);
                    button.setInterruptMode(FALLING);
                    button.setInvertValueToReport(true);
                    nodeManager.setInterruptDebounce(1000);
                  
                    // valve
                    valve.setSafeguard(120);
                    valve.setWaitAfterSet(2000);
                    valve.setLegacyMode(true);
                    valve.children.get(1)->setChildId(4);
                  
                    // node configuration
                    nodeManager.setSleepBetweenSendSleepOrWait(true);
                    nodeManager.setSleepSeconds(60*5);
                     
                    // call NodeManager before routine
                    nodeManager.before();
                  }
                  
                  // presentation
                  void presentation() {
                    // call NodeManager presentation routine
                    nodeManager.presentation();
                  }
                  
                  // setup
                  void setup() {
                    // call NodeManager setup routine
                    nodeManager.setup();
                  }
                  
                  // loop
                  void loop() {
                    // call NodeManager loop routine
                    nodeManager.loop();
                  }
                  
                  #if NODEMANAGER_RECEIVE == ON
                  // receive
                  void receive(const MyMessage &message) {
                    // call NodeManager receive routine
                    nodeManager.receive(message);
                  }
                  #endif
                  
                  #if NODEMANAGER_TIME == ON
                  // receiveTime
                  void receiveTime(unsigned long ts) {
                    // call NodeManager receiveTime routine
                    nodeManager.receiveTime(ts);
                  }
                  #endif
                  
                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    Gilles BILLARD
                    wrote on last edited by
                    #46

                    Hi,
                    I have already done all the same plus a flow control to check whether the valve is open or not and... it works perfectly.
                    ++

                    1 Reply Last reply
                    0
                    • I Offline
                      I Offline
                      Ivanli
                      Banned
                      wrote on last edited by
                      #47

                      Thanks for sharing the code, it would be nice to have a video demo.

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


                      20

                      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