Things used in this project

Hardware components:
398 09
Adafruit RGB Backlight LCD - 16x2
×1
51gzz5eu9pl. sx425
HC-SR04
×1
Adafruit industries ada1536 image
Buzzer
×1
Amazon Web Services DC Motor
×1
A000066 iso both
Arduino UNO & Genuino UNO
×1
Amazon Web Services motor shield
×1
11026 02
Jumper wires (generic)
×1
Software apps and online services:
Ide web
Arduino IDE

Custom parts and enclosures

Connect hardware
Connect hardware
Automatic door opening system aokbmorq5c

Schematics

Connect Hardware
Connect Hardware
F0ir7yhiyysyypv small vkb8adlsel

Code

Arduino codeArduino
Code for Automatic Door Opening Using Ultrasonic sensor HRSC04
#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 8, 9, 1);

const int trigPin = 7; 
const int echoPin = 4;
const int mt_En_Pin1  = 2; 
const int mt_IN1_Pin2  = 3; 
const int mt_IN2_Pin3  = 6;
int buzz = 10;

long duration;
int distance;

void setup()
{
lcd.clear();
lcd.begin(16, 2);
lcd.print("WELCOME");

pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(mt_En_Pin1, OUTPUT);
pinMode(mt_IN1_Pin2, OUTPUT);
pinMode(mt_IN2_Pin3, OUTPUT);
Serial.begin(9600);
pinMode(buzz, OUTPUT);
}

void loop() 
{
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);

distance= duration*0.034/2;
if(distance <= 5)
{
    digitalWrite(13, HIGH);
    delay(1000);
    digitalWrite(mt_En_Pin1, HIGH);
    analogWrite(mt_IN1_Pin2,50);
    analogWrite(mt_IN2_Pin3, 0);
    delay(2000);
    analogWrite(mt_IN1_Pin2, 0);
    analogWrite(mt_IN2_Pin3, 0);
    delay(1000);
    
    tone(buzz, 1000);
    delay(1000);
    tone(buzz, 1000);
    delay(1000);
    noTone(buzz);
    delay(3000);
    
    lcd.clear();
    lcd.setCursor(0,1);
    lcd.print("Please Enter");
    delay(1000);
  
    analogWrite(mt_IN1_Pin2,0);
    analogWrite(mt_IN2_Pin3,50);
    delay(3000);
}

else
{
    digitalWrite(13, LOW);
    digitalWrite(mt_En_Pin1, LOW);
    analogWrite(mt_IN1_Pin2,50);
    analogWrite(mt_IN2_Pin3, 0);    
}

}

Credits

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Wolf: Search and  Rescue Multi-Terrain Robot
Advanced
  • 401
  • 10

Full instructions

Wolf is an IoT multi-terrain robot running on the Arduino 101 platform.

Sweep 3D Scanner
Advanced
  • 1,987
  • 36

Work in progress

A complete hardware and software kit for creating full spherical 3D scans with a sweep scanning LiDAR sensor.

Sweep 3D Scanner

Team Scanse

Caravaggio, a Drawing Machine
Advanced
  • 5,577
  • 40

Caravaggio is a drawing machine able to replicate a digital image using a pen and a continuous line.

Touched by time – cyborgism
Advanced
  • 58
  • 2

I have no “sense" of time - can develop one? Tempo is a wearable device that feeds time data to my skin through vibration patterns.

Animatronic Tail by circuito.io
Advanced
  • 492
  • 5

Full instructions

Our first wearable project (!) is an animatronic tail with dual-control. No animals harmed in the making of this project.

NAMLA
Advanced
  • 373
  • 5

Work in progress

Autonomous omni-mobile robot

ProjectsCommunitiesContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Respect project
Feedback