Offline
Newbie
Karma: 0
Posts: 16
|
 |
« on: November 19, 2012, 09:10:06 pm » |
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
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 114
Posts: 2205
|
 |
« Reply #1 on: November 19, 2012, 10:14:37 pm » |
It is definitely not your code. Look somewhere else.
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 101
Posts: 9551
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #2 on: November 20, 2012, 01:29:47 pm » |
@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)
|
|
|
|
|
Logged
|
|
|
|
|
Switzerland
Offline
Faraday Member
Karma: 71
Posts: 3472
|
 |
« Reply #3 on: November 20, 2012, 01:57:00 pm » |
A quote from the playground article: 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?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 16
|
 |
« Reply #4 on: November 20, 2012, 02:21:26 pm » |
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
|
|
|
|
|
Logged
|
|
|
|
|
Switzerland
Offline
Faraday Member
Karma: 71
Posts: 3472
|
 |
« Reply #5 on: November 20, 2012, 02:27:26 pm » |
Can you make a picture of your wiring and post it?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
God Member
Karma: 15
Posts: 965
|
 |
« Reply #6 on: November 20, 2012, 03:24:51 pm » |
I've tried 2 different DHT11's and get the same result Where did you get them? Pete
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 16
|
 |
« Reply #7 on: November 20, 2012, 06:47:46 pm » |
the sensors came from hong kong via eBay -- going to borrow one from a friend shortly
quick diagram attached
|
|
|
|
|
Logged
|
|
|
|
|
Offline
God Member
Karma: 15
Posts: 965
|
 |
« Reply #8 on: November 20, 2012, 07:54:42 pm » |
the sensors came from hong kong via eBay Thought so. That is probably what is wrong. Pete
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 1
|
 |
« Reply #9 on: November 21, 2012, 11:50:38 am » |
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).
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 16
|
 |
« Reply #10 on: November 21, 2012, 10:51:02 pm » |
Borrowed a friends DHT11 -- plugged it in same result
even tried turning it around in the protoboard on an off chance
still nada...
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 101
Posts: 9551
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #11 on: November 22, 2012, 12:53:30 pm » |
Do other sensors work properly? Have you used other arduino pins?
Please post the non-working code
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 16
|
 |
« Reply #12 on: December 04, 2012, 04:59:29 pm » |
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-librarythough I added at line 33 Serial.print("h = "); Serial.println(h); Serial.print("t = "); Serial.println(t);
which spits out the result of 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 **
|
|
|
|
« Last Edit: December 04, 2012, 05:05:33 pm by amites »
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 101
Posts: 9551
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #13 on: December 04, 2012, 05:51:03 pm » |
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?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 16
|
 |
« Reply #14 on: December 13, 2012, 04:46:33 pm » |
**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
|
|
|
|
|
Logged
|
|
|
|
|
|