[PYTHON] Play with PIR sensor module [DSUN-PIR]

DSUN-PIR Motion sensor

I bought DSUN-PIR http://www.aitendo.com/product/10254

#!/usr/local/bin/python

-- coding: utf-8 --

from future import print_function
import RPi.GPIO as GPIO
import os
import time
SENSOR_PIN = 25
LED_PIN = 24
GPIO.setmode(GPIO.BCM)
GPIO.setup(SENSOR_PIN, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(LED_PIN, GPIO.OUT)
while True:
   pin_status = GPIO.input(SENSOR_PIN)
   print(pin_status)
   GPIO.output(LED_PIN, pin_status)
   time.sleep(1)
GPIO.cleanup()

If you set the LED to number 24, it will shine.

Adjustment

Seen from the front Left detection interval Right detection distance Like

Recommended Posts

Play with PIR sensor module [DSUN-PIR]
Play with ASE MD module
Detects people with motion sensor module
Play around with the pythonista3 ui module
Use PIR motion sensor with raspberry Pi
Play with Prophet
Play with 2016-Python
Play with CentOS 8
Play with Pyramid
Play with Fathom
Play with the Raspberry Pi Zero WH camera module Part 1
Let's play with 4D 4th
Let's play with Amedas data-Part 1
Play with reinforcement learning with MuZero
Play with push notifications with imap4lib
Let's play with Amedas data-Part 4
Play with Jupyter Notebook (IPython Notebook)
[Python] Play with Discord's Webhook.
Play RocketChat with API / Python
Let's play with Amedas data-Part 3
Let's play with Amedas data-Part 2
Play with A3RT (Text Suggest)