Advertisement

How to Get Started with a Microwave Radar Motion Sensor

Last year, I took a look at some mostly low-cost passive infrared (PIR) motion sensor modules. Then recently, I became more aware of cheap microwave radar motion sensor modules. The popular version of the pre-wired module currently available on eBay is the RCWL-0516 microwave radar motion sensor module. The compact module holds all essential electronics, including an on-chip integrated low-voltage regulator. It is very easy to use and trivial to splice into the roost of a little project idea.

 

RCWL-0516

This sensor module has been designed as an alternative to the common PIR motion sensors widely used in burglar alarms and security lights. Like the PIR sensor, this sensor also detects only movements within its detection range. But instead of sniffing the black body radiation from a moving person, this sensor uses a “microwave Doppler radar” technique to detect moving objects. It has a sensitivity range of ~7 meters. When triggered, its TTL-level output (OUT) pin will switch from LOW (0 V) to HIGH (3.3 V) for a finite time (2 to 3 s) before returning to its idle (LOW) state.

 

Key features:

Supply Voltage: 4–28 VDC (tested with 5 V at my lab)

Operating frequency: ~3.2 GHz (observed by me at my lab)

Transmit power: 20 mW (typical)/30 mW (max)

Sensing Distance: 5–7 m (>3 m measured at my lab)

 

Pinouts:

CDS — Sensor disable input (low = disable)

VIN — 4- to 28-V DC supply input

OUT — HIGH (3.3 V) motion detected/LOW (0 V) idle

GND — Ground/0 V

3V3 — Regulated DC output (100 mA max)

 

This flexible sensor module can easily be used in conjunction with many microcontrollers and even without a microcontroller at all. It can handle power supply inputs anywhere from 4 to 28 V. The output pin can be utilized for a multitude of tasks, such as for driving an aural/visual indicator or even linking with the I/O of any 3-V microcontroller for further processing. During construction, avoid any metal part in front of the sensor module. Similarly, always keep a minimum of 1-cm clear space in the front and rear side of the module.

 

RCWL-0516 Doppler radar unit pin out

 

Surprisingly, detection distance and output timeout of the module can be adjusted by adding passive components in their respective solder pads located at the rear of the circuit board (see next figure). There is also a provision to add a light-dependent resistor (LDR/CDS), and a sensor disable input pin is available to defeat the ambient light sensing option if necessary.

 

  • C-TM: Adjust repeat trigger time (default 2 s). Adding a capacitor will give a longer repeat trigger time.
  • R-GN: Detection distance adjustment (default 7 m). Adding a resistor the detection distance will become shorter. If connected with a 1-MΩ resistor, detection range is about 5 m.
  • R-CDS: By adding a resistor (in parallel with the internal 1-MΩ resistor), user can change the light detection threshold as per individual requirement. This is applicable only when a light sensor is soldered in its pads (CDS) on the front of the circuit board. A 47–100K resistor works fine with standard 5-mm LDRs.

 

A word of caution: I could not find an official English datasheet of this module, so I’ve had to make some guesswork here based on the machine translation of Chinese to English. I’m not responsible for any damage that this could cause to your sensor module and/or interfaced microcontroller!

RCWL-0516 front and rear pictures with passive component locations highlighted. These locations can be used to change the range functionality of the device

 

The electronics of the module consists of two equally important sections: a microwave frequency transmitter/receiver/mixer based on the MMBR941M high-frequency NPN transistor and a much-lower-frequency section based on an IC — RCWL-9196. Technically, the microwave section resembles a “Colpitt oscillator,” with the requisite inductor (and capacitors) made by circuit board traces. The inductor (~10 nH) is the S curve trace on the top surface, and capacitors are the ring structure on the bottom surface and also the rectangular block to the left of the S curve.

 

First test circuit

Before delving into anything, I recommend that you become familiar with the hardware and initial setup/run procedure and try to do some little experiments. Although you can use RCWL-0516 with just a power supply and an LED connected, I added an electromagnetic relay driver circuitry to control some external loads when a valid motion is detected. Here, note that the 1-kΩ resistor (R1) is not necessary as the module already held a 1-kΩ resistor between the OUT pin and actual output pin of the 16-pin onboard chip (RCWL-9196). Now to the schematic of the first test circuit:

 

The electromagnetic relay (RL1) in the circuit is driven by a standard BC547 transistor (T1) and there is a “relay on” indicator (LED1) that is when the relay is in an active state. If desired, you can also use other relays with a different supply voltage rating. However, in that case, the power supply input (now 5 V) will have to be changed (with some other minor modifications, of course). The 2-pin header (JP1) is reserved for the future and is practically usable only when a light sensor is connected to the module.

RCWL-0516 – Test Circuit

 

For experimental purposes, this circuit can be constructed on a perfboard/breadboard. A 5-pin header (only three are required for the first test) can be used to connect the radar module. Shown below is the random snap of my quick test setup (also watch the test video):

 

RCWL-0516 -Test Setup

 

Doppler Effect

In principle, the Doppler effect1 is a change in the frequency picked up by a receiver from the signal reflected by a moving object. In Doppler effect radars, to detect a moving object, an unmodulated (CW) signal can be used. The receiver of the sensor processes the transmitted signal with the received signal reflected from a target. Due to the Doppler effect, the mutual speed of an object related to the antenna causes a frequency shift. It can be simply estimated that the Doppler frequency (which is the beat frequency obtained in receiver) is the number of the half-waves of the signal frequency passed by the target per second. A higher speed will produce a higher Doppler frequency. Such a system, with a provision for detecting signal phase, can also indicate the sense of target movement: Escaping objects generate a lower frequency than that of the probing signal, while approaching objects generate a higher frequency.

 

Colpitts Oscillator

The Colpitts oscillator is a popular type of LC oscillator invented by Edwin Colpitts in 1918. The figure shown below depicts a typical BJT-based Colpitts oscillator with the tank circuit in which an inductor L is connected in parallel to the serial combination of capacitors C1 and C2. The frequency of the Colpitts oscillator depends on the components in its tank circuit and can be calculated by a simple formula (see figure). For example: If L=27 uH, C1=1 nF, and C2=15 nF, then F=1 MHz. Note that the Colpitts oscillator can be tuned either by varying the inductance or the capacitance.

Colpitts oscillator diagram

Closing Thoughts

In my opinion, the RCWL-0516 microwave sensor is a powerful alternative to the common PIR sensor, but this model has very limited (scant) documentation, making it difficult for beginners. In addition to reading the “Chinese” material collected by me, I also did some research to aggregate as much information so someone can use it quickly. While, at the moment, I don’t see a use for this sensor module apart from its signified application of motion sensing, it can easily be adapted to add or modify functions!

 

Reference 1: An Overview of Microwave Sensor Technology/Jiri Polivka, Spacek Labs Inc.

17 Comments

Join the conversation!

Error! Please fill all fields.
  • T.K.Hareendran

    Hi Carlos Carrera:

    Probably the chip is in faulty condition. Because:

    Vin of the header is connected to pin 8 of the chip, and it’s then regulated to 3.3V by the chip itself. This regulated 3.3v is also available to the external world through pin 11 (and/or pin 1) of the chip. Since you get the same voltage at the signal output, sure the chip is the culprit. Usually we get 3.3v at the signal output in active state,and 0v in idle state. Thank you for the feedback!

  • CARLOSCARRERA

    Hello,
    I’m using RCWL-0516 with NODEMCU, I made this small scretch with arduino IDE, but my Buzzer is always HIGH, and the RCWL-0516 is HIGH constantly without any new movement.

    Const int pinoSensor = 5; // DIGITAL PIN (D1) USED BY THE SENSOR OUTPUT
    Const int pinoBuzzer = 4; // DIGITAL PIN (D2) USED BY BUZZER
    Int reading; // CREATE A VARIABLE CALL “READY” OF THE WHOLE TYPE

    Void setup () {
       Serial.begin (115200); // INITIALIZE SERIAL
       PinMode (pinSensor, INPUT); // DEFINE PINE AS ENTRY
       PinMode (pinBuzzer, OUTPUT); // DEFINE THE PINE AS OUTPUT
       // digitalWrite (pinBuzzer, LOW);
    }
    Void loop () {
       Reading = digitalRead (pinSensor); // VARIABLE RECEIVES READ VALUE ON SENSOR OUTPUT
       If (reading, HIGH) {// IF ‘reading’ IS EQUAL TO 1 (HIGH), DOES
         DigitalWrite (pinBuzzer, LOW); // ACTION BUZZER
         Serial.println (“DETECTED MOVEMENT”); // PRINT THE TEXT ON THE SERIAL MONITOR
       }
       Else {// DOES, DOES
         DigitalWrite (pinBuzzer, HIGH); // BUZZER REMAINS OFF
         Serial.println (“NO DETECTED MOVEMENT”); // PRINT THE TEXT ON THE SERIAL MONITOR
       }
    }

    • CARLOSCARRERA

      HI , T.K.Hareendran,

      Thanks for the code, but the problem is in the RCWL-0516, it stays high so it connects to the power, and its output is the same as the input example: If the Sensor is connected to a 12V source the output is 12V, 9V output is 9V. I’ll buy another one and test.

    • CARLOSCARRERA

      Hi, Adam Carlson,
      A simple presence sensor with nodemcu and blyng, but my sensor is constantly high, it must be in trouble.

    • Adam Carlson

      Carlos,

      What project are you working on, I would love to hear more about it!

    • T.K.Hareendran

      @Carlos:

      Try this quick code, and let me know!

      This code keeps track of whether the Radar Sensor input on Digital pin D7 of NodeMCU is HIGH or LOW. It also activates the Piezo-Buzzer (connected to D6) in case of a valid motion detection, and prints out messages, as well.

      int Status = 12; // Digital pin D6

      int sensor = 13; // Digital pin D7

      void setup() {

      pinMode(sensor, INPUT); // RCWL-0516 Input
      pinMode(Status, OUTPUT); // Piezo_Buzzer Output
      }

      void loop() {

      long state = digitalRead(sensor);
      if(state == HIGH) {
      digitalWrite (Status, HIGH);
      Serial.println(“Movement Detected!”);
      delay(1000);
      }
      else {
      digitalWrite (Status, LOW);
      Serial.println(“No Movement Detected!”);
      delay(1000);
      }
      }

  • terry190

    Thanks for posting a detailed guide on this. This is really helpful.

  • T.K.Hareendran

    @Adam: What I observed at pin 12 of the controller is a complex noise pattern, while waving my hand in the close proximity of the sensor. I need some more time for experiments. Sure, thereafter I will share my findings here (with some waveforms) as an addendum.

  • findwilliams@gmail.com

    Hello T.K, this very nice. I think with close study, there will be more platform where the RCWL-0516 Doppler radar unit can find application.

    • CARLOSCARRERA

      HI , T.K.Hareendran,

      Thanks for the code, but the problem is in the RCWL-0516, it stays high so it connects to the power, and its output is the same as the input example: If the Sensor is connected to a 12V source the output is 12V, 9V output is 9V. I’ll buy another one and test.

    • Adam Carlson

      @TK,

      Sounds like you have found yet more projects that you can do with this new output that you found. What is the actual output? Is it a voltage/pwm based upon speed of the detected object, or something different?

      Adam

    • Adam Carlson

      @FindWilliams (sorry I do not know your name, just your email),

      Do you have any particular applications in mind? I love finding off use cases for fun parts like this!

      Adam

    • T.K.Hareendran

      Yes, now I think with a close study we can find some interesting application ideas.
      I just noted that it’s easy to take an analog output signal from pin 12 of the controller chip. Thank you for your feedback . It piqued my curiosity to examine things from some odd angles.

  • Adam Carlson

    TK, this looks like fun. I am actively watching the embedded radar market. There are a lot of developments that seem to be coming online in the last few years. I am really hoping that they will come out with a complete unit with embedded antenna that can then be mounted on a board.

Looking for the latest from TI?