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. 💬 Air Humidity Sensor - DHT

💬 Air Humidity Sensor - DHT

Scheduled Pinned Locked Moved Announcements
149 Posts 48 Posters 47.9k Views 38 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.
  • rsalmonR rsalmon

    bonjour , quel library DHT utilisez vous ? j'ai un probleme de compilation

    Arduino:1.6.10 (Windows 10), Carte : "Arduino Pro or Pro Mini, ATmega328 (3.3V, 8 MHz)"

    ATTENTION . Définition sur : 'Uncategorized'
    air_temp:73: error: no matching function for call to 'DHT::DHT()'
    
     DHT dht;
    
         ^
    
    C:\Users\rsalmon\Documents\Arduino\air_temp\air_temp.ino:73:5: note: candidates are:
    
    In file included from C:\Users\rsalmon\Documents\Arduino\air_temp\air_temp.ino:44:0:
    
    C:\Users\rsalmon\Documents\Arduino\libraries\DHT-sensor-library-master/DHT.h:40:4: note: DHT::DHT(uint8_t, uint8_t, uint8_t)
    
        DHT(uint8_t pin, uint8_t type, uint8_t count=6);
    
        ^
    
    C:\Users\rsalmon\Documents\Arduino\libraries\DHT-sensor-library-master/DHT.h:40:4: note:   candidate expects 3 arguments, 0 provided
    
    C:\Users\rsalmon\Documents\Arduino\libraries\DHT-sensor-library-master/DHT.h:38:7: note: constexpr DHT::DHT(const DHT&)
    
     class DHT {
    
           ^
    
    C:\Users\rsalmon\Documents\Arduino\libraries\DHT-sensor-library-master/DHT.h:38:7: note:   candidate expects 1 argument, 0 provided
    
    C:\Users\rsalmon\Documents\Arduino\libraries\DHT-sensor-library-master/DHT.h:38:7: note: constexpr DHT::DHT(DHT&&)
    
    C:\Users\rsalmon\Documents\Arduino\libraries\DHT-sensor-library-master/DHT.h:38:7: note:   candidate expects 1 argument, 0 provided
    
    C:\Users\rsalmon\Documents\Arduino\air_temp\air_temp.ino: In function 'void setup()':
    
    air_temp:91: error: 'class DHT' has no member named 'setup'
    
       dht.setup(DHT_DATA_PIN); // set data pin of DHT sensor
    
           ^
    
    air_temp:92: error: 'class DHT' has no member named 'getMinimumSamplingPeriod'
    
       if (UPDATE_INTERVAL <= dht.getMinimumSamplingPeriod()) {
    
                                  ^
    
    air_temp:97: error: 'class DHT' has no member named 'getMinimumSamplingPeriod'
    
       sleep(dht.getMinimumSamplingPeriod());
    
                 ^
    
    C:\Users\rsalmon\Documents\Arduino\air_temp\air_temp.ino: In function 'void loop()':
    
    air_temp:104: error: 'class DHT' has no member named 'readSensor'
    
       dht.readSensor(true);
    
           ^
    
    air_temp:107: error: 'class DHT' has no member named 'getTemperature'
    
       float temperature = dht.getTemperature();
    
                               ^
    
    air_temp:114: error: 'class DHT' has no member named 'toFahrenheit'
    
           temperature = dht.toFahrenheit(temperature);
    
                             ^
    
    air_temp:131: error: 'class DHT' has no member named 'getHumidity'
    
       float humidity = dht.getHumidity();
    
                            ^
    
    no matching function for call to 'DHT::DHT()'
    
    mfalkviddM Offline
    mfalkviddM Offline
    mfalkvidd
    Mod
    wrote on last edited by mfalkvidd
    #3

    Welcome to the MySensors community, @rsalmon

    You need to use the DHT library included in the MySensors examples. See https://forum.mysensors.org/topic/4672/dht-sketch-version-2-0-0-error-solved/

    Please use english when contributing in the foums, see https://forum.mysensors.org/topic/610/forum-user-guidelines

    1 Reply Last reply
    1
    • phillipP Offline
      phillipP Offline
      phillip
      wrote on last edited by
      #4

      has any one been able to fix this error?

      mfalkviddM 1 Reply Last reply
      0
      • phillipP phillip

        has any one been able to fix this error?

        mfalkviddM Offline
        mfalkviddM Offline
        mfalkvidd
        Mod
        wrote on last edited by
        #5

        @phillip yes, by following the instructions given in my post above.

        1 Reply Last reply
        1
        • carlosC Offline
          carlosC Offline
          carlos
          wrote on last edited by
          #6

          I was looking for examples on mysensors 2.0 having several sensors in the same node and this sketch looks very iteresting.
          Thanks

          1 Reply Last reply
          0
          • T Offline
            T Offline
            thomas schneider
            wrote on last edited by
            #7

            Hi everybody,

            I try to uploaded the sketch on my arduino nano and I have an error with this line :dht.readSensor(true);

            When I delete this line I have no error on the upload but the senosr has no refresh...

            carlosC 1 Reply Last reply
            0
            • T thomas schneider

              Hi everybody,

              I try to uploaded the sketch on my arduino nano and I have an error with this line :dht.readSensor(true);

              When I delete this line I have no error on the upload but the senosr has no refresh...

              carlosC Offline
              carlosC Offline
              carlos
              wrote on last edited by
              #8

              @thomas-schneider
              Did you see the comments from Mikael?. Do you have the DHT library?.
              What does the error say?

              1 Reply Last reply
              0
              • T Offline
                T Offline
                thomas schneider
                wrote on last edited by
                #9

                Yes I saw the comments of Mickael. But sorry, I didn't understand how to download the library. Now all is done and ok ! We need to come back and download the entire folder. Why this library is not in mysensors library ? It's not easy for a newbie.

                Thanks for the support and congratulations for the website.

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

                  Can anyone please show how to connect more than one DHT with this sketch? What needs changing in the code? (I am OK with the hardware side of things).

                  Once I have an example I can work the rest out but at the moment this bit baffles me! ;)

                  Thank you :)

                  1 Reply Last reply
                  0
                  • mikeSM Offline
                    mikeSM Offline
                    mikeS
                    wrote on last edited by
                    #11

                    @skywatch
                    I know what you mean, I was having the very same trouble with relay actuators, and that's where your solution lies. There is a sketch that allows you to name the number of relays, and then the sketch automatically names the children, you should be able to modify that, (or at least get an idea of how you have multiples of the same sensor on the same board) to add as many dht's as you have spare digital pins on your arduino. Good luck, hours of fun lies ahead ;)

                    1 Reply Last reply
                    0
                    • tianaT Offline
                      tianaT Offline
                      tiana
                      wrote on last edited by
                      #12

                      Is exist some way to calibrate DHT sensors? today i make a experiment assemble 5 nodes with 5 DHT11 sensors put all nodes on one table and leave them for some hours, and the result is the every sensor give different values about temperature and humidity + - MAX 5 degree Celsius around the real temperature in the room. Hardware used Arduino Nano X 5pc., HDT11 X 5pc., the power supply is 12V 2,2A enough to power all of the arduinos.

                      1 Reply Last reply
                      0
                      • AndurilA Offline
                        AndurilA Offline
                        Anduril
                        wrote on last edited by
                        #13

                        @tiana well you could simply calibrate the value you get in your sketch for every DHT on it's own. But you have to do a calibraton, meaning measure all of them at multiple temperatures and humidities.
                        If it's only a offset you can also use

                        // Set this offset if the sensor has a permanent small offset to the real temperatures
                        #define SENSOR_TEMP_OFFSET 0
                        

                        to correct for this, otherwise you have to implement your calibration function on your own.

                        1 Reply Last reply
                        0
                        • tianaT Offline
                          tianaT Offline
                          tiana
                          wrote on last edited by
                          #14

                          For some sensors is possible to make with offset, but some of the sensors changing their values 2 times in minute with + - 2 degree Celsius some times show more sometimes show less.

                          1 Reply Last reply
                          0
                          • AndurilA Offline
                            AndurilA Offline
                            Anduril
                            wrote on last edited by
                            #15

                            well I think this kind of noise can not be calibrated. I thought they all have different values, but with offset, linear oder squared function for deviation.

                            1 Reply Last reply
                            0
                            • tianaT Offline
                              tianaT Offline
                              tiana
                              wrote on last edited by
                              #16

                              I read datasheet for DHT11 and 2 degree deviation is ok for them. Now i playing with DHT22 I try this #define SENSOR_TEMP_OFFSET -1.3, but nothing is changed the sensor still give me same value.

                              mfalkviddM 1 Reply Last reply
                              0
                              • tianaT tiana

                                I read datasheet for DHT11 and 2 degree deviation is ok for them. Now i playing with DHT22 I try this #define SENSOR_TEMP_OFFSET -1.3, but nothing is changed the sensor still give me same value.

                                mfalkviddM Offline
                                mfalkviddM Offline
                                mfalkvidd
                                Mod
                                wrote on last edited by
                                #17

                                @tiana try setting SENSOR_TEMP_OFFSET to a really big value, for example -30.8 to make sure that the change is large enough to be noticeable.

                                1 Reply Last reply
                                0
                                • pepsonP Offline
                                  pepsonP Offline
                                  pepson
                                  wrote on last edited by
                                  #18

                                  Where i can found good DHT library for this sketch ?

                                  mfalkviddM 1 Reply Last reply
                                  0
                                  • pepsonP pepson

                                    Where i can found good DHT library for this sketch ?

                                    mfalkviddM Offline
                                    mfalkviddM Offline
                                    mfalkvidd
                                    Mod
                                    wrote on last edited by
                                    #19

                                    @pepson how about the library linked from the build page?

                                    1 Reply Last reply
                                    0
                                    • pepsonP Offline
                                      pepsonP Offline
                                      pepson
                                      wrote on last edited by
                                      #20

                                      sorry i found

                                      1 Reply Last reply
                                      1
                                      • Jim DanforthJ Offline
                                        Jim DanforthJ Offline
                                        Jim Danforth
                                        wrote on last edited by
                                        #21

                                        Using library linked above
                                        Getting: no matching function for call to 'DHT::readSensor(bool)'

                                        1 Reply Last reply
                                        0
                                        • hekH hek

                                          This thread contains comments for the article "Air Humidity Sensor - DHT" posted on MySensors.org.

                                          ramoncarranzaR Offline
                                          ramoncarranzaR Offline
                                          ramoncarranza
                                          wrote on last edited by
                                          #22

                                          @hek
                                          hi, how do I change the readings from C to F?
                                          My sensor works fine, by I get the readings I celsius

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


                                          11

                                          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