0
0
Raspberry Piprogramming~5 mins

MotionSensor (PIR) in Raspberry Pi - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does a PIR Motion Sensor detect?
A PIR (Passive Infrared) Motion Sensor detects changes in infrared radiation, which usually means it senses movement of warm objects like people or animals.
Click to reveal answer
beginner
How do you connect a PIR sensor to a Raspberry Pi?
You connect the PIR sensor's power pin to 5V or 3.3V, ground pin to GND, and the output pin to a GPIO pin on the Raspberry Pi to read motion signals.
Click to reveal answer
beginner
What Python library is commonly used to read GPIO pins on a Raspberry Pi?
The RPi.GPIO library is commonly used to control and read GPIO pins on a Raspberry Pi in Python programs.
Click to reveal answer
intermediate
What is the basic Python code structure to detect motion using a PIR sensor?
Set up the GPIO pin as input, then use a loop to check if the pin reads HIGH (motion detected) or LOW (no motion), and respond accordingly.
Click to reveal answer
intermediate
Why is it important to add a delay or debounce when reading PIR sensor signals?
Adding a delay helps avoid false triggers caused by sensor noise or rapid changes, ensuring the program reacts only to real motion events.
Click to reveal answer
What type of signal does a PIR sensor output when motion is detected?
ADigital HIGH signal
BAnalog voltage
CPWM signal
DNo signal
Which Raspberry Pi pin type should you use to read a PIR sensor output?
AGPIO output pin
BGPIO input pin
CPower pin
DGround pin
What Python command sets a GPIO pin as input using RPi.GPIO?
AGPIO.output(pin, True)
BGPIO.setup(pin, GPIO.OUT)
CGPIO.input(pin)
DGPIO.setup(pin, GPIO.IN)
Why should you use a try-except or cleanup in a PIR sensor Python script?
ATo safely release GPIO resources on exit
BTo speed up the sensor
CTo increase sensor sensitivity
DTo change sensor voltage
What does a PIR sensor NOT detect?
AMotion of warm objects
BChanges in infrared radiation
CSound waves
DPresence of people
Explain how a PIR sensor works with a Raspberry Pi to detect motion.
Think about how the sensor senses heat changes and how the Pi reads that signal.
You got /4 concepts.
    Describe the steps to write a Python program that alerts you when motion is detected by a PIR sensor.
    Start from setting up the pin to cleaning up after the program ends.
    You got /5 concepts.