If you are holding the standard Elegoo HC-SR501 PIR motion sensor with the white Fresnel lens dome facing you and the three metal pins pointing down, the pins from left to right are GND, OUT (Signal), and VCC. That is the direct answer. However, knowing the pinout is only 10% of the battle; getting clean, false-free triggers on an Arduino or ESP32 requires understanding the module's electrical quirks, timing math, and hardware revisions.
Elegoo typically ships two different PIR modules in their starter and "Most Complete" kits: the large, adjustable HC-SR501 and the ultra-compact AM312 (sometimes labeled SR602). This guide breaks down the exact pinout, the raw-to-unit signal math, and the physical interference traps that cause 90% of bench failures.
The Pyroelectric Sensing Principle
Passive Infrared (PIR) sensors do not "see" heat; they detect changes in infrared radiation. The sensor element consists of two pyroelectric halves wired in opposition. When a warm body moves across the sensor's field of view, it strikes one half before the other, creating a differential voltage spike. This raw analog spike is fed into an onboard comparator IC (typically the BISS0001 on the HC-SR501), which translates the micro-volt analog shift into a clean, digital logic HIGH.
Because the sensor relies on a change in the IR profile, it is physically blind to stationary heat sources. A person standing perfectly still in front of the sensor will eventually cause the output to drop LOW, even if they remain in the room. This differential design is what allows a $2 module to ignore a hot radiator while detecting a walking human, but it also dictates the strict timing and lockout constraints you must code around.
Pinout, Wiring, and Electrical Specifications
The HC-SR501 is notoriously unforgiving if you reverse the power pins. Unlike some I2C sensors that have built-in reverse polarity protection, flipping VCC and GND on the HC-SR501 will instantly fry the BISS0001 IC and the onboard voltage regulator. Always verify the silkscreen on your specific board, as some clone manufacturers swap the outer pins.
| Pin (Left to Right) | Function | HC-SR501 Specs | AM312 / SR602 Specs |
|---|---|---|---|
| 1. GND | Ground Reference | 0V (System Common) | 0V (System Common) |
| 2. OUT | Digital Signal Output | HIGH: ~3.3V to 5V LOW: 0V |
HIGH: ~3.0V to 3.3V LOW: 0V |
| 3. VCC | Power Supply Input | 5V to 20V DC (5V recommended) |
2.7V to 12V DC (3.3V recommended) |
OUT pin will still only swing to ~3.3V HIGH. This makes it perfectly safe to wire directly to the 3.3V GPIO pins of an ESP32-WROOM-32 without a logic level shifter. However, if you power it from a 3.3V source, the regulator dropout means the output HIGH might only reach ~2.9V, which can cause brownout-triggered false reads on some microcontrollers.
Output Signal Logic and Timing Math
A common mistake is treating a PIR sensor like a distance or temperature sensor. The output is strictly digital (boolean). It outputs a logic HIGH voltage when motion is detected, and a logic LOW when the delay timer expires. There is no analog scaling, no PWM, and no I2C data to parse.
The "raw reading" from your microcontroller is a pulse width measured in milliseconds. The "physical unit" you actually care about is the Delay Time (how long the output stays HIGH after motion ceases) and the Lockout Time (the forced blind period after the delay). Here is the math to map the physical potentiometer rotation to the delay time in seconds:
Delay Time Formula (HC-SR501):
T_delay = 0.3 + (θ / 270) × 199.7
- T_delay: Output HIGH duration in seconds.
- θ: Potentiometer rotation angle in degrees (0° is fully counter-clockwise, 270° is fully clockwise).
- 0.3: The minimum hardware delay floor in seconds.
- 199.7: The delta between max (~200s) and min (0.3s) delay.
Lockout Time (Hardware Fixed):
After T_delay expires and the OUT pin goes LOW, the BISS0001 chip enforces a hardware lockout of approximately 2.5 to 3 seconds. During this window, the sensor is physically deaf to new motion. Your code cannot override this. If you are building a rapid-trigger lighting system, you must account for this ~3-second dead zone in your state machine.
Calibration and Interference Mitigation
Out of the box, Elegoo PIR sensors are calibrated to a middle-ground delay and maximum sensitivity. You must calibrate them for your specific environment using the two orange trimpots (on the HC-SR501).
- Sensitivity Potentiometer (Sx): Adjusts the detection distance (3 to 7 meters) and the trigger threshold. Turning it clockwise increases the analog gain. In small rooms, max sensitivity will cause phantom triggers from HVAC air movement.
- Delay Time Potentiometer (Tx): Adjusts the HIGH pulse duration using the math defined above.
- Trigger Mode Jumper: Located on the bottom left.
- H (High/Retrigger): The timer resets every time new motion is detected. The output stays HIGH as long as the person keeps moving. (Default and recommended for 99% of projects).
- L (Low/Non-retrigger): The timer runs out regardless of ongoing motion, followed by the 3-second lockout. The output will pulse HIGH/LOW/HIGH even if a person is standing directly in front of it.
Common Interference Sources
If your sensor is triggering with no one in the room, check these three physical interference vectors:
- Thermal Drafts: HVAC vents, space heaters, or direct sunlight hitting the Fresnel lens. The sensor detects the rapid change in ambient IR caused by a hot air draft.
- RF Coupling: The pyroelectric element is extremely high-impedance. If you mount a PIR sensor within 6 inches of a WiFi router or an ESP32 transmitting at 20dBm, the RF energy will couple into the sensor traces and mimic a pyroelectric spike. Fix: Keep RF antennas at least 15cm away from the PIR dome.
- Power Rail Noise: The HC-SR501 is sensitive to VCC ripple. If you share a 5V rail with a high-draw servo motor or a relay coil, the voltage dip will cause the BISS0001 to reset and output a false HIGH. Fix: Add a 100µF electrolytic capacitor directly across the sensor's VCC and GND pins.
Decision Tree: Which Elegoo PIR Module Should You Use?
Elegoo kits include different PIR modules depending on the year and kit tier. Use this decision matrix to determine which one you have, and which one you should actually deploy for your project.
| Criteria | HC-SR501 (Large Dome) | AM312 / SR602 (Micro PIR) |
|---|---|---|
| Physical Size | 32mm x 24mm (Requires 24mm dome cutout) | 10mm x 8mm (Surface mount or tiny perfboard) |
| Adjustability | Yes (2 trimpots, 1 jumper) | No (Fixed ~2s delay, fixed sensitivity) |
| Operating Voltage | 5V - 20V (Best at 5V) | 2.7V - 12V (Best at 3.3V) |
| Detection Range | Up to 7 meters, 120° cone | Up to 3 meters, 100° cone |
| Quiescent Current | ~50 µA (Too high for coin-cell wearables) | ~10 µA (Excellent for battery IoT) |
The Final Verdict and Default Pick
Do not leave your module choice to chance. Here is the concrete pick based on your microcontroller and power source:
- Choose the HC-SR501 when: You are building a room-scale automation project (like a closet light or room occupancy tracker) powered by a 5V USB wall wart or an Arduino Uno R3. The adjustable delay and high sensitivity are mandatory for covering large physical spaces.
- Choose the AM312 / SR602 when: You are building a 3.3V battery-powered ESP32 deep-sleep node, a wearable, or a compact 3D-printed enclosure where the 24mm HC-SR501 dome simply will not fit.
Default Recommendation: For 80% of hobbyist makers starting with an Elegoo Super Starter Kit, the HC-SR501 is the correct tool. Wire it to 5V, set the delay potentiometer to 25% (approx. 50 seconds), ensure the jumper is on the "H" (retrigger) pins, and connect the OUT pin to a digital input with an internal pull-down resistor enabled in your firmware. For further reading on integrating these with microcontrollers, refer to the comprehensive Adafruit PIR Sensor Guide and the SparkFun PIR Hookup Guide for advanced code debouncing techniques.






