C:\Users\Dray98\AppData\Local\Temp\arduino_modified_sketch_819854\sketch_jun09a.ino:2:29: fatal error: Adafruit_Sensor.h: No such file or directory

 #include <Adafruit_Sensor.h>


compilation terminated.

Multiple libraries were found for "DHT.h"
 Used: C:\Users\Dray98\Documents\Arduino\libraries\DHT_sensor_library
 Not used: C:\Users\Dray98\Documents\Arduino\libraries\DHT-sensor-library-master
Using library DHT_sensor_library at version 1.3.0 in folder: C:\Users\Dray98\Documents\Arduino\libraries\DHT_sensor_library 
exit status 1
Error compiling for board Arduino/Genuino Uno.
  • 2
    Please edit your question and add an explanation of what you are working on. Place this text before what appears to be the output of your Arduino compiler session. Tell us how you tried to fix this problem. Posters who have tired and fail get better responses then posters who try nothing at all. If you do not do this soon people will likely vote to close your question and you will not get an answer.
    – st2000
    Jun 9, 2018 at 3:29

3 Answers 3


When you encounter a No such file or directory error it usually means you need to install the library that contains the missing file (in this case Adafruit_Sensor.h).

Ideally the documentation for the code you are trying to compile will have instructions for installing dependencies.

Sometimes the author did not make the effort to write this documentation and you'll need to go searching for the missing library.

Many Arduino libraries are in the Library Manager index, which makes them quite easy to install:

Library Manager installation

  1. (In the Arduino IDE) Sketch > Include Library > Manage Libraries.
  2. Wait for the download to finish.
  3. In the "Filter your search..." box, type your search query, in this case "adafruit unified sensor abstraction layer" would get you the one correct result but with a little searching through the results of a more general search like "adafruit sensor" will get you there also.
  4. Scroll through the search results to find something that looks correct (in this case "Adafruit Unified Sensor by Adafruit"), then click on it.
  5. Click "Install".
  6. Wait for installation to finish.
  7. Click "Close".

If you don't find the library you need in Library Manager you'll need to spend some time with your favorite search engine. Once you find the library and download it you'll need to install it.

.ZIP Installation

  1. (In the Arduino IDE) Sketch > Include Library > Add .ZIP Library
  2. Select the downloaded file (must be a .zip).
  3. Click "Open".

The above installation instructions require the .zip file to have a specific folder structure. In some cases the library author has not been kind enough to provide the correct folder structure. If you get a "Zip doesn't contain a library" error message then you will need to do a manual installation of the library.

Manual Installation

  1. Unzip the downloaded file
  2. Browse through the unzipped folder until you find the library folder. This will either have a library.properties file and/or a .h file.
  3. Copy the library folder to {Sketchbook folder}/libraries. You can find the sketchbook folder in the Arduino IDE at File > Properties > Sketchbook location. You will need to restart the Arduino IDE before the examples sketches for manually installed libraries will appear under the File > Examples menu.

Your problem is, that you haven't installed the Adafruit_Sensor.h, which is a dependency of Adafruits DHT library. The README on Github for the DHT library also states this:

You must have the following Arduino libraries installed to use this class:

Adafruit Unified Sensor Library

You can find the Adafruit_Sensor.h here at Github. Install it in your libraries folder. You can refer to the answer from per1234 for instructions on installing libraries.


The second part in your error output is not really an error. As others stated before, the IDE only tells you, which version of the DHT library it uses. If you want to have multiple version in your libraries folder, you will have to make sure, that you always use the correct one. If they are identical, you can delete one of them, if you want to. The outcome would not be any different, except for that the IDE doesn't have to tell you, which library it uses.


Have you installed the Adafruit_Sensor library correctly? If not, at top of IDE, click Include Library > and see if it's in the list and click it, if not, go to top of list and click Manage Libraries..., search for and click on it.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.