Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Random Stuff We Make!
Published © GPL3+

Touchless Door Opener

A simple circuit which allows you to open the door without touching it.

BeginnerFull instructions provided30 minutes1,512

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
4xAA battery holder
4xAA battery holder
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Schematics

Circuit

Make the same circuit

Code

Touchless door

Arduino
Download and run
#include <Servo.h>
Servo servo1;
int trigPin = 11;
int echoPin = 10;
long distance;
long duration;
 
void setup() 
{
servo1.attach(9); 
 pinMode(trigPin, OUTPUT);
 pinMode(echoPin, INPUT);// put your setup code here, to run once:
}
 
void loop() {
  ultra();
  servo1.write(0);
  if(distance <= 10){
  servo1.write(90);
  }
}
 
void ultra(){
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);
  duration = pulseIn(echoPin, HIGH);
  distance = duration*0.034/2;
  }

Credits

Random Stuff We Make!
17 projects • 65 followers
We at RSWM! try to bring Fiction to Reality through projects which are Interactive, Creative & way too simpler in terms of making.
Contact

Comments

Please log in or sign up to comment.