DHT-sensor-library: DHT Library 1.3.0 Does NOt Work

Hi, I can compile my project properly with DHT library 1.2.2. However, after updating my library to version 1.3.0, this error raised and I cannot compile my project using DHT22 sensor:

//////////////////////////////////

C:\Users\xxxxxx\Documents\Arduino\libraries\DHT_sensor_library/DHT_U.h:25:29: fatal error: Adafruit_Sensor.h: No such file or directory

 #include <Adafruit_Sensor.h>

                             ^

compilation terminated.

exit status 1
Error compiling for board WeMos D1 R2 & mini.

/////////////////////////////

I cannot back to version 1.2.3 it says CRC error. Backed to 1.2.2 and it compiles correctly. Can you please advise!

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 22
  • Comments: 31 (1 by maintainers)

Commits related to this issue

Most upvoted comments

You should be able to install the missing Adafruit_Sensor library from the Library Manager: screen shot 2016-12-26 at 12 52 24

1.3.0 is broken here to (and adafruit sensors is not in library manager) In DHT sensor lib in the lib manager I clicked on select version 1.2.3 and my old sketches started working again.

I fixed this issue by saving this Adafruit_Sensor.h file to new folder $ARDUINO_HOME$/libraries/Adafruit_Sensor/Adafruit_Sensor.h.

Download the “Adafruit Unified Sensor” it worked out for me https://github.com/adafruit/Adafruit_Sensor

Downgrading the lib to 1.2.3 worked for me.

Including in this order solves the problem #include <Adafruit_Sensor.h> #include “DHT.h”_

Broken here, too. Not cool pushing broken things to the public Arduino libraries…

I could manage to fix the compile issue by adding this : https://github.com/adafruit/Adafruit_Sensor

But why we need it in first place and why cannot add it from Library Manager ??? (I manually added this to work)!!!

Download the “Adafruit Unified Sensor” library from the library manager - this worked for me. adafruit sensor header file_LI vlcsnap-2019-04-25-12h39m06s015_LI

@hoegge I don’t know which version of the IDE you might be using but I can see the Adafruit Unified Sensor in the library manager. It was the second to last one on the list that I got while filtering the search with ‘Unified Sensor.’

Thank you @jimgitonga , this work.

Download the “Adafruit Unified Sensor” it worked out for me https://github.com/adafruit/Adafruit_Sensor

As was previously mentioned, download the “Adafruit Unified Sensor” library from the library manager. http://www.arduinolibraries.info/libraries/adafruit-unified-sensor

i had this exact same problem, and switching the DHT lib to 1.2.3 does solve the problem of compile error and compiles fine.

Didnt try the route of adding Adafruit Unified Sensor as suggested by others.

Download the “Adafruit Unified Sensor” library from the library manager - this worked for me.