DHT11 sensor issue

Reading the DHT 11 in python on Jessie - GrovePi up to date and firmware is 1.2.5.

The temperature reading is fine but the humidity reading is far to low. I have seen it bounce between 10% and 22%, mostly 10% - even 22% is too low. I have tried a different DHT11 sensor from another kit, but it read 18% (still way too low). I am expecting values 35-45%.

The code fragment I am using to read the values is;

temp_sensor = 7

t = 0.1
h = 0.1
[t,h] = grovepi.dht(temp_sensor,0)
temp = str(t)
humidity = str(h)



Hey Mitch,
I don’t have a great solution for this. If you have 2 sensors reporting readings in the same range then it might be right, however 10-20% does sound a bit low. The only way to check this might be to get a better sensor to check what the real value is or maybe take the sensors to a humid place and see if they work well.


Ok, thanks Karan. I was just wondering if this was a known issue, perhaps fixed in later firmware or code. I know the DHT11’s are not particularly accurate and very sensitive to timing on a read (having done it with a raw component in C code), but I expected it might be a few percentages off, not 10 or 20 percent off.

Coming back to this issue which is not solved. I am seeing exactly the same wrong value across multiple Grove Pi’s with different DHT11 sensors. It is well over 40% humidity in the office and the sensors consistently are reading 21%. In reviewing the firmware code, yours appears to be based on Adafuit Industries code. If I look at the current Adafruit code for reading a DHT11 at https://github.com/adafruit/DHT-sensor-library/blob/master/DHT.cpp it is very different from your code in the 1.2.6 firmware at https://github.com/DexterInd/GrovePi/blob/master/Firmware/Source/v1.2/grove_pi_v1_2_6/DHT.cpp. I realize that your code also handles the DHT21 and 22 sensors, but clearly this code does not work properly for a DHT11 - 21% is not within the ± 5% RH maximum error rating of a DHT11. Not having values that are even close makes the sensor readings useless.

I have a DHT11 raw sensor that I have put on a breadboard and read it with CPP code on a PI2 - it occasionally fails (likely because of interrupts), but the code at https://github.com/pfriedel/Temperature_Sensors/blob/master/dht11.cpp gives me better results with more reasonable humidity values.

Someone needs to review the firmware code.


Hi @mitchvh,
Thanks a lot for trying out the code at different places and letting us know about the problem. We’ll try out adafruit’s updated firmware and pfriedel’s firmware and check if it gives better values.