Other Arduino Codes and Videos by Robojax

Motion sensor module BYC-WB-D1 based on BISS0001 for Arduino

دروس آردوینو به فارسی

Motion sensor module BYC-WB-D1 based on BISS0001 for Arduino

This code is to use BYC-WB-D1 module based on BISS0001 chip to detect motion in an distance of 1 to 8 meter.


  /*
 * This is code for the module BYC-WB-D1 based on BISS0001 Micro Power motion detection IC
 * Written by Ahmad Shamshiri for RoboJax.com
Date modefied: Jun 30, 2018 at 17:45 in Ajax, Ontario, Canada

Watch the video instruction for tis code: https://youtu.be/h9JDlQXpi2w
You can get this code from Robojax.com

Pin connection
VCC to 5V
DNG to DNG
OUT to pin 11 of Arduino
 */

int count =0;// just counting seconds
int buzzer = 11;// pin to connect to buzzer or relay
void setup() {
  Serial.begin(9600);
  pinMode(buzzer,OUTPUT);// set pin 11 as output

}

void loop() {
  int v = analogRead(A0);// read the output pin of the module
   // HIGH is when motion is detected. 
  if (v == LOW){
    digitalWrite(buzzer,LOW);// set buzzer pin LOW
   count =0; 
  }else{
    count++;
    digitalWrite(buzzer,HIGH);// Set buzzer pin HIGH
    Serial.print(count);
    Serial.println("-Detected");    
  }
 delay(1000);// wait for 1 second
}   

If you found this tutorial helpful, please support me so I can continue creating content like this. support me via PayPal