1

I'm new in the Arduino world and today i was trying to make a simple program to show the temparature an humidity with this sensor. I made a circuit following one tutorial and nothing happend, the result was Temperature: 0 Humidity: 0. My question is, what is wrong? Probably the sensor is broken or the code is wrong. I also need to say that i use a 5K1 resistor in exchange of the 4.7K resistor and accidentally I connected the sensor without the resistance for a few seconds.

This is the code:

#include <DHT.h>
#include <DHT_U.h>

int SENSOR = 2;
int TEMPERATURE;
int HUMIDITY;

DHT dht(SENSOR, DHT11);

void setup() {
Serial.begin(9600);
dht.begin();
}

void loop() {
TEMPERATURE = dht.readTemperature();
HUMIDITY = dht.readHumidity();
Serial.print("Temperature: ");
Serial.print(TEMPERATURE);
Serial.print(" Humidity: ");
Serial.println(HUMIDITY);
delay(1000);
}

This is the circuit scheme:

enter image description here

This is a photo of the circuit and the sensor (probably damaged):

enter image description here enter image description here enter image description here

Thanks for your time and sorry for my bad english.

1
  • Caution! Always inspect components before hooking up! I got a DHT11 sensor in a Kuman kit. I hooked it up per standard and ran the sketch. Getting 0s reported back I grabbed the sensor to check it was in the board properly and it was burning hot. On closer inspection the were marked ground-data-VCC. Sensor is pooched. Jan 12, 2019 at 19:03

1 Answer 1

2

Finally I was able to solve the problem by not using the resistor and connecting it directly, I also had a problem with the sensor pins since some were badly connected, but it was also solved. Now both sensors are working well including the melted one. Thanks!.enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.