Usage of Temperature and Humidity sensor with LCD I2C display
I have used Arduino UNO for this project. You can use other cards.
NOTE: If you use another board, you may need to relocate the "SDA, SCL" pins. You can find out by looking at the data sheet of the card you are using.
First, make the connection of the DHT sensor with the Arduino board.
VCC - 5V
DATA - PIN 4 (you can also use pins 3, 4, 5, 12, 13)
GND - GND
LCD connections with Arduino board
VCC - 5V
GND - GND
SDA - A4(Analog Pin 4)
SCL - A5(Analog Pin 5)
If you have connected the connections correctly it will look like this.
Red Wires indicate the VCC wires and the black ones indicate GND wires.
NOTE- If you see that your sensor is rapidly getting warm(only for 4 pin sensors) then attach a 10K pull up resistor joining VCC and Signal ends of the sensor.
DHT
Open your Arduino IDE
and go to Sketch > Include Library > Manage Libraries.
The Library Manager should open.
Search for DHT
on the Search box and install the DHT library from Adafruit.
LCD I2C
Open your Arduino IDE
and go to Sketch > Include Library > Manage Libraries.
The Library Manager should open.
Search for LiquidCrystal I2C
on the Search box and install the LCD I2C.
lv_0_20221028171451.mp4
If you don't see any text on the LCD, try this.
Before
After