Ordered on weekdays before 14:00 = shipped the same day and delivered the next day in 98% of cases. Free returns 30-day reflection period 1-year warranty

Wiring diagram and code example

How to connect the Motion sensor with microwave radar RCWL-051 to an Arduino UNO or ESP32, with an example sketch you can upload straight away.

Microwave Radar Motion Detection with RCWL-051

This circuit detects human motion using the RCWL-051 Doppler radar sensor. When motion is detected, the sensor's OUT pin goes HIGH, lighting up the Arduino's built-in LED and printing a detection message to the Serial Monitor. Microwave radar can detect movement through non-metallic obstacles such as plastic, wood, or glass.

Wiring diagram: Motion sensor with microwave radar RCWL-051 on an Arduino UNO
Wiring diagram · Click to enlarge
Connection table: Motion sensor with microwave radar RCWL-051 on an Arduino UNO
Connection table · Click to enlarge
Microwave_Radar_Motion_Detection_with_RC.ino · compiled and verified
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : Microwave Radar Motion Detection with RCWL-051
 *  Board     : Arduino UNO (arduino:avr:uno)
 *  Parts     : Motion sensor with microwave radar RCWL-051
 *  Libraries : none (built-in)
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

// Microwave Radar Motion Detection with RCWL-051
// Connect RCWL-051 VIN to 5V, GND to GND, and OUT to D2.

const int sensorPin = 2;
const int ledPin = 13;

int lastState = LOW;

void setup() {
  pinMode(sensorPin, INPUT);
  pinMode(ledPin, OUTPUT);

  Serial.begin(115200);
  while (!Serial) {
    ; // Wait for serial port to connect
  }

  Serial.println(F("RCWL-051 Microwave Radar Sensor Ready"));
}

void loop() {
  int motionDetected = digitalRead(sensorPin);

  digitalWrite(ledPin, motionDetected);

  if (motionDetected != lastState) {
    if (motionDetected == HIGH) {
      Serial.println(F("Motion detected!"));
    } else {
      Serial.println(F("Motion ended."));
    }
    lastState = motionDetected;
  }

  delay(100);
}

Wiring diagram and example code generated by Codey.online — https://www.codey.online

Microwave Motion Detection with RCWL-051 and ESP32

This project detects human motion through microwave Doppler radar using the RCWL-051 sensor. A resistor voltage divider steps down the sensor's 5V output to 3.3V logic to safely protect the ESP32. When motion is detected, the ESP32 turns on its onboard LED and prints a status update to the Serial Monitor.

Wiring diagram: Motion sensor with microwave radar RCWL-051 on an ESP32 DevKit V1
Wiring diagram · Click to enlarge
Connection table: Motion sensor with microwave radar RCWL-051 on an ESP32 DevKit V1
Connection table · Click to enlarge
Microwave_Motion_Detection_with_RCWL_051.ino · compiled and verified
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : Microwave Motion Detection with RCWL-051 and ESP32
 *  Board     : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
 *  Parts     : Motion sensor with microwave radar RCWL-051
 *  Libraries : none (built-in)
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

// Microwave Radar Motion Detector with RCWL-051 and ESP32

const int RADAR_PIN = 4;   // Connected via divider to OUT pin on RCWL-051
const int LED_PIN = 2;     // Onboard LED on ESP32

int lastState = LOW;

void setup() {
  Serial.begin(115200);
  pinMode(RADAR_PIN, INPUT);
  pinMode(LED_PIN, OUTPUT);
  digitalWrite(LED_PIN, LOW);

  Serial.println("RCWL-051 Radar Sensor Initialized");
  Serial.println("Waiting for motion...");
}

void loop() {
  int motionDetected = digitalRead(RADAR_PIN);

  if (motionDetected != lastState) {
    lastState = motionDetected;

    if (motionDetected == HIGH) {
      Serial.println("Motion detected!");
      digitalWrite(LED_PIN, HIGH);
    } else {
      Serial.println("Motion ended.");
      digitalWrite(LED_PIN, LOW);
    }
  }

  delay(50);
}

Wiring diagram and example code generated by Codey.online — https://www.codey.online

Motion sensor with microwave radar RCWL-051

This RCWL-0516 sensor detects every tiny movement. Unlike a PIR module, this sensor can sense through materials such as plastic. This means there is no visible sensor.

The range of this sensor module is approx. 7 meters with an angle of approx. 120 degrees.

The microwave radar motion sensor operates on a voltage of 4V to 28V. Ideal for an ESP32, Arduino or Raspberry Pi project.

The sensor outputs a high signal of 3.3V when motion is detected.

There is also a CDS connection for connecting an LDR so that the sensor only works in the dark.

This motion sensor can be used both independently and in combination with an Arduino or ESP board.

Dimensions
Length: 3.6cm
Width: 1.7cm
Height: 0.08cm

Wiring diagram

Otronic example code for Arduino IDE:
int radarPin = 2;     // Pin to which the RCWL-051 output is connected

void setup() {
  pinMode(radarPin, INPUT);   // Set the radarPin as input
  pinMode(LED_BUILTIN, OUTPUT);    // Set the ledPin as output
  Serial.begin(9600);         // Start serial communication
}

void loop() {
  int radarValue = digitalRead(radarPin);   // Read the value of the radarPin

  if (radarValue == HIGH) {   // If motion is detected
    digitalWrite(LED_BUILTIN, HIGH);   // Turn on the ledPin
    Serial.println("Motion detected!");   // Send a message via the serial monitor
  }
  else {
    digitalWrite(LED_BUILTIN, LOW);   // Turn off the ledPin
  }
}

Explanation of how this code works
The setup() function sets the radarPin as input and the LED_BUILTIN pin as output.
Serial communication is also started with a baud rate of 9600.

In the loop() function, the value of the radarPin is read and stored in the radarValue variable.
If radarValue is equal to HIGH, which means that motion has been detected by the sensor, the built-in LED on the Arduino board is turned on and a message "Motion detected!" is sent via the serial monitor.
If no motion is detected, the LED is turned off.

The code is quite simple and can be adapted and expanded to use the sensor for various applications, such as controlling an alarm system or activating a motor.
Serial communication can be used to send messages to a computer or other devices to signal events or warnings.

The Vin pin is intended for the sensor's supply voltage. In some applications, it may be necessary to supply the sensor with a different voltage than the standard 5V provided via the VCC pin. In that case, the Vin pin can be used to power the sensor with a voltage between 4 and 28 volts.

The CDS pin is intended for connecting a CdS (cadmium sulfide) light-dependent resistor. This resistor can be used to adjust the sensitivity of the RCWL-051. If the CDS pin is not used, it can be connected to the GND pin.

Using the Vin and CDS pins is optional and depends on the specific application for which the RCWL-051 is used. In most applications, the VCC, GND and OUT pins are sufficient for the sensor to function correctly.

  • Microwave radar
  • Range 7 m
  • CDS connection
  • 4V to 28V
Playing loads the video from YouTube.

Why choose this product?

  • Works through plastic – Detects movement through plastic.
  • Long range – Detects movement up to approx. 7 meters.
  • Wide angle – Monitors an angle of approx. 120 degrees.
  • Flexible power supply – Works on 4V to 28V.
  • Darkness control – CDS connection for LDR in the dark.
Specifications
Dimensions3,6 x 1,7 x 0,08 cm
Suitable forArduino, ESP32 or Raspberry Pi
Output voltage3.3 V
Detection angleapprox. 120 degrees

Frequently bought together

Total: € 8,93

Reviews

★★★★★ 4,0/5 5 reviews
  • ★★★★★Frenck Klaassen

    I still need to test it. Nicely packaged and shipped by Otronic!

  • ★★★★★Danny van Esveld

    Does what it needs to do and is easy to adjust for the desired application

  • ★★★★★Nelectron[]

    Very good product, like all microwave sensors it detects through walls and partitions, don't hesitate to reduce the range with the R-GN resistor, a 470 KΩ one is suitable for most uses

Write a review
Your rating

Shipping & returns

Shipping

  • Parcel with track & trace€ 7,70Within 24 hours
  • Pick up at PostNL location€ 7,40Within 24 hours
  • Letterbox parcel€ 3,70Within 2 business days
  • Letterbox parcel 24 hours€ 4,55Within 24 hours
  • Pick up in storeFree
All about shipping

Returns

Not satisfied? You have 30 days after delivery to return the product.

All about returns