Introduction: PIR Sensor and LCD Interface to Arduino
Liquified crystal display(LCD) has been used in many electronics circuit which has been more user-friendly after the installation of I2C.In today's ibles, I am going to display characters on the LCD depending on the values thrown by the PIR sensor.PIR sensor helps to detect if there is any motion in it's given boundary.This is achieved by the variation in its temperature emitted by the object.
Let's start building the circuit.
Step 1: Components Required
Components required for making this projects are:
Step 2: PIR Connection
Passive infrared radiationsensor shortly known as PIR sensor measures the radiation of infrared from its boundary field.Usually, the object around us radiates infrared rays which are not visible to human but these sensors are designed for such purpose.when there is a change in the temperature around its boundary the sensor sends a signal.
PIR connection is as follows:
- The VCC pin of the sensor is connected to the positive railing of the breadboard.
- The GND pin is connected to the negative railing of the breadboard.
- The signal pin is connected to the digital pin 2 of the Arduino board.
Step 3: LCD Connection
LCD has the I2C installed in it.I2C is a powerful tool and which is used to reduce the hectic of wires required to connect LCD to any microcontroller.After the installation of the I2C, the number of wire reduced to 4.
The connection of the Arduino is as follows:
- The VCC pin of the LCD is connected to the positive railing of the breadboard.
- The GND pin is connected to the negative railing of the breadboard.
- The SDA or data line is connected to the A4 of the Arduino.
- The SCL or clock line is connected to the A5 of the Arduino.
Step 4: Coding
#include "wire.h" #include "dht.h" #include "LiquidCrystal_I2C.h" dht DHT; #define DHT11_PIN 2; void setup(){ lcd.begin(); Serial.begin(9600); } void loop(){ int chk = DHT.read11(DHT11_PIN); Serial.print("Temperature = "); Serial.println(DHT.temperature); lcd.print("Temperature = "); lcd.print(DHT.temperature); Serial.print("Humidity = "); lcd.println("Humidity = "); Serial.println(DHT.humidity); lcd.print(DHT.humidity); delay(1000); }
Step 5: Output

Participated in the
Makerspace Contest 2017
5 Comments
4 years ago
Please change the post code because we do not talk about DHT but the PIR sensor.
5 years ago
why the coding error? or my arduino appliation error? pls help :(
Reply 5 years ago
Other than that you should read this to be sure that it's the same pinout for your Arduino nano as for the Uno.
https://www.arduino.cc/en/Reference/Wire
Reply 5 years ago
Read the error message again and you will see that you're missing wire.h. It's a library that you can download from github.com.
https://github.com/nox771/i2c_t3
5 years ago
Arduino: 1.8.4 (Windows 7), Board: "Arduino Nano, ATmega328P"
Build options changed, rebuilding all
C:\Users\Asus\Documents\Arduino\sketch_nov01a\sketch_nov01a.ino:1:18: fatal error: wire.h: No such file or directory
#include <wire.h>
^
compilation terminated.
exit status 1
Error compiling for board Arduino Nano.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.