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. General Discussion
  3. Need working example battery powered sensor

Need working example battery powered sensor

Scheduled Pinned Locked Moved General Discussion
21 Posts 8 Posters 11.2k Views 7 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.
  • J Offline
    J Offline
    jovo
    wrote on last edited by jovo
    #1

    I like to build a low power sensor, for the moment only supporting a DHT22 sensor.
    The objective is use the following:

    • 3.3v mini-pro + radio of course
    • DHT22 sensor
    • 2 x AA battery power source
    • battery life time min 6 months.
      While searching I read about different aspects to improve power consumption. My initial conclusion is that I need to include the following items:
    • using a step-up converter to squeeze all energy from the batteries (which one has best performance/price?)
    • signaling down the unused digital ports (seems to be the most easy item)
    • low power sleep mode: there seems to be many different ways and status of sleep mode. I don't need external trigger. the default sleep mode from the sensor sketches seems not to give the power right saving (measurement show still 5mA while in sleep mode). It was written that we should be able to go down to 100's of uA but how?
    • lowering clock freq and "burning fuses", etc..

    There are tons of discussions on this forum and other similar internet places discussing this topic, but I am struggling finding the right directions that integrates easily with this mysensors platform (I am not a super experienced programmer).
    Basically I am looking for a working " how to" including all necessary steps to achieve low power. I suspect it does exist already somewhere, but I wasn't able to find. It would be great if someone can help me with this.

    funky81F 1 Reply Last reply
    0
    • J jovo

      I like to build a low power sensor, for the moment only supporting a DHT22 sensor.
      The objective is use the following:

      • 3.3v mini-pro + radio of course
      • DHT22 sensor
      • 2 x AA battery power source
      • battery life time min 6 months.
        While searching I read about different aspects to improve power consumption. My initial conclusion is that I need to include the following items:
      • using a step-up converter to squeeze all energy from the batteries (which one has best performance/price?)
      • signaling down the unused digital ports (seems to be the most easy item)
      • low power sleep mode: there seems to be many different ways and status of sleep mode. I don't need external trigger. the default sleep mode from the sensor sketches seems not to give the power right saving (measurement show still 5mA while in sleep mode). It was written that we should be able to go down to 100's of uA but how?
      • lowering clock freq and "burning fuses", etc..

      There are tons of discussions on this forum and other similar internet places discussing this topic, but I am struggling finding the right directions that integrates easily with this mysensors platform (I am not a super experienced programmer).
      Basically I am looking for a working " how to" including all necessary steps to achieve low power. I suspect it does exist already somewhere, but I wasn't able to find. It would be great if someone can help me with this.

      funky81F Offline
      funky81F Offline
      funky81
      wrote on last edited by
      #2

      @jovo said:

      • battery life time min 6 months.
        While searching I read about different aspects to improve power consumption. My initial conclusion is that I need to include the following items:
      • using a step-up converter to squeeze all energy from the batteries (which one has best performance/price?)
      • signaling down the unused digital ports (seems to be the most easy item)
      • low power sleep mode: there seems to be many different ways and status of sleep mode. I don't need external trigger. the default sleep mode from the sensor sketches seems not to give the power right saving (measurement show still 5mA while in sleep mode). It was written that we should be able to go down to 100's of uA but how?
      • lowering clock freq and "burning fuses", etc..

      I have the same questions. I've tried so many things, but the lowest still 2.4mA (I corrected my previous state that the lowest that I can go is 1mA - true,but it's not working actually).
      I want to achieve xxx on uA as well....but still can't and stuck.

      1 Reply Last reply
      0
      • rvendrameR Offline
        rvendrameR Offline
        rvendrame
        Hero Member
        wrote on last edited by
        #3

        http://forum.mysensors.org/topic/486/my-2aa-battery-sensor/36

        Home Assistant / Vera Plus UI7
        ESP8266 GW + mySensors 2.3.2
        Alexa / Google Home

        J 1 Reply Last reply
        0
        • rvendrameR rvendrame

          http://forum.mysensors.org/topic/486/my-2aa-battery-sensor/36

          J Offline
          J Offline
          jovo
          wrote on last edited by
          #4

          @rvendrame said:

          http://forum.mysensors.org/topic/486/my-2aa-battery-sensor/36

          Yes, i have seen this discussion. it has great information and i should try some of them.

          To be more precise on my initial request, i think i should prioritize exploring the software options so it would be great if someone could clarify the best low-power options in the sketches. I am now just using the "sleep-time" option from the default mysensor sketches, but there are many more sleep options to choose for when checking the lowpower sketch. In particular, is there an difference between just sleep and power down. I guess so and since i like to work with a timer, if i can power down the node for a number of minutes, i guess that has great savings. a suggestion for a mysensors based power-down sketch would be great.

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jovo
            wrote on last edited by jovo
            #5

            Spend some time today researching this topic.
            I concluded that I need a step-up anyway since the DHT-22 have a min Vcc of 3.3 which is easily reached when batteries are depleting, so I bought some of these.

            But this is not enough. I am fascinated by the extreme low power use of what we reported by EasyIoT in the low power guide by lowering the freq of the CPU.

            avrdude -c usbtiny -p m328p -U lfuse:w:0x62:m 
            

            and

            avrdude -c usbtiny -p m328p -U efuse:w:0x07:m
            

            After some struggle I manage to burn the fuses (or at least AVRDUDE gave me a successful status). Then I edited the boards.txt and selected the EasyIoT board from the list. The problem I have now is that I cannot upload sketches anymore:
            avrdude: stk500_recv(): programmer is not responding
            avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x15
            I played a bit with the com speed setting in board.txt (as this resolved also my fuse burn issue earlier). Unfortunately, no success...

            Now my questions:

            • anybody similar experience after fuse buring and how to resolve this?
            • how can I revert back to the original fuse setting so I can use my arduino again?
            m26872M funky81F 2 Replies Last reply
            0
            • J jovo

              Spend some time today researching this topic.
              I concluded that I need a step-up anyway since the DHT-22 have a min Vcc of 3.3 which is easily reached when batteries are depleting, so I bought some of these.

              But this is not enough. I am fascinated by the extreme low power use of what we reported by EasyIoT in the low power guide by lowering the freq of the CPU.

              avrdude -c usbtiny -p m328p -U lfuse:w:0x62:m 
              

              and

              avrdude -c usbtiny -p m328p -U efuse:w:0x07:m
              

              After some struggle I manage to burn the fuses (or at least AVRDUDE gave me a successful status). Then I edited the boards.txt and selected the EasyIoT board from the list. The problem I have now is that I cannot upload sketches anymore:
              avrdude: stk500_recv(): programmer is not responding
              avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x15
              I played a bit with the com speed setting in board.txt (as this resolved also my fuse burn issue earlier). Unfortunately, no success...

              Now my questions:

              • anybody similar experience after fuse buring and how to resolve this?
              • how can I revert back to the original fuse setting so I can use my arduino again?
              m26872M Offline
              m26872M Offline
              m26872
              Hardware Contributor
              wrote on last edited by m26872
              #6

              @jovo
              I don¨t have a straight answer. If you can't communicate with it, I think it's hard to do anything.

              Anyway I'll share my note since I researched this a while ago. I never got to the point when actually burn fuses. But I wrote this entry in my boards.txt:

              s328o1.name=ArduinoProMini-3.3V-8MHz(BOD 2.7V) FUSE-CHANGE to (int1MHz, BOD 1.8V)
              s328o1.upload.protocol=arduino
              s328o1.upload.maximum_size=30720
              s328o1.upload.speed=7200
              # http://www.gammon.com.au/forum/?id=11497
              # http://www.martyncurrey.com/?p=823
              s328o1.bootloader.low_fuses=0x62
              s328o1.bootloader.high_fuses=0xda
              s328o1.bootloader.extended_fuses=0x06
              #Omit .path and .file to simply burn the fuses. See https://code.google.com/p/arduino/wiki/Platforms
              #s328o1.bootloader.path=atmega
              #s328o1.bootloader.file=ATmegaBOOT_168_atmega328_pro_8MHz.hex
              s328o1.bootloader.unlock_bits=0x3F
              s328o1.bootloader.lock_bits=0x0F
              s328o1.build.mcu=atmega328p
              s328o1.build.f_cpu=1000000L
              s328o1.build.core=arduino
              s328o1.build.variant=standard
              

              Edit: Since I wrote that I've learn from here that BOD disabled saves 15-20uA. So now I would go for EasyIots setting with extended fuses 0x07.
              Edit2: It turned out that I had to use AvrStudio (v4.19+win7) with my avrispmkII to successfully burn fuses and bootloader (precompiled optiboot). Arduino IDE with avrdude just gave me trouble.

              1 Reply Last reply
              0
              • T Offline
                T Offline
                TimO
                Hero Member
                wrote on last edited by
                #7

                Is avrdude still working? Are you for example able to read out the fuses?
                Your fuses seem to be okay, I think there is an error in your board.txt. How are you trying to Upload the Sketch? Via ISP?

                1 Reply Last reply
                0
                • J jovo

                  Spend some time today researching this topic.
                  I concluded that I need a step-up anyway since the DHT-22 have a min Vcc of 3.3 which is easily reached when batteries are depleting, so I bought some of these.

                  But this is not enough. I am fascinated by the extreme low power use of what we reported by EasyIoT in the low power guide by lowering the freq of the CPU.

                  avrdude -c usbtiny -p m328p -U lfuse:w:0x62:m 
                  

                  and

                  avrdude -c usbtiny -p m328p -U efuse:w:0x07:m
                  

                  After some struggle I manage to burn the fuses (or at least AVRDUDE gave me a successful status). Then I edited the boards.txt and selected the EasyIoT board from the list. The problem I have now is that I cannot upload sketches anymore:
                  avrdude: stk500_recv(): programmer is not responding
                  avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x15
                  I played a bit with the com speed setting in board.txt (as this resolved also my fuse burn issue earlier). Unfortunately, no success...

                  Now my questions:

                  • anybody similar experience after fuse buring and how to resolve this?
                  • how can I revert back to the original fuse setting so I can use my arduino again?
                  funky81F Offline
                  funky81F Offline
                  funky81
                  wrote on last edited by funky81
                  #8

                  @jovo my experiences quite different with you. I can successfully compiled and upload the sketches. Unfortunately, the packet from node, never reach gateway. Even though I pump the NRF24L01+ power with step up regulator, but still the same. Since then, I never try it with 1MHz again...

                  To revert it again, burn your fuses again. Check this in Using the internal clock section

                  1 Reply Last reply
                  0
                  • J Offline
                    J Offline
                    Jan Gatzke
                    wrote on last edited by Jan Gatzke
                    #9

                    I think you need a modified Arduino bootloader for 1 Mhz operation. The bootloader does the serial communication wich is very timing critical. And when the bootloader is compiled with 8 mhz the baud value simply doesn't match.

                    Regarding power consumption...did you remove the LEDs? The power LED alone needs about 2 mA. This would explain your values.

                    funky81F 1 Reply Last reply
                    0
                    • J Jan Gatzke

                      I think you need a modified Arduino bootloader for 1 Mhz operation. The bootloader does the serial communication wich is very timing critical. And when the bootloader is compiled with 8 mhz the baud value simply doesn't match.

                      Regarding power consumption...did you remove the LEDs? The power LED alone needs about 2 mA. This would explain your values.

                      funky81F Offline
                      funky81F Offline
                      funky81
                      wrote on last edited by
                      #10

                      @Jan-Gatzke mind to share it how?

                      1 Reply Last reply
                      0
                      • J Offline
                        J Offline
                        Jan Gatzke
                        wrote on last edited by Jan Gatzke
                        #11

                        I have never done this before. But basically you need the c code of the bootloader for your Arduino. Then open it with a text editor and change the f_cpu value. Then compile and flash it using avrdude.

                        I googled and found this:
                        http://angryelectron.com/how-to-update-the-bootloader-on-arduino-pro-mini-328/

                        I would use Atmel studio for these low level tasks if you are running on Windows.

                        J 1 Reply Last reply
                        0
                        • J Jan Gatzke

                          I have never done this before. But basically you need the c code of the bootloader for your Arduino. Then open it with a text editor and change the f_cpu value. Then compile and flash it using avrdude.

                          I googled and found this:
                          http://angryelectron.com/how-to-update-the-bootloader-on-arduino-pro-mini-328/

                          I would use Atmel studio for these low level tasks if you are running on Windows.

                          J Offline
                          J Offline
                          Jan Gatzke
                          wrote on last edited by
                          #12

                          @Jan-Gatzke said:

                          I have never done this before. But basically you need the c code of the bootloader for your Arduino. Then open it with a text editor and change the f_cpu value. Then compile and flash it using avrdude.

                          I googled and found this:
                          http://angryelectron.com/how-to-update-the-bootloader-on-arduino-pro-mini-328/

                          I would use Atmel studio for these low level tasks if you are running in Windows.

                          Edit: Found already compiled bootloaders here: http://forum.arduino.cc/index.php?topic=160647.15

                          funky81F 1 Reply Last reply
                          1
                          • J Jan Gatzke

                            @Jan-Gatzke said:

                            I have never done this before. But basically you need the c code of the bootloader for your Arduino. Then open it with a text editor and change the f_cpu value. Then compile and flash it using avrdude.

                            I googled and found this:
                            http://angryelectron.com/how-to-update-the-bootloader-on-arduino-pro-mini-328/

                            I would use Atmel studio for these low level tasks if you are running in Windows.

                            Edit: Found already compiled bootloaders here: http://forum.arduino.cc/index.php?topic=160647.15

                            funky81F Offline
                            funky81F Offline
                            funky81
                            wrote on last edited by
                            #13

                            @Jan-Gatzke Thank you very much Sir....Now this is getting excited :+1:

                            funky81F 1 Reply Last reply
                            0
                            • J Offline
                              J Offline
                              jovo
                              wrote on last edited by jovo
                              #14

                              I broke one Arduino by removing the power regulator
                              I broke another one while playing with the fuses (I think?) in an attempt to set the 1Mhz system clock.
                              I tried all suggested "low power/sleep/pwr_dwn sketches" I came across, but one of them was giving my a better power consumption then the default "sleep time" option used in the sketches of mysensors.
                              The only thing that was working as removing the LED. This saves approx. 1.2mA.

                              I am now at 3.3mA sleep consumption. Adding the DC-DC power booster to the config once received from China, so I expect to add another extra mA consumption.
                              Not sure if 4.5mA sleep pwr draw is sustainable for battery operators (only 26 days on a 2800mAh batterypack).

                              Since I believe that lowering the clock rate could be the solution for my project, I ordered some more mini-pro's to experiment more with the fuses setting.

                              Overall, despite the mixed results, still a very interesting project where I had great learning on my rusty hardware and programming skills....

                              Any further suggestions to improve pwr consumption remain always welcome :-)

                              AWIA 1 Reply Last reply
                              0
                              • J jovo

                                I broke one Arduino by removing the power regulator
                                I broke another one while playing with the fuses (I think?) in an attempt to set the 1Mhz system clock.
                                I tried all suggested "low power/sleep/pwr_dwn sketches" I came across, but one of them was giving my a better power consumption then the default "sleep time" option used in the sketches of mysensors.
                                The only thing that was working as removing the LED. This saves approx. 1.2mA.

                                I am now at 3.3mA sleep consumption. Adding the DC-DC power booster to the config once received from China, so I expect to add another extra mA consumption.
                                Not sure if 4.5mA sleep pwr draw is sustainable for battery operators (only 26 days on a 2800mAh batterypack).

                                Since I believe that lowering the clock rate could be the solution for my project, I ordered some more mini-pro's to experiment more with the fuses setting.

                                Overall, despite the mixed results, still a very interesting project where I had great learning on my rusty hardware and programming skills....

                                Any further suggestions to improve pwr consumption remain always welcome :-)

                                AWIA Offline
                                AWIA Offline
                                AWI
                                Hero Member
                                wrote on last edited by
                                #15

                                @jovo I had some problems with mini's I ordered which can be "switched" between 3.3 and 5v. These mini's use a voltage divider that consumes around 2 mA.! Apart from the led and regulator I alse needed to remove this divider to get to less consumption.
                                upload-4891e188-701a-4c2b-a302-afd4caa9b6b0

                                J hansiiiH 2 Replies Last reply
                                0
                                • AWIA AWI

                                  @jovo I had some problems with mini's I ordered which can be "switched" between 3.3 and 5v. These mini's use a voltage divider that consumes around 2 mA.! Apart from the led and regulator I alse needed to remove this divider to get to less consumption.
                                  upload-4891e188-701a-4c2b-a302-afd4caa9b6b0

                                  J Offline
                                  J Offline
                                  jovo
                                  wrote on last edited by
                                  #16

                                  @AWI: Tx for the feedback. I checked with my mini's. I got both versions: 5v and 3v3 (ordered from BEEStore). They seems not to be switchable. they 3v3 one have a 8Mhz crystal and the regulator (AMS 1117) for 3v3. the 5v one has 16Mhz crystal and a 5v version of this regulator.

                                  I was wondering, in my design I plan to power the board directly from the VCC pin (not the raw). I suspect that the regulator doesn't consume much in this case. let me see if I can find a datasheet of this component.

                                  1 Reply Last reply
                                  0
                                  • J Offline
                                    J Offline
                                    jovo
                                    wrote on last edited by jovo
                                    #17

                                    Humm, from the AMS1117 datasheet:

                                    Quiescent Current AMS1117: 5-11mA.
                                    It looks like to has some significant quiescent current.
                                    Perhaps for me good idea to research a little further in this direction.

                                    1 Reply Last reply
                                    0
                                    • funky81F funky81

                                      @Jan-Gatzke Thank you very much Sir....Now this is getting excited :+1:

                                      funky81F Offline
                                      funky81F Offline
                                      funky81
                                      wrote on last edited by
                                      #18

                                      @Jan-Gatzke i've tried this bootloader with several of my arduino pro mini.
                                      most of them run @ 1 Mhz, thanks to you. but somehow the current consumption dont decrease. but i've check with my usbtiny for the fuse, it already @ 1MHz....

                                      no clue what happen here

                                      1 Reply Last reply
                                      0
                                      • AWIA AWI

                                        @jovo I had some problems with mini's I ordered which can be "switched" between 3.3 and 5v. These mini's use a voltage divider that consumes around 2 mA.! Apart from the led and regulator I alse needed to remove this divider to get to less consumption.
                                        upload-4891e188-701a-4c2b-a302-afd4caa9b6b0

                                        hansiiiH Offline
                                        hansiiiH Offline
                                        hansiii
                                        wrote on last edited by
                                        #19

                                        @AWI Hello AWI, sorry i know the topic is old, but i have exatly the same minis bought. Can you tell me what i have to remove or can you attach a photo. many thanks
                                        greetings
                                        hansiii

                                        AWIA 1 Reply Last reply
                                        0
                                        • hansiiiH hansiii

                                          @AWI Hello AWI, sorry i know the topic is old, but i have exatly the same minis bought. Can you tell me what i have to remove or can you attach a photo. many thanks
                                          greetings
                                          hansiii

                                          AWIA Offline
                                          AWIA Offline
                                          AWI
                                          Hero Member
                                          wrote on last edited by
                                          #20

                                          @hansiii that was certainly a while ago.. I removed all resistors near the voltage selector and the regulator (5 legs)

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


                                          16

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.0k

                                          Posts


                                          Copyright 2019 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