The class is based upon earlier work of George Hadjikyriacou and augmented by SimKard and RobTillaart. The main difference with other DHT11 classes is the support of two dewpoint() formulas, one as used by the NOAA and another faster and smaller one. The price for this is an inaccuracy of max 0.6544 C which is lower than the accuracy of the DHT11 sensor itself. The library is tested on an MEGA2560.
For positive temp values the library might be compatible with the DHT22, but this is not tested.
What platform do you intend to use it? The lib is just released and not tested on an UNO/2009. I hope you will provide feedback so I can improve the lib if needed.
The new 0.3.2 version is giving erroneous results:
Read sensor: OK
Humidity (%): 11110
Temperature (oC): 11100
Temperature (oF): 82.40
Temperature (K): 301.15
Dew Point (oC): 8.83
Dew PointFast (oC): 8.79
Strange that both values read as BINARY. When I make a decimal representation of they are realistic values. I'think it is a minor issue in the test application, I'll dive into it.
Humidity (%): 11110 = 30
Temperature (oC): 11100 = 28
This is confirmed by the value for Fahrenheid() and Dewpoint()
is 28 C a reasonable value for you? I don't know where you live, but for me it is not an extreme
Update
It is a bug in the example sketch. The integer value is presented as BINARY as the value 2 in the println statement is interpreted as the BINARY flag for integers iso 2 decimal places for a float. A cast is needed.
replace the corresponding lines in the test app to :
I'm working with Arduino mega 2560 and dht11 sensor. I have tried the code (0.3.2 version). It work without error, but, unfortunately the measurement don't work and seem to be constant all the time (also the temperature reading is out of measurement range). Here is the results of my measurement (from serial monitor).
Read sensor: OK
Humidity (%): 66.00
Temperature (oC): 60.00
Temperature (oF): 140.00
Temperature (K): 333.15
Dew Point (oC): 51.24
Dew PointFast (oC): 51.29
I bought the sensor 2 weeks ago, and I have used it since yesterday. I tested the sensor using this code DHT11_Temperature_and_Humidity_Sensor__SKU__DFR0067_-DFRobot
before I tested your code on dht11 sensor. I don't know, may be something happen to my sensor or i miss something in the code.
Perhaps someone can help me clearing this problem. I would be thankful
what was the real temperature? / how far was the measurement off ?
was the humidity right?
what was the output of the other sketch from dfrobot?
if you breath to the sensor does the values change?
if so how?
can you measure the voltage applied to the sensor?
are you sure you have a DHT11? A DHT22 looks the same, talks the same but data must be interpreted differently
you can test this with - Arduino Playground - DHTLib -
These questions help me to get a better picture what could cause the readings.
regards,
Rob
what was the real temperature? / how far was the measurement off ?
the real temperature is about 25OC, and the measurement off is about 60 - 25 C = 35 C.
was the humidity right?
the real humidity is about 80%.
what was the output of the other sketch from dfrobot?
The output was error status, because I didn't use sensor shield as the recommendation.
if you breath to the sensor does the values change?
if so how?
I have tried to do that, but the reading temperature and humidity doesn't change, even I use my laptop exhaust.
can you measure the voltage applied to the sensor?
Ya, I checked the sensor voltage (GND & Signal) and the power pin (VCC & GND). Both of them had same voltage, about 4.96 V.
are you sure you have a DHT11? A DHT22 looks the same, talks the same but data must be interpreted differently
you can test this with - Arduino Playground - DHTLib -
I am pretty sure that my sensor is DHT11 (as written in the sensor board). I have tried DHTLib from Arduino Playground - DHTLib, and the result didn't change at all, temperature 60 C and humidity 66 %.
I also read digital signal from the sensor using basic example from arduino DigitalReadSerial (without delay), and the result in serial monitor is 1111111 all the time.
Hi Rob,
Thanks for your help and guidance.
Yesterday, I did the measurement using Arduino Duemilanove, but the results still didn't change at all. Also, it didn't work with another pin on my MEGA.
Luckily, another dht11 sensor came yesterday. I tried the new dht11, and voila! it works
I think the problem is the sensor. When I uploaded code from DFrobot (that suggest to use sensor shield), I forgot to unplug my dht11 signal wire from arduino digital pin. And my guest, the dht11 ADC was damaged when I uploaded the code. I don't want to verify my guess, but if that (the problem) happen to someone, please let the others know for verification by posting in this forum. I would be thankful
thom--s:
I don't know, may be something happen to my sensor or i miss something in the code.
Perhaps someone can help me clearing this problem. I would be thankful
Regards,
Thoms
You've installed the required pull-up resistor on the sensor?
depends on the length of the wires, that said - I never used pull ups for my DHT22 (OK not a DHT11, but electrically similar) but my max length was approx 10 cm or 4inch