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. Announcements
  3. 💬 Temperature Sensor

💬 Temperature Sensor

Scheduled Pinned Locked Moved Announcements
171 Posts 40 Posters 54.8k Views 36 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.
  • mrwombleM mrwomble

    Hi there, I'm new to Mysensors and I thought I'd start with a simple DS Temp sensor. However, I'm getting compile errors when I try compile it. Can someone please point me in the right direction?

    Arduino: 1.6.11 (Windows 7), Board: "Arduino Nano, ATmega328"
    
    WARNING: Category 'Sensor' in library DallasTemperature is not valid. Setting to 'Uncategorized'
    In file included from C:\Users\Admin\Documents\Arduino\Projects\MS Temp sensor node\DallasTemperatureSensor\DallasTemperatureSensor.ino:37:0:
    
    C:\Users\Admin\Documents\Arduino\libraries\DallasTemperature/DallasTemperature.h: In function 'void loop()':
    
    C:\Users\Admin\Documents\Arduino\libraries\DallasTemperature/DallasTemperature.h:249:13: error: 'int16_t DallasTemperature::millisToWaitForConversion(uint8_t)' is private
    
         int16_t millisToWaitForConversion(uint8_t);
    
                 ^
    
    DallasTemperatureSensor:85: error: within this context
    
       int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution());
    
                                                                                         ^
    
    Multiple libraries were found for "DallasTemperature.h"
     Used: C:\Users\Admin\Documents\Arduino\libraries\DallasTemperature
     Not used: C:\Users\Admin\Documents\Arduino\libraries\Arduino-Temperature-Control-Library-master
    exit status 1
    within this context
    
    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.
    
    S Offline
    S Offline
    sjoerd14
    wrote on last edited by sjoerd14
    #143

    regarding error:

    C:\Users\Admin\Documents\Arduino\libraries\DallasTemperature/DallasTemperature.h:249:13: error: 'int16_t DallasTemperature::millisToWaitForConversion(uint8_t)' is private

    In the latest version of Miles Burton's the function is public and compiling fine.
    https://github.com/milesburton/Arduino-Temperature-Control-Library

    You can import the Lib as zip.
    You have to remove \ archive the lib: ...\libraries\DallasTemperature

    mfalkviddM 1 Reply Last reply
    1
    • S sjoerd14

      regarding error:

      C:\Users\Admin\Documents\Arduino\libraries\DallasTemperature/DallasTemperature.h:249:13: error: 'int16_t DallasTemperature::millisToWaitForConversion(uint8_t)' is private

      In the latest version of Miles Burton's the function is public and compiling fine.
      https://github.com/milesburton/Arduino-Temperature-Control-Library

      You can import the Lib as zip.
      You have to remove \ archive the lib: ...\libraries\DallasTemperature

      mfalkviddM Online
      mfalkviddM Online
      mfalkvidd
      Mod
      wrote on last edited by
      #144

      @sjoerd14 yes, thanks to MySensors user David Ducatel. The change is tracked in https://github.com/mysensors/MySensorsArduinoExamples/issues/20 and https://github.com/milesburton/Arduino-Temperature-Control-Library/pull/72 but we're still waiting for an official release of milesburton's library.

      1 Reply Last reply
      1
      • nofoxN Offline
        nofoxN Offline
        nofox
        wrote on last edited by
        #145

        Hi, I have few in wall nodes mounted under the light switches. I have two relays and one DS18B20 in each node. When i'm turning light on, switching the relay, the DS18B20 readings jumping about 0.8 degrees celsius up. When I switch off the relay readings back to normal. Anyone have similar problems ? Sensors are away from from node board, relays etc. so it's not about the heat from atmega or relays.

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

          Is the temperature gradually rising after the relay is activated or it is instantly jumping 0.8°?

          1 Reply Last reply
          0
          • nofoxN Offline
            nofoxN Offline
            nofox
            wrote on last edited by
            #147

            Jumping 0.8 immediately after switching the relay and sometimes rising very slow during the time when relay is on.

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

              That makes it quite difficult to figure out the problem. Can you make another node with same setup and see if you get the same results and if you do try unplug the relay and see what happens

              1 Reply Last reply
              0
              • skywatchS Offline
                skywatchS Offline
                skywatch
                wrote on last edited by skywatch
                #149

                It's probably a voltage drop from the psu when the relay is engaged and drawing current. That will cause the output voltage to dip slightly.

                If it is only momentary you can add a beefy capacitor across the power supply, but if the readings change for the whole time the relay is on, you really need to replace the relay with something that uses less power (triac/mosfet??) - Or get a more stable power supply with good regulation.

                A final thing might be more noise on the power line with the psu sending more current with the relay on. again a smoothing capacitor would help if this were the case.

                You could also try looking into the wiring and see if the relay cables and the ds18b20 cables are far enough apart, some induction might be going on there between the cables. Also, make sure everything goes back to a single ground point. I can't imagine how an earth loop would cause what you describe, but it's always a good thing to do.....

                Another thought to think about is matbe the magnetic field from the relap power cables are inducing into the sensor cables.

                1 Reply Last reply
                0
                • ben999B Offline
                  ben999B Offline
                  ben999
                  wrote on last edited by
                  #150

                  Hi
                  Can we talk about redundancy please? What if one or more sensor fail on a one-wire bus? Would it make the whole line unusable?
                  As part of a central heating MySensorization i would like to have groups of 3 sensors and have some sort of redundancy check.
                  Would i be allowed to run multiple one-wire busses on a single arduino?
                  Thanks a lot foryour help

                  mfalkviddM 1 Reply Last reply
                  0
                  • ben999B ben999

                    Hi
                    Can we talk about redundancy please? What if one or more sensor fail on a one-wire bus? Would it make the whole line unusable?
                    As part of a central heating MySensorization i would like to have groups of 3 sensors and have some sort of redundancy check.
                    Would i be allowed to run multiple one-wire busses on a single arduino?
                    Thanks a lot foryour help

                    mfalkviddM Online
                    mfalkviddM Online
                    mfalkvidd
                    Mod
                    wrote on last edited by
                    #151

                    @ben999 you can have as many onewire buses as you have digital pins. Just add more of these:

                    #define ONE_WIRE_BUS 3 // Pin where dallase sensor is connected 
                    OneWire oneWire(ONE_WIRE_BUS);
                    
                    ben999B 1 Reply Last reply
                    1
                    • mfalkviddM mfalkvidd

                      @ben999 you can have as many onewire buses as you have digital pins. Just add more of these:

                      #define ONE_WIRE_BUS 3 // Pin where dallase sensor is connected 
                      OneWire oneWire(ONE_WIRE_BUS);
                      
                      ben999B Offline
                      ben999B Offline
                      ben999
                      wrote on last edited by
                      #152

                      @mfalkvidd thanks a lot. Yes, that looks good to me. I will have a go.

                      The real big question now is about what happens when one or more sensor fails on the line.
                      I am not talking about removing a sensor, which doesn't produce any fault.
                      My concern is how does a DS18 ends its life under normal operation? Complete shortcut?

                      mfalkviddM zboblamontZ 2 Replies Last reply
                      0
                      • ben999B ben999

                        @mfalkvidd thanks a lot. Yes, that looks good to me. I will have a go.

                        The real big question now is about what happens when one or more sensor fails on the line.
                        I am not talking about removing a sensor, which doesn't produce any fault.
                        My concern is how does a DS18 ends its life under normal operation? Complete shortcut?

                        mfalkviddM Online
                        mfalkviddM Online
                        mfalkvidd
                        Mod
                        wrote on last edited by
                        #153

                        @ben999 I don't think there are any guarantees on how it will fail. If there are, the datasheet should list them.

                        ben999B 1 Reply Last reply
                        0
                        • ben999B ben999

                          @mfalkvidd thanks a lot. Yes, that looks good to me. I will have a go.

                          The real big question now is about what happens when one or more sensor fails on the line.
                          I am not talking about removing a sensor, which doesn't produce any fault.
                          My concern is how does a DS18 ends its life under normal operation? Complete shortcut?

                          zboblamontZ Offline
                          zboblamontZ Offline
                          zboblamont
                          wrote on last edited by
                          #154

                          @ben999 I cannot remember WHERE I read it, but if a DS18B20 fails it will either send impossible results when addressed or fail to be addressed at all as it is digitally addressed. Only cable short circuits can pull the entire chain down, as I found out when two socket pins had crossed over (sensor crimped into telephone plugs).

                          1 Reply Last reply
                          0
                          • mfalkviddM mfalkvidd

                            @ben999 I don't think there are any guarantees on how it will fail. If there are, the datasheet should list them.

                            ben999B Offline
                            ben999B Offline
                            ben999
                            wrote on last edited by
                            #155

                            @mfalkvidd thank you for the idea. Had a look (boooooring reading for me :D ) but no mention to failiure

                            @zboblamont you're right. Seems that a faulty sensor return "85" (top of my head). And a "dead" sensor looses its bus address (next sensor on the chain takes its address and so on)

                            Thanks a lot gentlemen :)

                            rejoe2R 1 Reply Last reply
                            0
                            • ben999B ben999

                              @mfalkvidd thank you for the idea. Had a look (boooooring reading for me :D ) but no mention to failiure

                              @zboblamont you're right. Seems that a faulty sensor return "85" (top of my head). And a "dead" sensor looses its bus address (next sensor on the chain takes its address and so on)

                              Thanks a lot gentlemen :)

                              rejoe2R Offline
                              rejoe2R Offline
                              rejoe2
                              wrote on last edited by
                              #156

                              @ben999 said in 💬 Temperature Sensor:

                              And a "dead" sensor looses its bus address (next sensor on the chain takes its address and so on)

                              That's not exactly right. Each of the 1-wire devices uses a hardcoded, unique address that can not be changed.
                              So if you use the standard sketch with multiple DS18B20, in case of detached or replaced sensors you may get reported the measured temperatures comming from the same physical DS18B20 device under a different ChildID (after node reboot). To avoid effects like that, one has to take additional measures as described here . In short:

                              • Use an array with the physical ID's to address them
                              • Store a hash-array (done automatically) to identify "known" physical ID's that have once been attached to the bus as well as the ChildID used for MySensors.

                              Controller: FHEM; MySensors: 2.3.1, RS485,nRF24,RFM69, serial Gateways

                              ben999B 1 Reply Last reply
                              2
                              • rejoe2R rejoe2

                                @ben999 said in 💬 Temperature Sensor:

                                And a "dead" sensor looses its bus address (next sensor on the chain takes its address and so on)

                                That's not exactly right. Each of the 1-wire devices uses a hardcoded, unique address that can not be changed.
                                So if you use the standard sketch with multiple DS18B20, in case of detached or replaced sensors you may get reported the measured temperatures comming from the same physical DS18B20 device under a different ChildID (after node reboot). To avoid effects like that, one has to take additional measures as described here . In short:

                                • Use an array with the physical ID's to address them
                                • Store a hash-array (done automatically) to identify "known" physical ID's that have once been attached to the bus as well as the ChildID used for MySensors.
                                ben999B Offline
                                ben999B Offline
                                ben999
                                wrote on last edited by
                                #157

                                @rejoe2 oooooooooh great! thanks a lot, exactly what i was looking for !!!

                                rejoe2R 1 Reply Last reply
                                0
                                • ben999B ben999

                                  @rejoe2 oooooooooh great! thanks a lot, exactly what i was looking for !!!

                                  rejoe2R Offline
                                  rejoe2R Offline
                                  rejoe2
                                  wrote on last edited by
                                  #158

                                  @ben999 You are welcome :grinning:

                                  Controller: FHEM; MySensors: 2.3.1, RS485,nRF24,RFM69, serial Gateways

                                  1 Reply Last reply
                                  0
                                  • P Offline
                                    P Offline
                                    pintman
                                    wrote on last edited by
                                    #159

                                    When I try to compile the sketch for an ESP8266 I get an error in DallasTemperature.h which results in an error in OneWire.h

                                    OneWire.h:108:2: error: #error "Please define I/O register types here"  #error "Please define I/O register types here"
                                    

                                    Is it possible to make the sensor run on an ESP?

                                    1 Reply Last reply
                                    0
                                    • cashew75C Offline
                                      cashew75C Offline
                                      cashew75
                                      wrote on last edited by
                                      #160

                                      Hi, I'm having a hard time getting this Temperatursensor to work with Home Assistant. When i start it it doesn't register with the HA. If I use the same hardware and switch out the sensor to a DHT sensor (new sketch of course) then it works out of the box, HA sees the sensor. I've tried changing the Dallas DS18B20, but nothing. If i look at the logs the gateway have no problem with the sensor. Is there something in the code for the sensor that doesn't add up to it being presented to HA in the right way? I'm quite the newbie when it comes to programming.

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

                                        Have you tried another controller like mycontroller?

                                        cashew75C 1 Reply Last reply
                                        0
                                        • gohanG gohan

                                          Have you tried another controller like mycontroller?

                                          cashew75C Offline
                                          cashew75C Offline
                                          cashew75
                                          wrote on last edited by
                                          #162

                                          @gohan No I have not. I have a RF-Link also connected to the HA and it's working great. As I said, if I use the same hardware that I used to control the Dallas sensor and change the sensor to a DHT sensor the DHT sensor is accepted by HA and shows up as a sensor. That's why I was asking if there is something in the code for the Temperature sensor sketch that has to be changed to be able to present it to HA.

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


                                          22

                                          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