PIR Sensor and LCD Interface to Arduino

by rammy2203 in Living > Education

14518 Views, 14 Favorites, 0 Comments

PIR Sensor and LCD Interface to Arduino

a.png

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.

Components Required

6.jpg
3.jpg
4.jpg
2.jpg
5.jpg

PIR Connection

7.jpg
8.jpg
11.jpg
9.jpg

Passive infrared radiation sensor 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.

LCD Connection

13.jpg
14.jpg
16.jpg
15.jpg
12.jpg
19.jpg
17.jpg

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.

Coding

20.jpg
#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);
}

Output

21.jpg