HC-SR501 PIR with ESP32-C3-DevKitM-1

Wiring for the HC-SR501 PIR motion sensor on the ESP32-C3-DevKitM-1 (ESP32-C3, 3.3 V logic), chosen with the same pin rules BoardPilot uses: default buses first, and no pins that are used for flash, USB, the debugger or booting.

Wiring

HC-SR501 PIR pinRoleESP32-C3-DevKitM-1 pinNotes
VCCPower5VNeeds 4.5 V or more: use 5V
OUTOutput from the part10
GNDGroundGND

Check before you power it on

Test code (Arduino)

void setup() {
  Serial.begin(115200);
  pinMode(10, INPUT);  // OUT on 10
}

void loop() {
  Serial.println(digitalRead(10));
  delay(100);
}

Arduino board: esp32:esp32:esp32c3. If uploading does not start, hold BOOT, press and release RST, then release BOOT.

Questions

Which ESP32-C3-DevKitM-1 pins do I use for the HC-SR501 PIR?

VCC → 5V, OUT → 10, GND → GND.

Does the HC-SR501 PIR work with the ESP32-C3-DevKitM-1 at 3.3 V?

The HC-SR501 PIR works at 5 V, so its output (OUT → 10) can reach 5 V. The ESP32-C3-DevKitM-1 pins take only 3.3 V: add a voltage divider (for example 1 kΩ and 2 kΩ) or a level shifter on that wire.

BoardPilot checks this wiring in 3D as you build it, and finds crossed or missing wires on the real board.

Download BoardPilot

Full ESP32-C3-DevKitM-1 pinout · HC-SR501 PIR motion sensor: all pins and data

The HC-SR501 PIR on other boards

Other parts on the ESP32-C3-DevKitM-1