2

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.

  • 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. – Jeff Richardson Jan 12 at 19:03
3

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

0

Your first image with the title "This is the circuit scheme" looks correct for a 4 wire sensor. Your third image with the "melted" sensor only has 3 wires.

I recommend you identify your 3 wire sensor, get a copy of it's data sheet and ensure it is connected to your Arduino Uno correctly.

enter image description here

Hopefully your Arduino was not damaged.

  • Hello, sorry for bothering you again. Can it be possible that the sensor is mounted on a PCB and that it does not need a resistor? Thanks – TaD Nov 29 '17 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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