DHT11 Temp and Humidity Sensor

I am trying to use the DHT11(http://www.robotshop.com/dfrobot-dht11-temperature-and-humidity-sensor-2.html) with my Arduino Duemilanova. I have found some code that some poeple have had some success with. Here is a link to that (DHT11 humidity and temperature sensor - ar3ne1humDHT11). I however keep getting the error: "Error 1: DHT start condition 1 not met." I have the sensor plugged into analog 0, I have also tried analog pin 0-5 while changing the code to the correct 14-19 pin. Anyone have experience with this sensor and this code or any other code that has been successful with these sensors?

My first question: Why ANALOG Zero? This device communicates digitally and does not perform any analog interfacing.

Nuelectronics also has some code for this:
http://www.nuelectronics.com/download/projects/sensor_pde/dht11.pde

And some additional info here(which appears to be a fix for the reference code you mentioned):

I've looked at a few of those links and haven't had much success. I'll have more time to troubleshoot this issue tomorrow. If anyone else has some knowledge about these sensors that would be great! I'll post my results soon, hopefully :slight_smile:

I have the sensor connected to the following things. Vcc to 5V, ground to ground, and data line to ADC0. Do I need to connect the ground and the Arduino ground?

SOLVED:
Use this code (DHT11 humidity and temperature sensor - ar3ne1humDHT11)

Make the corrections on this site (Some useful stuff...: DHT11 Arduino with VirtualWire)

Also the ground on the sensor does need to be connected to the Arduino's ground!!!!

Thanks for all the help!!!!

Also the ground on the sensor does need to be connected to the Arduino's ground!!!!

Just out of curiosity... what did you connect the ground to?

Just out of curiosity... what did you connect the ground to?

Of course the ground must be connected to arduino earth.

They have a three pin connector which fits very neatly next to a bare 328 socket -pin 21(VCC) -pin 22(GND) -pin 23(PC0)

I have a question about this sensor available at:

http://littlebirdelectronics.com/collections/df-studio/products/dht11-temperature-and-humidity-sensor

Using the code at:

http://www.dfrobot.com/image/data/DFR0067/DHT11_TEST.zip

The read sequence gets 5 bytes. The last byte is the check sum.

The first 4 bytes are:
"8bit integral RH data + 8bit decimal RH data + 8bit integral T data + 8bit decimal T data".

The first two bytes are humidity. The first byte is the whole number(20 to 90).
The next byte is the decimal fraction but its always 0.

The same with the the two bytes for temperature(0 to 50).

Why bother providing the second byte in each case if its always 0?

The Resolution is stated as 1 digit so the decimal fraction is useless?

@waterboy
I recently created a library for both DHT11 & DHT 22, might be usefull, see - Arduino Playground - DHTLib

@robtillaart

With the example code I gave above I get:

Ready
Current humdity = 70.0% temperature = 23.0C

With your class I get:

DHT11 TEST PROGRAM
LIBRARY VERSION: 0.3.2

Read sensor: OK
Humidity (%): 70.00
Temperature (oC): 23.00
Temperature (oF): 73.40
Temperature (K): 296.15
Dew Point (oC): 17.25
Dew PointFast (oC): 17.23

I like your class and I will use it in my project.

Any thoughts on the extra byte matter that I brought up?

Why bother providing the second byte in each case if its always 0?

The Resolution is stated as 1 digit so the decimal fraction is useless?

Why bother providing the second byte in each case if its always 0?

The Resolution is stated as 1 digit so the decimal fraction is useless?

In the DHT22 these bytes are used and contain data. The protocol to transmit the data is the same for DHT11 and DHT22, however the meaning/interpretation of the bytes transported differs.

For the DHT11 one can just skip byte 2 and 4 as they are not used. It would save 40% of the communication if they were not sent

If you have remarks or comments to improve the DHT lib, please PM me .
Rob

Thanks for your answer Rob.

I understand now.

cheers :slight_smile: