PIR Motion Detection Sensor


PIR Motion Detection Sensor

Welcome To Hackaholic and this is Raspberry pi Hack Series. In this video I will show you how to use PIR motion detection sensor.

How PIR Motion detection Sensor Works.

When it Detects the motion in the environment, the out pin value changes from low to high (Key point). We need to check for out value of pir sensor when its 1 (motion detected).

Lets see python Program: Copy the code and save it as pir_sensor.py

import sys
import time
import RPi.GPIO as gpio


def motion_detect():
        while True:
            if gpio.input(7)==1:
                print "Motion Detected"
    except KeyboardInterrupt:
        print "\n Terminated by User"

if __name__ == "__main__":

Watch the video for setup. Enjoy Hackaholic

Plz Share Share on FacebookShare on Google+Share on LinkedInTweet about this on TwitterEmail this to someoneShare on RedditShare on TumblrDigg thisBuffer this pagePrint this pagePin on PinterestShare on StumbleUponFlattr the author
Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *