Compile Fatal Error: Adafruit_Sensor.h: No such file

I am trying to compile the following code on a MKR1000, but I keep getting an error message: Arduino: 1.8.2 (Windows 10), Board: “Arduino/Genuino MKR1000”
In file included from C:\Users\johno\Documents\Arduino\libraries\DHT_sensor_library\DHT_U.cpp:22:0:
C:\Users\johno\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 Arduino/Genuino MKR1000.

// Libraries
#include "DHT.h"

// Pins
int sensorPin = A0;
#define DHTPIN 5
#define DHTTYPE DHT22

// Initialize DHT sensor

void setup() {

  // Serial

  // Init DHT 


void loop() {

  // Reading temperature and humidity
  float humidity = dht.readHumidity();
  // Read temperature as Celsius
  float temperature = dht.readTemperature();

  // Display
  Serial.print("Temperature: ");
  Serial.println(" C");

  Serial.print("Humidity: ");
  Serial.println(" %");

  // Reading from analog sensor
  int sensorValue = analogRead(sensorPin);
  float lightLevel = sensorValue/1024.*100;

  // Display
  Serial.print("Light level: ");
  Serial.println(" %");

  // Wait  


I have installed the DHT sensor library by Adafruit 1.3.0.

However, the Adafruit site says:
This library also includes an optional class for the DHT humidity and temperature sensor which is designed to work with the Adafruit unified sensor library.

You must have the following Arduino libraries installed to use this class:Adafruit Unified Sensor Library

But I cannot find this in the Library Manager.

Thanks in advanced.

It is there I can assure you.

There are three boxes at the top of the library manager

All I did was type unified into the third box and scroll down.

Its a lib I also use so I am surprised you did not see it.

Thanks. Found it using "Unified". I searched "Adafruit Sensor" before.

Thanks ballscrewbob . well your solution was the perfect for my project

Thanks ballscrewbob. your tip help me very much

BallScrewBob's fix didn't work for me. When I search for "unified" in the library manager there are no results.

any other suggesstions?


There are no less than 15 unified libraries. And just to be sure I checked again and YEP they are all still there in the regular desktop IDE. There are 12 in CREATE editor as I checked that too.

Clearly you did something wrong or have something not setup correctly.

Thanks ballscrewbob, it really helped me...

Thanks ballscrewbob, after wasting 2 days and just before giving up , you helped me to solve my problem. Now it works perfectly.

No to revive and old thread, but I’m having the same issue (fatal error). I did install/add the library but the issue is not resolved. Here is the Error Message I get:

LUXSensor_TSL2561_tutorial:2:10: fatal error: Adafruit_Sensor.h: No such file or directory

#include <Adafruit_Sensor.h>


compilation terminated.

exit status 1
Adafruit_Sensor.h: No such file or directory


Your issue sound more like you simple have not installed the library

Could you take a few moments to Learn How To Use The Forum. It will help you get the best out of the forum in the future. Other general help and troubleshooting advice can be found here.

Thank you ... I did install the library (or so I thought). It turns out my anti-virus was causing the library folders to be empty. Issue resolved, I simply install libraries manually now. thank You :)