DHT11 Humidity And Temperature Sensor Package

Temperature and humidity measurements are a nice addition to many hobby projects. But [Rajendra Bhatt] makes the point that many of these sensors have a price tag that is well above what most hobbiests are willing to spend. He decided to take an in-depth look at the DHT11 sensor; which you can get your hands on for under $3 if you know where to look.

The four-pin device uses a 1-wire protocol. [Rajendra] discusses the ins and outs of the communications, demonstrating the part using a PIC 16F628. It’s a snap to connect to your project, requiring VCC, GND, and a pull-up resistor on the single data line. We’ve already seen it used on at least one project, and hope to see more of this little guy in your own hacks.

Now we found this part listed on eBay for less than $3 (buy it now price including shipping… how can they do that?). But Octopart didn’t come up with any options. If you know how to get this through traditional parts suppliers let us know in the comments.

55 thoughts on “DHT11 Humidity And Temperature Sensor Package

  1. the relative humidity ranging from 20-95% with an accuracy of ±5% of the DHT11 for 3$ (9$ from uk on ebay) doesn’t seams to bad compared to the much more expensive 24$ SHT11 protoboard which has ±3%…

    if you want better temp resolution use an extra DS18B20 for 4$…

  2. An Adafruit-related air quality sensor device led me to Furturlec.com, which has Humidity/Temp, RH/Temp, and Humidity sensors listed in the range of $10 – $25/ea.

    They also carry a range of gas/air quality sensors. Unfortunately, the component sensors I’ve seen for my local sinus irritant, sulfur dioxide, have been listed elsewhere in the range of US$300 – $400. That’s a lot of Clariton.

  3. is 1-wire stuff still around? (plus a ground, so really, that is false advertising)

    I2C seems to be far more popular. Maybe they’re so cheap because the parts got sold wholesale to the closeout ebay crowd?

    How can they do that ($3, including shipping)? Probably because they send it in an envelope with a single first class stamp on it.

  4. 1wire isn’t false advertising, it’s talking about data transmission, most sensors need power, gnd and at least 1 other wire for data, unless it’s a dallas sensor and then it can get away with a data line, gnd and vcc pin tied to the data pin for parasite mode.

    1wire is still a valid protocol, somethings don’t need to be that fast and what could be less complicated than using a single dataline connected to 10 temperature sensors?

    1. I understand that “2-wire” isn’t as catchy a name, but unless you are driving ground rods and using a real earth as the return path, (or attaching to a metal frame, and plan to use the chassis as the return path), you are going to need to run a second wire.

  5. 1wire goes long distance. I’m using it to monitor for freezing of 70+ feet of water line with a string of DS18B20 1wire temp sensors. It can go lots farther than 70 feet. I2C and SPI only go a couple feet.

  6. this article is sadly only an advertisment for an ebay seller.

    no hacks, no builds, so software, so source file, no directions, no neat/new ideas, nothing, not even a shiny picture of some electronics project that was stolen from some other blog.


    PS: apple sells stuff too! and their havin a sale!!! …as always… XD

    time to go googleing for interesting articles about electronics and forget about all the “articles” on this site trying SO BADLY to get me to buy(COMSUME(-ER)) a kit or unpopulated board or some finished robot that would have been fun it actually BUILD. time for me and everyone else to go find a site that is like HAD used to be like.

    FYI i know its hard to find content, but ads posing as real content? im smart enough to rewire your anything, you think you’ll fool ALL OF US? im insulted.

    pps you can check humidity with a thermometer, wet cloth, string and pencil & paper, maybe even hack it into a robot

      1. Name-calling is a much larger logical error than a spelling mistake.

        Not only that… you spelled “troll” correctly, but you clearly misused the word. A misused word is always a larger mistake than a misspelled word. And in this case your usage is not just clumsy or on an edge case, but it is clearly misunderstood.

        You remind me of Biff from Back to the Future. Make like a tree and get outta here.

    1. Keep it to yourself Melvin.
      I for one like heads up on cheaper tech. Now if only things like the BlinkM and other LED controllers could be found cheaply on Ebay!
      …let me just go check! ;-)

    1. they state repeatability at +/-1 degree celsius.
      so, some of the error might be systematic and one might be able to calibrate for it.
      but one can also get a much more precise analog chip (like tmp36) for half the price.

  7. I saw a nifty bathroom fan the other week in a flyer.. automatically turns on the fan when the humidity is over a set percentage above normal.

    It’s definitely a “Why didn’t I think of that” type of thing, but certainly cool.

    The only question I would have is with regards to modifying a bathroom vent with a humidity sensor so that it meets code.

    1. We had one of those, it didn’t work at all. It would turn on out of itself without a reason. And it wouldn’t turn on when someone was taking a shower. We disabled the humidity sensor and went with manual control.

      1. We’re having trouble with an ‘automatic’ fan aswell. I have to adjust the sensitivity level at least every spring and autumn. Even then the behaviour is a bit erratic some times. That makes me think that it is probably controlled by absolute instead of relative humidity.

  8. There is a huge difference between this sensor and the SHT11. SHT11 is meant for exterior usage, it can go up to 100% RH and withstand condensation.

    Also, i think too that this project is not worth HAD. There is only ony thing telling me: usual sensor, usual usage, boring stuff, cheap ebay seller with questionable quality…

  9. It seems like most people commenting here have not read the original article at all. The author has nowhere mentioned about ebay or anything. DHT11 is now sold by almost every distributor in US because it is the most inexpensive digital sensor for measuring humidity and temperature together. The author has clearly mentioned that SHT sensors are more precise, and accurate but most hobbyists still can’t afford them. The problem with DHT11 is its proprietary 1-wire protocol which requires precise timing calculations to detect 1 and 0. The author has done a great job in explaining and implementing it using TIMER2 as a free running counter in PIC16F628A. This was helpful to me at least.

  10. The aosong temp/humidity sensors (“DHT11”) are extremely useful little sensors. I have a temperature humidity setup with four of them (soon to be five) and it gives me peace of mind that I don’t have a leak somewhere in my attic crawl space or basement. Their response to humidity from something like a hot water faucet running is immediate and that gives me peace of mind to know they are working.

    Basically it monitors the temperature and humidity on all three levels of my home as well as outside so that the heating and ventilation system that I have functions appropriately.

    I forget exactly what I spent on them but it was well under $5 each. The outdoor one is inside of a small box to shield it from the direct effects of the weather but still let air in so it can do its thing. It works fine. I am thinking of adding one for my computer area. The sensors are on lengths of wire ranging from around ten to more than 30 feet and the system so far works fine.

    You can’t touch these aosong sensors for value.

    I have a sensiron smt mount sensor I need to hook up to compare them to, since the sensiron is supposed to have very high accuracy it will be interesting to compare and graph the two.

    The one thing that the sensiron has that the aosong lacks though is the ability to put multiple sensirons on a single digital line. That would be nice in the aosongs but its not possible. They are not individually addressable. (But there are simple workarounds for that- you have multiple options.)

    On an arduino, for example, you will need a single digital IO pin for each sensor unless you multiplex them. Which I am looking into.

    Since you don’t need to query them more than once every few seconds – or even less..that seems like a good way to go for explandability. If I do that I also want to put the remote sensors on optoisolators – optoisolating sensors from GPIO inputs will I hope make the system more robust in resisting damage from lightning.

    Of course, its cheap so that matters less, but still, it would be a pain to have to replace it.

  11. Aosong AM2302 and AM2303 are the model numbers.

    For example,


    Again, extremely useful devices that are impossible to match in value/cost ratio for people like me.

    I would love to use sensiron but in small quantities they are twice as expensive as they would need to be for me. (which would still be several times the cost of the aosong, but the addressability is a nice feature that makes them far more versatile in some situations)

    I am also guessing the sensiron sensors are probably more durable over time, but I dont know that from experience, just the data sheets.

    The cheapest I have seen them for is $22. The one I have they were nice enough to send me as a free sample.

    If anyone knows a place that you can buy small quantities of them for less, please post it.

  12. @Chris: what results do you get with the sensor outside? The DHT11 is not rated for temperatures below 0°C.

    Btw. has anybody seen some code for the MSP430 with this sensor? I would be interested in it very much!

  13. I have tested and used both DHT11 and DHT22 sensors, and made little libraries for .netmf (look up on code.tinyclr.com )

    I found out for my personal use that the DHT11 is not very stable on the long term. If I match it so an expensive reference sensor, such as sensiron’s high end, they are not so bad “at first”. However after 4 to 6 months, the humidity part of the DHT11 has drifter a lot (more than 30% away) from its original values. Maybe I had bad luck, maybe not.

    However, I found out that the DHT22s are more reliable and accept negative temperature for outdoors.

    Justs my thoughts…

  14. Following up on Nicolas3’s comments …

    Having bench tested multiple SHT75 and DHT11 sensors side by side the DHT11 is woefully inaccurate (10-20% difference humidity readings). I haven’t come across a Sensiron model that wasn’t right on the money …

    I understand people’s comments about cost but be aware that you are getting what you pay for …

  15. This chip and the DHT22 are made by a company called aosong. The DHT11 is good enough for my uses.. but they also make another version, the DHT22 which is substantially more accurate. It may also be individually addressable.

    Another similar sensor worth looking at is the SHT series by sensiron. The price on them is as low as $13 and the individual IDs mean they can share a bus.

  16. I have 5 of the DHT11 (that I got for around $10/5 on ebay). But in 78% humidity they read anywhere from 40 to 60 %. Not a single one of them is anywhere near correct, and this kind of variation is way way off their spec. They are grossly misrepresented in the brochure. Hardly +/- 5%. Of the 5, several read around 40-46%%, one reads around 60%. but how that relates the the 78% shown on a mechanical hygrometer (that’s pretty accurate) is anyone’s guess.

    They do give a plausible and more consistent temperature reading, and the single pin interface does work. But my one unit that reads ~60% RH also gives 26 deg C, where the others are closer to the actual 21Deg. The humidity value does rise if you exhale on it. You might be able to offset the reading in the code, maybe try calibrating each one that way, but who knows. That’s as much as I’ve seen so far, I’m sitting here scratching my head. They seem worth all of $1, fer sure. Anyone who remembers the old days of “made in Japan” will be at home with these. I can’t recommend them for humidity sensing, except as very gross indicators, like maybe detect “damp vs. dry”. But who knows how stable they will be.

    1. I have several DHT11 sensor modules from dfrobot. All of them have horribly inaccurate humidity readings. The humidity readings do change from a dry to wet environment, but they’re all over the map. The temperature reading are reasonable on all of them. I get the same bad humidity values on all the DHT11 sensors I have on both the Parallax Propeller and the Raspberry Pi, and I’ve used a logic analyzer to verify the protocol meets the DHT11’s requirements. The logic analyzer confirms the humidity output from the DHT11 itself is essentially – useless. The drfrobot DHT11 sensor “modules” I have include a 10K data line pull-up which measures 9.9K Ohms and a 0.1uF bypass between Vcc and GND. I’ve tried the DHT11 sensor modules at both Vcc 3.3V and 5.0V, and at both voltages the humidity values are bad. dfrobot has introduced a V2 DHT11 sensor module that changes the 10K pull-up to 4.7K. That may make a difference, but I haven’t tried yet – I doubt it. Maybe it would be possible to “re-hydrate” the DHT11’s humidity sensor by putting it long-term in a high-humidity enclosure. I haven’t tried this yet too… Sigh.

  17. Sorry there is another Chris here so i change my name into Chris2.
    Just to clarify,I use dallas 1 wire with weather display software and would like to implement cheap humidity like dmt11. Or Dmt 22. As easy as possible.
    Or just another brand in a easy way without programming
    How do I do that ?

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.