Professional Documents
Culture Documents
embedded-project-103106109
embedded-project-103106109
Group Project
Submitted To:
Md. Mayenul Islam
Lecturer
Department of Electrical & Electronic Engineering, RUET
Submitted By:
Group Members:
1.Omar bin Harun- 1801103
2.Nasrin Sultana-1801106
3.Ahasanur Rahman Akash -1801109
1.1 Introduction
An RFID access control system is a type of key card or fob system that uses RFID technology to
verify a resident’s credentials.
RFID stands for Radio Frequency Identification. At its core, RFID enables wireless communication
between a reader and an RFID tag.
When RFID was invented in the 70s, RFID tags were costly and bulky. However, advances in
technology mean today’s RFID tags are tiny and inexpensive. Many industries have found countless
uses for RFID technology, from shipping to library cataloging and now access control.
RFID technology, as applied to access control, is found across a variety of buildings. RFID access
systems are used in residential apartments and industrial facilities, and commercial RFID door lock
systems for office complexes are popular as well.
RFID access control uses a system of tags, readers, and computer servers to allow door access to
registered residents who present the correct credentials.
There are two types of RFID access control systems: active and passive.
Active and passive RFID access control systems have different methods of establishing a connection
between an RFID tag and a reader. However, the overall process of using both systems remains the
same.
Active RFID tags use batteries, while passive RFID technology doesn’t. This means active RFID tags
power themselves when they interact with a reader, while passive tags must harvest power from the
reader’s electromagnetic field.
Some active readers are powerful enough to activate without even having to physically come in
contact with a reader, making active readers a popular choice for RFID touchless entry system
providers. On the other hand, while passive tags don’t need to be replaced as often, they have a shorter
range and aren’t as powerful.
1.2 Block Diagram of the Project
Passive RFID
Module
RFID
Module
LCD
Keypad Arduino Nano Display
LED
Solenoid
Buzzer
Lock
16x2 LCD
An LCD (Liquid Crystal Display) screen is an electronic display module and has a wide range of
applications. A 16x2 LCD is a very basic module and is very commonly used in various devices
and circuits. A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In
this LCD each character is displayed in a 5x7 pixel matrix. The 16 x 2 intelligent alphanumeric
dot matrix display is capable of displaying 224 different characters and symbols. This LCD has
two registers, namely, Command and Data.
Buzzer
Buzzer: A buzzer or beeper is an audio signaling device. Which may be mechanical,
electromechanical, or piezoelectric (piezo for short). Typical uses of buzzers and beepers include
alarm devices, training, and confirmation of user input such as a mouse click or keystroke. The
rating of this Buzzer was 5V.
LED
A light-emitting diode is a two-lead semiconductor light source. It is a p–n junction diode that
emits light when activated. When a suitable voltage is applied to the leads, electrons are able to
recombine with electron holes within the device, releasing energy in the form of photons. The LED
used in this project is red.
BJT
A bipolar junction transistor is a three-terminal semiconductor device that consists of two p-n
junctions which are able to amplify or magnify a signal. It is a current controlled device. The three
terminals of the BJT are the base, the collector, and the emitter. BD 135(1.5A,45V) and 2N2222
BJT (800mA, 40V) are used in this project. Here BD 135 is used to drive the relay whereas 2N2222
BJT is used to amplify the current of the buzzer. 2N2222 BJT is easy to find and one of the cheapest
BJT at market price.
Diode
A diode is a two-terminal Electrical device. Diodes are made from a semiconductor, most often
silicon but sometimes germanium. There are many types of diodes such as Zener, Rectifier,
Transient Voltage Suppressor, Thyristor, Silicon Controlled Rectifier, and TRIAC. Diod-1N4007
is a flyback diode. This is cheap as well as available in any Tech=shop
Opto Isolator
An opto isolator (also known as an optical coupler) is a semiconductor device that transfers an
electrical signal between isolated circuits using light.These electronic components are used in a
wide variety of communications and monitoring systems that use electrical isolation to prevent
high voltage emitters from affecting lower power circuitry receiving a signal. PC817 Optoisolator
is being used in this project.
Resistors
The resistor is a passive electrical component that creates resistance in the flow of electric current.
In almost all electrical networks and electronic circuits they can, be found. The resistance is
measured in ohms (Ω). Two resistors of (1/4) W and 5W is used.
Capacitors
A capacitor is a device that stores electrical energy in an electric field. It is a passive electronic
component with two terminals. Capacitor, a device for storing electrical energy, consisting of two
conductors in close proximity and insulated from each other. A simple example of such a storage
device is the parallel-plate capacitor.
Header (Rails)
Pin headers are stiff metallic connectors that are soldered to a circuit board and stick up to receive
a connection from a female socket. While pin headers (often called PH, or headers) are male by
definition, female equivalents are also quite common, and we refer to them as female headers (FH)
or header connectors. The female header is used to
Avoid direct soldering of the components
Makes the circuit functional despite one of the components being damaged.
Flexibility to replace the components
Card Board
Cardboard is a generic term for heavy paper-based products. The construction can range from a
thick paper known as paperboard to corrugated fiberboard which is made of multiple plies of
material.
Glue Stick
Most glue sticks are designed to glue papers and card stock together and are not so strong as some
liquid-based variants. They can be used for craft and design, office use, and at school.
PCB
A printed circuit board (PCB) is a thin board made from fiberglass, composite epoxy, or other
laminate materials. PCBs are found in various electrical and electronic components such as
beepers, radios, radars, computer systems, etc. Different types of PCBs are used based on the
applications. A printed circuit board (PCB) is the board base for physically supporting and wiring
the surface-mounted and socketed components in most electronics. We use it to connect the devices
DC Barrel Connector
Barrel connectors are typically found on low-cost consumer electronics which can be plugged into
wall power via bulky AC wall adaptors. Wall adaptors are widely available, in a variety of power
ratings and voltages, making barrel connectors a common means for connecting power to small
projects.5.5 mm DC barrel Connector.
PH Connector
This is a thin, low-profile 2.0mm pitch connector 8.0mm in height after mounting and 4.5mm in
width. It is designed to meet the demand for high-density connection of internal wires to printed
circuit boards. It is compact, highly reliable, and low in cost.
1.5 Required Components
Arduino Nano V3
MRF522 RFID module
4x3 matrix keypad
16x02 LCD
12C LCD adapter
12V Solenoid lock
12V adapter (rated 2Amp, original rating 0.95 amp)
5V Buzzer
LED(RED)
BD 135 Transistor
2N2222 Transistor
Diode(1N4007)
PC817 Opto-couple
1.7 Methodology:
Step 1: First of all we uploaded the example sketches from Arduino ide to an Arduino UNO,
connected the RFID as instructed, and learned to use it
Step 2: By following the same method described in step 1 we learned to use a 5v buzzer, the LCD
display with an I2C module, and the keypad.
Step 3: We make the flow chart of the code in this step and programmed the code step by step. We
debugged the code when necessary.
Step 4: Then we make comments in the code so that it is well documented and easy to understand
for all.
Step 5: Then we prototyped the hardware and software part altogether and checked if everything
works perfectly. We modified the circuit slightly where necessary, for example, the relay seems to
become too hot when we run it in 12v, so we added an extra 5w resistor between the emitter pin
and GND pin of the BJT so that the relay operates at a lower voltage.
Step 6: Then we designed a PCB with ECAD software. We used EasyEDA for the purpose. We
designed the PCB in such a way that it can easily be manufactured locally.
Step 7: Then we make the PCB ourselves and make all the connections.
Step 8: At last we soldered all the components and decorated the project nicely so that it can be
explained to anybody easily.
1.8. PCB Layout of the project
1.9
/*This code is written for a Project named Arduino Nano-Based RFID Door Access Control
using RUET ID Card
* It is a project for Embedded System Design
* of Department of EEE-Rajshahi University of Engineering & Technology
* The team members of this project are
* Roll no Name
* 1801103 Omar Bin Harun
* 1801106 Nasrin Sultana
* 1801109 Ahasanur Rahman Akash * Course Teacher :
* Md. Mayenul Islam
* Lecturer
* Department of EEE
* RUET
*/
/*
* The system scans any RFID tags and asks for password from the known tags
* An 3x4 matrix keypad is used to enter the password
* Entering correct password unlocks the door for 10 seconds and
* a countdown is shown on the lcd display
*/
#include <SPI.h> //Including SPI communication library
//A Serial Peripheral Interface (SPI) bus is a system for serial communication,
//which uses up to four conductors, commonly three.
//One for receiving data, another for sending,
//one for synchronization and one for selecting a device to communicate with.
#include <MFRC522.h> //Including MFRC522 library. this library is used for
programming the RFID module
byte rowPins[ROWS] = {14, 15, 16, 17}; //connect r1,r2,r3,r4 of keypad with these pins byte
colPins[COLS] = {2, 3, 4}; //Connect c1,c2,c3,c4 of keypad with these pins
MFRC522::MIFARE_Key key;
if(nuidPICC[0]==195&&nuidPICC[1]==171&&nuidPICC[2]==233&&nuidPICC[3]==24){
Serial.print(F("Hi Roboboy.PLease enter your password"));
password(); for(i=0;i<7;i++){ nuidPICC[i]=0;
}
}
//section ends
else
if(nuidPICC[0]==140&&nuidPICC[1]==103&&nuidPICC[2]==217&&nuidPICC[3]==56){
Serial.print(F("Welcome KBM. Please Enter your password"));
password(); for(i=0;i<7;i++){
nuidPICC[i]=0;
}
}
else
if(nuidPICC[0]==04&&nuidPICC[1]==115&&nuidPICC[2]==131&&nuidPICC[3]==82){
if(nuidPICC[4]==207&&nuidPICC[5]==73&&nuidPICC[6]==128){//Nasrin
Serial.print(F("Welcome Nasrin. Please Enter your password"));
password(); for(i=0;i<7;i++){
nuidPICC[i]=0;
}
}
}
else
if(nuidPICC[0]==04&&nuidPICC[1]==28&&nuidPICC[2]==102&&nuidPICC[3]==82){
if(nuidPICC[4]==207&&nuidPICC[5]==73&&nuidPICC[6]==128){//Talha
Serial.print(F("Welcome Talha. Please Enter your password"));
password(); for(i=0;i<7;i++){
nuidPICC[i]=0;
}
}
}
else
if(nuidPICC[0]==04&&nuidPICC[1]==49&&nuidPICC[2]==143&&nuidPICC[3]==82){
if(nuidPICC[4]==207&&nuidPICC[5]==73&&nuidPICC[6]==128){ //Ahsanur
Serial.print(F("Welcome Ahsanur. Please Enter your
password")); password(); for(i=0;i<7;i++){
nuidPICC[i]=0;
}
}
}
else{
Serial.print(F("unknown id, access denied"));
lcd.clear(); lcd.setCursor(0,0); lcd.print("
Unknown ID"); lcd.setCursor(0,1);
lcd.print(" Access denied"); for(i=0;i<3;i++){
tone(buzzer, 1000); // Send 1KHz sound signal...
delay(300); // ...for 1 sec
noTone(buzzer); // Stop sound...
delay(300); // ...for 1sec
}
delay(1000);
}
// Halt PICC
rfid.PICC_HaltA();
/**
* Helper routine to dump a byte array as hex values to Serial.
*/
void printHex(byte *buffer, byte bufferSize) {
for (byte i = 0; i < bufferSize; i++) {
Serial.print(buffer[i] < 0x10 ? " 0" : " ");
Serial.print(buffer[i], HEX);
}
}
/**
* Helper routine to dump a byte array as dec values to Serial.
*/
void printDec(byte *buffer, byte bufferSize) {
for (byte i = 0; i < bufferSize; i++) {
Serial.print(buffer[i] < 0x10 ? " 0" : " ");
Serial.print(buffer[i], DEC);
}
}
byte data_count = 0; // Counter for character entries char
Data[Password_Length];// Character to hold password input char
customKey;// Character to hold key input int TimeCount;
void password(){ // a function that checks Password and opnes the lock
delay(500); lcd.clear(); lcd.setCursor(0, 0);
lcd.print("Enter Password:");
Serial.print("Enter Password:");
while(data_count < Password_Length - 1){
customKey = customKeypad.getKey(); // Look for keypress
if (customKey) {
Data[data_count] = customKey; // Enter keypress into array and increment counter
lcd.setCursor(data_count, 1); lcd.print(Data[data_count]);
Serial.print(Data[data_count]); data_count++;
}
} // See if we have reached the password length
lcd.clear();
if (!strcmp(Data, Master)) { // Password is correct
lcd.print("Correct"); Serial.print("Correct\n");
delay(500);
digitalWrite(doorlock, HIGH);
for(TimeCount=0;TimeCount<10;TimeCount++){
lcd.clear();
lcd.print("Door is Open for");
Serial.print("Door is Open for");
lcd.setCursor(4,1); lcd.print(10-
TimeCount); Serial.print(10-
TimeCount); lcd.print(" Seconds");
Serial.print(" Seconds\n");
delay(1000);
}
digitalWrite(doorlock, LOW);
lcd.clear();
lcd.print("Door Closed");
Serial.print("Door closed\n");
delay(2000);
}
else {
// Password is incorrect
lcd.clear();
lcd.print("Incorrect");
Serial.print("Incorrect\n"); for(i=0;i<3;i++){
tone(buzzer, 1000); // Send 1KHz sound signal...
delay(300); // ...for 1 sec noTone(buzzer);
// Stop sound...
delay(300); // ...for 1sec
}
delay(1000);
}
lcd.clear(); // Clear data
while (data_count != 0) {
Data[data_count--] = 0;
}
}
1.11 Conclusion
The project was successful and we found the interesting fact that there is a built-in RFID chip
inside our University ID cards that is ISO standard. So some modified versions of the system may
be used for different purposes of the Institute. For example by introducing fingerprint verification
of the user
Instead of password the same system can be used to take attendance of the students. That will save
a lot of time and Productivity can be increased. So it can be concluded that it is a successful project
and further optimization and modification of the same project may solve different real life issues.