In this tutorial we interface RCWL-0516 Human body induction switch module Intelligent sensor (Radar Motion sensor) with Arduino.
This mini doppler radar motion sensor module is equipped with supporting DC 4-28V wide voltage. It will automatically continuously output the high level TTL signal when there is motion. 360 degree no blind angle detection and maximum 7m sensing distance. It is perfect for DIY microwave motion sensor light switch, human sensor toys, smart security devices, etc.
Features:
- Operating Voltage: 4-28V
- Operating Current: 2.8mA (typical); 3mA (max)
- Detection Distance: 5-9m
- Transmitting Power: 20mW (typical); 30mW (max)
- Output Voltage: 3.2-3.4V
- Output Voltage Driving Capacity: 100mA
- Trigger Way: repeat trigger
- Output Control Low Level: 0V
- Output Control High Level: 3.3V
- Operating Temperature: -20~80 celsius
- Storage Temperature: -40~100 celsius
- Board Size: 35.9 X 17.3mm/1.41 X 0.68inch
Pin Description:
Pin | Function |
---|---|
3V3 | 3.3V regulated output. Max 100mA (?) |
GND | Ground |
OUT | Trigger: high (3.3V) if motion detected. 0V normally. |
VIN | 4 – 28V supply voltage |
CDS | LDR 10-20k RL, U_LDR > 0.7V = On (Enable control chip) |
Arduino Interface with RCWL-0516
Arduino Code for RCWL-0516 Microwave Radar Motion Sensor
From the data sheet and pinout of the RCWL-0516, we know that this sensor gives high output when motion is detected. CDS pin can be used to enable the motion detection , in this example we keep that pin high, i.e. always on.
/* * Arduino Microwave Radar Motion Sensor Interface * https://Circuits4you.com * Oct 2018 */ int Sensor = 2; //Input Pin int LED = 13; // Led pin for Indication int flg = 0; //Change detection flag void setup() { Serial.begin(9600); pinMode (Sensor, INPUT); //Define Pin as input pinMode (LED, OUTPUT); //Led as OUTPUT Serial.println("Waiting for motion"); } void loop() { int val = digitalRead(Sensor); //Read Pin as input if((val > 0) && (flg==0)) { digitalWrite(LED, HIGH); Serial.println("Motion Detected"); flg = 1; } if(val == 0) { digitalWrite(LED, LOW); flg = 0; } delay(100); }
Testing
Open serial monitor at baud rate of 9600, And make some motion in front of sensor. Observe LED 13 and Serial monitor.
In the loop function, you need to change the ‘led’ in the digitalwrite function, and replace it with ‘LED’