Introduction
Hello Friends, This is my first spell with the Raspberry Pi Pi (motion) sensor will try to explain the operation.
PIR (Passive Infrared) sensor
Yes, let’s go practice after this information to your friends. Raspberry Pi ‘We are opening the computer After connecting y py file extension, entering a new terminal (sudo nano pır.py). After you type the command we are writing code that is displayed in the image below.
Codes:
import RPi.GPIO
as
GPIO
import time
GPIO.setmode(GPIO.BCM)
PIR_PIN = 7
GPIO.setup(PIR_PIN, GPIO.IN)
try
:
print
"PIR Modul Testi (Cikmak icin CTRL+C'ye basin )"
time.sleep(2)
print
"Hazir"
while
True:
if
GPIO.input(PIR_PIN):
print
"Hareket Algilandi!"
time.sleep(1)
except KeyboardInterrupt:
print
"Cikis"
GPIO.cleanup()
Sensor Raspberry Pi
GND> 6.p (black)
VCC> 2.Por’s (White)
OUT> 26.p the (Yellow)
After making the connection we can run our application. Pır.py terminal, type sudo python enter ‘a are pressed. If you have made your application moves complete the steps will work as follows.
The steps in the video I tried to individual applications. Hope has been useful work. When motion is detected in a subsequent spelling sound (buzzer) and light (LED) will tell the notifier hopefully work