2 DHT22 sensors.

Good day everyone,
recently ive been struggling to use 2 DHT22 at the same time. but only 1 DHT22 sensor is sending data and the other one does not. any suggestions?

Here is the image of the serial monitor

Here are the codes

#include <DHT.h>
#define DHTPIN1 3 
#define DHTPIN2 4 

#define DHTTYPE1 DHT22 // DHT 22 (AM2302)
#define DHTTYPE2 DHT22 // DHT 22 (AM2302)


int chk;
float hum1;  //Stores humidity value
float temp1; //Stores temperature value
float hum2;  //Stores humidity value
float temp2; //Stores temperature value
void setup()

void loop()
//Read data and store it to variables hum and temp
hum1 = dht1.readHumidity();
temp1= dht1.readTemperature();
hum2 = dht2.readHumidity();
temp2= dht2.readTemperature();
//Print temp and humidity values to serial monitor
Serial.print("Humidity1: ");
Serial.print(" %, Temp1: ");
Serial.println(" Celsius");
Serial.print("Humidity2: ");
Serial.print(" %, Temp2: ");
Serial.println(" Celsius");
delay(10000); //Delay 2 sec.

Welcome on the forum,

tip 1: use code tags (you can update your post)

tip 2: try to swap the sensors, if the other now works the sensor is not broken.

tip 3: check your wiring

tip 4: post the output of the sketch.

tip 5: do you have pull up resistors on the datapin (4K7 ohm)

how do i use a pull up resistor in parallel with 5v and data or in series with data? thanks for the reply


managed to do the pull up resistor but still the second DHT22 sensor did not send any data. i think theres something wrong with the codes bu i cant tell.

also the wiring is okay since both DHT22 works well one at a time but when it comes together it does not.

I have a circuitry of one DHT22, one BMP280 (I2C) and one TEMT6000 + 1602 on I2C. Clone Arduino Nano.

The most stable reading is from the DHT22 (20 minutes, difference in readings over time is bellow 1C). On 5V, 4K7 Resistor data to VCC.

From what I read, some recommends 5V instead of 3V3, for a more accurate and stable reading.


You may comment the lines of each sensor and see which is the one not sending data.

Then, check the wires of the one you identified as not working.

Tip1: use permanent markers to stamp each sensor (say 1 and 2).

Tip2: some jumpers makes "bad jokes" namely they allow sliding of the black plastic tube over metallic core, which protrude only a little in the breadboard, so not actually getting to the contacts in the breadboard.

So, dont believe your eyes! :-)) Just pull and plug all jumpers of the line of the DHT22 which you find as not sending data.

thank you very much guys. just found out one of my jumper wires gut busted