Today I am Going to show you how to make a interesting,wonderful,cheap home security alarm.In this project i am going to use a Arduino Compatible,P.I.R Sensor module,LCD and some other components.This Project can either powered with U.S.B of your computer.This can be used for security purpose in banks,home and many more fields.

So let's started...................!!!!!!!!!!!!


1. 1 x Arduino Uno(You can use any compatible)

2. 1 x P.I.R Sensor Module.

3. 1 x L.C.D(16 X 2)

4. 1 x 9V Battery

5. 1 x 9V Battery Clip

6. 1 x L.E.D

7. 1 x Piezo Buzzer(I am using Speaker instead)

8. 1 x Breadboard9. Some Jumper Wires

10. An USB Cable(Only for programming)

11. A Computer(Only for programming)


1.Connect Vcc pin of P.I.R sensor to positive terminal of Arduino(5V).

2.Connect Gnd pin of P.I.R sensor to any ground pin of Arduino.

3.Connect Out pin of P.I.R sensor to Pin no. -7 of Arduino.

Connecting L.E.D:-----
Connect Positive terminal(Longer Lead) Of L.E.D To Arduino Pin no. 13.

Connect Negative terminal(Shorter Lead) Of L.E.D To Any Ground Pin.

Connecting Piezo Buzzer:-----

Connect Positive terminal(Red Wire) Of Buzzer To Arduino Pin no. 10.

Connect Negative terminal(Black Wire) Of Buzzer To Any Ground Pin.

To wire your LCD screen to your Arduino, connect the following pins:
LCD RS pin to digital pin 12

LCD Enable pin to digital pin 11

LCD D4 pin to digital pin 5

LCD D5 pin to digital pin 4

LCD D6 pin to digital pin 3

LCD D7 pin to digital pin 2

Additionally, wire a 10K pot to +5V and GND, with it's wiper (output) to LCD screens VO pin (pin3).

Step 3: CODING :-

int IRpin = A0; // IR photodiode on analog pin A0

int IRemitter = 2; // IR emitter LED on digital pin 2 int ambientIR; // variable to store the IR coming from the ambient int obstacleIR; // variable to store the IR coming from the object int value[10]; // variable to store the IR values int distance; // variable that will tell if there is an obstacle or not

void setup(){

Serial.begin(9600); // initializing Serial monitor pinMode(IRemitter,OUTPUT); // IR emitter LED on digital pin 2 digitalWrite(IRemitter,LOW);// setup IR LED as off

pinMode(11,OUTPUT); // buzzer in digital pin 11 }

void loop(){

distance = readIR(5); // calling the function that will read the distance and passing the "accuracy" to it Serial.println(distance); // writing the read value on Serial monitor // buzzer(); // uncomment to activate the buzzer function }

int readIR(int times){

for(int x=0;x

//-- Function to sound a buzzer for audible measurements --//

void buzzer(){

if (distance>1){

if(distance>100){ // continuous sound if the obstacle is too close

digitalWrite(11,HIGH); }

else{ // bips faster when an obstacle approaches


delay(150-distance); // adjust this value for your convenience


delay(150-distance); // adjust this value for your convenience } }

else{ // off if there is no obstacle

digitalWrite(11,LOW); }