Access control is the method to permit or deny the use of particular resource by an entity. The resources can be Offices, parking lots, etc. Most common use is in offices, where access has to be permitted for employees and attendance log has to be maintained. For simulation, card reader circuit is replaced by a pattern generator with preloaded employee codes. To simulate this circuit, initially activate Mixed Mode simulator from the Schematic Editor window. Simulation can be performed by selecting Transient analysis from Simulation menu.
The circuit includes two M68HC11A8 microcontrollers, two Two-Line LCD modules (Display and controller) and two pattern generators.
pattern generatorhas preloaded employee codes to simulate card insertion. Each click on set pattern button is considered as one card entry. Depending on the code, access is denied or granted. In either case, status along with employee code is displayed on the LCD screen.
The master controller has functions such as read the card, control access of the card holder, display status and employee code, and send employee information to the second controller.
The slave controller has functionality to receive and store employee information sent from first controller in a data base, read cards, compare card code with database, control access of card holder. Master controller is considered to be placed outside the door and second one inside.
The system considers a person who has entered can only exit. So entry must be marked in the master controller prior to marking exit in the slave controller. Exiting without entering will show status invalid. Communication between the controllers is through SPI interface module of M68HC11 controller.
HD44780U is an LCD controller, which converts ASCII codes to corresponding segment display information. Cursor movement, cursor blink, display on, display off, scrolling display etc. can be done by passing instructions to HD44780U.
The source code written either in C or Assembly language can be viewed from the
code editor window.
The Algorithm is as shown:
Step2: Initialize SPI as master
Step3: Initialize LCD
Step4: Display “Insert Card” message
Step5: Check for input in PORT C
Step6: Compare input code with database
Step7: Send through SPI if code matches
Step8: Display “Accepted”
Step9: Display “Denied” if code does not match
Step10: Go to step 4
Step2: Initialize SPI as slave
Step3: Initialize LCD
Step4: Display “Insert Card To Exit” message
Step5: Check for SPI data reception
Step6: Store data, display welcome message and number of people if
SPI data is received