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. Hardware
  3. Battery powered sensor last 1 week

Battery powered sensor last 1 week

Scheduled Pinned Locked Moved Hardware
29 Posts 7 Posters 8.0k Views 6 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.
  • Martin TellblomM Offline
    Martin TellblomM Offline
    Martin Tellblom
    wrote on last edited by
    #3

    @scalz said:

    always powere

    Alright, as you proberbly understand I'm not a electronics engineer :) so please explain that to me.
    This is how its setup:

    Everything is build on @sundberg84 Easy/Newbie PCB (This is my LAB PCB that I try out on before soldering, easier to chane components to see if someone of the cheap once are broken)

    Sensor Vcc connected to 3,3V, GND to GND and sensor to D3.
    So what do I have to do to turn of the sensor when I put the arduino to sleep?

    alt text

    MySensors MQTT Client Gateway, Openhab, Dashing, Razberry, 1-wire

    sundberg84S 1 Reply Last reply
    0
    • Martin TellblomM Martin Tellblom

      @scalz said:

      always powere

      Alright, as you proberbly understand I'm not a electronics engineer :) so please explain that to me.
      This is how its setup:

      Everything is build on @sundberg84 Easy/Newbie PCB (This is my LAB PCB that I try out on before soldering, easier to chane components to see if someone of the cheap once are broken)

      Sensor Vcc connected to 3,3V, GND to GND and sensor to D3.
      So what do I have to do to turn of the sensor when I put the arduino to sleep?

      alt text

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

      @Martin-Tellblom - instead of wire power from VCC to the sensor you could try power it through D3 or another IO pin.
      Then you set this pin to HIGH to power the sensor and then LOW before you sleep the node.

      If you have a multimeter you could measure the ampere when you sleep the node.

      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
      1
      • Martin TellblomM Offline
        Martin TellblomM Offline
        Martin Tellblom
        wrote on last edited by
        #5

        @sundberg84 said:

        to HIGH to power the sensor and then LOW before you sleep the node.

        If you have a multimeter

        Alright so if I connect the Vcc sron the sensor to D2 (since I use D3 for measurement) and set that HIGH before I measure, should I have a sleep for it to power up aswell?

        Something Like this?

          digitalWrite(SOIL_POWER_PIN , HIGH);  
          delayMicroseconds(25);
        
          moisture = analogRead(SOIL_SENSE_PIN);
          
          delayMicroseconds(25);
          digitalWrite(SOIL_POWER_PIN , LOW);  
        

        MySensors MQTT Client Gateway, Openhab, Dashing, Razberry, 1-wire

        sundberg84S Nca78N 2 Replies Last reply
        0
        • Martin TellblomM Martin Tellblom

          @sundberg84 said:

          to HIGH to power the sensor and then LOW before you sleep the node.

          If you have a multimeter

          Alright so if I connect the Vcc sron the sensor to D2 (since I use D3 for measurement) and set that HIGH before I measure, should I have a sleep for it to power up aswell?

          Something Like this?

            digitalWrite(SOIL_POWER_PIN , HIGH);  
            delayMicroseconds(25);
          
            moisture = analogRead(SOIL_SENSE_PIN);
            
            delayMicroseconds(25);
            digitalWrite(SOIL_POWER_PIN , LOW);  
          
          sundberg84S Offline
          sundberg84S Offline
          sundberg84
          Hardware Contributor
          wrote on last edited by
          #6

          @Martin-Tellblom - Yes, something like that.
          Dont use delay, use wait(); if tou want to create a pause for reading.

          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

          Martin TellblomM 2 Replies Last reply
          0
          • sundberg84S sundberg84

            @Martin-Tellblom - Yes, something like that.
            Dont use delay, use wait(); if tou want to create a pause for reading.

            Martin TellblomM Offline
            Martin TellblomM Offline
            Martin Tellblom
            wrote on last edited by
            #7

            @sundberg84
            OK,

            I have now changed to the below code and changed to a SOIL sensor with the LED still on

            The LED is lit up even after digitalWrite(SOIL_POWER_PIN , LOW); so I don't think its working

            void loop()
            {
            
              digitalWrite(SOIL_POWER_PIN , HIGH);
              wait(25);
            
              moisture = analogRead(SOIL_SENSE_PIN);
            
              wait(25);
              digitalWrite(SOIL_POWER_PIN , LOW);
            
              if (oldMoisture != moisture) {
                send(msgSoil.set(moisture, 0));
                sendBatteryLevel(moisture);
                oldMoisture = moisture;
              }
            
              //Check Battery Level
              int sensorValue = analogRead(BATTERY_SENSE_PIN);
            
              int batteryPcnt = sensorValue / 10;
              if (oldBatteryPcnt != batteryPcnt) {
                // Power up radio after sleep
                sendBatteryLevel(batteryPcnt);
                oldBatteryPcnt = batteryPcnt;
              }
              digitalWrite(SOIL_POWER_PIN , LOW);
              digitalWrite(SOIL_POWER_PIN , LOW);
              sleep(SLEEP_TIME);
            }
            

            MySensors MQTT Client Gateway, Openhab, Dashing, Razberry, 1-wire

            1 Reply Last reply
            0
            • sundberg84S sundberg84

              @Martin-Tellblom - Yes, something like that.
              Dont use delay, use wait(); if tou want to create a pause for reading.

              Martin TellblomM Offline
              Martin TellblomM Offline
              Martin Tellblom
              wrote on last edited by
              #8

              @sundberg84

              Stupid me, forgot defining it as output pinMode(SOIL_POWER_PIN, OUTPUT); in the setup

              It's working now

              MySensors MQTT Client Gateway, Openhab, Dashing, Razberry, 1-wire

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

                Good! @Martin-Tellblom If you can measure how much uA it consumes in sleep() mode you can then calculate the life expectancy. Around 100uA is fine in my world with a booster and pro mini.

                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

                Martin TellblomM 1 Reply Last reply
                0
                • sundberg84S sundberg84

                  Good! @Martin-Tellblom If you can measure how much uA it consumes in sleep() mode you can then calculate the life expectancy. Around 100uA is fine in my world with a booster and pro mini.

                  Martin TellblomM Offline
                  Martin TellblomM Offline
                  Martin Tellblom
                  wrote on last edited by
                  #10

                  @sundberg84 said:

                  can measure how much uA it consumes in s

                  I thought I could do that with my multimeter but I get no value

                  MySensors MQTT Client Gateway, Openhab, Dashing, Razberry, 1-wire

                  sundberg84S 1 Reply Last reply
                  0
                  • Martin TellblomM Martin Tellblom

                    @sundberg84 said:

                    can measure how much uA it consumes in s

                    I thought I could do that with my multimeter but I get no value

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

                    @Martin-Tellblom - Put the multimeter in series with VCC. Dont forget to change the input on your multimeter.

                    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

                    cimba007C 1 Reply Last reply
                    0
                    • sundberg84S sundberg84

                      @Martin-Tellblom - Put the multimeter in series with VCC. Dont forget to change the input on your multimeter.

                      cimba007C Offline
                      cimba007C Offline
                      cimba007
                      wrote on last edited by cimba007
                      #12

                      @sundberg84

                      Be aware that depending on the mesurement range a multimeter could introduce a big burdan voltage.

                      Just simple and short: To measure in the mA range you the multmeter measures the voltage drop accross a series resistor with an value .. call it A.

                      Switching to the µA range the mutltimeter switches to a much larger resistor (e.g. 1000times A) to measure a significat enough voltage drop. With the wrong voltage range .. measuring µA while the board is consuming in the mA range might lead to a huge voltage drop and your circuit not working at all.

                      So do this:

                      • Switch to mA mode .. take your measurement .. wait until you KNOW for sure your circuit is in sleep mode (add some messages on the serial console) and THEN switch to µA range.
                      1 Reply Last reply
                      0
                      • Martin TellblomM Offline
                        Martin TellblomM Offline
                        Martin Tellblom
                        wrote on last edited by
                        #13

                        I don't think my multimeter is good enough for this, It seems like it put in some power due if I

                        I will try this when I get home today and see if I need a new multimeter or not :)

                        MySensors MQTT Client Gateway, Openhab, Dashing, Razberry, 1-wire

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

                          and with a multimeter only, due to burden voltage and depending of the multimeter precision, you won't get the true power consumption, an approx which is still nice, you can know what "looks" power consumption and tendancy. Even if you're using a nice expensive Fluke. Best precision for this is uCurrent Gold+multimeter ;)

                          1 Reply Last reply
                          0
                          • Martin TellblomM Offline
                            Martin TellblomM Offline
                            Martin Tellblom
                            wrote on last edited by Martin Tellblom
                            #15

                            @scalz

                            Or just simply take percentage and date/time and then a few days later see what has changed percentage wise ...
                            Its to simple I know but if 1% battery power equals 4 days the sensor probably last for about 9-10 month (the last percentage I suppose you don't get any communication with :) )

                            MySensors MQTT Client Gateway, Openhab, Dashing, Razberry, 1-wire

                            sundberg84S 1 Reply Last reply
                            1
                            • Martin TellblomM Martin Tellblom

                              @scalz

                              Or just simply take percentage and date/time and then a few days later see what has changed percentage wise ...
                              Its to simple I know but if 1% battery power equals 4 days the sensor probably last for about 9-10 month (the last percentage I suppose you don't get any communication with :) )

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

                              @Martin-Tellblom - Im not sure it works that way. It depends on which battery you use.
                              Voltage tends to drop faster in the end for normal AA batteries.

                              My sensors doesnt drop that much (maybe 5%) the first 6 months.

                              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
                              • Martin TellblomM Offline
                                Martin TellblomM Offline
                                Martin Tellblom
                                wrote on last edited by
                                #17

                                @sundberg84 Hmm What you are saying is that I need to buy a new and better Multimeter :) This is the reason I was waiting for ..... :9

                                MySensors MQTT Client Gateway, Openhab, Dashing, Razberry, 1-wire

                                sundberg84S 1 Reply Last reply
                                1
                                • Martin TellblomM Martin Tellblom

                                  @sundberg84 Hmm What you are saying is that I need to buy a new and better Multimeter :) This is the reason I was waiting for ..... :9

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

                                  @Martin-Tellblom - I hope you dont give up! Battery operations was the hardest part for me to figure out...

                                  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
                                  • Martin TellblomM Offline
                                    Martin TellblomM Offline
                                    Martin Tellblom
                                    wrote on last edited by
                                    #19

                                    I only have two kind of sensors that I need to be battery operated and that's the plants warning that they are out of water and soon gonna die and the dogs water bowl warning that they soon gonna die (KIDDING). The dogs bowl I like to measure the levels and have that to compare with the temperature, just for fun.
                                    I hope I get this working aswell, It wont be pretty with a cable around the few plants we got

                                    MySensors MQTT Client Gateway, Openhab, Dashing, Razberry, 1-wire

                                    1 Reply Last reply
                                    0
                                    • N Offline
                                      N Offline
                                      Nicklas Starkel
                                      wrote on last edited by
                                      #20

                                      @Martin-Tellblom , I'm in this mess as well. Just ordered a new Multimeter off aliexpress :)

                                      @sundberg84 , have you tried other batteries? I bough some ultrafire 3.7V 8800mAh and will try these.
                                      They were cheap so no loss if they do not work out..

                                      sundberg84S 1 Reply Last reply
                                      0
                                      • Martin TellblomM Martin Tellblom

                                        @sundberg84 said:

                                        to HIGH to power the sensor and then LOW before you sleep the node.

                                        If you have a multimeter

                                        Alright so if I connect the Vcc sron the sensor to D2 (since I use D3 for measurement) and set that HIGH before I measure, should I have a sleep for it to power up aswell?

                                        Something Like this?

                                          digitalWrite(SOIL_POWER_PIN , HIGH);  
                                          delayMicroseconds(25);
                                        
                                          moisture = analogRead(SOIL_SENSE_PIN);
                                          
                                          delayMicroseconds(25);
                                          digitalWrite(SOIL_POWER_PIN , LOW);  
                                        
                                        Nca78N Offline
                                        Nca78N Offline
                                        Nca78
                                        Hardware Contributor
                                        wrote on last edited by
                                        #21

                                        @Martin-Tellblom said:

                                        Alright so if I connect the Vcc sron the sensor to D2

                                        Hello, you should use another digital pin than D2 as it is used by MySensors library and on the EastPCB it is connected to the INT pin of the NRF24. I had problems using D2 pin before because of this reason. Use D4,5,6,7 or 8 and you will be sure to have no problem.

                                        sundberg84S 1 Reply Last reply
                                        0
                                        • N Nicklas Starkel

                                          @Martin-Tellblom , I'm in this mess as well. Just ordered a new Multimeter off aliexpress :)

                                          @sundberg84 , have you tried other batteries? I bough some ultrafire 3.7V 8800mAh and will try these.
                                          They were cheap so no loss if they do not work out..

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

                                          @Nicklas-Starkel - Nope I have not, but @AWI has experienced with some other batteries and i know he recommends some sort to be able to avoid the booster.

                                          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
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          11

                                          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