Why is the dht.h file not being detected?

Hello, my group and I are trying to replicate a product called the Arduino Digital Clock & Thermometer for our school project . As stated in the project name, it’s a clock that’s supposed to show the time, date, temperature, and humidity.

The original product was done using solder and the arduino pro mini, but my group is using the arduino uno to test the code first. We also didn’t use a rechargeable battery. After we finished wiring everything and uploaded the code, we kept on getting error messages. I have to admit that my group is still a beginner to the arduino coding and wiring so we can’t tell which parts we messed up on and fix them. Can we please get some assistance on this project?

Original Product link: Arduino Digital Clock & Thermometer

Error message:

Arduino: 1.8.10 (Windows 10), Board: "Arduino/Genuino Uno"

sketch_may25a:18:10: error: dht.h: No such file or directory

Multiple libraries were found for "Wire.h"

Used: C:\Program

Multiple libraries were found for "RTClib.h"

Used: C:\Users\student\Documents\Arduino\libraries\RTClib-master

Not used: C:\Users\student\Documents\Arduino\libraries\RTClib-2.0.3

Multiple libraries were found for "Adafruit_I2CDevice.h"

Used: C:\Users\student\Documents\Arduino\libraries\Adafruit_BusIO-master

Multiple libraries were found for "LiquidCrystal_I2C.h"

Used: C:\Users\student\Documents\Arduino\libraries\LiquidCrystal_I2C-1.1.2

#include <dht.h>

^~~~~~~

compilation terminated.

exit status 1

dht.h: No such file or directory

This report would have more information with

"Show verbose output during compilation"

option enabled in File -> Preferences.

Was the library installed?

https://create.arduino.cc/projecthub/pibots555/how-to-connect-dht11-sensor-with-arduino-uno-f4d239

The library was installed but it does not get detected and we are using a DHT-21 sensor.

The message says otherwise. From the link with the clock project there is an archive for download and in it are the program together with all the libraries. Did you copy these libraries where needed? You don't seem to have copied them to the required location.

Downloading the libraries worked but now we have another problem.

Arduino: 1.8.10 (Windows 10), Board: "Arduino/Genuino Uno"

sketch_jun02a:20:53: error: 'POSITIVE' was not declared in this scope

 LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address, if it's not working try 0x27.

                                                     ^~~~~~~~

Multiple libraries were found for "Wire.h"
 Used: C:\Program
Multiple libraries were found for "RTClib.h"
 Used: C:\Users\student\Documents\Arduino\libraries\RTClib-master
 Not used: C:\Users\student\Documents\Arduino\libraries\RTClib-2.0.3
Multiple libraries were found for "Adafruit_I2CDevice.h"
 Used: C:\Users\student\Documents\Arduino\libraries\Adafruit_BusIO-master
Multiple libraries were found for "LiquidCrystal_I2C.h"
 Used: C:\Users\student\Documents\Arduino\libraries\LiquidCrystal_I2C-1.1.2
Multiple libraries were found for "dht.h"
 Used: C:\Users\student\Documents\Arduino\libraries\DHT_Library
Multiple libraries were found for "SPI.h"
 Used: C:\Program
exit status 1
'POSITIVE' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Well. Why not declare POSITIVE in your code?

I suspect that you did install the wrong LiquidCrystal_I2C library. Either find the correct one or have a look at the examples that came with the one that you downloaded and modify your sketch.

So we declared int as positive in our sketch but then our code still does not work and it gives us the error:

Arduino: 1.8.10 (Windows 10), Board: "Arduino/Genuino Uno"

sketch_jun02a.1:21:61: error: no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int, int, int&)'

 LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address, if it's not working try 0x27.

                                                             ^

In file included from C:\Users\student\Documents\Arduino\sketch_jun02a.1\sketch_jun02a.1.ino:15:0:

C:\Users\student\Documents\Arduino\libraries\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:57:3: note: candidate: LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, uint8_t)

   LiquidCrystal_I2C(uint8_t lcd_Addr,uint8_t lcd_cols,uint8_t lcd_rows);

   ^~~~~~~~~~~~~~~~~

C:\Users\student\Documents\Arduino\libraries\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:57:3: note:   candidate expects 3 arguments, 10 provided

C:\Users\student\Documents\Arduino\libraries\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:55:7: note: candidate: constexpr LiquidCrystal_I2C::LiquidCrystal_I2C(const LiquidCrystal_I2C&)

 class LiquidCrystal_I2C : public Print {

       ^~~~~~~~~~~~~~~~~

C:\Users\student\Documents\Arduino\libraries\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:55:7: note:   candidate expects 1 argument, 10 provided

C:\Users\student\Documents\Arduino\libraries\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:55:7: note: candidate: constexpr LiquidCrystal_I2C::LiquidCrystal_I2C(LiquidCrystal_I2C&&)

C:\Users\student\Documents\Arduino\libraries\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:55:7: note:   candidate expects 1 argument, 10 provided

Multiple libraries were found for "Wire.h"
 Used: C:\Program
Multiple libraries were found for "RTClib.h"
 Used: C:\Users\student\Documents\Arduino\libraries\RTClib-master
 Not used: C:\Users\student\Documents\Arduino\libraries\RTClib-2.0.3
Multiple libraries were found for "Adafruit_I2CDevice.h"
 Used: C:\Users\student\Documents\Arduino\libraries\Adafruit_BusIO-master
Multiple libraries were found for "LiquidCrystal_I2C.h"
 Used: C:\Users\student\Documents\Arduino\libraries\LiquidCrystal_I2C-1.1.2
Multiple libraries were found for "dht.h"
 Used: C:\Users\student\Documents\Arduino\libraries\DHT_Library
Multiple libraries were found for "SPI.h"
 Used: C:\Program
exit status 1
no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int, int, int&)'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Which LCD library is being used? Do the LCD examples for the LCD library you are using work?

The below tells you that you have the wrong LiquidCrystal_I2C library

sketch_jun02a.1:21:61: error: no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int, int, int&)'

 LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address, if it's not working try 0x27.

                                                             ^

In file included from C:\Users\student\Documents\Arduino\sketch_jun02a.1\sketch_jun02a.1.ino:15:0:

C:\Users\student\Documents\Arduino\libraries\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:57:3: note: candidate: LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, uint8_t)

   LiquidCrystal_I2C(uint8_t lcd_Addr,uint8_t lcd_cols,uint8_t lcd_rows);

   ^~~~~~~~~~~~~~~~~

Below tells me that you seem to have multiple libraries installed; the Arduino environment picks the wrong one. I would delete this one and see if it compuiles with the remaining one.

So we got everything to work except the temperature and humidity. We ordered a DHT 21 but they shipped us one with 4 wires instead of 3. Is there a way to make it work with the sensor we have right now? What code do we have to modify and which wire connects to what?

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