Need working example battery powered sensor



  • 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.



  • @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.


  • Hero Member



  • @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.



  • 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?

  • Hardware Contributor

    @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.


  • Hero Member

    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?



  • @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



  • 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.



  • @Jan-Gatzke mind to share it how?



  • 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.



  • @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



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



  • 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 :-)


  • Hero Member

    @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



  • @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.



  • 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.



  • @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



  • @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


  • Hero Member

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


Log in to reply
 

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.