Hi all,
I am new to Arduino. I am trying to connect my Arduino UNO with I2C LCD display and DHT11 sensor. I connected all, tried different codes, but results for humidity and temperature are always 0.
I followed this tutorial
I tried to change pin for data on DHT11 from 2 to 3,5,7,8 and A0, but result is the same.
I tried to change code multiple times, tried given code and code in tutorial.
I am pretty sure that board and all wires are working properly.
Printing results as Serial.print also gives 0, so I doubt that my DHT11 sensor is not working.
Any help? Advice?
Several things to try. Try the contrast trim pot and see if your characters will appear, you should at least get some blocks where the characters should appear. If that does not work change your lcd.print statements to Serial.print and see if you get the information on the console. At this point you will know if your problem is in the interface-library or the hardware. If this does not resolve your problem post a schematic and links to each of the hardware devices.
With this code change, I got "0%" for humidity and nothing is printed for temperature.
Tested on both Serial.print and lcd.print and result is the same.
Here is the output I get:
Some modules show 5V supply rather than the 3v3 you have.
So which DHT11 module do you have?
Are you using a breadboard for connections.
Show a photo of what you have in front of you rather than what could be.
The above diagram shows that DATA-pin of the Sensor is connected with DPin-2 of UNO. So, check that the following code line has been included in your sketch.
If the DHT-11 was not connected you'd get NAN (Not A Number) returned on your display for f and h. Soo, I'd say your DHT is fried. If it's returning zero's for both, that sounds like a dead ground.