DHT11 showing random invalid results depending on cable

I have a DHT11 sensor unit (inbuilt pull up resistor) for humidity and temperature which was working well when plugged into my breadboard. I am now using an approx 1.5m cable and getting wildly incorrect results. I have checked the cable and there appears to be strong connection and no crossover between wires. Any ideas what may be causing this?

Results
I suspect that the 24 degrees and 63% humidity is accurate.

Temp=24.0C Humidity=63.0%
Temp=24.0
C Humidity=63.0%
Temp=12.0C Humidity=159.0%
Temp=12.0
C Humidity=159.0%
Temp=24.0C Humidity=63.0%
Temp=12.0
C Humidity=159.0%
Temp=24.0C Humidity=63.0%
Temp=12.0
C Humidity=159.0%
Temp=24.0C Humidity=63.0%
Temp=12.0
C Humidity=159.0%
Temp=12.0C Humidity=159.0%
Temp=12.0
C Humidity=159.0%
Temp=24.0C Humidity=63.0%
Temp=12.0
C Humidity=159.0%
Temp=12.0C Humidity=159.0%
Temp=12.0
C Humidity=159.0%
Temp=24.0C Humidity=63.0%
Temp=24.0
C Humidity=63.0%
Temp=12.0C Humidity=159.0%
Temp=12.0
C Humidity=159.0% <--Took the sensor out of greenhouse, so expect a lowering of humidity (which does happen)
Temp=24.0C Humidity=60.0%
Temp=12.0
C Humidity=155.0%
Temp=11.0C Humidity=156.0%
Temp=22.0
C Humidity=58.0%
Temp=11.0C Humidity=157.0%
Temp=21.0
C Humidity=59.0%
Temp=21.0*C Humidity=59.0%

I have no idea why a longer cable would make this impact (have tested two cables now) given that 20m should be acceptable based on the product specs. I am using 4 core security camera cable (only using 3 of the cores though), so not sure if the twist (or lack of twist) within a cable could make an impact like the twisted pairs in cat6 etc.

Note: The sensor is connected to an RPi, but I have tested two different python libraries and getting similar errors, so feel the issue is with the sensor/cable and not the processing unit.

Since the DHT11 has its own data transfer scheme I would look at:

  1. Can you measure Vcc at the sensor?
  2. is the internal pullup 5K as suggested?
  3. Marginal timing issues
  4. Does the error change if the wire is all curled up near the Arduino (trying to eliminate noise pickup)

Vcc at sensor is 4.93V and it's using a 10k pullup resistor (built into the unit). The coiling of the cable doesn't seem to make any difference.

Interestingly now it's also consistently showing around 10% above the expected range. I calibrated with two commercial units using the salt atmosphere test, both of the commercial units showed 73%, the DHT11 at 85% and has maintained about 10% above the commercial units following the test - strange that it was reasonably accurate before as well. I'm leaning towards a busted sensor.

I'm leaning towards a busted sensor.

Can you rewire it to the original configuration you said worked well?

Add another 10K pullup (the combination will be the 5k the datasheet suggests)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.