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. Troubleshooting
  3. Resolved - 18650 battery powered temperature sensors

Resolved - 18650 battery powered temperature sensors

Scheduled Pinned Locked Moved Troubleshooting
14 Posts 3 Posters 4.4k Views 3 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.
  • rozpruwaczR Offline
    rozpruwaczR Offline
    rozpruwacz
    wrote on last edited by
    #2

    what are your resistor devider values ? your "Volts per bit" value sugests that the max voltage you can measure is 3.78V so I guess you have wrong division ratio. I would go for 1M and 1k ohms, then you can measure up to 12V.

    1 Reply Last reply
    0
    • rozpruwaczR Offline
      rozpruwaczR Offline
      rozpruwacz
      wrote on last edited by
      #3

      and also this may help :) https://en.wikipedia.org/wiki/Voltage_divider

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

        Look at my post about solar powered node, I explained how to measure higher input voltage

        1 Reply Last reply
        0
        • pihomeP Offline
          pihomeP Offline
          pihome
          wrote on last edited by
          #5

          after changing r2 to 1k ohms and volts per bit to 1.076344086 i m getting first reading is 34.44v and then 2.15, this is even more messed up.... :(

          float batteryV  = battSensorValue * 1.076344086;
          
          0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
          4 MCO:BGN:BFR
          65 TSM:INIT
          65 TSF:WUR:MS=0
          73 TSM:INIT:TSP OK
          75 TSM:INIT:STATID=25
          77 TSF:SID:OK,ID=25
          79 TSM:FPAR
          116 TSF:MSG:SEND,25-25-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
          438 TSF:MSG:READ,0-0-25,s=255,c=3,t=8,pt=1,l=1,sg=0:0
          444 TSF:MSG:FPAR OK,ID=0,D=1
          2125 TSM:FPAR:OK
          2125 TSM:ID
          2127 TSM:ID:OK
          2129 TSM:UPL
          2164 TSF:MSG:SEND,25-25-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
          2355 TSF:MSG:READ,0-0-25,s=255,c=3,t=25,pt=1,l=1,sg=0:1
          2361 TSF:MSG:PONG RECV,HP=1
          2365 TSM:UPL:OK
          2365 TSM:READY:ID=25,PAR=0,DIS=1
          2371 TSF:MSG:SEND,25-25-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
          2506 TSF:MSG:READ,0-0-25,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
          2514 TSF:MSG:SEND,25-25-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.1.1
          2525 TSF:MSG:SEND,25-25-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
          4534 TSF:MSG:SEND,25-25-0-0,s=255,c=3,t=11,pt=0,l=18,sg=0,ft=0,st=OK:Temperature Sensor
          4544 TSF:MSG:SEND,25-25-0-0,s=255,c=3,t=12,pt=0,l=4,sg=0,ft=0,st=OK:1.34
          4554 TSF:MSG:SEND,25-25-0-0,s=0,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=OK:
          4562 MCO:REG:REQ
          4564 TSF:MSG:SEND,25-25-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
          4841 TSF:MSG:READ,0-0-25,s=255,c=3,t=27,pt=1,l=1,sg=0:1
          4847 MCO:PIM:NODE REG=1
          4849 MCO:BGN:STP
          4851 MCO:BGN:INIT OK,TSP=1
          Pin Reading: 32
          Battery Voltage: 34.44 v
          Battery percent: 3 %
          4859 TSF:MSG:SEND,25-25-0-0,s=1,c=1,t=38,pt=7,l=5,sg=0,ft=0,st=OK:34.44
          4870 TSF:MSG:SEND,25-25-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:3
          4878 MCO:SLP:MS=750,SMS=0,I1=255,M1=255,I2=255,M2=255
          4884 MCO:SLP:TPD
          4886 MCO:SLP:WUP=-1
          4919 TSF:MSG:SEND,25-25-0-0,s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:19.7
          4927 MCO:SLP:MS=56000,SMS=0,I1=255,M1=255,I2=255,M2=255
          4933 MCO:SLP:TPD
          4935 MCO:SLP:WUP=-1
          Pin Reading: 2
          Battery Voltage: 2.15 v
          Battery percent: 0 %
          4941 TSF:MSG:SEND,25-25-0-0,s=1,c=1,t=38,pt=7,l=5,sg=0,ft=0,st=OK:2.15
          4952 TSF:MSG:SEND,25-25-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:0
          4960 MCO:SLP:MS=750,SMS=0,I1=255,M1=255,I2=255,M2=255
          4966 MCO:SLP:TPD
          4968 MCO:SLP:WUP=-1
          5001 TSF:MSG:SEND,25-25-0-0,s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:19.5
          5009 MCO:SLP:MS=56000,SMS=0,I1=255,M1=255,I2=255,M2=255
          5015 MCO:SLP:TPD
          

          PiHome - Smart Heating Control

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

            I used R1 1.22M (1M + 220K) and R2 300K in order to read a maximum of 5.57v

            ((1e6+220e3+300e3)/300e3)*1.1 = Vmax = 5.57 Volts
            5.57/1023 = Volts per bit = 0.005448028

            1 Reply Last reply
            0
            • pihomeP Offline
              pihomeP Offline
              pihome
              wrote on last edited by
              #7

              Do you have 1m and 220k in series?

              PiHome - Smart Heating Control

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

                Yes of course. Use the following link to find the most suitable divider for the resistor you have, just remember to keep output voltage to 1.1 http://www.ohmslawcalculator.com/voltage-divider-calculator

                1 Reply Last reply
                0
                • pihomeP pihome

                  after changing r2 to 1k ohms and volts per bit to 1.076344086 i m getting first reading is 34.44v and then 2.15, this is even more messed up.... :(

                  float batteryV  = battSensorValue * 1.076344086;
                  
                  0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
                  4 MCO:BGN:BFR
                  65 TSM:INIT
                  65 TSF:WUR:MS=0
                  73 TSM:INIT:TSP OK
                  75 TSM:INIT:STATID=25
                  77 TSF:SID:OK,ID=25
                  79 TSM:FPAR
                  116 TSF:MSG:SEND,25-25-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
                  438 TSF:MSG:READ,0-0-25,s=255,c=3,t=8,pt=1,l=1,sg=0:0
                  444 TSF:MSG:FPAR OK,ID=0,D=1
                  2125 TSM:FPAR:OK
                  2125 TSM:ID
                  2127 TSM:ID:OK
                  2129 TSM:UPL
                  2164 TSF:MSG:SEND,25-25-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
                  2355 TSF:MSG:READ,0-0-25,s=255,c=3,t=25,pt=1,l=1,sg=0:1
                  2361 TSF:MSG:PONG RECV,HP=1
                  2365 TSM:UPL:OK
                  2365 TSM:READY:ID=25,PAR=0,DIS=1
                  2371 TSF:MSG:SEND,25-25-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
                  2506 TSF:MSG:READ,0-0-25,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
                  2514 TSF:MSG:SEND,25-25-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.1.1
                  2525 TSF:MSG:SEND,25-25-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
                  4534 TSF:MSG:SEND,25-25-0-0,s=255,c=3,t=11,pt=0,l=18,sg=0,ft=0,st=OK:Temperature Sensor
                  4544 TSF:MSG:SEND,25-25-0-0,s=255,c=3,t=12,pt=0,l=4,sg=0,ft=0,st=OK:1.34
                  4554 TSF:MSG:SEND,25-25-0-0,s=0,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=OK:
                  4562 MCO:REG:REQ
                  4564 TSF:MSG:SEND,25-25-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
                  4841 TSF:MSG:READ,0-0-25,s=255,c=3,t=27,pt=1,l=1,sg=0:1
                  4847 MCO:PIM:NODE REG=1
                  4849 MCO:BGN:STP
                  4851 MCO:BGN:INIT OK,TSP=1
                  Pin Reading: 32
                  Battery Voltage: 34.44 v
                  Battery percent: 3 %
                  4859 TSF:MSG:SEND,25-25-0-0,s=1,c=1,t=38,pt=7,l=5,sg=0,ft=0,st=OK:34.44
                  4870 TSF:MSG:SEND,25-25-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:3
                  4878 MCO:SLP:MS=750,SMS=0,I1=255,M1=255,I2=255,M2=255
                  4884 MCO:SLP:TPD
                  4886 MCO:SLP:WUP=-1
                  4919 TSF:MSG:SEND,25-25-0-0,s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:19.7
                  4927 MCO:SLP:MS=56000,SMS=0,I1=255,M1=255,I2=255,M2=255
                  4933 MCO:SLP:TPD
                  4935 MCO:SLP:WUP=-1
                  Pin Reading: 2
                  Battery Voltage: 2.15 v
                  Battery percent: 0 %
                  4941 TSF:MSG:SEND,25-25-0-0,s=1,c=1,t=38,pt=7,l=5,sg=0,ft=0,st=OK:2.15
                  4952 TSF:MSG:SEND,25-25-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:0
                  4960 MCO:SLP:MS=750,SMS=0,I1=255,M1=255,I2=255,M2=255
                  4966 MCO:SLP:TPD
                  4968 MCO:SLP:WUP=-1
                  5001 TSF:MSG:SEND,25-25-0-0,s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:19.5
                  5009 MCO:SLP:MS=56000,SMS=0,I1=255,M1=255,I2=255,M2=255
                  5015 MCO:SLP:TPD
                  
                  rozpruwaczR Offline
                  rozpruwaczR Offline
                  rozpruwacz
                  wrote on last edited by
                  #9

                  @pihome sorry, I meant 100kOhm. I would suggest You to understand the theory behind the voltage divider, then you would know what you are doing and be able to solve your problem by yourself. This is just one simple formula, not magic.

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

                    I started to punch in resistor values more or less randomly of various combinations of the resistors I had until I got close enough to the maximum input voltage I wanted to have

                    1 Reply Last reply
                    0
                    • pihomeP Offline
                      pihomeP Offline
                      pihome
                      wrote on last edited by
                      #11

                      thank you guys for help, really appreciate this. for 18650 battery with 4.2volt in following combination would do the job for you, i m adding here so in future if some one wants reference and save some time on trial and error. @rozpruwacz i m using your idea with 1m and 100k thank you for help.

                      620k
                      220k
                      1.1v out

                      470k
                      170k
                      1.116v out

                      1m
                      355k
                      1.1v out

                      220k
                      80k
                      1.12v out

                      680k
                      270k
                      1.194v out

                      390k
                      150k
                      1.167v out

                      330k
                      120k
                      1.12v out

                      270k
                      100k
                      1.135v out

                      PiHome - Smart Heating Control

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

                        Try to use the highest total resistance in order to lower the battery drain as much as possible

                        pihomeP 1 Reply Last reply
                        0
                        • gohanG gohan

                          Try to use the highest total resistance in order to lower the battery drain as much as possible

                          pihomeP Offline
                          pihomeP Offline
                          pihome
                          wrote on last edited by
                          #13

                          @gohan i m using 1m with 100k but second best combination would be then 620k with 220k ?

                          PiHome - Smart Heating Control

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

                            Yes, but there could be also other combinations that will allow you to detect higher voltage but with an higher total resistance

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


                            12

                            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