Project Assistance (DHT11 and Grove stuff)

I'm a kid working on a grove project, which involves a DHT11 humidity and temp. sensor. I'm currently using the grove beginner kit, and trying to connect it with an arduino uno as well. My problem is that i cant connect it with the UNO and i dont know how to build off of my current code to add other items, like a mist creator. This is my current code. Can anyone help me? (This is project due 3 days later so please help)

#include <DHT11.h>
#include <Grove_Temperature_And_Humidity_Sensor.h>

#include <dht11.h>
#define DHT11PIN 4

dht11 DHT11;

void  setup()
{
  Serial.begin(9600);
 
}

void loop()
{
  Serial.println();

  int chk = DHT11.read(DHT11PIN);

  Serial.print("Temperature  (C): ");
  Serial.println((float)DHT11.temperature, 2);

  delay(2000);


if (Serial.println=("37")) {
  
(empty part where i intend to add the mist)

}
}

I also get this error message and don't know how to deal with it.

C:\Users\Curtis\OneDrive\文件\Arduino\sketch_aug19a\sketch_aug19a.ino:1:10: fatal error: DHT11.h: No such file or directory
compilation terminated.

exit status 1

Compilation error: DHT11.h: No such file or directory

Please help!

did you install DHT11 library in library manager?

1 Like

I installed multiple variants of the library and tested them 1 by 1 but none of them worked

before attempting to implement a project using multiple devices test each device in a separate program
e.g. using Tools>Manage Libraries install a DHT11 library
image

then compile, link and load the library example programs, e.g. Edit>Examples>DHT11>ReadTemperature

test any other sensors in a similar manner

once you know how to use the libraries and you know the sensors work you can start implementing your project

what microcontroller are you using?

1 Like

To interface DHT11 sensor with Arduino checkout this guide: https://playwithcircuit.com/how-to-interface-dht11-and-dht22-sensors-with-arduino-uno/

1 Like

Thanks a lot, horace and jrchana! It worked after I treid your methods.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.