The Default Pick: Which PIR Sensor Module to Wire
Before tracing a single wire, you must select the correct PIR (Passive Infrared) module for your microcontroller's logic level and power budget. Wiring a 5V HC-SR501 directly to a 3.3V ESP32 GPIO without a level shifter is a common bench mistake that degrades the MCU over time. Use this decision tree to select your module:
| Criteria | HC-SR501 (Standard) | SR602 (Compact) | AM312 (Mini Low-Power) |
|---|---|---|---|
| Operating Voltage | 5V - 20V DC | 3.3V - 5V DC | 2.7V - 5.5V DC |
| Logic Output Level | Matches VCC (5V) | Matches VCC (3.3V) | Matches VCC (3.3V) |
| Quiescent Current | ~50 µA | ~15 µA | ~10 µA |
| Adjustable Delay | Yes (Potentiometer) | No (Fixed ~2.5s) | No (Fixed ~2.5s) |
| Best Use Case | Mains-powered 5V Arduino | 3.3V ESP32 general IoT | Battery ESP32 Deep Sleep |
Decoding the PIR Sensor Wiring Diagram Symbols
Schematic diagrams for PIR modules abstract the physical components into standard electronic symbols. Here is exactly what those symbols mean when you are reading the datasheet or module schematic:
- VCC / +V: Represented by a straight horizontal line or an upward arrow. This is the positive DC supply rail. On the AM312, this accepts 2.7V to 5.5V.
- GND / ⏚: Represented by three descending horizontal lines (the earth ground symbol) or a solid downward triangle (chassis/signal ground). This is your 0V reference return path.
- OUT / SIG: Represented by an arrow pointing outward from the IC block, or a zigzag line indicating a digital signal. This is the push-pull digital output that swings from 0V to VCC.
- Rt / Rd (Potentiometers): Represented by a standard resistor symbol with a diagonal arrow striking through it. On the HC-SR501, these adjust the timing capacitor (Rt) and the comparator threshold (Rd). The AM312 omits these to save space and power.
- BISS0001 / LP0001 IC Block: The central rectangle with 16 pins. This is the analog signal processing IC that amplifies the microvolt-level signals from the pyroelectric sensor.
Node-by-Node Trace: Power, Signal, and Ground Paths
Do not just connect pins blindly. Understanding the electron flow from source to load prevents ground-loop noise and false triggers. Here is the exact node-by-node trace for the AM312 to ESP32 circuit:
1. The Power Path (Source to Sensor)
Current flows from the ESP32's 3V3 pin (Node 1) through a red jumper wire into the AM312's VCC pad (Node 2). From the VCC pad, it enters the module's onboard ME6211 low-dropout (LDO) regulator, which filters noise and steps the voltage down to a stable 3.0V for the internal BISS0001 IC (Node 3). Polarity note: Reversing VCC and GND on the AM312 will instantly destroy the LDO and the sensor element, as there is no reverse-polarity protection diode on the mini modules.
2. The Signal Path (Sensor to Load)
When the pyroelectric element detects a change in infrared radiation, it generates a tiny AC voltage. This enters the BISS0001 IC at Pins 14 and 15 (internal operational amplifiers). The IC processes the signal and drives Pin 2 high. Pin 2 connects directly to the physical OUT pad on the module (Node 4). From the OUT pad, current flows through a yellow jumper wire into the ESP32's GPIO 13 (Node 5). Because the AM312 uses a push-pull output stage, it actively drives the line to 3.3V (HIGH) and pulls it to 0V (LOW); no external pull-down resistor is required.
3. The Ground Path (The 0V Reference)
The ground path is critical for signal integrity. The ESP32's GND pin (Node 6) connects via a black wire to the AM312's GND pad (Node 7). This pad ties into the module's internal ground plane, which connects to the BISS0001 Pin 8 and the metal shielding can of the pyroelectric sensor. Explicit Ground Rule: The sensor's metal shield must share the exact same 0V reference as the ESP32's ADC/DAC ground. If you power the sensor from a separate 3.3V buck converter, you must bond the buck converter's GND output to the ESP32's GND, or the OUT signal will float and cause phantom motion triggers.
Terminal and Pin Mapping Table for ESP32
Use this exact mapping when wiring the AM312 to an ESP32 DevKit V1. GPIO 13 is chosen because it is a standard input/output pin that does not have strapping pin conflicts during boot, unlike GPIO 0, 2, or 12. For authoritative ESP32 pin constraints, always verify against the Espressif GPIO API Reference.
| AM312 Physical Pad | Wire Color | ESP32 DevKit V1 Pin | Function / Notes |
|---|---|---|---|
| VCC (Left Pad) | Red | 3V3 | 3.3V Power Supply (Max 50mA draw) |
| OUT (Center Pad) | Yellow | GPIO 13 | Digital Motion Signal (HIGH = Motion) |
| GND (Right Pad) | Black | GND | Common Ground Reference (0V) |
Step-by-Step Physical Wiring and Multimeter Verification
Before uploading code, verify your physical wiring with a digital multimeter (DMM). This prevents bricking your MCU and isolates hardware faults from software bugs. For more on sensor integration, refer to the Adafruit PIR Sensor Guide.
- Verify Power Rail Voltage: Set your DMM to DC Volts (V⎓). Place the black probe on the ESP32 GND pin and the red probe on the AM312 VCC pad. The reading must be between 3.25V and 3.35V. If it reads 5V, you are plugged into the VIN/5V pin and risk damaging the sensor if it lacks an LDO.
- Verify Ground Continuity: Power down the ESP32 (unplug USB). Set the DMM to Continuity mode (the diode/sound wave symbol). Place one probe on the AM312 GND pad and the other on the ESP32 GND pin. The meter should beep and read < 1.0 Ω. If it reads OL (Open Loop), your ground wire is broken or unseated.
- Verify Signal Path Isolation: While in Continuity mode, place one probe on the AM312 OUT pad and the other on the ESP32 3V3 pin. It must read OL. If it beeps, you have a short between power and signal, which will instantly fry the ESP32 GPIO upon boot.
- Verify Live Signal Swinging: Power the ESP32 back on. Set the DMM to DC Volts. Place the black probe on GND and the red probe on the AM312 OUT pad. Resting state should read 0.00V to 0.15V. Wave your hand 2 meters in front of the lens. The voltage should immediately spike to 3.25V - 3.30V and hold for roughly 2.5 seconds before dropping back to 0V.
Common Wiring Faults and How to Fix Them
If your multimeter checks out but the ESP32 code reads continuous HIGH or continuous LOW, you are likely facing one of these physical layer issues:
- Phantom Triggers (Continuous HIGH): The PIR sensor is highly sensitive to power rail noise. If you are powering the ESP32 from a cheap USB switching supply, high-frequency ripple is coupling into the AM312's analog front end. Fix: Solder a 100µF electrolytic capacitor and a 0.1µF ceramic capacitor in parallel across the VCC and GND pads on the sensor module.
- No Trigger (Stuck LOW): The pyroelectric element is sealed behind the white HDPE Fresnel lens. If you removed the lens to solder the pins and forgot to snap it back on, the sensor cannot focus IR light onto the dual-element detector. Fix: Reattach the dome; it is optically required, not just a dust cover.
- Boot Loop / Brownout on ESP32: When the PIR triggers, it draws a sudden burst of current. If your USB cable has high resistance, this causes a voltage drop that resets the ESP32. Fix: Use a short, 20AWG or thicker USB data cable, or power the ESP32 via the 5V VIN pin with a dedicated 2A wall adapter.
By tracing the power, ground, and signal nodes explicitly and verifying them with a meter, you eliminate the guesswork from motion-sensing projects. Stick to the AM312 for 3.3V logic environments, respect the pad-out silkscreen variations, and your ESP32 will register motion reliably without hardware-level debugging.






