💬 Air Humidity Sensor


  • Admin

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



  • 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()'
    

  • Mod

    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



  • has any one been able to fix this error?


  • Mod

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



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



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



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



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



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



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



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



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



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



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



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


  • Mod

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



  • Where i can found good DHT library for this sketch ?


  • Mod

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



  • sorry i found


Log in to reply
 

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