Hackster is hosting Hackster Holidays, Ep. 7: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 7 on Friday!
DKARDU
Published © GPL3+

How to Make Non-Touch Automatic Door Open-Close System

The purpose of this project is a automatic open-close door system by detecting body temperature. To Avoid spreading Covid-19.

BeginnerFull instructions provided1 hour22,796

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
2004 I2C LCD
×1
GY-906-BCC IR Infrared Thermometry Module
×1
Two Tower Pro MG90S Servos
×1
Buzzer
×1
HC-SR501 Human infrared sensor
×1

Story

Read more

Schematics

circuit_diagram_KtCfBMevFL.jpg

Code

autodoor.ino

Arduino
#include <LiquidCrystal_I2C.h>

#include <Servo.h>
#include <Wire.h>
#include <Adafruit_MLX90614.h>

Adafruit_MLX90614 mlx = Adafruit_MLX90614();
LiquidCrystal_I2C lcd(0x27,20,4);

Servo myservo1;  
Servo myservo2; 

#define red 13
#define haha 4
int pos1,pos2;

void setup() {
  Serial.begin(9600);
  pinMode(red,OUTPUT);
  pinMode(haha,INPUT);
  myservo1.attach(7);  
  myservo2.attach(8); 
  myservo1.write(90);
  myservo2.write(90);
  mlx.begin();  
 
  lcd.init();
  lcd.backlight();
 

}

void loop() {
  
        int montion = digitalRead(haha);
        
        if(montion == 1){
          
          Serial.print("made");
          Serial.print("\n");
          lcd.setCursor(0,0);
          lcd.print("ObjectTemp:");
          lcd.setCursor(13,3);
          lcd.print("-DKARDU");          

          kaiguan();
          }   
}
          
void kaiguan(){
  
   int temp_obj = mlx.readObjectTempC();
   Serial.print(temp_obj);
   Serial.print("\n");
          if(temp_obj < 31){
           lcd.setCursor(0,1);
           lcd.print(temp_obj);
           lcd.setCursor(0,2);
           lcd.print("Not detected,retest!");
              
          }if(temp_obj > 30 && temp_obj <38){
           
           lcd.setCursor(0,1);
           lcd.print(temp_obj);
           lcd.setCursor(0,2);
           lcd.print("body temperature ok "); 
           for(pos1 = 90; pos1 <= 180; pos1 += 1)
          {                                 
            myservo1.write(pos1);
            myservo2.write(180-pos1);         
            delay(15);
          }
            delay(5000);

           for(pos1 = 180; pos1>=90; pos1 -=1)
           {
            myservo1.write(pos1);
            myservo2.write(180-pos1);     
            delay(15);                     
           }

          } 
          if(temp_obj>37){
            digitalWrite(red,HIGH);
            lcd.setCursor(0,1);
            lcd.print(temp_obj);
            lcd.setCursor(0,2);
            lcd.print("     Keep out!       ");
            delay(500);
            
  }
  digitalWrite(red,LOW);
}            
               
         

 

   

Credits

DKARDU
22 projects • 44 followers
Arduino

Comments