DHT 11 Issue.

So, i'm trying yo read values from DHT-11 1 time in 1 minut, for first 10 minutes everthing is ok, but then.... the values freezes, so if had 20 C DHT-11 show 20 C even if i put it to the refrigerator... Coul'd some 1 help me with that issue?

DHT-11 and DHT-22 need some time - 2 seconds IIRC - between samples (see datasheet)

opt. check my lib - http://arduino.cc/playground/Main/DHT11Lib - http://arduino.cc/playground/Main/DHTLib -

I have 2 DHT11's connected in front of me on a neat breakout cabled breadboard from my Uno with 2 DHT11's connected with the recommended pull-up separate for each sensor and a 100nF capacitor across each sensor Vcc and ground lines, both have been powered up and working interchangeably overnight and over day too... as I wanted to see if there was any drift in the devices. Both have worked for several days now without any issues whatsoever except possible calibration. So since you didn't post your code I am having to get out my crystal ball and suggest that it isn't wired properly, either you are missing the pull-up or you are missing the capacitor that the data sheet and the sketches and other material found here recommend, By here I will point out that there are several articles/examples on this topic on this site and this forum topic specifically, that show how to and why you must connect the sensor to the Arduino in a specific manner and method. Failure to observe these basic steps frequently leads to issues regarding erratic or non operation of the Device/Arduino/Sensor however it will make you happy to know that it takes real work to do any of the above and successfully "Brick" either the Sensor or the Arduino, and the Arduino can be repaired for around $5.00, the cost of a new chip W/bootloader and they plug in. If you change the wiring to the Recommended connections/parts and it still fails then you might re assign the DHT11 pin to another pin in the sketch and try again. Should the results be the same then surely you have either a bad sensor or your wiring is still not correct. My Sketch worked great from the beginning, after I got a lesson about where to put things,... no, not there... libraries... I then modified the\ sketch to talk to a serial display and removed the temperature measurement function and have had the thing work constantly Since. I an a complete NOOB to Arduino but I am a skilled electronics oriented person and at age 66 (in june) I have learned to follow instructions... Sooner or Later... usually later as I am as hardheaded and obstinate as they come... and I write long and really boring replies,,, Dementia setting in, I suppose. IMO Hope this was more helpful than insulting, It wasn't meant to be insulting but you can never tell about us Old Geezers... (nor can we)


Agree with Doc. The missing pull up resistor is a well know problem

DON'T FORGET THAT CAPACITOR... The issue is I think... That most of the people using this forum don't understand what a capacitor is and does, electrically. The simple FACT that SOME things... SEEM to work OK leads MANY to BELIEVE that somehow Capacitors aren't necessary... Well I don't need it, waste of time and money... What NO ONE except us old Geezers fully understand is that someone else, WITH a GREAT DEAL MORE EXPERIENCE PUT THE PART THERE FOR A GOOD REASON. If ALL YOU ELECTRONICS NOOBS WERE SO DARN SMART... You would be writing your own Sketches and dictating to others "How To Do It" instead of sniveling about how your copied sketch doesn't work, and 'Please help me to FIX IT... BEFORE YOU ASK FOR HELP, ASK YOURSELF ONE SIMPLE QUESTION... Does IT (MY Project) Look EXACTLY LIKE THE DIAGRAM??? IF NOT, MAKE IT SO BEFORE YOU ASK FOR "HELP" as in so doing (Exact copies of diagrams (READ INSTRUCTIONS FIRST, ALL OF THEM). Then those of us that have the time and interest will BE ABLE TO SPOT the ERROR in the SKETCH THAT YOU POSTED WITH YOUR REQUEST FOR HELP. IF YOU DON'T FOLLOW SIMPLE INSTRUCTIONS AND SHOW US WHAT YOU ARE TRYING TO DO, THEN HOW??? CAN WE REALLY HELP YOU? imo


Hi Doc,

Can you explain what the capacitor does and why it is needed. That helps the next generation to understand the why ...

No I don't need to waste a great deal of time trying to explain advanced concepts like that. Grumpy Mike has already done it here (and Very Well too). You can do several things First trust that someone who knows a great deal more than you has found the part necessary and Second take it on faith that the part is NECESSARY.

Go Read Grumpy Mikes explanation and then you will know why I didn't repeat it. As to GO Look... It IS YOUR JOB to find the information not mine to deliver either a link (Easily Found) or a Long dissertation on why capacitors are a REQUIRED PART OF ANY Device Externally connected to an Arduino. Perhaps the easiest method is to take it on Faith that the part is REQUIRED, Later when you have learned more I promise You That You Will Understand why. IMO


I just re-read my last post and if I came on too strong, I apologize. Perhaps I should change my handle to Grumpy Doc... Essentially it is this, All Digital devices made today contain a very large number of small devices in them, These devices, when operating pull little bits of current from the 5V source, they are Very FAST pulses AND for reasons that are too difficult to explain it is difficult if not impossible to 'see' them with an oscilloscope... A capacitor can be thought of as a small reservoir of current. When the device is working the small reservoir helps out by supplying the device with a little extra CURRENT when the pulse, (called a 'switching pulse) occurs locally (at the device) and this little help, again the small reservoir takes up the slack represented by the small loss in the 'wires' (PCB Traces) and 'helps' the device and all the others to work more efficiently by "smoothing out" the current pulses drawn by the device in question... Better? I do Hope this helps... But Bypassing is a complex subject, Very Complex.


No need to apologize BTW for stating that people should try to understand first before asking. And for stating that datasheets exist for a reason :wink:


Perfect explanation, thanx.

In short: the capacitor takes care that the voltage supplied stays more stable and (almost) unaffected by the internal working of the sensor.

For more about the working of capacitors see - http://openbookproject.net/electricCircuits/ - Part I, chapter 13

Yeah and Thank you TOO Sir for posting the reference. I have seen people here argue that they can't see what it could possibly affect and therefore was NOT Necessary..., Was a guy trying to light 59 led's off the usb port supply voltage across three boards without ANY supply bypassing who said that it had to be the sketch that someone else had written and he was CONVINCED that it was the sketch that was at fault and not the HEAVILY SUGGESTED bypassing... He did later change his "tune", after he had added the recommended parts... I think that everyone here who posts a question about erratic operation of sketches should be required to read that reference, before posting questions. Breadboards ARE EASY to USE and are VERY EASY to ABUSE with. They are easy to put components on and test with... BUT THEY DON'T really reflect the real world. When I did this stuff for a living I breadboarded all that I did and Many times what I needed to do when breadboarding was "Fix" or "Compensate" the operating conditions imposed by the breadboard. Typically I needed 50% of the bypassing and other compensation when I made the actual circuit board. This is a Very Hard subject to understand. It would be much better for the "NOOBS' here to simply follow the "Pretty pictures" and later understanding may take place. When I design something it is from a FOUNDATION of knowledge that I acquired over many years... I know what will be needed to make a given device work, If I don't, I have the knowledge to figure out after measurement what I need to do to make the device operate as I intended... I cannot yet really write a sketch with any real degree of confidence But I Can Engineer. Unlike many here I am here to learn how to write sketches and later the underlying Code processes to create my desired projects and since I am retired... I have a bunch... some worthwhile and most simply for the education. I have all my life had a BOOK either in my hand or very close to me... I have over 200 data sheets... so far in my parts library and the number grows daily. My life today is learning all I can and occasionally passing on what is relevant.