Home

RFID Door Lock

image

Contents

1. Figure 6 Created by Cytron Technologies Sdn Bhd All Rights Reserved 2 Cytron gt Figure 7 A relay Figure6 is a simple electromechanical switch made up of an electromagnet and a set of contacts Current flow through the coil of the relay creates a magnetic field which attracts a lever and changes the switch contacts The coil current can be ON or OFF so relay have two switch positions and they are double throw changeover switches Relays allow one circuit to switch a second circuit which can be completely separate from the first For example a low voltage battery circuit can use a relay to switch a 230V AC mains circuit There is no electrical connection inside the relay between the two circuits the link is magnetic and mechanical The coil of a relay passes a relatively large current typically 30mA for a 12V relay but it can be as much as 100mA for relays designed to operate from lower voltages Most ICs chips cannot provide this current and a transistor is usually used to amplify the small IC current to the larger value required for the relay coil Relays are usually Single Pole Double Throw SPDT or Double Pole Double Throw DPDT but they can have many more sets of switch contacts for example relays with 4 sets of changeover contacts are readily available Transistor Figure 8 The transistor used to amplify the current for the relay is an NPN transistor 2N2222A The pin sequence is as shown in Figure
2. 8 Beware that wrong sequence will burn the transistor ROBOT HEAD to TOE PR25 RFID Read and Display LED as output for PIC microcontroller Figure 9 One I O pin is designated for a LED as output of PIC microcontroller The connection for a LED to I O pin is shown in Figure9 The function of R2 is to protect the LED from over current that will burn the LED When the output is in logic 1 the LED will ON while when the output is in logic 0 the LED will OFF Magnetic lock Figure 10 A magnetic lock is a simple locking device that consists of an electromagnet and armature plate By attaching the electromagnet to the door frame and the armature plate to the door a current passing through the electromagnet attracts the armature plate holding the door shut Unlike an electric strike a magnetic lock has no interconnecting parts and is therefore not suitable for high security applications because it is possible to bypass the lock by disrupting the power supply Nevertheless the strength of today s magnetic locks compare well with conventional door locks and cost less than conventional light bulbs to operate HARDWARE This project will require following hardware 1 x PICI6F876A 1 x PR25 Printed Circuit Board PCB 1 x LCD 2x16 character 1x 12V relay 1 x RFID tag reader 1 x 9V 12V power supply Related electronic components mono ss Please refer to Appendix A for the board layout of PR25 The board layout is pr
3. Timing Pattern ROBOT HEAD to TOE PR25 RFID Read and Display Data 6 0 0000 0001 Data 7 0 0000 0001 Data 8 0 0000 0000 V Data 25 0 0000 00001 In the program we shift the current data and combine with previous saved data and repeat the loop until the last data Using the example above Data 0 will be saved in the variable convertl and then Data 1 is shift to left by one bit to combine with the Data 0 Variable convert is updated become 0 0000 0001 now and the loop keep going until last data for i 0 i lt 8 itt convert l convertl lt lt 1 datalitl Eor 1 0 1216 i convert convertz lt 1 datalit3 Jloop for shift prew Yfloop for ffshift prev ae Pyramid Series idl 1 convertl isave conve id Z 1 convert save conve Pulse Width Time 100 us Pulse Interval Time database F iset databe Table 2 Pulse Times As explained above the Data 1 and Data O signals in RFID reader are held at a logic high level until there is a RFID tag is placed near to the RFID reader When a RFID tag is scanned the RFID will receive the data stream from RIFD tag Standard 26 Bit Wiegand Format Leading Parity Bit Even Facillity Code 8 Bits P FFFFFFFF NNNNNNNNNNNNNNNN P Trailing Parity Bit Odd ID Number 13 Bits Figure 14 Since there is 26 bit of data in a RFID tag so once the RFID tag is scanned the data will receive one bit
4. but it can be found at Cytron website User manual is provided at website 10 Test the functionality of the PCB board 11 Have fun TEST METHOD 1 Switch ON the power e Power LED Green will turn ON Power LED Red is OFF Door lock is locked LCD will show RFID door security After a few second it will change to Place your ID on the reader 2 Place ID tag on RFID tag reader e LCD will display ID no xxxxxxxx user not found RFID card given is different e Power LED Red will turn ON e After a few second it will change again to Place your tag on the reader 3 Press SW1 e Enter to save mode e LCD will display User ID saved when you place your ID tag on the reader 4 Place the ID tag saved on the reader again e LCD will display ID identified e Power LED Red is OFF e Door lock on e After a few second it will change again to Place your tag on the reader 5 If all steps mention above can be executed your project is done successfully Congratulations WARRANTY No warranty will be provided as this is DIY project Thus user is advice to check the polarity of each electronic component before soldering it to board Created by Cytron Technologies Sdn Bhd All Rights Reserved ROBOT HEAD to TOE PR25 RFID Read and Display Appendix A PCB Layout S Created by Cytron Technologies Sdn Box PEPER HERVE ET ETS Bhd All Rights Reserved R
5. format Select read or write write DBO DB2 Table 1 26 bit Wiegand Format B B Data Transmission in Wiegand 26 Standard ED Figure 13 displays the timing pattern for data bits sent Input by the reader to the access control panel This timing LED Backlight pattern falls within the Wiegand guidelines as negative input proscribed by the SIA s Access Control Standard Protocol for the 26 Bit Wiegand Reader Interface a Pulse Width time between 20 uS and 100 uS and a Pulse Interval time between 200 uS and 20 mS Odd parity over bits 14 to 25 Ww ve nn AJU aJa Pin Wi ca oe Ei The Data 1 and Data 0 signals are held at a logic high level above the Voh level until the reader is ready to send a data stream The reader places data as Created by Cytron Technologies Sdn Bhd All Rights Reserved 4 Cytron gt asynchronous low going pulses below the Vol level on the Data 1 or Data 0 lines to transmit the data stream to the access control panel the saw teeth in Figure 13 The Data 1 and Data 0 pulses will not overlap or occur simultaneously Table 2 provides the minimum and maximum allowable pulse width times the duration of a pulse and pulse interval times the time between pulses for Pyramid Series Readers Daia 1 Signal i es ns Whale Ware Yoh a ee E ee I i i R R i a Tpw Data 0 Signal Green Wire yay 7 TT TT TR f i Figure13 Data Bit
6. of data start from data 0 to data 25 in the program Each data is saved in the RFID tag reader with only bit O else equal to 0 which is 0 0000 000X For an example if the tag ID is as below Bit 25 _____ gt 1 0110 1001 1000 0100 0110 1010 1 The illustration of data process will be like this Data 0 0 0000 0001 Data 1 0 0000 0000 Data 2 0 0000 0001 Data 3 0 0000 0000 Data 4 0 0000 0001 Data 5 0 0000 0000 iclear led Led CLE Figure 15 Note that data are store in two variable convertl and convert2 This is because Wiegand 26 bit is a special data format bits 2 to 9 and bits 10 to 25 are grouped in two and they are use for different purpose Facility Code and ID Number as shown in Table 1 above The special data format of Wiegand unable the two grouped data store in a variable so id number array use id1 and id2 to save the data from convert and convert2 Interface WIEGAND RFID tag reader with PIC16F876A For this project user has to connect the wire of RFID reader to a 2510 04 female connector There are 6 output wire of RFID reader only 4 are used in this project Be careful when plug in the 4 wires to the connector connect them according to the table shown below WEIGAND 2510 04 Figure 16 Created by Cytron Technologies Sdn Bhd All Rights Reserved 5 C yer on gt ROBOT HEAD to TOE Technologie PR25 RFID Read and Display SOFT
7. voltage at the input side of the LM7805 voltage regulator while the C3 and C4 is use to stabilize the voltage at the output side of the LM7805 voltage supply LED is a green LED to indicate the power status of the circuit R1 is resistor to protect LED from over current that will burn the LED ROBOT HEAD to TOE PR25 RFID Read and Display Push Button as microcontroller input for PIC CC 2 1N4148 R3 10K Reset W PB 2 4 pin ys Figure 4 One I O pin is needed for one push button as input of PIC microcontroller The connection of the push button to the I O pin is shown in Figure 3 The I O pin should be pull up to 5V using a resistor with value range 1K 10K and this configuration will result an active low input When the button is being pressed reading of I O pin will be in logic 0 while when the button is not pressed reading of that I O pin will be logic 1 ICSP for microcontroller programming PIC UICOOA IDC 5X2 Figure 5 MCLR RB6 and RB7 need to be connected to the USB In Circuit Programmer UICOOA to program the PIC microcontroller The programmer UICOOA is not included in DIY project set since it can be used several time for different project set User can also choose other type of PIC programmer to load the program For the instruction of using PIC programmer please refer to the particular PIC programmer user s manual at cytron website Relay Circud symbol for a relay
8. 22449 m Figure 26 The ID number circled in red is the number that will displayed if UART RFID reader is used not used in this case while ID number circled in blue is the number that will be displayed if Wiegand RFID reader is used RFID tag is not included in this DIY project set In sample source code provided we did not use UART for RFID Read and Display For more information on UART setting please refer to previous PR or refer to the PIC16F876A datasheet in microchip website at http www microchip com 8 Plug in power supply for the circuit User can choose to use battery or AD to DC adaptor AC to DC adaptor TELETRON L TMO 500 MODE NPUT AC 220 240 uTeut OC V J as en a ne i A 340 0 SIRIM sT en OILANG OLEH TELETRON INDUSTRIES SDN BHD te NO 1 BATU 19 JALAN SEGAMAT 0 TANGKAK A S Figure 23 Not included in DIY project set Connection to the PCB board Ai Figure 24 Created by Cytron Technologies Sdn Bhd All Rights Reserved 8 Cytron gt 9 Build the project and load the hex file into the PIC microcontroller using the USB In Circuit Programmer UICOOA When user build the project MPLAB IDE will generate hex file The hex file generated from MPLAB IDE will be named according to project name not C file name Cytron Technologies also provide hex file for user Do not forget to switch ON the power The programmer is not included in the hardware set
9. Cytron Technologie PRI 5 RFID Door Lock Version 1 0 October 2009 Cytron Technologies Sdn Bhd Information contained in this publication regarding device applications and the like is intended through suggestion only and may be superseded by updates It is your responsibility to ensure that your application meets with your specifications No representation or warranty is given and no liability is assumed by Cytron Technologies Incorporated with respect to the accuracy or use of such information or infringement of patents or other intellectual property rights arising from such use or otherwise Use of Cytron Technologies s products as critical components in life support systems is not authorized except with express written approval by Cytron Technologies No licenses are conveyed implicitly or otherwise under any intellectual property rights OVERVIEW FEATURES This document describes the development of Cytron PIC16F876A Technologies DIY Do It Yourself Project PR25 This _ _ amp _ bit microcontroller with 22 O project revises PR8 Read and Display and PR9 Operate with 5V supply Password Door Security However this project Operating speed 20MHz improves the previous PR where it can learn new RFID ID tag and read ID tag in two different communication ways Wiegand and UART Connection for UART and Wiegand RFID tag reader are provided on PCB to be extended Schematic and source code is also provided WIEGAND RFID TAG R
10. EADER RFID tag reader with specification reader to card and binary reader to controller interface Standard 26 bit binary card data format Operate with 5V supply Created by Cytron Technologies Sdn Bhd All Rights Reserved 1 Cytron 5 SYSTEM OVERVIEW Push Button lad LOS Ci XIL TAN RFID Tag Reader RFID Tag GENERAL DESCRIPTION PR25 is an open source microcontroller Do It Yourself kit This PIC microcontroller based project is designed to develop a low cost RFID door lock It combine the features and functions of PR8 RFID Read and Display and PR9 Password Door Security When RFID tag is place near to RDIF reader the reader can read RFID tag further send the tag ID to the PIC microcontroller After PIC microcontroller process the data the tag ID will display on LCD in decimal number and only particular RFID tag can pass the door lock However this project improves the previous PR where it can read ID tag in two different communication ways Wiegand and UART And connection for UART and Wiegand RFID tag reader are provided on PCB to be extended Besides it also can learn new ID tag The new RFID tag saved can open the door lock for next time used This DIY project also provides LCD 2x16 characters for user to display the status Buzzer is not provided as there is an internal build buzzer inside the RFID tag reader PIC16F876A This powerful 200 nanosecond instruction execution yet easy to progra
11. OBOT HEAD to TOE PR25 RFID Read and Display 10 Cytr on 5 ROBOT HEAD to TOE Technologie PR25 RFID Door Lock Cytron Technologies reserved the right to replace the component in the list with component of the same functionality without prior notice Prepared by Cytron Technologies Sdn Bhd 19 Jalan Kebudayaan 1A Taman Universiti 81300 Skudai Johor Malaysia Tel 607 521 3178 Fax 607 521 1861 URL www cytron com my Email support cytron com my sales cytron com my Created by Cytron Technologies Sdn Bhd All Rights Reserved 11 Cytron gt Created by Cytron Technologies Sdn Bhd All Rights Reserved ROBOT HEAD to TOE PR25 RFID Door Lock 12
12. WARE ee Flow Chart 2V Not Used Not Used not connected Table 3 Wire description Initialize PIC and LCD Connect only four green white red and black of the wire to 2510 04 female connector according to the colour E of the wire For more information about how to connect Sd y noe the wire to 2510 04 connector please refer to getting om m mode start section pressed PCB circuit board No Tag ID received H a 5 O Verererevevrere ry Compare received tag ID with saved ID Tag ID No match Yes Display Tag ID and Display Tag ID user not found LED on LED off l Door lock on Door lock off Figure 17 19 Component For more information about the software for this 1 Box header To ICSP programmer system please refer to the source code provided The 2 Parallel LCD 2x16 explanation of each instruction is provided in the a 9510 02 connector fordoor Wek source code as the comment of each line 4 2510 02 connector for 9V battery or 12V battery to power up the circuit The source code is provided free and Cytron 2510 04 connector RFID tag reader connector Technologies will not be responsible for any further 2510 04 Connector UART Connector modification or improvement SW 1 push button to save mood SW2 This push button not used in sample source code provided 9 LED indicate power status of circuit 10 LED indicate the status of door lock 11 Reset button to reset the mi
13. crocontroller 12 Slide switch to ON or OFF the circuit 13 AC DC adaptor socket to use power supply from AC DC adaptor at aN Created by Cytron Technologies Sdn Bhd All Rights Reserved 6 Cytr on gt ROBOT HEAD to TOE Technologie PR25 RFID Read and Display GETTING START Guide for making 2510 02 for User can obtain the hardware set for this project PR25 9V battery connector either by online purchasing www cytron com my or purchase it in Cytron Technologies Shop 1 Once user has the hardware set soldering process can be started Please solder the electronic components one by one according the symbols or overlays on the Printed Circuit Board PCB Ensure the component value and polarity is correctly soldered Please refer to PCB Layout in Appendix A Figure 19 not included in DIY project set 1 Make sure all the connectors 2510 are soldered in proper side Those electronic components have polarity such as capacitor diode PIC LM7805 and LED should be soldered in right polarity or it may cause the circuit board fail to work Door lock connector Warning Before the battery Power is plugged in make sure the polarity is correct to prevent the explosion Wrong polarity of capacitor also may 3 cause explosion 2 Connect the RFID reader to 2510 04 connector Figure 20 3 Connect the door lock to 2510 02 connector Guide for making 2510 04 for RFID tag Guide for making 2510 02 co
14. e PIC microcontroller please refer to the datasheet The datasheet can be found in microchip web site at http www microchip com Created by Cytron Technologies Sdn Bhd All Rights Reserved 1 Cytron 5 RFID Reader Wiegand Format et Figure 2 The term Wiegand is applied to several characteristics related to access control readers and cards Unfortunately the word is used carelessly and can lead to unnecessary confusion Here are the basics Wiegand is A specific reader to card interface A specific binary reader to controller interface An electronic signal carrying data The standard 26 bit binary card data format An electromagnetic effect A card technology ee S For more information on how RFID work please refer to Cytron s DIY project PR8 at www cytron co my Power supply for the circuit D1 1 LEAT SIS Figure 3 User can choose either AC to DC adaptor not included in the DIY project set or 9V 12V battery not included in the DIY project set to power up the circuit Higher input voltage will produce more heat at LM7805 voltage regulator Typical voltage is 12V Anyhow LM7805 will still generate some heat at 12V There are two type of power connector for the circuit DC plug J1 and 2510 02 Power Connector Normally AC to DC adaptor can be plugged to J1 type connector Refer to Figure 3 the D1 is use to protect the circuit from wrong polarity supply C1 and C2 is use to stabilize the
15. m only 35 single word instructions CMOS FLASH based 8 bit microcontroller packs Microchip s powerful PIC architecture into an 40 or 44 pin package and is upwards compatible with the PIC16C5X PIC12CXXX and PICI6C7X devices Features of the device 256 bytes of EEPROM data memory self programming 2 Comparators 8 channels of 10 bit Analog to Digital A D converter ROBOT HEAD to TOE PR25 RFID Read and Display e 2 capture compare PWM functions e synchronous serial port can be configured as either 3 wire Serial Peripheral Interface SPI or the 2 wire Inter Integrated Circuit I2C bus e Universal Asynchronous Receiver Transmitter UART All of these features make it ideal for more advanced level A D applications in automotive industrial appliances and consumer applications 28 Pin PDIP SOIC SSOP 28 lt gt RB7 PGD 27 _ gt RB6 PGC MCLRiVpr gt L RAO ANO gt RA1I AN1 L RA2 AN2 VREF CVREF gt RA3 AN3 VREF gt RA4ITOCKIIC1OUT J RASIAN4 SSIC20UT LI o Oona nk WwWh OSC1 CLKI gt L OSC2 CLKO 110 RCO T1OSOM1CKI gt L 11 RC1 T10SI CCP2 gt _ 12 RC2 CCP1 J13 RC3 SCK SCL gt 14 PIC16F873A 876A a i A S z 18 _ lt gt RC7 RX DT 17 RC6 TXICK 16 gt RCS5 SDO 15 _ RC4 SDI SDA Figure 1 Figure shows the pin diagram for PIC16F876A For more information about th
16. nnector A connector Figure 21 Figure 18 Created by Cytron Technologies Sdn Bhd All Rights Reserved T Cytron 5 Figure 22 4 Please download the necessary files and document from Cytron Technologies website These included documentation sample source code schematic component list and software 5 The next step is to install MPLAB IDE and HI TECC C PRO into a computer The MPLAB IDE and HI TECC C PRO can be downloaded from www cytron commy Please refer MPLAB IDE installation step document to install the software The documents can be used to any version of MPLAB IDE software 6 After the installation complete open the project file provided using MPLAB IDE Please refer MPLAB Open Project document to open the sample program 7 Please modify the tag ID in the program same as the tag ID that you want to read This step is to allow the system to remember the ID Note that the first member of id array initialized in the program is idl 127 and id2 22449 to change the initialized idl and id2 you can reset the value at the beginning of the program void main ivroid unsigned char i repeat b database unsigned char data z unsigned char cornyrertl 0 ffcle unsigned int convertz 0 role unsigned char mo role unsigned cha idl 127 id 2 2z24493 rini unsigned ir rini Figure 25 ROBOT HEAD to TOE PR25 RFID Read and Display UART WIEGAND 00083455215127
17. ovided free therefore Cytron Technologies will not be responsible for any further modification or improvement Created by Cytron Technologies Sdn Bhd All Rights Reserved 3 Cytron 5 Interface LCD 2x16 Character with PIC16F876A To use the LCD display users have to solder 16 pin header pin to the LCD display LCD used in this project is RT1602C for other type of LCD please refer to its data sheet Figure 11 Figure 11 is a 2X16 character LCD LCD connection pin and function of each pin is shown Name VSS VCC Positive supply 5V VEE Brightness adjust Connected to a trimmer to adjust LCD 1 Z zs N Select register select instruction or data register ROBOT HEAD to TOE PR25 RFID Read and Display VEC RS 4 7K Q2 22222 Figure 12 The transistor Q2 2N2222 is use to provide more current for the LCD Backlight Interface RFID tag with WIEGAND RFID tag reader 26 Bit Wiegand Format The composition of the industry standard 26 Bit Wiegand format contains 8 bits for the facility code field and 16 bits for the ID number field Mathematically these 8 facility code bits allow for a total of just 256 0 to 255 facility codes while the 16 ID number bits allow for a total of only 65 536 0 to 65 535 individual ID s within each facility code Due to the mathematical limitations of the 26 bit Wiegand format code duplication might occur Table 1 provides a summary the 26 bit Wiegand

Download Pdf Manuals

image

Related Search

Related Contents

  表紙・裏表紙  Delta 77736-CZ Installation Guide  Dicota College  Manuale Utente  Manual - Gene Bridges  Allocation sûre dans les systèmes aéronautiques : Modélisation  Manual de Procedimentos    APM -24005g User's Manual  

Copyright © All rights reserved.
Failed to retrieve file