David Aristel
Published

Touchless Doorbell V1

Busy with chores while welcoming guests? With this system, you won't need to stop what you're doing to welcome a guest in safely.

IntermediateShowcase (no instructions)Over 1 day36
Touchless Doorbell V1

Things used in this project

Hardware components

I2C 16x2 Arduino LCD Display Module
DFRobot I2C 16x2 Arduino LCD Display Module
×1
Breadboard (generic)
Breadboard (generic)
×1
Arduino Nano R3
Arduino Nano R3
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
Grove - Piezo Buzzer
Seeed Studio Grove - Piezo Buzzer
×1
Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×1
Machine Screw, M4
Machine Screw, M4
×1
Ultra-High Molecular Weight Polyethylene Cord
×1

Software apps and online services

Arduino IDE
Arduino IDE
Tinkercad
Autodesk Tinkercad

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)

Story

Read more

Custom parts and enclosures

Base

This is the Base of the project, this can be used to store the wiring and overall create the structure needed for the system.

Servo Holder

This is the container used to hold the servo. This container is placed over the base in order to create the door opening system.

Roof

Schematics

Touchless Doorbell circuit Diagram

Code

Touchless Doorbell code

C/C++
This allows the LCD, servo, and Piezo buzzer to respond based on the ultrasonic rangefinder.
#include <Servo.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

#define TRIG 6
#define ECHO 7

#define BUZZER 9
#define SERVO_PIN 4

Servo doorServo;
LiquidCrystal_I2C lcd(0x27, 16, 2);

int getDistance() {
  digitalWrite(TRIG, LOW);
  delayMicroseconds(2);

  digitalWrite(TRIG, HIGH);
  delayMicroseconds(10);
  digitalWrite(TRIG, LOW);

  long d = pulseIn(ECHO, HIGH, 30000) * 0.034 / 2;
  return d;
}

bool detected() {
  int valid = 0;

  for (int i = 0; i < 5; i++) {
    int d = getDistance();
    if (d > 0 && d < 80) valid++;
    delay(50);
  }

  return valid >= 3;
}

void setup() {
  Serial.begin(9600);

  pinMode(TRIG, OUTPUT);
  pinMode(ECHO, INPUT);
  pinMode(BUZZER, OUTPUT);

  doorServo.attach(SERVO_PIN);
  doorServo.write(0);

  lcd.init();
  lcd.backlight();
  lcd.print("System Ready");
}

void loop() {

  int d = getDistance();
  Serial.println(d);

  if (detected()) {

    tone(BUZZER, 1000);
    delay(300);
    noTone(BUZZER);

    lcd.clear();
    lcd.print("Doorbell Ringing");

    delay(1000);

    lcd.clear();
    lcd.print("Opening Door");

    doorServo.write(180);
    delay(5000);

    lcd.clear();
    lcd.print("Closing Door");

    doorServo.write(0);
    delay(3000);

    lcd.clear();
    lcd.print("System Ready");

    while (detected()) {
      delay(100);
    }
  }

  delay(150);
}

Credits

David Aristel
1 project • 0 followers

Comments