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. coin-cell (CR2032) powered temperature sensor

coin-cell (CR2032) powered temperature sensor

Scheduled Pinned Locked Moved My Project
39 Posts 10 Posters 23.1k Views 18 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.
  • F fleinze

    @carmelo42 I just changed coin-cell on one of my sensors. It lasted since for 10 months, this is ok for me.

    carlekiC Offline
    carlekiC Offline
    carleki
    wrote on last edited by
    #15

    @fleinze said:

    @carmelo42 I just changed coin-cell on one of my sensors. It lasted since for 10 months, this is ok for me.

    10 months ? it's perfect :)

    Can you provide the modified version of the library to avoid using 4.7k resistor for the Dallas sensor ?

    What is for the resistor on the pic ? for the voltage mesurement ?

    F 1 Reply Last reply
    0
    • carlekiC carleki

      @fleinze said:

      @carmelo42 I just changed coin-cell on one of my sensors. It lasted since for 10 months, this is ok for me.

      10 months ? it's perfect :)

      Can you provide the modified version of the library to avoid using 4.7k resistor for the Dallas sensor ?

      What is for the resistor on the pic ? for the voltage mesurement ?

      F Offline
      F Offline
      fleinze
      wrote on last edited by fleinze
      #16

      @carmelo42

      The no-resistor-library can be found here:
      https://wp.josh.com/2014/06/23/no-external-pull-up-needed-for-ds18b20-temp-sensor/

      The resistors (there are two but the other one is barely visible) are for voltage-measurement. In a later version I got rid of them using this resistor-less method of measurement:
      http://provideyourown.com/2012/secret-arduino-voltmeter-measure-battery-voltage/

      carlekiC 1 Reply Last reply
      1
      • Moebius LutchingM Offline
        Moebius LutchingM Offline
        Moebius Lutching
        wrote on last edited by
        #17

        Just found this post https://www.hackster.io/Talk2/temp-and-humidity-sensor-with-a-cr2032-for-over-1-year-580114 showing some details about using a CR2032 to power a sensor node. By my calculations, if the author removed the LED at all the solution would last for over 2 years!

        1 Reply Last reply
        1
        • F fleinze

          @carmelo42

          The no-resistor-library can be found here:
          https://wp.josh.com/2014/06/23/no-external-pull-up-needed-for-ds18b20-temp-sensor/

          The resistors (there are two but the other one is barely visible) are for voltage-measurement. In a later version I got rid of them using this resistor-less method of measurement:
          http://provideyourown.com/2012/secret-arduino-voltmeter-measure-battery-voltage/

          carlekiC Offline
          carlekiC Offline
          carleki
          wrote on last edited by
          #18

          @fleinze said:

          @carmelo42

          The no-resistor-library can be found here:
          https://wp.josh.com/2014/06/23/no-external-pull-up-needed-for-ds18b20-temp-sensor/

          The resistors (there are two but the other one is barely visible) are for voltage-measurement. In a later version I got rid of them using this resistor-less method of measurement:
          http://provideyourown.com/2012/secret-arduino-voltmeter-measure-battery-voltage/

          great :)

          Did you change the bootloader ? Which one did you use ?

          F 1 Reply Last reply
          0
          • Nca78N Offline
            Nca78N Offline
            Nca78
            Hardware Contributor
            wrote on last edited by
            #19

            Hello,

            there are a few improvements you can do to make your CR2032 nodes last longer:

            • add a capacitor of 100-200µF in parallel with your battery. Ceramic is better, but I have no problem with nodes using electrolytic capacitors. This will help when there is a peak power consumption from the radio. If you do not put one, voltage will drop quickly and that's probably what is triggering reboot loop on one of your nodes: maybe radio is less efficient and needs to resend more messages. Or maybe your BOD is not updated so it resets when voltage drops at 2.7V...
            • in your code, add a sleep command between message sending to give time for your cell to rest, and for the capacitor to recharge. Do it also at the beginning of presentation method and between each message sending in presentation.
            • use a better sensor that can accept a lower voltage, they are more expensive that DS18 but they can work down to 2V and use much less current: BMP180/280 if you want to measure only temperature (with barometer as extra), SI7021 for temp/hum, BME280 for temp/hum more expensive but better.
            • do not use voltage divider at all, you don't need one as you can just get Vcc from the A0 pin (with it I have some change of voltage related to temperature but not as wild as you seem to get. Maybe it's related to the DS18 measurement also ?)

            With these changes and a si7021 breakout board from which I removed the voltage regulator (it's not consuming much, but without it is even better), I can send every minute, flash a led and I hardly see any drop in voltage after a few weeks of running.

            1 Reply Last reply
            2
            • F Offline
              F Offline
              fleinze
              wrote on last edited by
              #20

              @Nca78 said:

              add a capacitor of 100-200µF

              I will try this, thanks! Currently I use the 10uF capacitor which is on the arduino pro minis on the raw pin side.

              in your code, add a sleep command between message sending

              How long do you sleep? In normal operation there is only one send command per loop, I only send battery level once every hour. I try to read vcc after sending the temperature so the battery is under some load when measuring.

              use a better sensor that can accept a lower voltage

              I already built one with a Si7021 sensor. But I ran out of CR2032 so I powered it using two AA cells. I should solder it back to coin cell now I got some.

              you can just get Vcc from the A0 pin

              I don't know this method do you have a link or can you explain it?

              1 Reply Last reply
              0
              • carlekiC carleki

                @fleinze said:

                @carmelo42

                The no-resistor-library can be found here:
                https://wp.josh.com/2014/06/23/no-external-pull-up-needed-for-ds18b20-temp-sensor/

                The resistors (there are two but the other one is barely visible) are for voltage-measurement. In a later version I got rid of them using this resistor-less method of measurement:
                http://provideyourown.com/2012/secret-arduino-voltmeter-measure-battery-voltage/

                great :)

                Did you change the bootloader ? Which one did you use ?

                F Offline
                F Offline
                fleinze
                wrote on last edited by
                #21

                @carmelo42 sorry I somehow missed your post. I use the standard-bootloader as I did not get Optiboot to run on the 3.3V/8MHz pro minis. I set the extended fuse to 0x07 (BOD disabled) by editing boards.txt.

                carlekiC 1 Reply Last reply
                0
                • F fleinze

                  @carmelo42 sorry I somehow missed your post. I use the standard-bootloader as I did not get Optiboot to run on the 3.3V/8MHz pro minis. I set the extended fuse to 0x07 (BOD disabled) by editing boards.txt.

                  carlekiC Offline
                  carlekiC Offline
                  carleki
                  wrote on last edited by
                  #22

                  @fleinze said:

                  @carmelo42 sorry I somehow missed your post. I use the standard-bootloader as I did not get Optiboot to run on the 3.3V/8MHz pro minis. I set the extended fuse to 0x07 (BOD disabled) by editing boards.txt.
                  thanks !

                  is is a bit confusing for me :

                  • we can burn the bootloader from the Arduino IDE : are the fuses written at this moment ?
                  • we can upload a sketch with the arduino IDE : are the fuses written at this moment ?
                  • with my researches, I found that for disabling BOD was possible with 0xFF value for efuse ?

                  I have some lifetime issues with my CR2032 sensor .. and I suspect the fuses are not correctly set ...

                  If you can light up my mind it will be perfect :)

                  1 Reply Last reply
                  0
                  • F Offline
                    F Offline
                    fleinze
                    wrote on last edited by
                    #23

                    @carmelo42 The fuses only are written when you burn the bootloader, not when uploading the sketch. The Arduino IDE takes the fuse bytes from the boards.txt files.
                    It would also be possible to just set the fuse bytes by using the avrdude-program from a command line, but you will still need to use a programmer.
                    The extended-fuse setting 0xFF is the same as 0x07 as only the last 3 bits of this bytes are used. Both values will give you BOD disabled.

                    1 Reply Last reply
                    1
                    • F Offline
                      F Offline
                      fleinze
                      wrote on last edited by
                      #24

                      I just added an 100uF capacitor to one of my sensors and put an old battery in. Let's see how much more life I can get out of this battery now.

                      F 1 Reply Last reply
                      1
                      • carlekiC Offline
                        carlekiC Offline
                        carleki
                        wrote on last edited by carleki
                        #25

                        @fleinze
                        Hi, do you think it's possible to connect de Dallas sensor to pin 7, 8 and 9 of the arduino ?

                        Like this :

                        #define ONE_WIRE_BUS 8 // Pin where dallase sensor is connected
                        #define ONE_WIRE_GND 9
                        #define ONE_WIRE_VCC 7
                        

                        I have tried, and the temperature is always 85°C ...

                        Nca78N 1 Reply Last reply
                        0
                        • carlekiC carleki

                          @fleinze
                          Hi, do you think it's possible to connect de Dallas sensor to pin 7, 8 and 9 of the arduino ?

                          Like this :

                          #define ONE_WIRE_BUS 8 // Pin where dallase sensor is connected
                          #define ONE_WIRE_GND 9
                          #define ONE_WIRE_VCC 7
                          

                          I have tried, and the temperature is always 85°C ...

                          Nca78N Offline
                          Nca78N Offline
                          Nca78
                          Hardware Contributor
                          wrote on last edited by
                          #26

                          Hello @carmelo42, pin 9 is supposed to be connected to the NRF24 (CE / Chip Enable) so it cannot work as ground for the sensor as it will be high (and so = to Vcc) most if not all of the time.

                          1 Reply Last reply
                          1
                          • F fleinze

                            I just added an 100uF capacitor to one of my sensors and put an old battery in. Let's see how much more life I can get out of this battery now.

                            F Offline
                            F Offline
                            flopp
                            wrote on last edited by
                            #27

                            @fleinze said:

                            I just added an 100uF capacitor to one of my sensors and put an old battery in. Let's see how much more life I can get out of this battery now.

                            Very interest work.
                            Is it still working?

                            F 1 Reply Last reply
                            0
                            • Moebius LutchingM Offline
                              Moebius LutchingM Offline
                              Moebius Lutching
                              wrote on last edited by
                              #28

                              There is a TI paper about adding a big capacitor in series with the coin-cell battery to minimize the voltage drop during high-current peaks: http://www.ti.com/lit/wp/swra349/swra349.pdf, also another interesting article related to low-power and CR2032: http://www.low-powerdesign.com/121312-article-extending-battery-life.htm

                              1 Reply Last reply
                              1
                              • F flopp

                                @fleinze said:

                                I just added an 100uF capacitor to one of my sensors and put an old battery in. Let's see how much more life I can get out of this battery now.

                                Very interest work.
                                Is it still working?

                                F Offline
                                F Offline
                                fleinze
                                wrote on last edited by
                                #29

                                @flopp I added the capacitor and put the old battery in. By old battery I mean the one I had replaced a week earlier for a new one. Sensor running smooth since, so great success!

                                F 1 Reply Last reply
                                2
                                • F fleinze

                                  @flopp I added the capacitor and put the old battery in. By old battery I mean the one I had replaced a week earlier for a new one. Sensor running smooth since, so great success!

                                  F Offline
                                  F Offline
                                  flopp
                                  wrote on last edited by
                                  #30

                                  @fleinze
                                  :thumbsup:

                                  1 Reply Last reply
                                  0
                                  • M Offline
                                    M Offline
                                    mihai.aldea
                                    wrote on last edited by
                                    #31

                                    The DS18B20+ is not a great sensor for the battery powered nodes. It has a huge conversion time comparing to others.
                                    9-bit resolution | 93.75 ms | 0.5°C
                                    10-bit resolution | 187.5 ms | 0.25°C
                                    11-bit resolution | 375 ms | 0.125°C
                                    12-bit resolution | 750 ms | 0.0625°C
                                    The last column is the sensor's precision. So unless you're OK with a 0.5°C steps, the simple usage of DS18B20+ will kill your battery a lot faster.
                                    Don't use DHT22, that one is very slow too. BME280 does have a barometric pressure sensor but it's not very fast either.
                                    The best sensor for battery powered nodes is the the Si7021 which is rather old, but is the fastest.

                                    1 Reply Last reply
                                    1
                                    • F Offline
                                      F Offline
                                      fleinze
                                      wrote on last edited by
                                      #32

                                      I put the arduino to sleep during the conversion time, so this is not a big issue. But I agree that the DS18B20 is not the best, but it is widely available. For newer nodes I try to use the Si7021 where possible.

                                      M T 2 Replies Last reply
                                      0
                                      • F fleinze

                                        I put the arduino to sleep during the conversion time, so this is not a big issue. But I agree that the DS18B20 is not the best, but it is widely available. For newer nodes I try to use the Si7021 where possible.

                                        M Offline
                                        M Offline
                                        mihai.aldea
                                        wrote on last edited by
                                        #33

                                        @fleinze said:

                                        I put the arduino to sleep during the conversion time, so this is not a big issue. But I agree that the DS18B20 is not the best, but it is widely available. For newer nodes I try to use the Si7021 where possible.

                                        It goes without saying that the nodes are in sleep mode between reports. However, the conversion time has a great impact in the cycle math. I won't say that pulling the readings 10 times faster will give you 10 times more time on battery but if you'll get 5 times more time then it's something. Not to mention that the Si7021 works down to 1.9V unlike the DS18B20+ which works down to only 3.0V.

                                        1 Reply Last reply
                                        0
                                        • F fleinze

                                          I put the arduino to sleep during the conversion time, so this is not a big issue. But I agree that the DS18B20 is not the best, but it is widely available. For newer nodes I try to use the Si7021 where possible.

                                          T Offline
                                          T Offline
                                          tango156157
                                          wrote on last edited by
                                          #34

                                          @fleinze Great work with the CR2032 coin cell temp. sensor. I am trying to do a similar exercise with Si7021 sensors but getting into issues while coding. The examples from other posts around Si7021 adapted for latest MySensor lib seem to get stuck in my IDE giving lot of errors. I have tried getting all the required Header files but still get stuck due to some random error. Is it possible for you to share your code based on CR2032 temp node running on Si7021? Thanks....

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


                                          15

                                          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