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. OpenHardware.io
  3. 💬 Battery operated rain-gauge

💬 Battery operated rain-gauge

Scheduled Pinned Locked Moved OpenHardware.io
rain
12 Posts 6 Posters 3.1k Views 4 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
    #2

    why are you using a 555 timer? the sleep function can handle both hw interrupt and a timed sleep time

    sundberg84S 1 Reply Last reply
    0
    • gohanG gohan

      why are you using a 555 timer? the sleep function can handle both hw interrupt and a timed sleep time

      sundberg84S Offline
      sundberg84S Offline
      sundberg84
      Hardware Contributor
      wrote on last edited by sundberg84
      #3

      timed sleep time

      @gohan how does the node keep track of time when sleeping? Is this the "new" smartsleep function?

      Controller: Proxmox VM - Home Assistant
      MySensors GW: Arduino Uno - W5100 Ethernet, Gw Shield Nrf24l01+ 2,4Ghz
      MySensors GW: Arduino Uno - Gw Shield RFM69, 433mhz
      RFLink GW - Arduino Mega + RFLink Shield, 433mhz

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

        don't you normally use sleep(30000) to sleep sleep a node for 5 minutes?

        1 Reply Last reply
        0
        • bgunnarbB Offline
          bgunnarbB Offline
          bgunnarb
          wrote on last edited by
          #5

          Well, maybe I missed something. So, if the node sleeps for say 30000 mS and it receives an interrupt from the bucket: After handling the interrupt, does it sleep for the remaining time until 30000 mS have passed or does it start over, sleeping for another 30000mS? Not fully clear from the API. What I wanted to achieve is to have a rain report every 5 minutes regardless if there is rain or not.

          I have never been so busy since I retired!

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

            it starts over whichever way you interrupt the sleep

            1 Reply Last reply
            0
            • bgunnarbB Offline
              bgunnarbB Offline
              bgunnarb
              wrote on last edited by
              #7

              So this is why i implemented a timer. I want rain reports every five minutes, no more, no less. Since it is battery operated I need the node to sleep if there is no bucket tip. But if the bucket tips, and generates an interrupt, then the node will sleep for another five minutes. And I don't want the node to report rain as soon as the bucket tips either. I started messing around with an RTC but that got much too complicated and I don't need real-time. The controller OpenHAB handles that together with Influxdb and Grafana.

              I have never been so busy since I retired!

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

                well... it is better to have the node reporting something at least every hour or so, otherwise the controller will most likely consider it offline. About reporting every bucket tip, unless you are living in a very rainy area, I don't think it will drain much battery anyway (there are nodes sending temperature and humidity every 10 minutes and battery lasts 1 or 2 years). I'd suggest to start simple and add more complicated things afterwards. Btw, in case you need it, the sleep function should return a value about what interrupted it.

                H 1 Reply Last reply
                0
                • gohanG gohan

                  well... it is better to have the node reporting something at least every hour or so, otherwise the controller will most likely consider it offline. About reporting every bucket tip, unless you are living in a very rainy area, I don't think it will drain much battery anyway (there are nodes sending temperature and humidity every 10 minutes and battery lasts 1 or 2 years). I'd suggest to start simple and add more complicated things afterwards. Btw, in case you need it, the sleep function should return a value about what interrupted it.

                  H Offline
                  H Offline
                  Heizelmann
                  wrote on last edited by
                  #9

                  My selfmade rain gauge uses the following algorithm:

                  It collects amount of rain per day and stores it in eeprom ( with other values) every hour.
                  If it is not raining, every hour it reports battery voltage and amount of rain per day (mm/day).
                  If it is raining, it collects bucket tips and reports rain rate (l/h) every 5 minutes. It doesn't matter that the one hour sleep timer is resetted in this case and amount of rain and battery voltage is sent too.
                  If it stops raining the bucket tip collector is reset to zero after a configurable amount of time, e.g. 1 minute.

                  Using Arduino pro mini with 2 AA Batteries. Still have 2.9V after 9 month of operation.

                  gohanG xydixX 2 Replies Last reply
                  0
                  • H Heizelmann

                    My selfmade rain gauge uses the following algorithm:

                    It collects amount of rain per day and stores it in eeprom ( with other values) every hour.
                    If it is not raining, every hour it reports battery voltage and amount of rain per day (mm/day).
                    If it is raining, it collects bucket tips and reports rain rate (l/h) every 5 minutes. It doesn't matter that the one hour sleep timer is resetted in this case and amount of rain and battery voltage is sent too.
                    If it stops raining the bucket tip collector is reset to zero after a configurable amount of time, e.g. 1 minute.

                    Using Arduino pro mini with 2 AA Batteries. Still have 2.9V after 9 month of operation.

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

                    @heizelmann how do you keep track of time in your case?

                    H 1 Reply Last reply
                    0
                    • gohanG gohan

                      @heizelmann how do you keep track of time in your case?

                      H Offline
                      H Offline
                      Heizelmann
                      wrote on last edited by
                      #11

                      @gohan As far as I can remember I used requestTime() on every wakeup which gets time from gateway. Basic implementation based on https://www.mysensors.org/build/rain.

                      1 Reply Last reply
                      0
                      • H Heizelmann

                        My selfmade rain gauge uses the following algorithm:

                        It collects amount of rain per day and stores it in eeprom ( with other values) every hour.
                        If it is not raining, every hour it reports battery voltage and amount of rain per day (mm/day).
                        If it is raining, it collects bucket tips and reports rain rate (l/h) every 5 minutes. It doesn't matter that the one hour sleep timer is resetted in this case and amount of rain and battery voltage is sent too.
                        If it stops raining the bucket tip collector is reset to zero after a configurable amount of time, e.g. 1 minute.

                        Using Arduino pro mini with 2 AA Batteries. Still have 2.9V after 9 month of operation.

                        xydixX Offline
                        xydixX Offline
                        xydix
                        wrote on last edited by
                        #12

                        @heizelmann Hi. Sorry if I wake an old thread.
                        Do you still have your code?
                        I am about to build a rain gauge and want it to run on battery.
                        Your way to handle things is what I am looking for.
                        Would you like to share your code?

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


                        22

                        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