My intent is to get a reading of humidity and temperature from the DHT11, show it on a LCD and also to check if the readings require a relay to turn on a mister, or to turn on a heater.
I am not understanding which variable will give me the current humidity and which the current temperature so that I can apply some if/else logic to the reading. I would very much appreciate someone looking at the sketch and advising me which variable to use.
The sketch does not use variables for temperature and humidity. Rather, it creates a DHT11 object and uses methods from this object to print the temperature and humidity.
You could create variables, say, float tempFahr, and assign it tempFahr = Fahrenheit(DHT11.temperature) . I think adafruit has a simpler sketch for this sensor. I found a DHT22 sketch there.
I found the adafruit sketch. In it they advise using a 10k resistor on pins 1-2 of the sensor but I also note that they are covering a number of different DHT type sensors.
On the sketch I referred to above they did not make that suggestion and I found it worked without the resistor on the DHT11. Should I opt for a 10k resistor with the UNO dispite it working without it?
If in doubt check the data sheet. From memory the DHT11 and DHT22 require different value resistors. If you choose not to use one despite it appearing to work then don't be too surprised if you have strange problems further down the line.
dannable:
If in doubt check the data sheet. From memory the DHT11 and DHT22 require different value resistors. If you choose not to use one despite it appearing to work then don't be too surprised if you have strange problems further down the line.
Sorry for the intromission, but i have a question to what you just said: if you don't use a resistor, is it possible to damage the sensor? I was able to get a reading or two, and then it stopped reporting...
robtillaart:
this length should not give such problems.
Which library do you use?
Used your library DHTlib, with the test program dht11_test
I just get DHTLIB_ERROR_ACK_H from it.
Edit: just tried again with another board i have (Jeenode v6) and was able to get it working with your library. Still it baffles me why it would not work with Arduino UNO v3. Any ideas? I must be overlooking something stupid