Source: https://mokxi.com/learn/arduino-rcwl-0516
Updated: 2026-11-02

Learn

# The RCWL-0516 radar motion sensor on an Arduino

Beginner

Written by the Mokxi team, updated November 2, 2026

Start building free Open the editor

Or see every lesson.

- 505 parts on the bench
- 45 boards running now
- 1.00x real time, on every board

Click to open it in the editor

An RCWL-0516 on pin 2 lighting the LED on pin 13, on a simulated ATmega328P. Click the sensor to start and stop movement.

The RCWL-0516 is a motion sensor that uses radar instead of heat. A tiny 3.2 GHz transmitter on the board sends out a signal, and anything moving shifts the echo’s frequency a little, the Doppler effect. A chip on the board turns that into one digital output: high while something moves. It costs about the same as a PIR sensor and sees through plastic, glass and thin walls.

The circuit above is an Uno with an RCWL-0516 on pin 2, lighting the Uno’s own LED on pin 13 while something moves. Click the sensor to start movement and click again to stop it, and the serial monitor prints when the room goes busy and when it goes quiet again. It runs in your browser on the sketch below.

## What you need

- An Arduino Uno
- An RCWL-0516 module
- Three jumper wires

## Wiring

Part and pin | Goes to | Note

RCWL-0516 VIN | 5 V | Takes 4 to 28 V

RCWL-0516 GND | GND |

RCWL-0516 OUT | Pin 2 | High at 3.3 V while it sees movement

3V3 and CDS | Not connected | 3V3 is an output; CDS is for a light sensor

## One pin, no library

OUT goes high, to 3.3 V, the moment the board sees movement. 3.3 V is well over what a 5 V Uno counts as HIGH, so it connects straight to a pin with no level shifter. The sketch reads it with digitalRead(), copies it to the LED on pin 13, and prints a line each time it changes.

OUT stays high while the movement goes on, and for two seconds after it stops. Click the sensor, wait half a second and click again: the serial monitor says "Movement", then "Clear after 2505 ms", the half second of movement plus the two second hold.

The radar light sketch, trimmed

Open this sketch in the editor The code alone: the editor places the board and the parts it can read from the sketch.

## Radar or PIR?

A PIR sensor such as the HC-SR501 sees the heat of a body moving across its view. The RCWL-0516 sees anything that moves, warm or not, and through plastic boxes and thin walls. A PIR also has a dead time after each trigger, about 2.5 seconds, when it cannot fire at all. The RCWL-0516 has none.

You can see that here. Move for a moment, pause for a second, and move again before the two seconds run out: the hold starts over, and you get one "Clear after" of about 3.6 seconds instead of two separate alarms. The PIR tutorial explains a PIR’s hold and block times.

Seeing through things is not always good. A radar sensor in a hallway can trigger on someone in the next room, or on a fan or a curtain. A PIR is the better choice when you want only the room in front of it.

## The hold time and the CDS pin

The two second hold is set by parts on the board. On a real module the pads on the back marked C-TM, R-GN and R-CDS are commonly used to lengthen the hold, shorten the range and add a light sensor. In Mokxi the hold is the sensor’s hold property: set it to 5 and a half-second movement prints "Clear after 5309 ms".

CDS is meant for a light-dependent resistor, so the sensor works only in the dark. Pulled below about 0.7 V, the sensor turns off. Wire CDS to GND in this circuit and clicking the sensor does nothing. Leave it unconnected for a sensor that is always on.

## Common mistakes

Powering it from the 3V3 pin. VIN needs at least 4 V. The 3V3 pin on the module is its own regulator’s output, not an input.

Mounting it behind metal. Radar does not pass through metal, so a metal box blinds it.

Expecting it to ignore the next room. It sees through walls and doors.

CDS grounded by accident, which turns the sensor off.

Two modules close together. Their signals can interfere and trigger each other. Mokxi does not model that, or false triggers from fans and vibration, so test a real one in place.

Open this circuit in the editor. Arduino Uno: an RCWL-0516 radar light, wired as it runs at the top of this page. Change a part or a value and run it again.
Open the circuit

## Questions

How do I connect an RCWL-0516 to an Arduino?

VIN to 5 V, GND to GND and OUT to any digital pin. Read OUT with digitalRead(); it is HIGH while the sensor sees movement and for about two seconds after.

Does the RCWL-0516 need a library?

No. It has one digital output, so digitalRead() is all the code it needs.

What is the range of the RCWL-0516?

About 5 to 7 meters, through plastic and thin walls. Mokxi models movement as either in range or not, so the range is not something you can test here.

Is the RCWL-0516 better than a PIR sensor?

It is different. It sees any movement, through enclosures, with no dead time, but it also sees through walls and triggers on fans. A PIR sees only warm bodies in front of it.

Related

## Keep going

PIR Motion Sensor: How It Works, With an Arduino Arduino Blink Without Delay: Two LEDs, Two Rates Arduino IR Obstacle Sensor (FC-51): Wiring, Code Arduino Halloween Props to Build in Your Browser How the RCWL-0516 is modeled The Arduino Uno simulator The project page, with the full sketch Beginner

## Build this for real

Open the editor, change a value and watch the number move with it. Nothing to install, and no account needed.

Start building free Open the editor
