The Physics: Continuous-Wave Doppler Sensing

The RCWL-0516 operates on the continuous-wave (CW) Doppler radar principle. It transmits a low-power microwave signal (typically around 3.18 GHz) and continuously monitors the reflected waves. When a person or object moves within its field, the reflected wave undergoes a frequency shift proportional to the object's velocity relative to the sensor. The onboard mixer compares the transmitted and received frequencies, extracting a baseband signal that represents motion.

Unlike passive infrared (PIR) sensors that rely on body heat and strict line-of-sight, microwaves penetrate non-metallic materials like drywall, wood, and plastic. This allows the RCWL-0516 to detect motion through walls or inside concealed enclosures, making it ideal for hidden smart-home occupancy detection. However, this same penetrating ability requires careful placement and physical shielding to avoid false triggers from adjacent rooms or hallways.

RCWL-0516 Specifications and Pinout Reference

Before wiring the module, review the hardware limits. The RCWL-0516 is incredibly forgiving on the power supply side, accepting a wide voltage range, but its logic outputs are strictly 3.3V. Below are the core specifications for the standard breakout board (typically priced between $1.50 and $2.50 on bulk marketplaces).

Parameter Specification / Value Notes & Tolerances
Operating Voltage (VCC) 4.0V to 28.0V DC Onboard LDO regulates to 3.3V for the IC
Quiescent Current ~2.8 mA Spikes to ~3.0 mA during transmission
Detection Range 5 to 9 meters (16 to 30 ft) Adjustable via hardware pads on the rear
Operating Frequency 3.18 GHz ± 50 MHz Unlicensed ISM band; FCC Part 15 compliant
Output Logic High 3.2V to 3.3V Safe for direct connection to ESP32/3.3V Arduino
Trigger Delay Time ~2 seconds (default) Adjustable via timing capacitor on C1/C2 pads
Hardware Hacking Tip: If the default 2-second delay is too short for your lighting automation, solder a 1µF to 10µF electrolytic capacitor across the C1 and C2 pads on the back of the module. This extends the HIGH output duration proportionally.

Pinout and Wiring Table

Pin Name Function Connection Target
VCC Power Supply Input 5V (Arduino/ESP32) or up to 24V external supply
GND Ground Reference Common Ground (MCU and Power Supply)
OUT Digital Motion Output MCU Digital GPIO (3.3V tolerant)
CDS Light Sensor Input Voltage divider with LDR (or leave floating)
TX Analog Baseband Output Op-Amp input or Oscilloscope (Do not connect to 5V ADC)

Output Signals: Digital OUT vs. Analog TX (and the Doppler Math)

A common mistake when interfacing the RCWL-0516 is conflating its digital and analog outputs. The module provides two distinct ways to read motion, and they require entirely different handling.

The Digital OUT Pin (Presence Detection)

The OUT pin is a simple digital signal. It sits at 0V (LOW) when the area is clear and jumps to ~3.3V (HIGH) when motion is detected. No scaling or calibration is needed. You simply use digitalRead() on your microcontroller. The 3.3V logic level makes it natively compatible with the ESP32, Raspberry Pi Pico, and 3.3V Arduino boards. If you are using a 5V Arduino Uno, the 3.3V HIGH signal is still recognized as a valid logic HIGH (the ATmega328P threshold is typically 0.6 × VCC, or 3.0V, but it reliably reads 3.3V in practice).

The Analog TX Pin (Velocity and Baseband Math)

The TX pin outputs the raw, unamplified analog baseband signal from the radar mixer. This is not a distance measurement; it is a velocity signature. The signal sits at a DC bias of roughly 0.6V to 1.0V, with an AC ripple of only 10mV to 50mV representing the Doppler shift.

To convert this raw frequency reading into a physical velocity unit (meters per second), we use the Doppler shift equation:

fd = (2 × v × ft) / c

Where:
fd = Doppler frequency shift (Hz)
v = Velocity of the target (m/s)
ft = Transmitted frequency (3.18 × 109 Hz)
c = Speed of light (~3.0 × 108 m/s)

Solving for velocity (v), the raw-to-unit math simplifies to:

v = fd / 21.2

Worked Example: If a person walks toward the sensor at a typical pace of 1.2 m/s, the TX pin will output a ripple frequency of 1.2 × 21.2 = 25.4 Hz. If you measure a 50 Hz ripple on an oscilloscope, the target is moving at 50 / 21.2 = 2.35 m/s (likely a fast jog or a moving fan blade).

ADC Scaling Requirement: Do not connect the TX pin directly to an ESP32 ADC. A 20mV ripple on a 12-bit ADC (0-3.1V usable range) yields only ~25 digital counts, which will be lost in the ESP32's inherent ADC noise floor. To read the TX pin, you must build a non-inverting op-amp stage (using an MCP6002 or LM358) with a gain of ~50, AC-coupled and biased at 1.65V, to scale the ripple into a clean 0-3.3V swing.

Wiring to ESP32 and Arduino: Step-by-Step

For 95% of smart home and security projects, you only need the digital OUT pin. Here is the exact procedure to wire it for basic occupancy detection, including an optional light-dependent resistor (LDR) to disable the sensor during daylight.

  1. De-energize the Circuit: Ensure your breadboard or enclosure is completely disconnected from USB or external power before making connections.
  2. Connect Power: Wire the sensor's VCC pin to the 5V output of your ESP32/Arduino. Wire the GND pin to the MCU's GND. (Do not power it directly from the 3.3V pin; the onboard LDO requires at least 4V to regulate properly).
  3. Connect the Digital Output: Wire the sensor's OUT pin to a digital GPIO on your MCU (e.g., GPIO 4 on ESP32, or Pin 2 on Arduino Uno).
  4. Configure the CDS Pin (Optional): If you want the sensor to ignore motion when the room is bright, create a voltage divider. Connect an LDR between the CDS pin and GND, and a 10kΩ pull-up resistor between CDS and VCC. The sensor will disable itself if the voltage on the CDS pin drops below ~0.7V (indicating high light).
  5. Verify the Logic: Upload a simple digitalRead() sketch. Open the Serial Monitor at 115200 baud. Wave your hand in front of the sensor; the console should print "MOTION DETECTED" for approximately 2 seconds before returning to "CLEAR".

For complete ESP32 integration, ensure you are using the correct GPIO mapping. Consult the official Espressif GPIO documentation to avoid using strapping pins (like GPIO 0, 2, or 12) which can cause boot failures if pulled high or low during startup.

Troubleshooting Common Interference and False Triggers

Because the RCWL-0516 emits Part 15 compliant microwave energy that easily penetrates building materials, "ghost" triggers are the most common complaint on the workbench. Here is how to diagnose and fix them.

  • Drywall and Wall Penetration: The sensor will detect people walking in the room behind the wall. Fix: Apply copper tape or aluminum foil to the rear and sides of the sensor module, leaving only the front face exposed. This creates a directional shield.
  • Ceiling Fans and HVAC Vents: Moving fan blades create a strong, continuous Doppler shift. Fix: Tilt the sensor away from the ceiling, or reduce the sensitivity by soldering a 1MΩ resistor across the R9 pads on the back of the module (this drops the detection range from 9m to roughly 3m).
  • Multiple Sensor Interference: If you deploy three RCWL-0516 modules in a single hallway, they will interfere with each other, causing the OUT pin to flutter or stay permanently HIGH. Fix: Space modules at least 5 meters apart, or place physical metallic barriers between them. They lack frequency hopping, so they will heterodyne if placed too close.
  • Power Supply Noise: Switching LED drivers and cheap phone chargers inject high-frequency noise into the 5V rail, which the radar mixer interprets as motion. Fix: Solder a 100µF electrolytic capacitor and a 0.1µF ceramic capacitor directly across the VCC and GND pins on the sensor module, or add a ferrite bead to the VCC wire.

By understanding the distinction between the digital presence output and the analog velocity signature, and by properly managing the microwave radiation pattern, the RCWL-0516 becomes one of the most reliable and cost-effective occupancy sensors available for embedded projects.