A PIR (Passive Infrared) motion sensor detects changes in infrared radiation, which usually means it senses movement of warm objects like humans or animals.
Click to reveal answer
beginner
How do you connect a PIR sensor to an Arduino?
Connect the PIR sensor's VCC pin to 5V on Arduino, GND to ground, and the output pin to a digital input pin on the Arduino (e.g., pin 2).
Click to reveal answer
beginner
What Arduino function reads the PIR sensor output?
Use the digitalRead() function on the Arduino pin connected to the PIR sensor output to check if motion is detected (HIGH) or not (LOW).
Click to reveal answer
intermediate
Why is it important to add a delay after detecting motion with a PIR sensor?
Adding a delay helps prevent multiple rapid triggers and gives the sensor time to stabilize before detecting new motion.
Click to reveal answer
beginner
What is the typical output signal of a PIR sensor when motion is detected?
The PIR sensor output goes HIGH (usually 3.3V or 5V) when motion is detected, and LOW when no motion is present.
Click to reveal answer
What type of signal does a PIR sensor output to the Arduino when motion is detected?
ADigital HIGH signal
BAnalog voltage proportional to distance
CPWM signal
DNo signal
✗ Incorrect
The PIR sensor outputs a digital HIGH signal when it detects motion.
Which Arduino function is used to read the PIR sensor's output pin?
ApulseIn()
BanalogRead()
CdigitalWrite()
DdigitalRead()
✗ Incorrect
digitalRead() reads the digital signal from the PIR sensor output pin.
Why should you add a delay after detecting motion with a PIR sensor?
ATo increase sensor sensitivity
BTo reset the Arduino
CTo prevent multiple rapid triggers
DTo save power
✗ Incorrect
Adding a delay prevents multiple rapid triggers and allows the sensor to stabilize.
What voltage is typically used to power a PIR sensor with Arduino?
A5V
B3.3V only
C12V
D1.5V
✗ Incorrect
Most PIR sensors work well with 5V power from the Arduino.
What does PIR stand for in PIR motion sensor?
AProximity Infrared
BPassive Infrared
CPower Infrared
DPulse Infrared
✗ Incorrect
PIR stands for Passive Infrared, meaning it detects infrared radiation passively.
Explain how a PIR motion sensor works with an Arduino to detect movement.
Think about how the sensor senses heat changes and how Arduino reads that.
You got /4 concepts.
Describe the steps to connect and program a PIR sensor with Arduino for a simple motion detection project.
Start from wiring, then how to read and respond to sensor signals.
You got /5 concepts.
Practice
(1/5)
1. What does a PIR motion sensor detect in an Arduino project?
easy
A. Light intensity changes
B. Sound levels in the environment
C. Movement by sensing infrared changes
D. Temperature variations
Solution
Step 1: Understand PIR sensor function
A PIR sensor detects motion by sensing changes in infrared radiation emitted by objects.
Step 2: Compare with other options
Sound, temperature, and light sensors detect different things, not motion via infrared.
Final Answer:
Movement by sensing infrared changes -> Option C
Quick Check:
PIR sensor = Motion detection [OK]
Hint: PIR sensors detect heat movement, not sound or light [OK]
Common Mistakes:
Confusing PIR with sound or light sensors
Thinking PIR detects temperature directly
2. Which Arduino code line correctly reads the PIR sensor connected to digital pin 7?
easy
A. int motion = digitalWrite(7);
B. int motion = digitalRead(7);
C. int motion = analogRead(7);
D. int motion = pinMode(7, INPUT);
Solution
Step 1: Identify correct function to read digital input
digitalRead(pin) reads the digital value from a pin, suitable for PIR sensor output.
Step 2: Eliminate incorrect functions
analogRead reads analog pins, digitalWrite sets output, pinMode sets pin mode but does not read value.
Final Answer:
int motion = digitalRead(7); -> Option B
Quick Check:
Use digitalRead for digital sensor input [OK]
Hint: Use digitalRead to get sensor state from digital pins [OK]
Common Mistakes:
Using analogRead on digital pin
Using digitalWrite instead of digitalRead
Confusing pinMode with reading value
3. What will be the output on the Serial Monitor when the following Arduino code runs and the PIR sensor detects motion?
PIR sensor output is digital input, so pin 9 must be set as INPUT, not OUTPUT.
Step 2: Verify other code parts
Serial.begin is correctly in setup, digitalRead works on pin 9, and semicolon is present.
Final Answer:
Pin 9 should be set as INPUT, not OUTPUT -> Option A
Quick Check:
Input pins must use pinMode(INPUT) [OK]
Hint: Set sensor pins as INPUT, not OUTPUT [OK]
Common Mistakes:
Setting sensor pin as OUTPUT
Moving Serial.begin to loop
Ignoring pinMode settings
5. You want to turn on an LED connected to pin 13 only when the PIR sensor on pin 2 detects motion. Which Arduino code snippet correctly implements this behavior?
hard
A. pinMode(2, INPUT);
pinMode(13, OUTPUT);
if (digitalRead(2) == LOW) {
digitalWrite(13, HIGH);
}
B. pinMode(2, OUTPUT);
pinMode(13, INPUT);
if (digitalRead(13) == HIGH) {
digitalWrite(2, HIGH);
}
C. pinMode(2, INPUT);
pinMode(13, OUTPUT);
if (digitalRead(2) == HIGH) {
digitalWrite(13, HIGH);
}
D. pinMode(2, INPUT);
pinMode(13, OUTPUT);
digitalWrite(13, digitalRead(2));
Solution
Step 1: Set correct pin modes
Pin 2 is sensor input, so INPUT; pin 13 is LED output, so OUTPUT.
Step 2: Use digitalRead to control LED
digitalWrite(13, digitalRead(2)) sets LED HIGH when sensor reads HIGH, LOW otherwise.
Step 3: Eliminate other options
pinMode(2, OUTPUT);
pinMode(13, INPUT);
if (digitalRead(13) == HIGH) {
digitalWrite(2, HIGH);
} has wrong pin modes and logic. pinMode(2, INPUT);
pinMode(13, OUTPUT);
if (digitalRead(2) == HIGH) {
digitalWrite(13, HIGH);
} turns LED on for motion but lacks else clause to turn off when no motion. pinMode(2, INPUT);
pinMode(13, OUTPUT);
if (digitalRead(2) == LOW) {
digitalWrite(13, HIGH);
} reverses logic.
Final Answer:
pinMode(2, INPUT);
pinMode(13, OUTPUT);
digitalWrite(13, digitalRead(2)); -> Option D
Quick Check:
LED state = PIR sensor state [OK]
Hint: Write LED pin to sensor pin state directly for simplicity [OK]
Common Mistakes:
Setting sensor pin as OUTPUT
Reversing HIGH/LOW logic
Confusing input/output pin modes
Omitting else clause to turn off LED
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.