Using a Scrap Ordinary House Alarm PIR With Arduino

by mviljoen2 in Circuits > Arduino

8651 Views, 128 Favorites, 0 Comments

Using a Scrap Ordinary House Alarm PIR With Arduino

1.png
images.jpg

If you are like me and don't like to throw away junk electronic items, you may have an old PIR sensor from an ordinary house alarm at the bottom of your junk box.

You can easily hook it up to your arduino to detect movement by simply making use of the LED on the PIR which turns on when movement was detected.

They usually run with a 12v power source.

Check the next step to see how its connected..

Connecting the PIR to Your Arduino.

2.png

In my case I'm making use of 2 different power sources.

The Arduino is connected to my PC via USB (Not Shown in the Picture) and the PIR is connected to a 12V Power source.

This means that both the Arduino and PIR's GND needs to be joined, otherwise the Arduino will not detect an input from the PIR. (Joining the GND allows the little amount of voltage from the PIR to run via the input pin to GND)

But to simply it , Its better to use the same power source which will be less confusing.

I'm basically powering both the arduino and PIR and then simply connect the LED on the PIR, with a wire which I have soldered to the back of the PIR sensor, the LED then connects to PIN 8 on the arduino (Be sure to put a resistor in between the PIR's LED and the Arduino's Digital Pin 8)

Creating the Code.

3.JPG

The Arduino code is simple and easy to understand.

int PIRInput = 8;
int ledPin = 13;
int PIRState; void setup()
{
pinMode(ledPin, OUTPUT);
pinMode(PIRInput, INPUT);
}
void loop()
{
PIRState = digitalRead(PIRInput);
if (PIRState==HIGH)
{
digitalWrite(ledPin, LOW);
}
else
{
digitalWrite(ledPin, HIGH);
}
}

How it works.

Once the PIR detect's movement, it will turn on its own on board LED which has enough power for the Arduino's digital read feature to detect voltage.

Once the Arduino has detected an incomming signal it simply turns on its own internal built in LED on pin 13.

Off-coarse now you can change the code to do what ever you want it to do.

Watch the Video for Better Clarity.

Connect a normal house alarm PIR Sensor to Arduino

Watch a demonstration of this video.

Hope you enjoyed my instructable.