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.
  • 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
                    • TmasterT Offline
                      TmasterT Offline
                      Tmaster
                      wrote on last edited by
                      #26

                      the only desvantagem you have is ; not having main power there .Because if you have it you coud use standart 24v AC irrigation valves ,controlled by 5vDC as i did and then if power fails it just goes off, because they need current(+-200mha) for work. And they are cheap. the bi state 9v version cost more than 30€ and i never use it

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

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

                        Timeout is a nice safe feature, but also could be that if you loose connection to controller for more than X minutes it should shut everything down.

                        1 Reply Last reply
                        0
                        • TmasterT Tmaster

                          the only desvantagem you have is ; not having main power there .Because if you have it you coud use standart 24v AC irrigation valves ,controlled by 5vDC as i did and then if power fails it just goes off, because they need current(+-200mha) for work. And they are cheap. the bi state 9v version cost more than 30€ and i never use it

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

                          @Tmaster that's my issue, I don't have power there so I was trying to find out a way to have this working with batteries. But regardless of the issues I'm experiencing, the idea to add an additional safe guard is definitely great, thanks again for the advice!

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

                            Just to share this pointer from a similar project: http://rayshobby.blogspot.it/2010/06/minty-water-valve-controller.html. It is actually way beyond my knowledge to understand all the steps but I guess could be useful for somebody here.

                            Changing valve and stepping up to 24v seems too complex for my requirements but adding a big capacitor could be something worth trying also here.

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

                              Yet another quick update on this. I think I was able to mitigate somehow the few issues I had:

                              • Regarding the abnormal battery consumption, I placed two 330uF capacitor between gnd and Vcc of the H-bridge powering the valve and they seem to help. After a few on and off the battery went from 4.70V to 4.68V so it was not affected at all. Not sure if it is a good idea or not but I thought could help the valve to be more gentle against the battery. I've also added a sleep of two seconds just after the digitalOutput pulse so to allow the board not to suffer of the voltage drop before sending the ack back to the controller (it was sometimes lost before).
                              • Regarding the pressure lost at the valve, I was able to gain this pressure somewhere else. First of all I bought new, high quality irrigation sprinklers and they cover with exactly the same pressure almost 50% more ground than the old one. Then I removed a few junctions which were losing additional pressure. Now at least it is usable since I have full coverage of the garden (about 100 square meters) with a single sprinkler.
                              • Regarding the safeguard, I've added a very simple timer to my sketch. When a valve is turned on, the time starts (it just counts the number of cycles to make it simple). If too many cycles have passed by and the valve is still on, turns it off automatically.

                              Bottom line, I was about to give up with this but now I'm back on track :)

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

                                @user2684 said in Battery-powered irrigation controller:

                                Regarding the abnormal battery consumption, I placed two 330uF capacitor between gnd and Vcc of the H-bridge powering the valve and they seem to help. After a few on and off the battery went from 4.70V to 4.68V so it was not affected at all. Not sure if it is a good idea or not but I thought could help the valve to be more gentle against the battery. I've also added a sleep of two seconds just after the digitalOutput pulse so to allow the board not to suffer of the voltage drop before sending the ack back to the controller (it was sometimes lost before).

                                AA bateries can't handle much current. You are feeding an solenoid (coil) that probably requires 1A for switch state and it drains too much from aa battery. Buy a 12v /7a battery from chinese brand for 10€ and use a voltage regulator from ebay and you have you problems gone.

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

                                U 1 Reply Last reply
                                0
                                • TmasterT Tmaster

                                  @user2684 said in Battery-powered irrigation controller:

                                  Regarding the abnormal battery consumption, I placed two 330uF capacitor between gnd and Vcc of the H-bridge powering the valve and they seem to help. After a few on and off the battery went from 4.70V to 4.68V so it was not affected at all. Not sure if it is a good idea or not but I thought could help the valve to be more gentle against the battery. I've also added a sleep of two seconds just after the digitalOutput pulse so to allow the board not to suffer of the voltage drop before sending the ack back to the controller (it was sometimes lost before).

                                  AA bateries can't handle much current. You are feeding an solenoid (coil) that probably requires 1A for switch state and it drains too much from aa battery. Buy a 12v /7a battery from chinese brand for 10€ and use a voltage regulator from ebay and you have you problems gone.

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

                                  @Tmaster thanks, I'll give it a try as well! regarding the voltage regulator, is there anything able to provide >1A as output as far as you know? Thanks

                                  1 Reply Last reply
                                  0
                                  • rozpruwaczR Offline
                                    rozpruwaczR Offline
                                    rozpruwacz
                                    wrote on last edited by rozpruwacz
                                    #33

                                    Hi all, I just wan't to share with You my idea about controlling bi-stable solenoids (let it be valves or latching relay, doesn't matter). And I wonder why nowbody considering this solution. I'm talking about this kind of circuit http://www.avrfreaks.net/sites/default/files/Latching relay driver.jpg. And those two transistors that have to be controlled with two pins may be replaced with a push-pull driver like L293 (or L203DD which has built-in clamping diodes) which can be cotrolled with just one pin (HIGH - open; LOW - closed). This L293 will make the hardware interface the same as with monostable relays.
                                    So pros are:

                                    1. simple circuit (relay, capacitor, L293 IC and additional capacitor for power supply filtering)
                                    2. simple interface (use it like normal relay)
                                    3. safe - bi-stable solenoids have maximum pulse with, with this circuit there is no possibility to cross that requirement (the pulse width is defined by the RC constant of the capacitor and solenoid)

                                    Cons are:

                                    1. the capacitor between relay and the ground has to be quite large about 1-2mF so its size is significant
                                    2. the l293 ic maybe not very cheap
                                    1 Reply Last reply
                                    2
                                    • U Offline
                                      U Offline
                                      user2684
                                      Contest Winner
                                      wrote on last edited by
                                      #34

                                      Hi, just to spend a final word on this project. Despite the battery consumption is not that great (even if I believe by better sizing the capacitor the result would be much better), three AA battery lasted for more than two months powering the valve on and off twice a day and checking in with the controller every minute. I've changed the battery recently just because the valve operates at 3.6v and I was unsure there was enough power to still perform in a good shape for long. Below the battery discharging trend:

                                      0_1501939556969_Untitled.png

                                      1 Reply Last reply
                                      0
                                      • ionuI Offline
                                        ionuI Offline
                                        ionu
                                        wrote on last edited by
                                        #35

                                        @user2684 How is your project going now? I am trying to use the same valves and diver board but I can not seem to get it to work. Could you answer some questions for me in order to help me get it to work.

                                        Am i right in saying that if I connect the power leads of the valve to a + source (Li 18650 4.1v 2500ma) it should open the valve and the if I reverse the the leads it should close the valve?

                                        U 1 Reply Last reply
                                        0
                                        • ionuI ionu

                                          @user2684 How is your project going now? I am trying to use the same valves and diver board but I can not seem to get it to work. Could you answer some questions for me in order to help me get it to work.

                                          Am i right in saying that if I connect the power leads of the valve to a + source (Li 18650 4.1v 2500ma) it should open the valve and the if I reverse the the leads it should close the valve?

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

                                          @ionu very sorry for missing your reply for more than 6 months but I didn't get any notification :-( Your understanding is correct, if you just connect the + and - of the battery to the valve you should hear a "click" and if you reverse the wire, another "click". I wonder if that battery would be powerful enough, I've noticed that valve drains really a lot of current (>1A) when triggering. Try with AA batteries at first, just to check if the valve is functioning.

                                          My project has evolved over the time, let me share a picture below:
                                          0_1528148437750_irrigation.png

                                          • 1: is the amazing EasyPCB from @sundberg84 RFM69 version
                                          • 2: since the valve works at 3.7v I'm powering the project with 3 AA batteries. I've noticed the valve works just fine with 4.5v when full, till down to around 3v
                                          • 3: this is a step down regulator for providing 3.3v to the arduino and the radio. I've soldered it there on the EasyPCB (where a booster is supposed to be soldered) since I needed to use the voltage divider which is not available when using the voltage regulator spot. For this reason the battery is connected to the "<=3.3" plug
                                          • 4: this is the voltage divider for measuring the battery, since we have 4.5v I've coupled the 1M with a 300k
                                          • 5: this is the bi-stable valve. Can be found on amazon for 5 euros. Ships from china of course
                                          • 6: this is a 2200uF capacitor placed between the + and the - of the H bridge controlling the valve. Without it, the huge current drain would destroy the battery shortly
                                          • 7: this is an analog rain sensor. It is powered on by an arduino pin so to save battery while sleeping
                                          • 8: this is an analog soil moisture. It is powered on by an arduino pin so to save battery while sleeping
                                          • 9: this is a button to manually turn the valve on or off. It is connected to the arduino pin 3
                                          • 10: this is the H-bridge capable of controlling the valve since rated at 2A

                                          The code I'm using, based on NodeManager, is the following:

                                          /**********************************
                                           * MySensors node configuration
                                           */
                                          
                                          // General settings
                                          #define SKETCH_NAME "Irrigation"
                                          #define SKETCH_VERSION "2.0"
                                          #define MY_NODE_ID 6
                                          
                                          // RFM69 radio settings
                                          #define MY_RADIO_RFM69
                                          #define MY_IS_RFM69HW
                                          #define MY_RFM69_NEW_DRIVER
                                          
                                          // Advanced settings
                                          #define MY_BAUD_RATE 9600
                                          #define MY_SMART_SLEEP_WAIT_DURATION_MS 1000
                                          #define MY_SPLASH_SCREEN_DISABLED
                                          
                                          /***********************************
                                           * NodeManager modules for supported sensors
                                           */
                                          
                                          #define USE_BATTERY
                                          #define USE_SIGNAL
                                          #define USE_CONFIGURATION
                                          #define USE_ANALOG_INPUT
                                          #define USE_DIGITAL_OUTPUT
                                          #define USE_INTERRUPT
                                          
                                          /***********************************
                                           * NodeManager built-in features
                                           */
                                          
                                          // Enable/disable NodeManager's features
                                          #define FEATURE_DEBUG ON
                                          #define FEATURE_POWER_MANAGER ON
                                          #define FEATURE_INTERRUPTS ON
                                          #define FEATURE_CONDITIONAL_REPORT OFF
                                          #define FEATURE_EEPROM OFF
                                          #define FEATURE_SLEEP ON
                                          #define FEATURE_RECEIVE ON
                                          #define FEATURE_TIME OFF
                                          #define FEATURE_RTC OFF
                                          #define FEATURE_SD OFF
                                          #define FEATURE_HOOKING ON
                                          
                                          /***********************************
                                           * Load NodeManager Library
                                           */
                                          
                                          #include "NodeManagerLibrary.h"
                                          NodeManager node;
                                          
                                          /***********************************
                                           * Add your sensors below
                                           */
                                          
                                          // built-in sensors
                                          SensorBattery battery(node);
                                          SensorConfiguration configuration(node);
                                          SensorSignal signal(node);
                                          PowerManager power(-1,A1,300);
                                          
                                          // Attached sensors
                                          SensorRain rain(node,A4);
                                          SensorSoilMoisture soil(node,A5);
                                          SensorInterrupt button(node,3);
                                          SensorLatchingRelay2Pins valve(node,5,6);
                                          
                                          /***********************************
                                           * Main Sketch
                                           */
                                          
                                          void toggleValve(Sensor* sensor) {
                                            valve.toggleStatus();
                                          }
                                          
                                          // before
                                          void before() {
                                            // setup the serial port baud rate
                                            Serial.begin(MY_BAUD_RATE);
                                            /*
                                            * Configure your sensors below
                                            */
                                          
                                            // 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);
                                          
                                            // valve
                                            valve.setSafeguard(60);
                                            valve.setWaitAfterSet(2000);
                                            valve.setLegacyMode(true);
                                          
                                            // button
                                            button.setInterruptHook(&toggleValve);
                                            button.setInitialValue(HIGH);
                                            button.setInterruptMode(FALLING);
                                            button.setInvertValueToReport(true);
                                            node.setInterruptDebounce(1000);
                                            
                                            // rain sensor
                                            rain.setPowerManager(power);
                                            rain.setReportIntervalMinutes(10);
                                            rain.setRangeMin(300);
                                            rain.setReverse(true);
                                          
                                            // soil moisture sensor
                                            soil.setPowerManager(power);
                                            soil.setReportIntervalMinutes(10);
                                            soil.setRangeMin(500);
                                          
                                            // node configuration
                                            node.setSleepSeconds(60);
                                           
                                            /*
                                            * Configure your sensors above
                                            */
                                            node.before();
                                          }
                                          
                                          // presentation
                                          void presentation() {
                                            // call NodeManager presentation routine
                                            node.presentation();
                                          }
                                          
                                          // setup
                                          void setup() {
                                            // call NodeManager setup routine
                                            node.setup();
                                          }
                                          
                                          // loop
                                          void loop() {
                                            // call NodeManager loop routine
                                            node.loop();
                                          }
                                          
                                          #if FEATURE_RECEIVE == ON
                                          // receive
                                          void receive(const MyMessage &message) {
                                            // call NodeManager receive routine
                                            node.receive(message);
                                          }
                                          #endif
                                          
                                          #if FEATURE_TIME == ON
                                          // receiveTime
                                          void receiveTime(unsigned long ts) {
                                            // call NodeManager receiveTime routine
                                            node.receiveTime(ts);
                                          }
                                          #endif
                                          

                                          Rain and soil moisture are connected to A4 and A5, reports every 10 minutes and are powered on just before taking the measure through pin A1. The button through the hooking function toggles the valve, when pressed. The valve (or better the H-bridge) is connected through pin 5 and 6 (off and on). The node wakes up every minute to pick up from the controller new orders (using smart sleep). There is also a safeguard of 60 minutes (if something goes wrong with the communication, irrigation is turned off regardless after 60 minutes).

                                          1 Reply Last reply
                                          1
                                          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