Introduction
Arduino projects often use PIR sensors for motion detection, but with dozens of modules available, choosing the right one can be confusing. This guide covers the most popular PIR sensor modules for Arduino, their characteristics, and when to use each.
Popular PIR Sensor Modules for Arduino
1. HC-SR501 – The Classic
Price: $2-3
Voltage: 4.5-20V (typically 5V)
Output: 3.3V digital HIGH on detection
Adjustments: Sensitivity (range), time delay (hold time), trigger mode jumper
Pros: Cheap, widely available, adjustable, works with 5V Arduino
Cons: Relatively high power consumption (50-65µA standby), not 3.3V compatible without level shifting
Best for: Beginners, breadboard projects, 5V Arduino (Uno, Mega, Nano).
2. AM312 – Mini Low-Power Option
Price: $2-3
Voltage: 2.7-12V
Output: 3.0V digital HIGH
Adjustments: None (fixed 2-second hold time)
Pros: Very small (10×8mm), low power (35µA standby), works with 3.3V systems
Cons: Fixed hold time, shorter range (3-5m), more expensive than HC-SR501
Best for: Battery-powered projects, ESP32/Raspberry Pi (3.3V), compact designs.
3. HC-SR505 – Mini HC-SR501
Price: $2-3
Voltage: 4.5-20V
Output: 3.3V digital HIGH
Adjustments: None (fixed 3-5 second hold time)
Pros: Smaller than HC-SR501, good range (3-7m)
Cons: Fixed hold time, requires 5V, higher power than AM312
Best for: Projects where HC-SR501 is too large but 5V is available.
4. Panasonic EKMB Series – Premium Low Power
Price: $8-12
Voltage: 2.3-4.0V
Output: Open-drain (requires pull-up)
Adjustments: Digital interface (I2C) on some models
Pros: Ultra-low power (1-6µA), high sensitivity, excellent temperature stability, various lens options
Cons: More expensive, requires pull-up resistor, surface-mount or small package
Best for: Battery-powered projects, professional products, long-term reliability.
5. Excelitas PYD 2597 – Ultra-Low Power Digital
Price: $6-8
Voltage: 1.4-3.6V
Output: 1-wire digital interface
Adjustments: Configurable via 1-wire
Pros: Extremely low power (2µA), 1.4V operation, integrated wake-up mode
Cons: Requires external lens, more complex interface, surface-mount
Best for: Energy-harvesting projects, coin-cell battery devices.
Comparison Table
| Model |
Voltage |
Standby Current |
Range |
Size |
Best For |
HC-SR501 |
等方面4.5-20V
等方面50-65µA
等方面3-7m
等方面32×24mm
等方面Beginners, 5V projects
AM312 |
等方面2.7-12V
等方面35µA
等方面3-5m
等方面10×8mm
等方面3.3V, battery projects
HC-SR505 |
等方面4.5-20V
等方面50µA
等方面3-7m
等方面12×12mm
等方面Compact 5V projects
Panasonic EKMB |
等方面2.3-4.0V
等方面1-6µA
等方面5-12m
等方面Various
等方面Battery, professional
Excelitas PYD |
等方面1.4-3.6V
等方面2µA
等方面5-10m
等方面TO-5
等方面Energy harvesting
表
Power Considerations
Battery-Powered Projects
For battery-powered projects, power consumption is critical. Consider these options:
- AM312: 35µA standby – good for 6-12 months on 2xAA batteries
- Panasonic EKMB: 1-6µA – excellent for 2-4 years on AA batteries
- Excelitas PYD 2597: 2µA – up to 5 years on coin cell
- Avoid HC-SR501/505: 50-65µA – reduces battery life significantly
Adding Deep Sleep to Arduino
To maximize battery life, use Arduino deep sleep with wake-on-interrupt from PIR output:
#include <avr/sleep.h>
void setup() {
pinMode(pirPin, INPUT);
attachInterrupt(digitalPinToInterrupt(pirPin), wakeUp, RISING);
}
void loop() {
// Do nothing - all work done in interrupt
}
void wakeUp() {
// PIR triggered - process motion
}
Voltage Compatibility
3.3V Microcontrollers (ESP32, Raspberry Pi Pico, STM32)
If using a 3.3V board:
- AM312: Direct connection (2.7-12V input, 3.0V output)
- Panasonic EKMB: Direct connection with pull-up resistor to 3.3V
- HC-SR501: Power at 5V, use voltage divider on output (10k + 20k resistors)
5V Microcontrollers (Arduino Uno, Mega, Nano)
All modules work with 5V Arduino. HC-SR501 is the simplest choice.
Detection Range Selection
- Desk/table projects (0-2m): AM312 or any sensor with sensitivity turned down
- Room monitoring (3-7m): HC-SR501, HC-SR505, or Panasonic EKMB
- Outdoor/long-range (8-15m): Panasonic EKMB with long-range lens, or professional sensors
Where to Buy
- HC-SR501/505, AM312: AliExpress, eBay, Amazon, Adafruit, SparkFun
- Panasonic EKMB: DigiKey, Mouser, Farnell
- Excelitas PYD 2597: DigiKey, Mouser
Sample Arduino Code for Each Sensor
HC-SR501 / HC-SR505 / AM312
const int pirPin = 2;
void setup() {
pinMode(pirPin, INPUT);
Serial.begin(9600);
}
void loop() {
if (digitalRead(pirPin) == HIGH) {
Serial.println("Motion detected!");
}
delay(100);
}
Panasonic EKMB (with pull-up)
const int pirPin = 2;
void setup() {
pinMode(pirPin, INPUT_PULLUP); // Enable internal pull-up
Serial.begin(9600);
}
void loop() {
if (digitalRead(pirPin) == LOW) { // Note: inverted logic
Serial.println("Motion detected!");
}
delay(100);
}
Conclusion
For most Arduino beginners, the HC-SR501 is the best starting point due to its low cost and adjustable settings. For battery-powered projects, the AM312 offers a good balance of size and power consumption. For professional or long-term projects, consider the Panasonic EKMB series for superior reliability and ultra-low power.