​ ​ ​ ​ DHT11 Humidity Sensor
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 22

Thread: DHT11 Humidity Sensor

  1. #1
    Senior Member
    Join Date
    Feb 2010
    Location
    Texas
    Posts
    2,920

    Default DHT11 Humidity Sensor

    The DHT11 Digital Humidity Sensor is available on Ebay and elsewhere and is an inexpensive alternative to sensors from Honeywell, Sensirion and Humirel. This project shows how to make this Sensor work with a Picaxe X2.

    I had received several of these for testing but was unable to get them working due to a speed / timing issue related
    to Picaxe processing overhead. But thanks to a clever workaround by Picaxe Forum Member MGU (Maguin Michel - Paris France ) the problem was solved. I took his idea and built a working circuit using a 74Hc221 instead of the 555 timer.

    The results look very good and the Humidity and Temperature outputs are stable & accurate enough for many applications.

    The DHT11 Datasheet can be found here:

    http://www.robotshop.com/PDF/dht11.pdf
    http://www.micro4you...ensor/DHT11.pdf


    This is how I did it. ( See the Attached Files)

    Edit: Added Schematic for using 555 timer instead of 74HC221. Fixed Graphic
    Attached Files Attached Files
    Last edited by Goeytex; 28-09-2011 at 14:22. Reason: Added Schematic for Using 555 timer.

  2. #2

    Default

    I am using the same sensor, sold as AM2301 from Satistronics in China in my Mobile Logger described in the Miscellaneous finished projects forum. I used a DS1302 clock (the RAM part in burst mode) as a buffer. It works perfectly with any Picaxe with reconfigurable ports. It only needs a simple circuit to change the sensor's PWM into separate NRZ and clock lines.

  3. #3
    Moderator
    Join Date
    Mar 2008
    Location
    Western Australia
    Posts
    12,177

    Thumbs up DHT11 Humidity Sensor to PICAXE

    Well done Goeytex.

    A relatively simple circuit and code size quite small for RH monitoring.
    westaust55

    Hey Hamlet, 2B OR NOT 2B = $FF

  4. #4
    New Member
    Join Date
    Mar 2011
    Location
    vzla
    Posts
    20
    Blog Entries
    1

    Default

    Greetings to all forum, I have read carefully the comments and analysis shown here and those shown in the French blog I think it's great the way they resolved, however I have noticed some details that I have very clear, these are: the schema using the 74hc221 pulse width according to R3 and C2 values shown, I get 110us (although according to Philips data sheet would be 77us) which are not consistent with 65us, C2 is not connected properly (leg should go to pin Rx / Cx and the other to Cx), mount the circuit but I do not get good results, RH% reading is very unstable and T ░ C did not get ... I think it's a problem reading from the sensor (I'm using DHT03) not get the pulses correctly ... I can do? ... I think a 40X2 fit ... they recommend ....! thanks in advance

  5. #5
    Senior Member
    Join Date
    Feb 2010
    Location
    Texas
    Posts
    2,920

    Default

    If you carefully read the Datasheet, the CX connection is correct. The CX pin ties directly to external ground as shown in the schematic. Then one leg of CX ties to external ground. See the note on Page 5 and the diagram in Figure 6.

    To get the correct pulse width output you may have to experiment with the RX value while reading the pulse width with a scope. Trigger the 74Hc221 with a 20 to 50us pulse using pulsout and look for a 65 us pulse out from the 74Hc221. Adjust RX accordingly. Make sure you have decoupled both the Picaxe and the 74Hc221 with a .1uf capacitor.

  6. #6
    Senior Member
    Join Date
    Jan 1970
    Location
    New Zealand
    Posts
    890

    Default

    I've read a pile on these DHT-11 sensors - I have one - and am looking to incorporate it into my orchid controller I've made (using a 40x2, 16MHz external resonator... I've got that bit!) I'm a little unsure of the hardware wiring so thought I'd just ask.
    For the DHT-11, there's a + and -, which is obvious. A 100nF decouple cap I'll add too. The data line - goes straight to C.1 on the 40x2? As for C.0, do I simply add a 4k7 pull-up resistor on this port? I've seen the odd note on a diode of some description so if Goeytex or someone can clarify, I'd appreciate. Thanks for the posts; I feel like I'm about 80% there without having actually connected the sensor yet :-)

    Barney
    Last edited by nbw; 13-04-2016 at 11:01.
    Humour for the Electronically-biased among us:
    blog: http://ohmart.wordpress.com

  7. #7
    Senior Member
    Join Date
    Jan 1970
    Location
    New Zealand
    Posts
    890

    Default

    Ah! Goeytex's PDF above helps (I missed it thinking it would be a datasheet). I'm not using a 555 or similar - purely a 40x2 and the DHT-11 sensor (it's on a board with +,-,out pins). I'm thinking the DHT-11's out pin gets tied high with a 4k7 resistor and I can see that C.1 1n4148 diode on there... but not sure still how c.0 comes into it?
    Humour for the Electronically-biased among us:
    blog: http://ohmart.wordpress.com

  8. #8
    Senior Member
    Join Date
    Oct 2013
    Location
    Stockport, UK. On a good day, Cornwall UK
    Posts
    313

    Default

    Quote Originally Posted by nbw View Post
    I'm not using a 555 or similar - purely a 40x2 and the DHT-11 sensor (it's on a board with +,-,out pins).
    So how's it going to work? I thought the whole point of this thread, was to demonstrate how to use a 555 or similar to overcome the problem that the X2 Picaxe isn't fast enough to process the data directly

  9. #9
    Senior Member
    Join Date
    Jan 1970
    Location
    New Zealand
    Posts
    890

    Default

    I understand you can use 1 (or 2) 555s, or the 74xxxx equivalent, or - if you use a 28X2 or 40X2 with a 16MHz resonator, you can get it to work with just 2 pins. (Which is what I am hoping for!)
    Humour for the Electronically-biased among us:
    blog: http://ohmart.wordpress.com

  10. #10
    Moderator
    Join Date
    Mar 2008
    Location
    Western Australia
    Posts
    12,177

    Default

    Quote Originally Posted by nbw View Post
    I understand you can use 1 (or 2) 555s, or the 74xxxx equivalent, or - if you use a 28X2 or 40X2 with a 16MHz resonator, you can get it to work with just 2 pins. (Which is what I am hoping for!)
    I used a similar scheme as per Goeytex with a 74HX221/74HC123 for my DCC Accessory Decoder project but that had to look at signals with half cycle durations of 58 us and 100 us.

    If you are looking at the 28X2 or 40X2 with a 16 MHz resonator to achieve 64 MHz clock speed then the 20X2 can achieve this with the internal resonator.

    I have not looked into reading the DH11 devices directly with a PICAXE chip. If you find that you need a little more speed again, then I have successfully (no Rev Ed warranty) used a 20 MHz resonator with a 28X2 for an 80 MHz clock speed.
    westaust55

    Hey Hamlet, 2B OR NOT 2B = $FF

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •