
Hello!
We have already written about the fact that we are doing Wiren Board - a compact industrial computer with Wi-Fi, GPRS, GPS, NFC and Ethernet running Linux. On its basis, you can quickly make ready-made devices, using the necessary modules.
To show its capabilities, we decided to make a complete device. Today's article is about the access control system on the Wiren Board.
')
Device idea
In the hostels of our alma mater - MIPT - there are public infrastructure facilities - laundry and sports rooms. For many years, access to them was carried out by obtaining the key from the guard with a log entry.
Of course, this is very inconvenient. A good solution would be to make the access system on the cards.
Not so long ago, we learned that the students of our institute decided to make a throughput system in the dormitory - so that the entrance to the laundry and sports rooms was possible only with a personal card.
We decided to help our institute.
Instead of distributing cards to all students and registering them, we decided to use the existing Student Social Cards. The owner’s full name and some other information have already been recorded on them (
an article on the study of cards ), so the controller on the door simply checks the full name from the card with the list of people living in the dormitory without requiring any prior registration.
Implementation
How are such systems usually built? Simple autonomous access control systems include:
- Card reader
- Lock controller (can be combined with a reader)
- Electromagnetic lock
- Exit button (back side)
They are usually programmed using a master card.
In network solutions, an additional access control server, interface converters are installed, and an RS-485 line is laid, through which the server communicates with the controllers.
Naturally, it was possible to use ready-made systems, which are many in the market, but they showed various
fatal flaws. And we remembered that we have a Wiren Board, which can both read and lock cards, and communicate with the server via Ethernet, that is, it combines all the components. We decided to make a “smart” access controller.
We do not need to lay a separate RS-485 line to the server, we only need to connect to the SCS via Ethernet, and this is not a problem in the hostel. And the server itself as a separate computer (and even with Windows) in the server one is not needed, it is enough to raise a virtual server. Power is supplied to the device via Ethernet (PoE) - no need to think about where to connect the power supply and how to pull wires from it to the door.
Of course, there are some good solutions on the market in the form of ACS network controllers, but they come with closed software, and it will be difficult to implement support for social cards on them. In our case, the standard functionality of reading a sector from a card is not suitable, since the controller must extract data from the necessary sectors, decrypt it, and build a request to the base for card registration using the information received.
Also, the ACS should be integrated with existing and future self-written systems: the site, the recording system in the laundry, etc. Closed complex software makes this a very difficult task. It may also be paid, with a subscription or license - unnecessary problems.
Iron
What we will use in Wiren Board:
-
NFC - for reading Social Cards (Mifare Classic type cards)
-
Ethernet - for communication with the database
-
transistor outputs for controlling the magnetic lock and indication LEDs
-
GPIO for connecting the “Exit” button
-
Power over Ethernet - to reduce the number of cables and not take care of the outlet
Connection diagram is shown in the figure.

Green and red LEDs perform indication functions. The exit button for safety requirements must be three-contact and provide mechanical opening of the electromagnetic lock circuit. When you press the button, the pair of contacts opens and the middle contact closes on the third one, a signal goes to the board. The control transistor closes, breaking the power supply circuit of the lock for 3-4 seconds.

Electromagnetic lock is controlled by supplying 12V through a transistor output. Passive PoE injectors from Ubiquiti were used for power supply.
A suitable housing was selected, and the devices took their rightful place at the door.

Soft
The software and the logic of the system is very simple.
Uses social cards that most students have. In theory, you can use any ISO 14443-compatible label, for example, a bank card, a Mifare key ring, a subway card, or even a smartphone with NFC.
All information is stored in a MySQL database on a remote server. It contains a list of users (a list of students of the faculty), a list of each user's cards, logs, etc. For each card, the factory number, its type and additional information depending on the type of card are stored: name, number and duration of the social card; disposable metro card number, etc.
When you bring a card, the controller reads its serial number and sends a request to the database. If the card number is found in the corresponding table, the controller opens the door and adds a log entry. If the number is not found, the controller tries to identify the card.
and take the name and other information from the social card and the number from the metro card. If a user with the desired name and date of birth is in the user table, the card is automatically registered in the system.
To simplify the system, the controller communicates directly with the MySQL database by calling stored procedures. Of course, the controller does not have direct access to the tables.
The client part running on the controller is written in Python and takes several dozen lines.
Conclusion
We even liked the resulting controller, so we decided to
release it for sale as a ready-made device. As options, all the possibilities that Wiren Board provides, for example, GPRS for redundancy of the communication channel, or connection to the RS-485 line are available. You can also connect external readers, additional locks and buttons to the device.
A detailed description of the computer Wiren Board can be found on
the documentation portal , and in the
store you can buy a sample. We are also waiting for your comments and suggestions on our
forum and in the comments.