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?
✗ Incorrect
A PIR sensor outputs a digital HIGH signal on its output pin when it detects motion.
Which Raspberry Pi pin type should you use to read a PIR sensor output?
✗ Incorrect
The PIR sensor output connects to a GPIO input pin to read motion signals.
What Python command sets a GPIO pin as input using RPi.GPIO?
✗ Incorrect
GPIO.setup(pin, GPIO.IN) configures the pin as an input to read signals.
Why should you use a try-except or cleanup in a PIR sensor Python script?
✗ Incorrect
Using try-except or GPIO.cleanup() ensures GPIO pins are properly reset when the program ends.
What does a PIR sensor NOT detect?
✗ Incorrect
PIR sensors do not detect sound waves; they detect infrared radiation changes.
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.