Ying ZHAO,Cheng LIU,Yan-juan LI
(1Electrical & Information Engineering College, Beihua University, Jilin 132021,China) (2College of Information and Computer Engineering, Northeast Forestry University, Harbin 150040, China)
Abstract: In order to meet the requirements of intelligent management of access control area such as rapid passing of people flow, rapid counting and rapid verification, an access control system that is quick in response, powerful in function, easy to expand and prevent illegal invasion is designed in this paper. Based on the advantages of embedded technology and RFID technology, the system’s hardware design and software design of access control system are given. The field applications indicate that the access control system can avoid the phenomenon of people following and meet the needs of the new modern intelligent access control system, and it has a wide application prospect.
Key words: Access control, Embedded technology, RFID, Card reader
With the continuous development and improvement of people’s sense of safety and prevention, access control system is more and more widely used in modern office and house [1]. The access control system in market has many disadvantages including structure and function’s flaw and inefficiency. So the design of a responsive, powerful, easy to expand intelligent access control system is very important. The system includes access controller, data acquisition model, card reader, alarm model, electromagnetic lock and host computer.
The access control system is composed of the host computer, card issuer, access control controller, card Reader, electronic lock and identification card. The system composition is shown in Fig.1. Among them, the communication between the host computer and the controller is through Ethernet using TCP/IP protocol [2]. The controller communicates with the card reader through RS485. The work process of the access control system is divided into two parts:
Part A: Identification card is near to Reader1 or Reader2, Reader1 or Reader2 reads identification card information, and then sends by RS485 transmission information to the controller. According to the card number, the current time, and internal database information, whether the card is valid, the controller controls the lock. At the same time, the card number, login time, valid, invalid and other information parameters will be recorded. The stored data information is then uploaded to the host computer, and the database of the controller is updated regularly by downloading the database from the host computer through the TCP/IP protocol.
Part B: Identification cards enter the measuring range of Reader3~Reader5, Reader3~Reader5 read identification card information. The horizontal and vertical coordinate values of the identification card are sent to the host computer based on the positioning principle of arrival field intensity information. The data acquisition part of the controller obtains signals from the outside, such as gate magnetic state, alarm signal, button signal, etc. The output of the controller is the response action of the controller, including door opening, alarm and identification card coordinates [3].
Fig.1 The system composition
The diagram of access controller’s hardware circuit is shown in Fig.2. In the intelligent access control system, every access controller has a unique address, the computer can distinguish different access controller according to the address. ARM chip S3C2440 is chosen as the main microcomputer because it has better function and fast performance speed [4]. The system computer transfers performance parameter, person information, time information and entrance and exiting mode to the access controller before starting the access controller. The access controller can performance absolutely after initialization. When people put the card to the card reader, the card reader transfers the card information to the access controller, the access controller gives the order of opening door or not according to the card information. When the order permits opening door, the access controller makes the lock open by relay. At the same time, the access controller records all the process and sends it to the computer to save.
The computer and the access controller communicate by TCP/IP protocol. The access controller and the card reader communicate by RS485 bus.
Fig.2 The diagram of access controller’s hardware circuit
The edge detection operator sobel operator is used to detect the edge of the target area to obtain the contour of the human body. Finally, Hough transform is used to identify the quasi-circular contour of the human body. Hough transform is often used in image processing and computer to extract the edge information of the target in the image after edge enhancement [5]. What Hough transform realizes is a mapping relation from image space to parameter space. It transforms complex edge feature information in image space into clustering detection problem in parameter space. Therefore, Hough transform has the advantages of clear geometric analysis, certain anti-interference ability and easy parallel processing. After pre-processing, the contour of the human body is a quasi-circular shape. To identify the human body, it is necessary to quickly detect the quasi-circular shape in the image, so as to accurately realize the automatic counting of the human body. Hough transform is an effective way to solve the above problems.
The position difference of image motion frame can be used to determine the entry and exit of personnel. The number of people entering and leaving the apartment through image recognition is compared with the number of people swiping the card by the user to determine whether there is an invasion of illegal person, and the positioning information of the electronic tag from the lower computer is used to locate the card holders, so as to find out the position of the illegal person without cards, which provides a favorable guarantee for the security of the apartment.
Image processing function is completed in Matlab, and then use Matlab compiler to generate C code file. For image processing in Matlab, rgb2gary() function should be used to convert the obtained frame image into grayscale image first, then Otsu method should be selected for automatic threshold selection to obtain the appropriate threshold, and then im2bw() function should be used to binarize the grayscale image with this threshold. The obtained grayscale and binary graphs are shown in Fig.3. According to the image that can be observed, after detecting movement area, movement area is not smooth, the outline of the image have greater noise, in order to solve these problems, using medfilt2 () function of image median filtering, and use imclose () function and imopen () function for the morphology of the closed and open operation, to remove the small area of the image, get the target area is relatively smooth. The results are shown in Fig.4.
Fig.3 Grayscale and binary graphs of image
Fig.4 Image after filtering and deleting small area image
The power module is responsible for supplying power to the system controller, and the basic composition diagram of the power board is shown in Fig.5.
Fig.5 Basic composition diagram of the power board
Battery charging circuit can be automatically charged to the battery, which can be automatically cut off after finishing [6]. The charging circuit is shown in Fig.6. The core of the circuit is the voltage comparator CA3140 and the two-way relay, in which the two-way relay controls the two-way switch with current passing through. The two-way switch is mutually exclusive, always one way is on and the other way is off. When D+ and D- do not conduct, K1+ and K1- will conduct, K2+ and K2- do not conduct; When D+ and D- conduct, K1+ and K1- do not conduct, K2+ and K2- will conduct.
Fig.6 Battery charging circuit
The state of the battery is realized by light-emitting diodes, as shown in Fig.5. DS1 shows the power supply state. The light of DS1 indicates that the power supply is not provided, and the battery is supplying power to the system. DS2 is the charging status symbol, when DS2 light, it means that the battery is charging. When DS2 is off, it means that the battery is a full state. The conversion of external power supply to battery power supply is accomplished by two parallel secondary pipes.
JTAG interface is mainly used to test inner device, emulation and debug, and it is a simple and effective method of developing and debugging[7]. The JTAG interface’s connection circuit with S3C2440 is shown in Fig.7.
Fig.7 JTAG interface’s connection circuit with S3C2440
The door lock control circuit is shown in Fig.8.
Fig.8 The door lock control circuit
When the access controller makes the order to open or close the door, it will change the high and low level of GPIO to control the on-off of the triode, i.e., to control the current flow of relay RelaySPDT, and the on-off of the relay current controls the opening or closing state of the electric lock.
RFID card data acquisition uses card reader [8], and other data collection is collected directly, such as magnetic door, button, the peripheral circuit, etc. Take the gate magnet as an example to introduce the circuit principle as below. The acquisition circuit is shown in Fig.9.
Fig.9 Diagram of gate magnetic data acquisition circuit
The design idea of gate magnetic circuit is: VCC forms a loop through a resistance and a wire, which is connected to the gate magnetic coil. In the circuit diagram, they are VCC, R22 and R31, in which R32 is the equivalent resistance of the wire. Under normal conditions, the equivalent resistance of a wire is equal to the equilibrium resistance. Set a voltage range for the double-limit comparator. When the voltage of the comparator’s feet 4 and 7 is in this range, the comparator outputs a high level, and ANTIDES1 sends the high level to GPIO, the access control controller. At this time, no alarm is triggered. Under the condition that the wire is in an open circuit or short circuit, the voltage of the comparator’s feet 4 and 7 is higher or lower than the set voltage range, the comparator outputs a low level, and ANTIDES1 sends a low level to GPIO, the access control controller. At this time, the alarm is triggered by the application software.
The main flow diagram of access control controller is shown in Fig.10. After the system is powered up and started, it reads the property data of each port from the host database and configures, initializes each port device and completes the initialization setting of the system. After that, the background communication thread is started to handle the communication module, and the main control process starts to monitor the access control area. After the system starts normally, the status of each port is detected first. If there is any abnormality, it will give an alarm and record the event, and perform the corresponding I/O processing. At the same time, check whether the user swipes the card, whether the automatic alarm condition is met, and it deals with relevant modules.
Fig.10 Main flow diagram of access control controller
With the development of the intelligent and networked, the modern access control management system has evolved into a complex integrated management system integrating field monitoring, parameter setting and information management. In the access control system, the access control controller has taken the most important responsibility, it must make the reasonable judgment to each kind of situation, thus commands the access control equipment the operation. The basis of these judgments must be issued by the management system. Access control management system includes communication port setting, user information management configuration, real-time monitoring, access control event information collection and management and alarm condition setting and other modules. The administrator login interface is shown in Fig.11.
The interface of modifying keyword is shown in Fig.12.
The interface of user’s recording information is shown in Fig.13.
Fig.11 The administrator login interface
Fig.12 The interface of modifying keyword
The index function program is implemented as follows
void__fastcall TQuickReport1:
AccessQueryToPrint (int Type,TDateTime dtDate)
{AnsiString sql;
sql="SELECT*FROM Toll WHERE日期>=";
sql+=dtDate;
sql+="ORDER BY日期 ASC ";
ADOQuery1->Close();
ADOQuery1->SQL->Clear();
ADOQuery1->SQL->Add(sql);
ADOQuery1->Open();
ADOQuery1->First();
p=(TFloatField *) ADOQuery1-> FieldByName ("ID號(hào)");
p->DisplayFormat="0:D";
p=(TFloatField *)ADOQuery1->FieldByName("日期");
p->DisplayFormat=" 0:yyyy-MM-dd HH:mm:ss ";
if(IntToStr(ADOQuery1->RecordCount)==1){
if(Type==1){
PreView->Show();
QuickReport1->Preview();
PreView->FormStyle =fsStayOnTop;
}else{
QuickReport1->Print();
}
}
}
The intelligent access control system is designed in this paper. The hardware diagram and corresponding software flow diagram are given in details. The system chooses ARM chip S3C2440 as main microcomputer, so the system had faster performance and better stability. The computer and the access controller communicate by TCP/IP protocol. The computer managerial interface is simple and operates easily. The access controller and the card reader communicate by RS485 bus and performance reliably.