Error compiling for Arduino Uno, because of #include <cactus_io_AM2302.h>

Everything I’ve read said my code should be fine, can anyone help me with this?

Copy of code:

#include <SoftwareSerial.h>

#include <cactus_io_AM2302.h>
#define AM2302_PIN 7
const int pinPhoto = A0;
int raw = 0;
const int inputPin = 6;
AM2302 dht(AM2302_PIN);
const int ledPin = 13;
void setup() {
// put your setup code here, to run once:
pinMode( pinPhoto, INPUT );
pinMode(inputPin, INPUT);
pinMode(ledPin, OUTPUT);

void loop() {
// put your main code here, to run repeatedly:
int value = digitalRead(inputPin);
raw = analogRead(pinPhoto);

if (isnan(dht.humidity) || isnan(dht.temperature_C)) {

if (value == HIGH)

digitalWrite(ledPin, HIGH);
Serial.print(“wake”);Serial.print(" “);Serial.print(raw); Serial.print(” “); Serial.print(dht.temperature_C); Serial.print(” “); Serial.println(dht.humidity);
Serial.print(“sleep”);Serial.print(” “);Serial.print(raw); Serial.print(” “); Serial.print(dht.temperature_C); Serial.print(” "); Serial.println(dht.humidity);
digitalWrite(ledPin, LOW);

Copy of error message:

Arduino: 1.6.9 (Windows 10), Board: “Arduino/Genuino Uno”

C:\Users\590136\AppData\Local\Temp\arduino_modified_sketch_733324\sketch_jun04b.ino:3:30: fatal error: cactus_io_AM2302.h: No such file or directory

#include <cactus_io_AM2302.h>


compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

When you see a "No such file or directory" error it almost always means you need to install the library that contains the missing file.

Often the code you're compiling will come with documentation (either a comment or separate document) that tells you where to get the library dependencies.

In other cases the author of the code will not have been so kind and you'll need to go on a hunt for the missing library.

A good place to start is the Arduino IDE's Library Manager:

  • Sketch > Include Library > Manage Libraries...
  • In the "Filter your search..." box, type some keywords you have gleaned from the missing file name.
  • Scroll through the results for the right library. Click on it.
  • Click "Install".
  • Wait for installation to finish.
  • Click "Close".
  • Try compiling your code again.

If you have no luck in Library Manager then load up your favorite search engine and do a search for the missing filename. You will often get multiple results. If you have a lot of results you might add "arduino" as an additional search keyword. I will usually prefer results on since that is where most Arduino libraries are hosted and downloading from there is fast and easy. In some cases there will be multiple libraries that contain the given filename and you'll need to do some evaluation to determine which seems the most appropriate, then try it out. After downloading the library you found you'll need to install it. This requires a different process than the Library Manager installation. You will find instructions here:

Do not know that library, however writing the code to handle the DHT11 is not that hard. However, here is a link to a lib that should work.