Automatic Door Final

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

Project

“Door Automatic using RFID, Ultrasonic


and Gas Sensor”

Group 11
Names : 1. Diandra Laudia (2220010110)
2. Dinah Aryani Zavitri (2220010111)

Class : 3ISA2
Faculty : Mr. Listyo Edi Prabowo, S.T., M.T.

CEP CCIT
FAKULTAS TEKNIK UNIVERSITAS INDONESIA
2024
PROJECT ON
Door Automatic using RFID, Ultrasonic and Gas Sensor

Developed by

1. Diandra Laudia (2220010110)


2. Dinah Aryani Zavitri (2220010111)

4
Door Automatic using RFID, Ultrasonic and Gas
Sensor

Batch Code : 3ISA2


Start Date : 23 December 2023
End Date :

Name of Faculty : Mr. Listyo Edi Prabowo, S.T., M.T.

Names of Developer:
1. Diandra Laudia (2220010110)
2. Dinah Aryani Zavitri (2220010111)

Date of Submission:
CERTIFICATE

This is to certify that this report titled “Door Automatic using RFID, Ultrasonic an Gas
Sensor” embodies the original work done Diandra Laudia and Dinah Aryani Zavitri. Project
in partial fulfillment of their course requirement at NIIT.

Coordinator:
Listyo Edi Prabowo, S.T., M.T.
ACKNOWLEDGEMENT

Praise God Almighty, who has bestowed His grace so that this paper can be completed
in time. We also thanks to all who have helped in the process of completing this paper,
especially to Listyo Edi Prabowo, S.T., M.T. as a faculty of the class.

This paper entitled “Door Automatic using RFID, Ultrasonic and Gas Sensor” can be
completed. The contents of this paper explain about automatic door with ESP8266 using RFID
sensor, ultrasonic sensor and gas sensor.

The author realizes that this paper still has shortcomings. Therefore, the writer expects
the reader to be able to provide constructive criticism and suggestions in order to improve the
writing of further papers.

Depok, 10 January 2024

Authors
SYSTEM ANALYSIS

System Summary:
The Automatic Door System, powered by the ESP8266 microcontroller, seamlessly
blends RFID technology, a gas sensor, and an ultrasonic sensor to create a sophisticated access
control solution. The door will be open with the card used RFID sensor and when the car accros
the ultrasonic sensor, the door would automatic closed. When the gas sensor detected gas
around area the servo will automatically open for emergency condition. The ESP8266 processes
the authentication data, cross-referencing it with the authorized user database.

System Processes:
The automatic door system, orchestrated by the ESP8266 microcontroller, orchestrates
a seamless interaction of various components to deliver secure and efficient access control. The
RFID sensor, integrated into the system, scans RFID cards presented by users, while the
ultrasonic sensor would closed the door when car accros them. Complementing these methods,
when the gas sensor detected gas around are the servo will automatically open for emergency
condition . The ESP8266 processes the amalgamated data, checking it against a database of
authorized users. Upon successful authentication, the electronic lock is activated, prompting the
door to open automatically for a designated period. With potential for integration with remote
monitoring systems and customization features, the automatic door system emerges as an
intelligent, adaptable, and user-friendly solution for controlled access scenarios
FLOWCHART
PROGRAM CODE

#include <Servo.h>
#include <MFRC522.h>
#include <ESP8266WiFi.h>
#include <ThingSpeak.h>

#define SS_PIN D1
#define RST_PIN D0

int pinMQ2 = A0;


int threshold = 150;
int servoPin = D2;
int bukaPintuCounter = 0;

const int ULTRASONIC_TRIGGER_PIN = D3;


const int ULTRASONIC_ECHO_PIN = D8;
const int FLAME_SENSOR_PIN = A0;
const int AMBAT_BAHAYA = 500;

const char *ssid = "Audi";


const char *password = "audiii123";
const char *thingSpeakAPIKey = "RUXSBPN258FOPYGK";
const unsigned long channelID = 2397299;

Servo myServo; // Objek Servo


MFRC522 mfrc522(SS_PIN, RST_PIN);
PROGRAM CODE

void setup() {

Serial.begin(115200);

myServo.attach(servoPin);

WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {

delay(1000);

Serial.println("Connecting to WiFi...");

Serial.println("Connected to WiFi");

WiFiClient client;

ThingSpeak.begin(client);

SPI.begin();

mfrc522.PCD_Init();

myServo.attach(D2);

myServo.write(0);

pinMode(ULTRASONIC_TRIGGER_PIN, OUTPUT);

pinMode(ULTRASONIC_ECHO_PIN, INPUT);

void handleRFID() {

if (mfrc522.PICC_IsNewCardPresent() && mfrc522.PICC_ReadCardSerial()) {

Serial.println("RFID Detected!");

if (memcmp(mfrc522.uid.uidByte, (byte*)"\xB3\x62\x3A\x10", 4) == 0) {

Serial.println("Valid Card. Opening the gate.");

bukaPintu();
PROGRAM CODE

// Send data to ThingSpeak

} else {

Serial.println("Invalid Card. Please try again.");

mfrc522.PICC_HaltA();

void bukaPintu() {

myServo.write(180);

ThingSpeak.writeField(channelID, 1, 1, thingSpeakAPIKey);

void tutupPintu() {

myServo.write(0);

long bacaJarak() {

digitalWrite(ULTRASONIC_TRIGGER_PIN, LOW);

delayMicroseconds(2);

digitalWrite(ULTRASONIC_TRIGGER_PIN, HIGH);

delayMicroseconds(10);

digitalWrite(ULTRASONIC_TRIGGER_PIN, LOW);

return pulseIn(ULTRASONIC_ECHO_PIN, HIGH) * 0.034 / 2;

}
PROGRAM CODE

boolean deteksiApi() {

int nilaiSensorApi = analogRead(FLAME_SENSOR_PIN);

Serial.print("Nilai Sensor Api: ");

Serial.println(nilaiSensorApi);

// Send gas sensor value to ThingSpeak

return nilaiSensorApi > AMBAT_BAHAYA;

void loop() {

handleRFID();

int sensorValue = analogRead(pinMQ2);

Serial.print("Nilai Sensor Gas: ");

Serial.println(sensorValue);
PROGRAM CODE

// Send gas sensor value to ThingSpeak

if (sensorValue > threshold) {

Serial.println("Deteksi Gas! Bahaya!");

bukaPintu();

if (deteksiApi()) {

Serial.println("Deteksi Api! Tanggapan Tambahan...");

ThingSpeak.writeField(channelID, 2, sensorValue, thingSpeakAPIKey);

String url = "http://api.thingspeak.com/update?api_key=";

url += thingSpeakAPIKey;

url += "&field2=";

url += String(sensorValue);

} else {

Serial.println("Tidak ada deteksi gas.");

tutupPintu();

delay(1000);

}
SCHEMATIC SYSTEM

,
OUTPUT
OUTPUT
CONFIGURATION

Hardware :
Hardware:
ESP-8266
1. HP Pavilion, Acer Aspire 5, Alienware m17xR4

Operating System :

1. Windows 10 64-bit

Software :

1. Dev C++ Ultrasonic Distance Sensor


2. Draw io
3. Ms. Word
4. Ms. Power Point

Cabels Jumper

Breadboard
CONFIGURATION

RFID Sensor and Card

Pir Sensor (Motion Detector)

Servo
\
CONFIGURATION

Software:
1. Arduino IDE
2. Ms Word
3. Thingspeak

Operating System
“”
Windows 11
CONCLUSION & SUGGESTION

Conclusion:

The automatic door system using ESP8266, RFID sensor, keypad, and ultrasonic
sensor is a smart and secure way to control access. It combines RFID cards and keypad
PINs for user entry, and the ultrasonic sensor ensures the door opens when someone
approaches. The ESP8266 efficiently processes this information, allowing authorized users
to enter while keeping a record of access events. With features like dual authentication and
potential for remote monitoring, this system is not just secure but also user-friendly and
adaptable to modern access control requirements.

You might also like