Getting Started with Microwave Radar Sensor RCWL-0516 (Arduino IDE)

Microwave Radar Sensor RCWL-0516 Pins:

VIN : +5 VDC
OUT : Pin 2
GND : GND

Upload the code using Arduino IDE.

#define Radar_PIN 2
#define LED_PIN   3

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

void loop() {
  if(digitalRead(Radar_PIN)==1){
    Serial.println("Detect !");
    digitalWrite(LED_PIN,HIGH);
  }else {
    digitalWrite(LED_PIN,LOW);
   }
}
Tags: