Overview
The rcwl0516 node detects motion using the RCWL-0516 microwave Doppler radar sensor.
Unlike PIR sensors that detect infrared radiation, this sensor uses 3.18 GHz microwave signals to detect
movement through walls, glass, and thin enclosures. It provides a digital HIGH/LOW output when motion is
detected, making it ideal for concealed installations and through-wall presence sensing.
Properties
| Property | Type | Default | Description |
|---|---|---|---|
| pin | number * | 17 | GPIO pin connected to the OUT pin of the sensor (required) |
| activeHigh | boolean | true | Whether HIGH signal indicates motion detected |
| debounceMs | number | 50 | Debounce time in milliseconds to filter signal noise |
| holdTimeMs | number | 2000 | Time in ms to hold motion state after last detection |
| enableCallback | boolean | false | Use interrupt-driven callback instead of polling |
| pollInterval | number | 100 | Polling interval in ms (when callback is disabled) |
Output
{
"motion": true,
"pin": 17,
"holdTime": 2000,
"timestamp": 1640000000000
} Wiring
Connection
VIN → 5V (Pin 2)
GND → GND (Pin 6)
OUT → GPIO 17 (Pin 11)
OUT pin outputs 3.3V - safe for Pi GPIO pins directly
ASCII Wiring Diagram
RCWL-0516 Raspberry Pi
--------- ------------
VIN ─────────── 5V (Pin 2)
GND ─────────── GND (Pin 6)
OUT ─────────── GPIO17 (Pin 11)
Optional pads on sensor PCB:
CDS ── LDR ── for light-dependent enable
R-GN ── Resistor ── adjust sensitivity Example: Hidden Security Sensor
Use the through-wall detection capability for a concealed security system that detects motion behind walls or inside enclosures.
// Function node: Security alert with cooldown
var motion = msg.motion;
var lastAlert = flow.get('lastAlert') || 0;
var cooldown = 30000; // 30 second cooldown
var now = Date.now();
var armed = global.get('securityArmed') || false;
if (motion && armed && (now - lastAlert) > cooldown) {
flow.set('lastAlert', now);
msg.payload = {
alert: true,
zone: "Zone A - Living Room",
sensor: "rcwl0516",
type: "microwave_radar",
timestamp: msg.timestamp,
message: "Motion detected in Zone A"
};
return msg;
}
return null; Example: Room Occupancy with Auto-Lighting
Combine with a hold timer for occupancy-based lighting control that works even when the sensor is hidden behind a panel.
// Function node: Occupancy state machine
var motion = msg.motion;
var state = flow.get('roomState') || { occupied: false, lastMotion: 0 };
var timeout = 300000; // 5 minutes
var now = Date.now();
if (motion) {
state.lastMotion = now;
if (!state.occupied) {
state.occupied = true;
flow.set('roomState', state);
msg.payload = { occupied: true, action: "lights_on" };
return msg;
}
} else if (state.occupied && (now - state.lastMotion) > timeout) {
state.occupied = false;
flow.set('roomState', state);
msg.payload = { occupied: false, action: "lights_off" };
return msg;
}
flow.set('roomState', state);
return null; Common Use Cases
Concealed Security
Hidden intrusion detection behind walls, ceilings, or enclosures
Smart Lighting
Occupancy-based lighting control with through-wall sensing
Bathroom Occupancy
Detect presence in wet environments where PIR may not be suitable
Vehicle Detection
Detect moving vehicles in driveways or parking areas