fbpx
skip to content

Procedure

Touchless Doorbell

Components required:

  • Nano Board – 1
  • Arduino Nano – 1
  • Arduino Nano Cable – 1
  • Power Bank-1
  • USB to DC jack-1
  • Buzzer -1
  • IR Sensor -1

Circuit Diagram:

Connect the circuit as shown in the image above.

Arduino Code:

  • Scan the QR to open the code. Copy the code and paste it in your Arduino IDE.
  • Once you paste the code in Arduino IDE, Compile the code and upload it in the Arduino Nano.

Code :

int IR=6;                           //IR sensor block is connected to digital pin 6
int BUZZER=2;                       //Buzzer block is connected to digital pin 2


void setup() {
  // put your setup code here, to run once:
  pinMode(IR,INPUT);                //Declaring IR sensor as input device
  pinMode(BUZZER,OUTPUT);           //Declaring BUZZER as output device

}

void loop() {
  // put your main code here, to run repeatedly:
  int a=digitalRead(IR);            
  if (a==0)
  {
    digitalWrite(BUZZER,HIGH);      //If sensor senses any object, buzzer will start buzzing.
  }

  if (a==1)
  {
    digitalWrite(BUZZER,LOW);      //If sensor does not sense any object, buzzer will be OFF. 
  }

}

Output:

Once the code is uploaded, we can hear that the Buzzer on pin 2 turns ON when you place a hand near the Light Sensor on pin 6 then it turns OFF once your hand moves away from it. 

Please enter your email address to receive your cart as a PDF.