Mahsa Shafiei
Career Episode NO.3
A project I was involved as
Electronic Design Engineer
(Designing and Assembling Smart Card Door Access
Control System with Time and Attendance Database)
1
Career Episode Three
Introduction
3.1. Increasing the security of facilities, property, data, and most importantly people in a
developing country like Iran could be a serious problem for creating the right
circumstances for a safe and secure environment to work, study and live. Access control
systems have made significant strides in the area of secure credentialing for people. I
have been working since July 2006 in Best Alarm Co. as Electronics Design Engineer in
project of Designing and Assembling Smart Card Door Access Control System with Time
and Attendance Database. It was continued for about 4 months. I have chosen this
project because it was very impressive on my experience in technical troubleshooting
and increasing my specialized knowledge of Microcontrollers.
Background
General nature of project
Contactless smart card technology is well-suited for access control applications. It
provides higher levels of security than traditional access control technologies and the
platform from which additional applications can be implemented on the same
credential. Best Alarm Co., which has a background of 15 years in the field of Safety &
Alarm, Automatic Fire Extinguishment Systems and CCTV in Iran, find it possible to
design and add an Access Control System with contactless smart cards to its production
list. Whether a company is implementing an IT security solution today, or is looking
downstream and planning for the future, it makes sense to put in a contactless smart
card access control system, because it creates a technology base that can support IT
security and physical access applications on the same credential. General nature of this
project was to achieve a system which has both features of Door Access Control and
Time & Attendance System together.
Project goals
3.2 Project general goals
Identifying people, using Contactless Smart Card Technology
Surveillance the traffic of people and sending proper command to door lock in
order to control the access authority to defined zones and areas in various
environments or buildings such as Home, Office, Factory, Bank or even Military
Environments
Register entrance and exit times of people in the central computer database
Calculate the working hours and any further human resources calculation
2
3.3 Specific goals of project to combine time & attendance with access control system
Smart Cards may carry applications from more than one area. Employee cards with
secured ID could be used to protect physical access to facilities in addition to registering
time table of their attendance in the specific zones or at work. The main aim in this
project was combining time & attendance -instead of manual clock cards- with physical
security access control system. Hence the system would be adaptable to just about any
application. At the first phase, identifying employees with the smart cards were as
agenda.
Nature of Engineering Project
3.4 Smart cards (chip or integrated circuit cards or ICCs) are plastic cards containing a
microcontroller. The embedded microcontroller transforms a credit card-sized piece of
plastic into a portable, tamper-resistant computer with a calculating power of the
original IBM PC. Although most smart cards still use 8-bit microcontrollers, 32-bit
systems already line up for next generation cards. The same happens with the available
on-card memory, which quickly becomes larger. Smart cards are either contact or
contactless. Most smart cards are "contact" cards, distinguished by a visible set of
golden electrical contact pads. "Contactless" smart cards contain a RF antenna rather
than the golden contact pads of regular smart cards. Contact cards require a card
reader; contactless cards use RF signals to operate. Both types can be printed with the
issuer's artwork and information. Contactless smart card memory capacity ranges from
64 to 64k Bytes while contact card memory ranges from eight to 256 Bytes (2k bit).
3.5 When a cardholder presents their credential badge at the reader, the reader’s RF signal
excites the embedded microcontroller-causing it to transmit its encoded serial number
to the reader. Then, the reader sends the unique BID (badge ID) serial number to the
connecting main board to grant or deny access.
3.6 There were three main activity definition, working paralleled on this project:
Microcontroller Programming
Computer Software Programming
Hardware Design & Assemble
3
In this project, team co-operation play an important role as all team members are
attached to each other in a network of activity relationship and stopping work of each of
them causes stopping of all work. For more clearance note to the following activity
network diagram:
Microcontroller
Programming
Systematic PCB Design & Communicate
Module Design Assembling Modules
Software
Programming
3.7 Different steps of work are as follows:
Preliminary Design and Preparing Requirements
Research and study
Defining the project
Systematic Module Design
Identifying the requirement and list of materials (LOM)
Providing equipments and electronic parts from reputable suppliers
System Design Process
Identify the signals generated by the card reader modules
Coding and simulating the AVR Microcontroller Program with AVR compilers
Drawing the Main Microcontroller Circuit Board Schematic
Simulating the designed Schematic with PROTEUS for troubleshooting
Drawing the PCB of Main Board and Power Supply Board with Protel DXP
Printing and preparing the primary test PCBs
Assembling The Electronic Parts of Test Boards
Programming the Application Software with Visual Basic to make Time &
Attendance data base and staff information in MS Office Excel file format
Linking up and Finalize
Communicate the Main Microcontroller Module, Card Readers, PC and the
mechanical door lock
Testing the whole system in different conditions and under predefined
circumstances
Finalize and assembling the whole system in its housing
4
All team members have special responsibilities in different times, and I have had
Designing as Electronics Digital Engineer and Microcontroller Programming, in different
times. My duties description will be in next section.
3.8 List of My Tasks as Digital Design Engineer
Primary research about RFID, all features, advantages and standards of MIFARE
smart cards and methods of applying them in Access Control Systems
Planning the general structure of the system in a systematic module design
Preparing design description document and Identifying the requirement
specifications and list of materials
Attending technical meetings with other team members to clarify ambiguities,
sharing information and determining if the design meets all requirements
Coding, simulating, and testing AVR Microcontroller Program
Main Control Board Schematic and PCB plotting process
Control and get relevant testing results via different design and executive teams
3.9Best Alarm Organization Chart
5
Personal Workplace Activity
3.10 Describing some of my activities as Digital Design Engineer
3.10.1 Primary Research: I have to kick off a primary research to learn more about
contactless and proximity smart cards and identify the differences and advantages. It
was necessary to collect information for making decide which type of smart card is
more suitable for our project. In this step, I created extended collections of
information that can be used for years in different situations.
3.10.2 Systematic Module Design: I should prepare a general systematic module
design based on the results of primary research and the main goals of the system. I
proceed to prepare designs after analyzing the general specifications that are
demanded from the desired system. I divided the system into four main modules
which includes: Card Reader Module (antenna) and Main Control Board (packaged
into a single fitted housing), Computer Software and Data-Base System and
Electromechanical Door Lock. In our development system, a proximity door sensor is
added, in order to immediate notification if the door is breached or opened illegally.
3.10.3 Market research and preparing LOM and design documents: Before starting
construction process, and after preparing the modular design of the whole system, I
prepared a precise document of system requirement specifications, design process
and also list of materials (LOM) with consideration of their accessibility in Iran
marketplace -based on my market research. I have to attend several meetings to
discuss with design team. Preparing the final LOM and design documents, I
submitted them to director manager.
3.10.4 Coding AVR Microcontroller Program: In this stage I should program the
Microcontroller. It is the most important step and the most sophisticated one. I used
an AVR ATMEGA16 microcontroller to perform the system control. The ATMEGA16
has an internal AVR 8-bits processor with a 16-bit address space range. It has 16Kb of
program memory and 1Kb of RAM memory. The database was implemented inside
an EEPROM memory that holds 512 bytes. The ATMEGA16 includes a set of devices,
such as programmable timers, serial controllers, ADC converters and I/O interfaces
for external devices interaction.
The program should be compatible with the MIFARE smart card technology,
supervising monitoring and reporting of door contacts (open or close) and reader
communications.
The reader performs the reading by emitting a radio frequency signal that is
captured by the card antenna and energizes a small inside mounted IC. The card’s
unique serial number, retrieved from the EEPROM, is transmitted back to the reader.
The contactless smart card reader then sends the data through a serial interface. The
program which I was developed in the microcontroller reads the data from reader
and performs a lookup table search over a database implemented in an internal
EEPROM. If the data is found in the database, the system liberates the door locking
system through a general-purpose input/output port (For example in our primary
6
tests it switches on a triac connected on electromechanical door lock). Otherwise it
will make a sound buzzer on.
The diagram below is illustrating the serial communication between the Mifare Card
Reader and the AVR Microcontroller which I was programmed.
Figure1. The communication between Mifare Reader and the AVR Microcontroller
Microcontroller also passes data to the PC. MAX 232 will make it compatible with PC
through RS 232 serial port. RS 232 is the most widely used serial I/O interfacing
standard. The specification of this standard and my specific experiences about that
will be discussed in next session.
While the microcontroller is sending the data about the serial number of card which
is observed by the reader the VB software –which is programmed with the software
team-, makes the attendance record on the basis of time in the format of an MS-
Excel file-type.
The administrator card which is pre-programmed by its specific serial number in the
microcontroller is used to add new smart cards to microcontroller data base. We
called this operation "identification". Identification could be followed on a 16-
character x 2-line, dot matrix, liquid crystal display module and a matrix keyboard
implemented on the main board. The LCD used to show necessary messages and the
keyboard is to submit required commands.
Figure2. An overview of the system communication diagram
7
3.10.5 Simulating and Testing: At the same time I was coding the microcontroller
program in BASCOM AVR; I prepare a schematic in Proteus ISIS and simulate the
circuit board together with microcontroller program in Proteus VSM. The software
give a real-time show of my code interact with simulated hardware. So I benefit as
the hardware design may be changed just as easily as the software design and the
coding can begin as soon as the schematic is completed and there is no need to wait
until a physical prototype exists. It simulates the execution of machine code, just like
a real chip. If the program code writes to a port, the logic levels in circuit change
accordingly, and if the circuit changes the state of the processor's pins, this will be
seen by program code, just as in real life.
3.10.6 Main Control Board Schematic and PCB Design: As a digital design engineer,
I have to prepare PCB as well as embedded microcontroller program. I used Protel
DXP to draw the schematic of main board and then I transform it to a Printed Circuit
Board by use of PCB Board Wizard. I should consider all components, input and
output ports, ICs, Keyboard and LCD in my design and try to make it well set and
compact. It was my first time working with DXP and that was a good experience for
me. New features of Protel DXP make it easier for me in comparison with the last
version of Protel 99. Waiting for PCB fabrication, a prototype of main board is ready
and I test the programmed processor on it same as the simulated one.
3.11 My Special Experiences in the Project
3.11.1 As a special experience in my primary researches, I found out that the best
choice for this project is MIFARE Contactless Smart Card and Reader. MIFARE is a
technology, which is used for contactless smart card systems consisting of card and
reader components with a typical read/write distance of 10 cm (4 inch). MIFARE uses
a 32-bit data format that translates into a unique 12-digit credential identification
number. To compare opposites, contact smart cards never gained acceptance for use
in physical access control systems for the three main reasons.
First of all a contactless presentation of the card is much more user friendly and
convenient for physical access control. They are less intrusive, not require insertion
of a card into the reader, no issues with orientation of the card and may be kept in a
wallet or purse for personal security during use.
Secondly contactless smart cards and readers are much more durable in harsh, dirty,
or outdoor environments such as those typically found in access control applications.
Finally contactless card transactions are designed to be faster than contact
transactions. Additional benefits to using MIFARE contactless smart card technology
for physical access include:
Reduced maintenance costs for card readers (as compared to magnetic stripe
and contact readers)
More durable and reliable cards (no external parts that can wear out or be
contaminated)
And they Cannot be duplicated
8
3.11.2 My other special experience in this project is configuring USART registers in
ATmega16 AVR and transferring data between different modules, microcontroller
and computer.
Generally all serial communication protocols use two lines, one for data and other
for synchronization, while USART uses RS232 protocol which is designed to use only
data lines and no clock lines. In RS232 there are two data lines RX and TX. TX is the
wire in which data is sent out to other device. RX is the line in which other device
puts the data it needs to send to the device.
Figure3: Serial Communication in RS232
In RS232, a 1 is represented by -3 to -25 v. while a 0 bit is +3 to + 25 v, making -3 to
+3 undefined. For this reason, to connect RS232 to a microcontroller system I have
to use MAX232 voltage converter to convert the TTL logic levels to the RS232 voltage
level, and vice versa.
Figure4: Using a level converter to communicate between PC and MCU
One important concept involved in the RS232 protocol is the baud rate. I use serial
communication at standard speed of 9600 bps which is slow compared to the AVR
speed.
The advantage of USART is that I just need to write the data to one of the registers of
USART. Also the USART automatically senses the start of transmission of RX line and
then inputs the whole byte and when it has the byte it informs CPU to read that data
from one of its registers.
9
Figure6: How does MAX232 work?
3.11.3 One of my other interesting experiences as
3.11.4 When I was selected as an electronics design engineer for the project, I knew a
little about AVR microcontrollers and its advantages in comparison to the prior
generation of microcontrollers such as PICs. As I began the project I learned to program
this new edge of technology with basic compiler, Bascom AVR. It was very user friendly
and every instruction was so easy to implement. For example you can easily identify dot
matrix LCD and keyboards with just a line of codes in Bascom AVR.
The problem I faced to it as
For the first step,
Also we had to exert some changes in
This design was important, as we could meet customer's demand for rapid operations
My Co-operation With Other Team Members
3.12.1 In general, in Company accepting responsibility and team co-operation is very
important because the work is so convoluted that all of team members are attached to
each other like chain circles and there is no individual decision at the same time. The
team co-operation is very important; everyone should act his task well as an impressive
member, and should have responsibility feeling. Mean while company gives always this
opportunity to its members in order to help for project advance by using innovations,
10
because as I explained, I had to find innovative solutions for every obstacle in designing
process or in the test failures, and in order to reach this purpose, I have been always
supported by my coworkers and director of manager.
3.12.2 Company,
11
Summary
3.13.1 In my opinion, project was a unique project for Company, because caused the
company to receive many experiences in… Although this project was deviated
sometimes from its goals, by help of employees it returned to balance situation rapidly,
and always all teams tried to cover each other weaknesses points and not to allow
stopping work. This project was also very important for me, because it caused to
increase my experiences and to learn many points from my colleagues and team mates.
3.13.2 Since project was one of the biggest projects of Company, thus meeting its goals
was very important for company since starting. This project was performed in
In my opinion Company could perform project successfully.
3.13.3 My aim was the same aim of company and I always tried to make my duty and
responsibilities well and omit project holding points and preventing factors of work
advance as I can. Fortunately I could exploit from my knowledge in most times and omit
those obstacles. I could also learn many points from my colleagues in this project, who
are specialist in their work, and I trained these points and my other experiences to new
staffs, also I have always tried to take in to consideration the ethical and professional
principles and to include them in all my work aspects, and respect to the company rules.
Finally I learned in Company, I have to communicate with my team mates and other
teams and exchanges my ideas with them continuously in order to meet company goals.
12
Smart card access control has never been more essential, as evidenced by the estimated
20 million smart cards issued in North America in 2004. Between heightened security
concerns and new government security regulations, more businesses recognize the need
to implement, update or consolidate access control. Transitioning to smart cards—in
particular, contactless systems—makes sense, for several reasons:
• Smart card use is expected to grow 27 percent over the next three years
• Consolidated systems allow you to converge physical logistics and budgets
• Enterprise-wide smart card systems make access control easier for users and
administrators
• Contactless systems, with no moving or external parts, are more convenient, require
less maintenance and less time for read throughput, and can be used in harsh
environments
13