Previously, we published guide on how to setup LCD 1602A with Arduino, print Arduino Temperature Humidity Sensor reading on serial display. This guide, simply combining those two guides in the same way we combined two guides on our Arduino basic light meter guide. In This Guide, We Will create a Arduino Temperature & Humidity Sensor DHT 11 With LCD 1602A Following Few Steps. A the end of this guide, you’ll get the below photograph like thing :
We are using Arduino Web IDE for compilation and uploading code. You’ll also get the code, circuit diagram of this project on below URLs :
Arduino Temperature & Humidity Sensor DHT 11 With LCD 1602A
Needed components :
- Arduino UNO or similar dev board
- 10K Ohm Potentiometer
- DHT 11 or similar sensor
Here is the circuit diagram :
Exactly like the previous guides, first setup the LCD. We will adjust the contrast with potentiometer – so that is an important thing.
Pin 1 on LCD (VSS) will connect to GND of Arduino
Pin 16 on LCD (K) will connect to GND of Arduino
Pin 2 on LCD (VDD) will connect to +5v of Arduino
Pin 15 on LCD (A) will connect to +5v of Arduino
With the above connection if you connect Arduino with computer, the LCD will light up. Next, disconnect from computer and add the potentiometer :
First pin of the potentiometer will go to GND of Arduino
Pin 3 of the LCD display (VO) will connect to the middle pin of the potentiometer
With the above connection, again connect your Arduino with computer, the LCD will light up. Adjust the potentiometer and you’ll be able to see from blank to white all units like    . That     is full contrast and blank is minimum contrast.
Pin 4 of the LCD display (RS) will connect to Pin 7 of Arduino
Pin 5 of the LCD display (RW) will connect to GND of Arduino
Pin 6 of the LCD display (E) will connect to Pin 8 of Arduino
Pin 11 of the LCD display (D4) will connect to Pin 9 of Arduino
Pin 12 of the LCD display (D5) will connect to Pin 10 of Arduino
Pin 13 of the LCD display (D6) will connect to Pin 11 of Arduino
Pin 14 of the LCD display (D7) will connect to Pin 12 of Arduino
If you use 1, 2, 3, 4 numbers of breadboard, you’ll not get confused. With the above connection again connect Arduino with computer. Next step is connecting the DHT 11 sensor. That is easy.
VCC – connect to 5v of Arduino, first pole from extreme left from front-side
Data – to connect with A0 pin of Arduino, second pole from extreme left from front-side
NC – not needed to do anything
GND – to connect with GND of Arduino, last pole from extreme left from front-side
This is the code :
#define DHTPIN A0 // Pin which is connected to the DHT sensor.
// type the model of sensor in use, we are using DHT 11, if you are using DHT 21 or DHT 22 change it
#define DHTTYPE DHT11
DHT_Unified dht(DHTPIN, DHTTYPE);
LiquidCrystal lcd(7, 8, 9, 10, 11 , 12);
lcd.begin(16,2); //16 by 2 character display
delay(1000); //wait a sec (recommended for DHT11)
The above is 100% working code tested on January 2018. The reason peoples face issues with DHT 11 is out of not properly using the needed libraries. From Arduino Web IDE, you’ll not need to install any libraries. What libraries to install on local computer’s Arduino IDE, that is discussed on the previous basic guides linked at the beginning of this article.
Follow the Author of this article :