doc

51
Access Control & Security System Final Report Presented By Syed A. Ali George Kutsaftis

Upload: petersam67

Post on 14-May-2015

660 views

Category:

Business


0 download

TRANSCRIPT

Page 1: doc

Access Control & Security SystemFinal Report

Presented BySyed A. Ali

George KutsaftisZachary J. MauraChuong NguyenJonathan Vanase

Advisors Dr. John Chandy

Dr. Rajeev Bansal

Page 2: doc

________________________________________________________________________

Table of Contents

Background..........................................................................................................................3Summary..............................................................................................................................3Competitive Analysis...........................................................................................................4

Door Access Interface..................................................................................................4Product Security Interface...........................................................................................5

Component Level Module...................................................................................................6Design Components.............................................................................................................7

Microcontroller............................................................................................................7Card Reader.................................................................................................................9Electric Door Strike...................................................................................................10Schlage Lock.............................................................................................................10Wireless Units............................................................................................................11Wireless ConnexLink................................................................................................12Texas Instruments TI-Tags........................................................................................13Display.......................................................................................................................14Power Management...................................................................................................15Regulated Power Supply............................................................................................15Driving Circuitry.......................................................................................................16

Control Software................................................................................................................17Current System Functionality............................................................................................19Possible Future Modifications...........................................................................................20Timeline.............................................................................................................................21Parts List............................................................................................................................22Budget................................................................................................................................22Team member participation ..............................................................................................23Conclusion.........................................................................................................................23Index..................................................................................................................................24

Figure 1 Core System Mapping...........................................................................................6Figure 2 Qik Start PIC education board /w CAN................................................................7Figure 3 Block diagram of 16F874......................................................................................8Figure 4 MSR200-33R Card Reader...................................................................................9Figure 5 Smart home SA Type Door Strike......................................................................10Figure 6 Schlage Lock.......................................................................................................10Figure 7 ConnexLink Unit.................................................................................................12Figure 8 Display of security system..................................................................................14Figure 9 Power management circuitry...............................................................................15Figure 10 Driving Circuit..................................................................................................16Figure 11 Screenshot of the GUI.......................................................................................18Figure 12 Software external structure................................................................................18

2

Page 3: doc

________________________________________________________________________

Background

Due to missing equipment from the design and computer labs the ECE department had

decided that they would like to secure these locations by using a card swipe and

surveillance type security system. All labs will have the card access system installed as

part of the project. .The University of Connecticut currently uses a decentralized card

access security system called “Husky One Card”, which the card contains students

school’s identity number and social security number. We were assigned the task of

designing a card swipe based security and surveillance interface based on the “Husky

One Card” system.

The security system was required to be a completely operational “Door Access System”

based on authentication. It will also monitor the flow of equipment in the room using

RFID Technology.

________________________________________________________________________

Summary

The Building Security System has been designed to reduce the amount of stolen

equipment from the Senior Design Labs in the Information Technologies Engineering

building. It makes use of card swipes for user authentication along with a locking system

on the doors to allow entry only to authorized students. The doors open from the inside

without authentication for compliance with fire codes and for an acceptable level of

usability. For ease of application the authentication is transmitted wirelessly throughout

the building from door unit to authentication unit. This main authentication unit is

capable of allowing entry to designated labs, logging traffic, and is easily programmable.

Residing on a Windows based PC the program to control authentication and access

logging is easily portable to most of today’s PC market.

3

Page 4: doc

The Building Security System also protects units in the room from thief by means of

radio frequency tracking. Small RF tags concealed within units trigger an alarm when

removed from the room.

The combination of these two subsystems composes the Access Control & Security

System. The ability to track user access and protect devices at the same time should

allow the labs to operate under normal conditions while preventing the theft of expensive

devices used within the labs.

________________________________________________________________________

Competitive Analysis

Door Access Interface

During our research period we looked into a complete system used by many large hotel

chains from the company “vingcard”. This product seemed to be an appropriate solution

to the project’s chief dilemma. This system included an all in one door lock, handle and

card reader. It also had a manual override (in case of power outage and emergency).

This full system also incorporated a card encoder, which would program the cards with

access to the appropriate doors. This system seemed to be a great resolution, yet it still

had several drawbacks. First, the system would not utilize the “Husky one-card” system

that the university already uses. This would force the administrators to key many cards

and attempt to distribute them to the appropriate students and cause this process to be

repeated once a card was reported stolen or lost. The other chief shortcoming was the

cost of this system which was found to be approximately ten thousand dollars, which did

not satisfy our prescribed budget.

We decided to use an independent card reader and built up the rest of the system around

this card reader. A little research revealed a myriad of card readers to choose from.

4

Page 5: doc

Anything over the price of two hundred dollars was removed from the running. Also

only RS-232 based readers were considered for the project. Another qualification the

card readers must meet was versatility. A card reader must read tracks 1, 2 and 3 of

almost any card. Another prerequisite for the card reader was that it must be sturdy

enough to handle frequent use while still being reasonably compact. After all was said

and done we found our card reader. Its price was only one hundred and sixty dollars,

slightly under our price ceiling. It was also a RS-232 reader that read all three tracks of

the standard swipe card. It also appeared to be of sturdy build and moderate proportions.

Of all the card readers that were found this was the only one to meet or exceed all of

demands, hence we decided to choose MR-232 card reader.

Product Security Interface

One of the goals of this project was to design a system that would protect equipment from

the lab something that will trigger an alarm if lab equipment (such as a computer or

signal generators) was taken outside the designated area. This had proven difficult but a

few possible solutions were considered. The first was the EAS towers, which are

commonly employed in most stores. A small magnetic strip would be hidden securely on

an item; this strip can be deactivated to allow passage through the towers. If the strip is

not deactivated and one tries to pass through the towers an alarm would sound. At first

look this is a good solution; the magnetic strips are very cheap and disposable. The

system is very simple to use and effective, hence its use in stores. In retrospect this is not

a feasible due to the fact the towers themselves cost upwards of two thousand dollars;

which would not satisfy the budget limitation for this project.

Another solution to this problem came by way of a company whose products seemed to

be a reasonable solution. The company claimed to equip their customer with sensors that

would create “containment fields”, and transmitters that would trigger an alarm if a piece

of equipment breeched on of these “containment fields”. The system would then transmit

an automated message to a pager or walkie-talkie telling the administrators which piece

5

Page 6: doc

of equipment was being stolen and from where. A very novel idea, however a minimum

purchase and a high starting price made this an impractical solution

The most acceptable solution we found was from Texas Instruments. The company is in

a phase of developing RFID devices that operates on the principle of passive transmitters.

These RFID tags can store a small amount of information about the device it is attached

to and then transmit this information to a reader. This system also includes an interface

to communicate with a PC, so we found it possible to incorporate the TI-Tag system into

our project.

________________________________________________________________________

Component Level Module

Figure 1 Core System Mapping

6

Page 7: doc

The Figure above shows all the major components involved and how they are connected. The yellow block is what’s been mounted on or near the door, the pink block is what’s been mounted in the vicinity of the labs near the door or window etc and the blue block is control system which is a windows based PC connected to a wireless server transceiver. ________________________________________________________________________

Design Components

Microcontroller

During the initial design phase we had the microcontroller serve a dual purpose in this

project. It will both bridge the gap between the card reader and the wireless unit along

with controlling the door lock and the alarm. The bridging operation was to allow us to

parse the output stream of the card reader and determine which action to take. This

RS232 I/O will also allow us to communicate with the wireless transmitter/receiver. This

will ensure that the only data sent via the wireless channels are valid authentication

information.

Later we made some modifications to the design and limited the usage of the

microcontroller to receiving commands from the control unit when it authorizes user or

component access and active the alarm and the door lock respectively. In this case the

data is being taken from the wireless receiver and needs to be communicated to the door

lock and alarm. The connections between the wireless receiver and the microcontroller

will still use RS232, while the microcontroller will communicate with the door lock

through signal the door lock receives. If the microcontroller receives a signal from the

wireless receiver designated to allow the door to unlock, then the microcontroller will

relay this information into control circuitry and will unlock the door. This completes the

full loop of needed communications handled by the microcontroller.

7

Page 8: doc

Figure 2 Qik Start PIC education board /w CANThe microcontroller (PIC kit) is introduced in this project an alternative solution to a

sequential circuit. The core of PIC kit is Microcontroller 16F874, 8-bit high performance

RICS CPU with plenty of powerful features. Shown below is block diagram of 16F874.

Figure 3 Block diagram of 16F874

Operation

USART unit in the diagram above can communicate with peripheral devices such as A/D

or D/A integrated circuits, modem (DCE) or terminals (DTE). The program running on

PIC configures the USART unit as full-duplex asynchronous system.

Port D is programmed to operate as output where control signals to activate the door lock

or alarms are generated.

8

Page 9: doc

In terms of functionality, the PIC-microcontroller plays the role of receiver and driver. As

a receiver, the program running in the PIC keeps polling and scanning the serial input of

USART until an entire 8-byte command is obtained from the host computer. After

processing the command, PIC continues to do the polling process.

As a driver, the PIC will compare 8-bit data received from host computer with sample

commands stored in PIC memory. If they are matched, an appropriate pin on Port D will

be driven High.

Card Reader

The Card Reader is part of the front end user interface in our design, so the challenge was

to get something rugged, reliable, compact and presentable, but at the same time

compatible with the Back-End design. We recommended the MSR200-33R Card Reader,

manufactured by Semicron Corporation. Some of the features this reader provides are

Decoded Magnetic Stripe Reader

Low power CMOS design

Keyboard emulation

Reads dual and triple track cards

Bi-directional read capability

Conforms to ISO 7811, ANSI x4.16 &

AAMVA (Driver Licenses) standards

May be mounted on a keyboard or   a flat surface.

Provides feedback by LED and buzz

Interfaces Available are PC XT/AT, PS/2, and RS232

For our design we needed a card reader which would have a RS232 port interface

because the wireless device had a RS232 interface. The card reader and the PIC

Microcontroller kit was bridged through a port splitter with one wireless device. This

allowed us to eliminate one wireless device.

Another feature which triggered us to choose this particular card reader was the fact that

it can read dual and triple track cards and Conforms to ISO 7811 and ANSI x4.16

9

Page 10: doc

standards. Since we are using the Husky One Card as an Access Interface card, these

features are very flexible in that respect.

Figure 4 MSR200-33R Card Reader

Electric Door Strike

The electric door strike is the electro-mechanical release mechanism that unlocks the

door when it receives a 12V signal. When no power is sent to the door strike it remains

locked. It is used in conjunction with a Schlage Lock as shown in the picture below. The

electric door strike is used in place of the strike that comes with the Schlage Lock. This

strike is reversible for left or right-handed doors. Once installed, the door can still be

operated using a key. To power the door strike we will use a 12-volt DC 500mA power

supply that can be bought with the door strike. When operating off the DC power supply

a gentle 'click' is heard when unlocked. We will also place a push button on the inside of

the room so that people can easily leave with out unlocking the Schalage Lock.

Figure 5 Smart home SA Type Door Strike

Schlage Lock

10

Page 11: doc

This Schlage Lock has a keyed exterior and it has a turn button on the interior that will

lock or unlock both levers. This Schlage Lock is used the same way as the locks on your

home. Therefore, in the case of power outages the door could still be unlocked using a

key. Schalage locks work for doors between (35 mm - 48 mm) thick. A schematic of a

Schalage Lock and how it put together is given below.

Figure 6 Schlage Lock

Wireless Units

Wireless connectivity is quickly becoming recognized as a flexible and reliable medium

for data communications across a broad range of applications. A wireless solution in our

system eliminates the need for cabling from the central PC to the access point.

Advantages:

Wireless interrogation speeds data collection.

Equipments (computer, card reader, etc.) can be moved without

regard to location of network.

Effective communication over distances of up to 500 feet indoors or several miles

line-of-sight.

High frequency 2.4GHz or 900MHz, employing frequency hopping spread spectrum

technology, providing resistance to interference and highly reliable data

communication.

Lowers cost, time and effort of installation.

Ideal for retrofits in buildings not wired for electronic access.

Proprietary protocol & FHSS for security & interference rejection.

2.4GHz, 900MHz and 868MHz for virtually worldwide suitability.

Isolated collocated networks.

11

Page 12: doc

Small enough to fit into virtually any enclosure.

Low power consumption.

Industry standard interfaces.

Seamless integration as direct cable replacement

For low data rate applications, such as remote keyboard or mag-stripe readers, the

transceivers are ideal. They transmit up to 500 feet indoors through walls or a couple of

miles line-of-sight. Key benefits for access control are long ranges achievable from

900MHz, and incredible cost efficiency for a radio with the protocol RS232.

Wireless ConnexLink

Physically, one transceiver is connected to a serial port (COM port) on the central

computer, while the other will link to the card reader and the PIC kit. The RS232

interface is a key protocol in communication. The interface program running on the

central computer will scan and detect the signal from card reader through transceivers.

Figure 7 ConnexLink Unit

12

Card Readerr

Central Computer

Transceiver1

Transceiver2

Block Diagram of transceiver arrangement in the wireless security

system

Page 13: doc

Texas Instruments TI-Tags

The TI-Tag system has just 2 major components. The first is the tags themselves. These

tags each contain a small amount of information that can catalog the device they are

attached to. The tags act as passive wireless transmitters, and when run through a field

produced by the receiver, they transmit the data that they store. The range, orientation of

transitions and amount of data stored vary depending on the model of the tag, but there

are a variety of different tags available. The second component is a receiver that

produces the read field. This system stick reader can have its range extended with

additional antennas placed around the original receiver. The default range of 1 meter

should work for our evaluation purposes. The key part of the receiver is the RS232

interface that allows it to hook into the rest of our system. Using this, we will be able to

track the devices and compare the data received with our database to take appropriate

action.

While dealing with the RFID device we had to face a lot of connectivity issues because

the device did not come with any development software. But we resolved these issues by

introducing our own java based serial communication interface which allowed us to

communicate with the microcontroller in the RFID device. Another problem we had to

13

Page 14: doc

face while dealing with the RFID device was the limited range for tag detection. Texas

instrument promised us a range of 1 meter with the standard antenna but after testing we

found out that the range was limited to only few inches. When we contacted the Texas

instrument engineering department they apologized for the inconvenience and could not

provide any reason for the limited range, they recommended another external antenna

which had a retail price of $400. Due to high cost of the antenna and poor technical

support we had lost faith in Texas instrument’s engineering department thus we decided

to build our own antenna. But due to time limitation we weren’t able to design a

impedance matched antenna which would allow better range. Thus at this time for

demonstration purposes we have mounted the RFID device to the door frame so that we

can at least have a range clearance of 2 to 3 inches.

________________________________________________________________________

Display

Figure 8 Display of security system

14

Page 15: doc

This display is made of wood for the customization options inherent in this material.

Before building this display a diagram was created to help with making decisions on

proper material for the job. The diagram above has the dimensions and pointers of the

various parts of the display. This display is made from a eight foot 2x4, eight foot 4x4,

18” wide door, door lock, two hinges, card swipe and equipment box with many

electronics inside including the wireless devices. The door was cut to the height of 48”.

The eight foot 4x4 was cut in half for the two sides of the frame. Then the 2x4 was cut

into two 25” peaces for the two tops of the frame. The remainder of the 2x4 was cut in

half for the two legs of the display for stability. The door knob whole was drilled out and

the hinges on the door and frame had to be indented with a motto tool so that they sat

flush. The door strike had to also be fit into the 4x4 so that it was almost flush. Ass easy

as it sounds working with wood is a lot harder than it seems especially getting things such

as the strike and hinges flush.

________________________________________________________________________

Power Management

Power management circuitry was designed to fulfill the needs of various devices involved

Device Voltage Specification

RFID Device & PIC Kit 9VWireless Units 7.5VCard Reader & Relay Circuitry 5 VDoor Strike 12 V

15

Page 16: doc

I N1

O U T2

CO

M3

U 17805

I N1

O U T2

CO

M3

U 27809

I N1

O U T2

CO

M3

U 3 7809

1 2D 1

1N4007

1 2D 2

1N4007

9V

5V

7.5V

GND

12V unregulated

C 1

.01C 2

.01C 3

.01

Figure 9 Power management circuitry

Regulated Power Supply

The circuit simply applies widely used regulators such as 7805, 7809 providingRegulated 5V and 9V at their outputs.

Input: 12VDC unregulatedOutput: 9V - 7.5V – 5V regulated

Since wireless transceivers require DC power of 7.5 VDC, so at the output of regulator 7809, two diodes are introduced to drop 1.5V across these diodes (since each diode holds 0.75V). As result, we obtain 9v – 1.5v = 7.5v at output. ________________________________________________________________________

Driving Circuitry

In order to trigger the alarm and the door strike when the microcontroller signals

activation of each device, following relay based circuitry was designed.

Input

Signal from port D1 (or portD4) of microcontroller. This signal is applied to Base of

transistor-Q1 through resistor R2, 4.7K.

Output

Status Close/Open of contact of relay U1 ( or U2).

Load

16

Page 17: doc

Alarm (or Door Lock)

Operation

Simply, the control signal from microcontroller will drive relay U1 (or U2) through

transistor Q1(or Q2). Depending on this signal is at High or Low level, transistor Q1 (or

Q2) will be On/Off respectively. If transistor Q1 (Q2) is ON, contact of relay U1 (U2) is

CLOSE and alarm (lock) will be energized by 12V (unregulated). Otherwise, contact of

relay U1 (U2) is OPEN and alarm (lock) is not energized. State table shown in the figure

below:

l Signal from Microcontroller TransistorQ1 (Q2) Relay U1 (U2) Alarm(Lock) Low OFF OPEN OFF High ON CLOSE ON

CO

MAB

NC

NO

U5

Relay

CO

MAB

NC

NO

U4

Relay

Q1 Q2R 1

4.7k

R 2

4.7K

R 3

47kR 4

47K

1 2D 3

1 N 4 5 0 0

1 2D 4

1 N 4 5 0 0

From PIC kit / PortD1

From PIC kit / PortD4

ALARMDOOR LOCK

5V

12V (unregulated)

Figure 10 Driving Circuit________________________________________________________________________

Control Software

The control software acts as a server for the hardware located near the entrance way to

communicate with. It is designed to interpret responses from the door modules and take

appropriate action. There are three main functions that the control software performs.

These are keeping track of who/what has access, administering access, and controlling

the RFid module.

17

Page 18: doc

The Graphical User Interface or GUI of the program is used to keep track of what is

allowed access to the room. The program can enter two modes, one to track personnel

and one to track devices. In each mode the program performs the same steps, but with

different prompts. To change the program between the two modes, there are two buttons

located in the left panel of the GUI labeled “Personnel” and “Equipment”. Clicking one

of these two buttons will update the display in the right panel of the GUI accordingly.

The right panel displays one page (10 entries) of items designated from the current mode.

If you are in personnel mode the display fields are First Name, Last Name, and Social

Security Number. In Equipment mode the display fields are PartID, and Description.

Along with these fields to identify the entries is a drop down menu used to designate

access to the entry. Selecting “Access” or “No Access” will immediately update the data

structure accordingly. The third option from the dropdown menu is Delete, and this will

remove the item immediately also, without prompt. There is a delete button located in

the left panel of the GUI, but clicking it will only give you a reminder to “please use the

dropdown menu”. In addition to being able to delete entries, you can add an entry by

clicking the Add button in the left panel. Depending on the mode you are in (Equipment

or Personnel) this will show an appropriate window for entry of information about the

new item. The remaining two buttons in the left panel of the GUI are the Previous and

Next Page buttons. Clicking one of these buttons will scroll through the data in the right

panel of the GUI in the corresponding direction to allow the user to view more than 10

entries. Figure X. shows a screenshot of the GUI with a dropdown menu being selected.

18

Page 19: doc

Figure 11 Screenshot of the GUI

One of the functions of the software that is not visible to the user is interpreting the

signals sent from the card swipe unit. When a user swipes a card a signal is transmitted

wirelessly and picked up by a server running the control software. This command

sequence is interpreted by the software as a Social Security Number. The SSN is then

checked against the internal database to see if that user has access to the room or not. If

the user does not have access, the system does nothing and the user will not be able to

open the door. If the user does have access to the room the program will transmit a

special command sequence to be interpreted by the microcontroller on the other side and

subsequently unlock the door.

Figure 12 Software external structure

19

Page 20: doc

The only continuous function of the Control Software is the control of the RFid unit. The

unit requires a command signal before it will poll the field for tags. This signal is

continuously sent from the control software across the wireless device to the unit at a rate

of 4 timer per second. If a tag is found in the read zone the RFid sends back a response,

or if no tag is found it sends back an “empty” response. In each case the response is

interpreted as an RFid response and converted to a partID. If this particular partID is

found in the database and the part does NOT have access, a signal is send to the

microcontroller to trigger an alarm. This unauthorized access is also logged in a logfile

stored on the server.

_______________________________________________________________________

Current System FunctionalityThe user swipes his card in the card swipe. The card swipe then outputs the card data to

the wireless unit for transmission to the other wireless unit. The other wireless unit is

located far away in the administrator’s office. This Wireless unit is connected to a

computer that has a Java program on it. This program is connected to the database and

searches the database for the card data. If the card data is in the data base then a signal is

sent back to the microcontroller telling it to unlock the door. Data is not in the database

then nothing happens and the door remains locked. The door always remains locked

from the outside while the inside of the door is always unlocked. If the power is to fail

then an administrator has a key to let people in the room. Once the key is removed from

the lock the door will be locked again.

The RFID system is used to keep track of the flow of equipment leaving and entering the

room. The RFID system is activated by being told to search for RFID tags. Once a tag

passed through the read range of the RFID system it then sends the information on the tag

wirelessly to the Java program. This program then decides if the tag data is in this

database and weather is allowed to leave. If the Item is allowed to leave then it can be

passed with no interference. On the other hand if item is not granted access to leave the

room then an alarm will sound and the tag data will be logged.

20

Page 21: doc

The Java Program is the brains to this whole system and without it this system would not

work. This program allows the administrator to add or remove persons to the database

making it possible for them to enter the room. Also the administrator can add and

remove devices from another data base. Although this may not sound like much to some

people creating the GUI interface and functionality of this program is very complicated

and Jon should be commended for implementing it.

________________________________________________________________

Possible Future ModificationsFirst and the most important future modification would be the use of an antenna that is

matched to the impedance of our RFID system. This is an expensive but very important

part our tracking needs. Because we don’t know the input impedance of our RFID

system it would be almost useless to try to build one not knowing this information. That

is why it would be best to buy the antenna that is matched for this RFID system. Next

and not as important a part of any future modifications could be the use of cameras. We

could add a few video cameras to the inside of the room and store the video on a hard

drive for use if something is stolen. They make cameras that are even wireless so we

could store them in a different room. Also a digital camera could be added to the door to

take a picture of a person each time they swipe there card in the door. This could also be

stored on a hard drive and sent wirelessly to a secure position. With all of this wireless

date being sent around it would be smart to use some kind of encryption technique. This

would be so that people are not able to hack into our wireless data network causing our

security system to fail.

We set our RFID system to not allow people from taking certain equipment. Well what if

one of our Administrators should have access to a device but no one else should. The

answer is a special RFID override tag given to the administrator. This tag when run

through the RFID read range with the device will allow the administrator the freedom to

come and go as he pleases with the device while keeping the device secure from others.

In the setting of this last idea we will talk about or final possibility being the use of RFID

21

Page 22: doc

tags to enter the room. This could make everything a whole lot easer if done the right

way. The only thing about this is it should not be done until everyone on campus uses a

RFID card for their student activities.

_______________________________________________________________________

Timeline

1st Quarter 2nd Quarter 3rd QuarterFeb Mar Apr May Jun Jul Aug Sep Oct Nov Dec

1 Brainstorming2 Project

Specification3 Weekly report4 Research5 Web Updates6 Project

Statement7 Parts Listing8 Ordering

Components9 Modifications10 Proposal11 Proposal

Presentation12 Building &

Testing Parts13 Wireless

Testing 14 RFID Device

Testing15 Control

Circuitry16 Software

Development17 Basic Testing18 Preliminary

Assembly19 Debugging

Prototype20 Preliminary

Demo21 Finished

Prototype22 Final report

22

Page 23: doc

________________________________________________________________________

Parts ListItem # Symbol Name Description

1 C1 0.01u  2 C2 0.01u Multilayer ceramic capacitor3 C3 0.01u  4 D1 1N4007  5 D2 1N4007  6 D3 1N4007 General purpose diode 7 D4 1N4007  8 Q1 2N2222  9 Q2 2N2222 General purpose amplifier NPN

10 R1 4.7K 1/8W  11 R2 4.7K 1/8W  12 R3 47K 1/8W Metal film resistor 13 R4 47K 1/8W  14 U1 LM7805 Regulator 5V15 U2 LM7809 Regulator 9V16 U3 LM7809  17 U4 Relay Relay: Coil: 5VDC - Contact: 5A/24Vdc 18 U5 Relay  19   Alarm Working voltage: 6Vdc -- 48 Vdc20   Electronic lock Working voltage: 12 Vdc21   Card Reader MSR200-33R

22   PIC Kit PIC 16F874 Microcontroller23   RFID Device TI RFID S4100 series24   Wireless Device Connexlink CL449025   Door Strike Smart home 5190S26   Door Lock SCHLAGE Lock Al series

________________________________________________________________________

BudgetHardware  Card Reader $ 160PIC Kit $ 175Wireless Units $ 250Door Lock $ 100Door Lock – Electrical Interface $ 50RF Surveillance Kit from TI $ 650 Product Display Interface & Connectors $ 75Total $1,460 ______________________________________________________________________

23

Page 24: doc

Team Members Participation

Syed A. Ali (EE)- Project Management- Design Circuitry & Connectivity- Card Reader & Wireless Support - Documentation & Presentation

Chuong Nguyen (CMPE)- Microcontroller Programming- Alternate Software Development - Card Reader & Wireless Support - System testing & troubleshooting

Jonathan Vanase (CMPE)- Chief Software Development & Testing- RFID Research & Support- Serial Communication- Web Updates & Project Progress Reports

George Kutsaftis (CMPE)- Front-End Demonstration Display- Comparative Analysis- RFID Antenna design

Zachary J. Maura (EE)- Front-End Demonstration Display- Future Modification Analysis- Product Ordering

______________________________________________________________________

Conclusion

In conclusion, we were very successful at finding devices that will fit the needs of this

project. In addition, we were able to provide sufficient evidence that our project is of

valid consideration. The cost involved in our project makes it much more affordable than

comparable products, but ours also allows for the exact type of security that we wish to

provide. By staying well within budget on our parts estimations, and selecting many

devices that use universal communications standards, we have successfully completed

out project.

24

Page 25: doc

______________________________________________________________________

Index

PIC Microcontroller Code

;********************************************************** ; SENIOR DESIGN PROGRAM: Do polling command from host ;computer and generating control signal to activate Alarm ;or Door Lock ;**********************************************************

list P=PIC16F874, F=INHX8M, C=160, N=77, ST=OFF, MM=OFF, R=DEC, X=OFF

#include P16F874.inc__config(_CP_OFF & _PWRTE_ON & _XT_OSC & _WDT_OFF & _BODEN_OFF)

errorlevel -302

;************** Equates *****************************

Bank0RAM equ H'20' ;Start of Bank 0 RAM areaBank1RAM equ H'A0' ;Start of Bank 1 RAM area

;************** Variables ***************************

cblock Bank0RAM

TEMP1 ;Temporary variable for Character subroutine

TEMP_DISP ;temp store for displayCounterLCD_TEMP ;keep track of LCD vectorRXBufMatchlengthTempWTempFSRTempTempBuffer:8Buffer2:8

TEMPSTG:8 endc

25

Page 26: doc

MOVLF macro literal,destmovlw literalmovwf destendm

MOVFF macro source,destmovf source,Wmovwf destendm

BANK0 macrobcf STATUS,5 ; Select bank 0endm

BANK1 macrobsf STATUS,5 ; Select bank 1endm

;******************** Program Code ***********************

org H'000' ;Reset vectorcall Initial ;Initialize everythinggoto Receiving

;****************** Initial subroutine *******************; This subroutine performs all initializations of variables and registers.;*********************************************************

Initial

BANK1 ;Set register access to bank 1bsf PIE2,CCP2IE ;set CCP2 interruptMOVLF B'00000100',ADCON1 ;Select PORTA pins for

ADC or digital I/OMOVLF B'00001011',TRISA ;Set I/O for PORTAMOVLF B'11100001',TRISB ;Set I/O for PORTB; 1-

4=out; MOVLF B'10xxxxxx',TRISC; set c7 to input,c6 to output

MOVLF B'10010111',TRISC ;Set I/O for PORTC-bit 1 makes CCP2 an input

MOVLF B'00000100',TRISE ;Set I/O for PORTEMOVLF 95,PR2 ;Set up Timer2 for a Delay

of 10 msMOVLF B'01000100',OPTION_REG ; Initialize option

register for 32:1 ;prescale

26

Page 27: doc

MOVLF B'10100100',TXSTA ;set txsta int BRG,8 bit,asynch,hi spd

MOVLF 47,SPBRG ; set baud rate w/7.37 MHz Xtal

MOVLF B'10000000',TRISC; set c7 to input,c6 to output

BANK0 ;Set register access back to bank 0

bcf RCSTA,SPENbcf RCSTA,CREN

clrf TMR0 ;initialize timer 0clrf TMR1L ;initialize to zero low and high bytes

of timer 1clrf TMR1H ;clrf T1CON ;to turn on set bit 0 to 1 (TMR1ON bit)bsf T1CON,TMR1ON ;start timer1

MOVLF B'01011111',T2CON;Finish set up of Tmr2, pre=16,post=12

MOVLF H'01',Buffer ;beginning of 1st reference command

MOVLF H'03',Buffer+1 MOVLF H'05',Buffer+2

MOVLF H'07',Buffer+3MOVLF H'09',Buffer+4 MOVLF H'0B',Buffer+5 MOVLF H'0D',Buffer+6 MOVLF H'0F',Buffer+7

MOVLF H'00',Buffer2 ;beginning of 2nd reference command

MOVLF H'02',Buffer2+1 MOVLF H'04',Buffer2+2

MOVLF H'06',Buffer2+3MOVLF H'08',Buffer2+4 MOVLF H'0A',Buffer2+5 MOVLF H'0C',Buffer2+6 MOVLF H'0E',Buffer2+7

clrf CCPR2L ;init CCPR2 registersclrf CCPR2Hclrf PORTD ;Turn off LEDsclrf PORTBclrf PORTE

27

Page 28: doc

clrf INTCON ;initialize interrupt control register

bsf PIE1,RCIE ; ENABLE INTERRUPT RCIEbsf INDF,RCIE ; enable receiver irqbsf INTCON,T0IE ;enable timer 0 [bit5]bsf INTCON,PEIE ;enable peripheral interrupts for

capturebsf INTCON,GIE ;global interrupt enable

[bit7]return

;*********************** CompareSubroutine ***************; This subroutine compares receiving command and reference command.; if they match --> set 1 to Match, otherwise set 0.;*****************************************************************************Compare

clrf Match ; initialize Match = 0LoopCompare xorwf INDF,w

btfss STATUS,Zgoto Compare_Doneincf FSR ; next byte in reference

keyMOVFF FSR,TempFSR ;save FSR to TempFSRincf TempTemp ; next byte in input-

bufferMOVFF TempTemp,FSR ; point at that byte in input-

bufferMOVFF INDF,TempW ; read that byte into WMOVFF TempFSR,FSR movf TempW,wdecfsz lengthgoto LoopCompare ; compare

rest of command MOVLF 1, Match ; return 1 if match successful return Compare_Done clrf Match return

28

Page 29: doc

;*********************** Receiving subroutine ************; This subroutine compares receiving command and reference command.; if they match --> activate ALARM or Lock Door appropriately.;***************************************************************Receiving MOVLF 8,length ; length of command

clrf TRISD ; all LEDs are off

MOVLFTEMPSTG,TempTemp MOVLFBuffer,TempFSR ; save start address of Buffer MOVLFBuffer,FSR ; load address of Buffer

into pointer FSR movfw TEMPSTG

Call Compare btfsc Match,0

goto Alarm ; if match --> activate Alarm Call Compare ; else check for DoorLock btfsc Match,0 goto LockDoor goto Activate_Done Alarm MOVLF H'F0',TRISD ; set signal High to activate Alarm MOVLF 200,Counter ; to ON state long enoughLoop1 call Delay decfsz Counter goto Loop1

MOVLF 0,TRISD ; reset signal Low to deactivate Alarm goto Activate_Done ; polling again LockDoor MOVLF H'0F',TRISD

MOVLF 200,CounterLoop2

call Delay decfsz Countergoto Loop2

Activate_Done

29

Page 30: doc

MOVLF 0,TRISDbsf RCSTA,SPEN ;enable serial portbsf RCSTA,CRENmovlw TEMPSTGcall RXgoto Receiving

;********************** Receiving Subroutine *******; This subroutine is called to check if any data is available in input buffer. It uses indirect addressing to ; avoid problems on interrupt with banks.;**********************************************************

RX movwf FSR ;Save pointer MOVLF 8,CounterRX_ready

btfss PIR1, RCIF ; check for received bytegoto RX_ready ; Rcv_Done

movfw RCREG ; get char from RCREG and store in rx buffer

movwf INDF ; RXBufincf FSR,1

bcf PIR1, RCIF ; Reset rcv flagbcf RCSTA, CREN ; clear then set CREN tobsf RCSTA, CREN ;clear all errors.

decfsz Counter goto RX_ready

bcf RCSTA, CREN bcf RCSTA,SPEN ; disable serial port return

;********************** Delay subroutine ******************; This subroutine waits for Timer2 to complete its ten millisecond count sequence.;; Creates a 10 ms loop time using timer 2 ;for 7.37 MHz clock need 18425 counts = 96*12*16;**************************************************************************

30

Page 31: doc

Delay btfss PIR1,TMR2IF ;Check whether ten

milliseconds are upgoto Delay bcf PIR1,TMR2IF ;Clear flagmovlw b'00100000'xorwf PORTA,Freturn

end

Java Class Descriptions

commPort.java – This class initializes the communications port to ready it for use in the program.

It has the values needed for proper communication with our other hardware hard coded. It also contains the code for timing the RFid polling operations.

addPerson.java – This class initializes the window that allows you to add a Person to the database.

It also handles the action of inserting the entered data into the database.

addPart.java – This class initializes the window that allows you to add a Part to the database. It

also handles the action of inserting the entered data into the database.

31

Page 32: doc

SerialConnection.java – This class was modified by one provided from the Sun website. The modified

version handles the incoming serial data coming onto the port and sends an appropriate response based upon the received information. It also contains the method that sends the command for the RFid device to poll its read field.

PersonsDB.java – This class initializes and handles access to the database that contains personnel

information.

Persons.java – This class contains access to the 4 fields that describe an item of a personnel

database.

PartsDB.java – This class initializes and handles access to the database that contains items.

Parts.javaThis class contains access to the 3 fields that describe an item of the parts

database.

Interface.java – This class draws the main window for the program. It handles all button clicks

associated with the main window and links with all the other classes to perform the desired function.

commPort.java methods commPortType – ConstructorFunction – initializes the comport and the timer to control the RFid polling.

addPerson.java methods addPersonType – ConstructorFunction – Used to instantiate the class so that it can be called to draw the

window. show_addPersonType – voidFunction – Brings the addPerson window back to the foreground.

32

Page 33: doc

initialize_addPersonType – voidFunction – Adds the items to the window to add personnel.

addPart.java methods addPartType – ConstructorFunction – Used to instantiate the class so that it can be called to draw the

window. show_addPartType – voidFunction – Brings the addPart window back to the foreground.

initialize_addPartType – voidFunction – Adds the items to the window to add equipment.

serialConnection.java methodsThis class is provided by java.sun.com. The source was modified to

include the parameters we needed into the constructor along with the event listener performing additional actions for our program.

PersonsDB.java methods PersonsDB Type – ConstructorFunction – Used to instantiate the personnel database.

insertNewPersonType – voidFunction – Adds a new entry into the personnel database.

deletePersonType – booleanFunction – Deletes an entry from the personnel database if there is a match found using parameter SSN. If a match is found returns true, otherwise returns false.

updatePersonAccessType – booleanFunction – Modifies the Access field of an entry in the database with the Access_ parameter if a match is found using the SSN parameter. If a match is found returns true, otherwise returns false.

findPersonType – Persons

33

Page 34: doc

Function – Searches for a personnel entry based upon the SSN field. If a match is found the returned value is the matching Persons profile.

findFirstPersonType – PersonsFunction – Returns the first entry in the database. This also sets an internal counter back to 0. This is used in conjunction with findNextPerson to scroll through entries in the database.

findNextPersonType – PersonsFunction – Returns the next entry in the database based upon the index that is started in findFirstPerson.

sortPersonsType – voidFunction – Sorts the database alphabetically by last name.

getNumberOfPersonsType – intFunction – returns the total number of personnel currently in the database.

initializeDataBaseType – voidFunction – Writes all the values from a stored file into the programs internal database.

writeToDatabaseType – voidFunction – Writes all the values from the programs database into a file.

PartsDB.java methods PartsDB Type – ConstructorFunction – Used to instantiate the equipment database.

insertNewPartType – voidFunction – Adds a new entry into the equipment database.

deletePartType – booleanFunction – Deletes an entry from the equipment database if there is a match found using parameter PartID. If a match is found returns true, otherwise returns false.

34

Page 35: doc

updatePartAccessType – booleanFunction – Modifies the Access field of an entry in the database with the Access_ parameter if a match is found using the PartID parameter. If a match is found returns true, otherwise returns false.

findPartType – PartsFunction – Searches for an equipment entry based upon the PartID field. If a match is found the returned value is the matching Persons profile.

findFirstPartType – PartsFunction – Returns the first entry in the database. This also sets an internal counter back to 0. This is used in conjunction with findNextPart to scroll through entries in the database.

findNextPartType – PartsFunction – Returns the next entry in the database based upon the index that is started in findFirstPart.

sortPartsType – voidFunction – Sorts the database alphabetically by PartID.

getNumberOfPartsType – intFunction – returns the total number of equipment currently in the database.

initializeDataBaseType – voidFunction – Writes all the values from a stored file into the programs internal database.

writeToDatabaseType – voidFunction – Writes all the values from the programs database into a file.

Persons.java methods PersonsType – constructorFunction – Allocated a Persons type object.

getLastName

35

Page 36: doc

Type – StringFunction – Returns the lastName field of the calling object.

getFirstNameType – StringFunction – Returns the firstName field of the calling object.

getSSNType – StringFunction – Returns the SSN field of the calling object.

getAccessType – booleanFunction – Returns true is the calling object’s Access field is true, otherwise false.

updateLastName Type – voidFunction – Sets the lastName field of the calling object.

updateFirstName Type – voidFunction – Sets the firstName field of the calling object.

updateSSNType – voidFunction – Sets the SSN field of the calling object.

updateAccessType – voidFunction – Sets the Access field of the calling object.

Parts.java methods PartsType – constructorFunction – Allocated a Parts type object.

getPartIDType – StringFunction – Returns the PartID field of the calling object.

getDescriptionType – StringFunction – Returns the Description field of the calling object.

getAccessType – boolean

36

Page 37: doc

Function – Returns true is the calling object’s Access field is true, otherwise false.

updatePartIDType – voidFunction – Sets the PartID field of the calling object.

Update DescriptionType – voidFunction – Sets the Description field of the calling object.

updateAccessType – voidFunction – Sets the Access field of the calling object.

Interface.java methods createAndShowGUIType – voidFunction – Initializes a new interface type and calls it to be displayed

showInterfaceType – voidFunction – Adds all the GUI objects to the main window and displays it. Also initializes the serial communications classes.

updateDisplayType – voidFunction – Updates the display pane of the main display window with the current information. This should be called anytime a change is made to the data structure to ensure that it is properly displayed.

37