Development of A Microcontroller Control
Development of A Microcontroller Control
The control action is actually performed by the Microcontroller PIC16F84A: The system is
microcontroller. It processes the signals designed around PIC16f84A microcontroller. The
(requests) that are inputted from the card reader PIC16f84A is used because it is readily available
upon the insertion of the valid smart card at the and is relatively simple to understand. The PIC
entrance. The output section of the implements the software based control and
microcontroller is connected via relays for the commands the electromechanical interface circuit
desired operational actions. The stages involved to open and/or close the door. The PORT (RB6,
in this design are shown in the Figure 1. RB7) of the PIC was designed to send the output
control signals to the door circuit through the relay
The Card Reader: A card is a small piece of switch of the electromechanical interface circuit
plastic that holds information in a magnetic strip and the PORT A (RA0 and RA1) is configured as
or microprocessor used in activities such as analog input to receive voltage values that specify
getting cash from the Automated Teller Machines the state of denial and acceptance of entrance
(ATM) or making phone calls (i.e. SIM) or opening parameter form the card reader. These parameter
and closing of a microcontrolled based door. controls produces voltage which is reduced to a
Based on highly optimised construction, the card maximum of 5V s.
readers are very compact with a discreet and cost
Electromechanical
RB6 Interface
PIC16f84A
The Card Reader RB7
RA 0
RA1
Door System
For example, if the card reader accepts valid card circuit is triggered or not (1 = YES, 0 = NO) [7,
upon the decoding from the PIC, 5V is produced 11].
and 0V for an invalid card. The voltage is read
through the PORT A of the PIC as analog input Electromechanical Door Interface Circuit: In
and is interpreted to mean high or low depending the model, a simple 12v DC motor and Rack and
on the input. PORT A status is read, the status (1 Pinion motion transmission systems were used to
or 0) determine if the electromechanical interface provide translatory motion for the door to open
and close upon the command of the
THE SYSTEM CONTROL PROGRAM When a valid card is inserted into the card slot
(the reader), the LED light changes from its
The system control program can be accomplished yellow colour to the red colour. The red colour
using program written in either low level or high signifies the busy state of the door.The card
level language such as C, Java, mikrobasic. A reader only functions when the LED is in the
compiler for a high level language helps to reduce ready state. The PIC16F84A decodes the name
production time. Although inline assembly is on the card and compares it with specific name
possible, the programming was done in the on its memory.The privilege user gain entrance to
Mikrobasic language. The source code has been a restricted application area by triggering the
commented to facilitate any occasional future interface circuit.
improvement and maintenance. The code written
followed all the three steps of microcontroller The interface circuit thererefore triggers the direct
program development that is, Compilation, motor driven electromechanical door to slide
Burning and Evaluation before it was transformed from the left to the right, opening the door for five
to the microcontroller through the programmer.A seconds. The door however closes after some
fraction code fragment for the system is given few seconds. The number of seconds it takes the
below : door to slide back is a function of how the
microcontroller is programmed.The timing can be
Program Autodoor changed if need be by modification of the
Dim i as byte program code in the microcontroller. This is the
Main: competitive advantage of designing this proposed
TRISB = 0 door access control system around PIC16f84A
TRISA = 0 microcontroller unit.
PORTA =0
PORTB = 0 However, an intruder is denied an entry upon the
Eloop: insertion of an invalid card.The overall system
PortB.2 = 1 on green light(ready) design and system operation diagram are shown
Delay_ms(1000) in Figure 5 below.
portB.2 = 0
RB 7
RA 0
5 Access
2
RB 6 Interface Circuit
Granted
4
RA 1
Smart Card 6
Privilege User
Decoding section Software OR Application Section Electromechanical Section
The Card reader accepts valid The PIC compares the the The Interface circuit responds to
smart card from a privilege user information on the card with the the control signal from PIC to
coded instruction in the memory allow or deny entry.