I'm a newbe and from Belgium(dutch). Sorry if my English is not that perfect.
For a schoolproject I'm trying to read out the Humidity and Temperature of my conseratory with LCD and alarm. Sadely I'm only on the piece of coding the DHT11 and all ready on mealtdown.
The humidity and temperature is coming in to com5 very well and in dutch but it only gives me a read out of 0% humidity and 0°C temperature. And I've tryed 2 DHT11 both the same read out. I don't think they're broken but I really don't now what to do. Plus I have only until monday to give my project.
This is my code.
//Adjusted programma to read out in NL by MaDe
//Use the DHT Adafruit lib #include "DHT.h"
//DHTpin11 connect to arduinopin2 #define DHTPIN 2
//Type of DHT sensor #define DHTTYPE DHT11
//Initialize DHT sensor
DHT dht(DHTPIN,DHTTYPE);
void setup() {
//We will use the serialmonitor to read out
Serial.begin(9600);
Serial.println("Vochtigheid en Temperatuur")
//Start the sensor
;dht.begin();
}
void loop() {
//Waiting a few seconds to start up
delay(2000);
He/She appears to have a DHT module rather than a bare DHT. The sole purpose of such modules is to remove the need to add your own resistor and to make the wiring simpler
Plug the Vcc pin of the sensor into the Uno 5V socket
Plug the Ground pin of the sensor into one of the Uno GND sockets
Plug the sensor Data pin into the Uno pin 2 socket
Power the Uno and open the serial monitor
What do you see ?
Hello guys, Thanks for the help. A other student helpt me out. Everything was okay but my breadboard was shorted out . A total bar of + & - thats why it was not working and shorted out. + I put a pin in dubble gnd. oops . Sorry Guys. But loved the in put. Thank you