Introduction
With dozens of PIR modules available, choosing the right one for your Arduino project can be confusing. This guide covers the most popular options and when to use each.
Popular PIR Modules
HC-SR501 – The Classic
Price: $2-3
Voltage: 4.5-20V (5V recommended)
Output: 3.3V digital HIGH
Standby current: 50-65µA
Pros: Cheap, adjustable sensitivity and hold time, works with 5V Arduino
Cons: Higher power, not 3.3V compatible without level shifting
Best for: Beginners, USB-powered projects, 5V boards
AM312 – Mini Low-Power
Price: $2-3
Voltage: 2.7-12V (works at 3.3V)
Output: 3.0V digital HIGH
Standby current: 35µA
Pros: Small (10×8mm), low power, 3.3V compatible
Cons: Fixed 2-second hold time, shorter range (3-5m)
Best for: Battery projects, ESP32/Raspberry Pi, compact designs
Panasonic EKMB – Premium Low Power
Price: $8-12
Voltage: 2.3-4.0V
Output: Open-drain (requires pull-up)
Standby current: 1-6µA
Pros: Ultra-low power, high sensitivity, excellent temperature stability
Cons: More expensive, requires pull-up resistor
Best for: Battery projects, professional products
Comparison Table
| Model |
Voltage |
Standby Current |
Range |
Size |
HC-SR501 |
4.5-20V
50-65µA
3-7m
32×24mm
AM312 |
2.7-12V
35µA
3-5m
10×8mm
Panasonic EKMB |
2.3-4V
1-6µA
5-12m
Various
表
Power Considerations
Battery-Powered Projects
- AM312: 35µA – good for 6-12 months on 2xAA
- Panasonic EKMB: 1-6µA – excellent for 2-4 years
- Avoid HC-SR501: 50-65µA reduces battery life significantly
3.3V Microcontrollers (ESP32, Raspberry Pi Pico)
- AM312: Direct connection (2.7-12V input, 3.0V output)
- Panasonic EKMB: Direct with pull-up to 3.3V
- HC-SR501: Power at 5V, use voltage divider on output
Sample Code
HC-SR501 / 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);
Serial.begin(9600);
}
void loop() {
if (digitalRead(pirPin) == LOW) { // Inverted logic
Serial.println("Motion detected!");
}
delay(100);
}
Conclusion
For most 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, the Panasonic EKMB series provides superior reliability and ultra-low power.