Go Down

Topic: DHT11 Woes (Read 1 time) previous topic - next topic

amites

Have a DHT11 plugged in and feeling silly

long story short I have tried 3 different libraries (1 on arduino.cc, 1 on adafruit, 1 on github)
and Serial.print for the raw data received from the sensor and always 0's or 255 (255 might have been a fluke since it only showed once on the github library)

errors reported have mostly been timeout errors, with general fault and invalid value thrown into the mix at various configurations

so far it's all been attempted through various digital ports on the Arduino

DHT11 has 4 pins

  • 1 = power

  • 2 = signal (tried port 1-13) (with 10k jumper from power)

  • 3 = dummy

  • 4 = ground



still a greenhorn at writing Arduino code and this is the first sensor I've tried plugging in -- any ideas what I might be missing or data that I haven't reported that would be helpful in finding what direction to be looking?

thanks in advance

dhenry

It is definitely not your code. Look somewhere else.

robtillaart

@dhenry
?

@amites
Have you tried this library and code - http://www.arduino.cc/playground/Main/DHTLib/ - it has been tested with DHT22 and DHT11 on duemillanove, UNO and MEGA.

Be aware that the DHT11 needs 2 seconds between sampling (google for datasheet)
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

pylon

A quote from the playground article:

Quote
There have been reports that some sensors have pin 3 and 4 reversed, probably as a quality control/manufacturing issue. If you have issues, consider grounding both pins 3 and 4.


Have you tried that?

amites

Just tried grounding pins 3 &4 together -- same result

running the library from http://www.arduino.cc/playground/Main/DHTLib/
it returns bGlobalErr = 1 (Start condition not met)

if I disable that section then it spits out Error 3: DHT Checksum Error


beginning suspect the Arduino Uno I'm working with may be faulty as I've tried 2 different DHT11's and get the same result


any other ideas to debug are appreciated

pylon

Can you make a picture of your wiring and post it?

el_supremo

Quote
I've tried 2 different DHT11's and get the same result

Where did you get them?

Pete

amites

the sensors came from hong kong via eBay -- going to borrow one from a friend shortly

quick diagram attached

el_supremo

Quote
the sensors came from hong kong via eBay

Thought so. That is probably what is wrong.

Pete

jfglassworks

I have been playing with the DHT11 sensors the past couple days and had much the same problem initially.  I ended up having the pins reversed, (ie 1 for 4). The label facing AWAY from you, pin 1 is on left.

Would assume you tried already, but it worked for me.

I have the DHT11 (chinese versions).

amites

Borrowed a friends DHT11 -- plugged it in same result

even tried turning it around in the protoboard on an off chance

still nada...

robtillaart


Do other sensors work properly?
Have you used other arduino pins?

Please post the non-working code
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

amites

#12
Dec 04, 2012, 10:59 pm Last Edit: Dec 04, 2012, 11:05 pm by amites Reason: 1
borrowed a friends Duemilanove and tried the same hookup

same result

most recent library I tested is from ADAfruit at https://github.com/adafruit/DHT-sensor-library

though I added at line 33
Code: [Select]
    Serial.print("h = ");
   Serial.println(h);
   Serial.print("t = ");
   Serial.println(t);


which spits out the result of
Code: [Select]
DHTxx test!
Read failh = 0.00
t = 0.00
Failed to read from DHT
h = 0.00
t = 0.00
Humidity: 0.00 % Temperature: 0.00 *C
h = 0.00
t = 0.00


same result with 3 different DHT11 sensors

this one is starting to really bug me


** EDIT: added debugging code & result **

robtillaart

you can patch the library and make the 5 databytes that should be received public to see if any signal is coming in and print them.

If you have a scope you should be able to detect the 40 bits

Just checking - you have connected the DHT11-datapin to a digitalpin of the arduino? (Once seen in another thread)

Which board are you using?
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

amites

**UPDATE**

I was using wire with a thin layer of insulation that I couldn't see -- thus no signal

now getting readings that come back way off from possible but progress

Go Up