i'm currently working on a project. For this i need to measure humidity and temperature on two different places (one outside, one inside). I am doing this by using two DHT11-sensors with an Arduino Uno R3, I switch between the two sensors with an for-loop, which is switching through the pins (I use digital 2 and digital 3). Well, that far it's working out fine.
On the beginning i got the exact same values of both the sensors since they are directly next to each other (that means about 20°C and 40% hum).
After some time (and some restarts..) one of the two DHT11-sensors i use started giving crazy data. the first sensor was still giving the 20°C and 40% hum, but the second was giving out values about 20°C and 25% hum. The wrong data came from the sensor at the Pin 3 location.
I switched the sensors, now the wrong data came from Pin 2. I switched the wires on pin 2, no change at all.
Then I tested whether the wrong sensor is still measureing while taking them outside on a foggy day. The values from the right sensor changed to the real ones this day, but the wrong sensor was still measuring about 20% below the reality, the temperature readings were okay.
I exchanged the wrong sensor, and i got good values again. But the same now happend again.
Since I am pretty new into Arduino and programming at all, I am pretty sure i mismatched something, but i cant find the reason for that issue.
It would be nice if someone could help me, i am happy about anything, like suggestions about the code, ideas what could have went wrong, everything would be amazing.
postscriptum: as you may have recognized, english is not a language i speak or write that often, and i am trying to improve. i know my current level is not good, i am really sorry for this.