The RCWL-051 is a microwave radar motion sensor module that detects movement by emitting low-power microwave signals and looking for changes in the reflected signal. It typically operates from a 3.3–5 V supply and provides a digital TTL output (OUT) that you can read with an Arduino or ESP32 for motion/presence detection.
| Pin | Signal | Description |
|---|---|---|
3V3 |
power | Regulated 3.3V output from the module for small external loads or reference. |
GND |
ground | Common ground return for power supply and logic signal reference. |
OUT |
digital | Digital motion output; goes high when the radar sensor detects movement. |
VIN |
power | Main supply input for powering the RCWL-051 module. |
CDS |
analog | Light-sensor control input; connect an LDR network to inhibit motion output in daylight. |
| From | To | Wire |
|---|---|---|
board:5V |
x1:VIN |
red |
board:GND |
x1:GND |
black |
board:D2 |
x1:OUT |
green |
This example was written and compile-checked for the arduino-uno. Codey Online adapts it to any other supported board for you.
// RCWL-051 microwave radar motion sensor example
// Wiring:
// - RCWL-051 VIN -> Arduino 5V
// - RCWL-051 GND -> Arduino GND
// - RCWL-051 OUT -> Arduino D2
const int motionPin = 2;
void setup() {
pinMode(motionPin, INPUT);
Serial.begin(9600);
while (!Serial) {
;
}
Serial.println("RCWL-051 motion sensor example");
Serial.println("Move in front of the sensor to see OUTPUT change.");
}
void loop() {
int motionState = digitalRead(motionPin);
if (motionState == HIGH) {
Serial.println("Motion detected");
} else {
Serial.println("No motion");
}
delay(250);
}
Describe what you want to build. Codey Online writes the code, draws the wiring diagram, compiles it and flashes your board straight from the browser.
Start for free