Skip to content

Emre-Dag/Tijdsregistratiesysteem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Time registration system

Introduction

This project includes a time registration system worked out for the method school "Het Kompas". The current system consisted of a QR code that they had to scan themselves to be registered. This gave several security problems.
As a solution we worked out 3 methods of which we went deeper into the system that works with NFC badges scanning and registering on a database.

Flowchart NFC

Manual use website and Raspberry Pi


1. Raspberry Pi

To run a project on a Raspberry Pi, the Raspberry Pi operating system must be installed on an SD card of at least 16GB. This SD card may be fully formatted before starting. To do this, you must first install the Raspberry Pi Imager on your computer. This tool is a quick and easy way to install the Raspberry Pi OS on an SD card. Insert the SD card into your computer and open the Imager. Upon opening the Imager, you will see a welcome screen.

image

To install the Raspberry Pi operating system, click on 'CHOOSE OS' in the Raspberry Pi Imager and select Raspberry Pi OS (32-bit). Then choose the SD card you want to install the OS on by clicking on 'CHOOSE STORAGE' and selecting the SD card. When the image writing is completed successfully, you may remove the SD card from your computer and insert it into the Raspberry Pi. Then connect the peripherals such as keyboard, mouse, camera, screen (HDMI). The Raspberry Pi is now prepared, but still needs to be configured.


Connecting Raspberry Pi to wifi

Plug in the Raspberry Pi and wait for it to turn on.

Start screen:

image

To connect to a wifi network, click on the wifi icon in the upper right corner of the screen. Turn on the wifi and then select the desired wifi network.

image

After choosing your network, a window appears in the middle. Enter your network password here.

image

Make sure the Raspberry Pi is connected to the network and note the assigned IP address by moving the cursor over the Wi-Fi icon. This will bring up a window with the IP address. Make sure that both the Raspberry Pi and your PC are connected to the same wifi network.

image

possible IP-address: 169.154.146.220, do not take over.

To enable SSH on the Raspberry Pi, go to the menu at the top left and select "Preferences" and then "Raspberry Pi Configuration." In the "Interfaces" tab, then click on "SSH" to enable it. Also enable "SPI" since it will be used later.

image

Download Putty (MSI Windows Installer: 64-bit x86:)

When Putty is opened, the following screen will present itself.

PuTTY is a free and open-source serial console and network file transfer application. It is widely used to remotely access servers, network devices and other equipment. It is available for Windows, Linux and macOS.

When you open Putty on your computer, you will be greeted with a welcome screen:

image

To connect to a Raspberry Pi via SSH, enter the Raspberry Pi's IP address in the hostname. Make sure the PC and the Raspberry Pi are on the same Wi-Fi network. Next, enter port number 22 and select SSH as the connection type. Next, press Open to open the connection.

image

To log in to the Raspberry Pi, use the default login credentials of "pi" as the username and "raspberry" as the password. If you have chosen a different username and password, use them instead. Each time you want to log back in with Putty, you need to repeat these steps.

If you are successfully logged in, your terminal will look like this:

image

Login data for illustration purposes, do not copy.

Installing libraries to run the code: Copy and paste (right mouse button) into the Putty terminal to install the following.

  • sudo pip3 install adafruit-circuitpython-pn532

  • sudo pip3 install mysql-connector-python

  • sudo pip3 install adafruit-blinka

  • sudo apt-get install python3-rpi.gpio

  • pip install opencv-python

  • pip install webbrowser

  • pip install time


Next, to transport the code on the Raspberry Pi, we need an FTP client. And finally an SSH client to execute commands on the Raspberry Pi. You should have installed these at the beginning.

First, download the full repository.

MicrosoftTeams-image

Download FileZilla

Open FileZilla and enter the data you had retrieved in the previous steps.

Host: IP-adres

Username: pi

Password: raspberry

Port: 22

Click 'Snelverbinden' to make a connection.

tempsnip

On the left you see the working environment of your PC and on the right you see that of the Raspberry Pi. Now files can be exchanged between these 2 devices.

On the left, select the repository that was downloaded and drag the code (RPI_master.py) on the right into the Desktop folder.

Commands below to run the code.

image


2. Database

phpMyAdmin is a free and open-source web-based tool written in PHP used to manage and administer MySQL and MariaDB databases. It provides a user-friendly web interface to interact with databases, allowing users to perform various tasks such as creating, modifying and deleting databases and tables, managing users , running SQL queries and more.

In the project there are 2 tables used as database. One is used purely for keeping track of students' time and the other for keeping track of all the students with their information. Both tables use the following information. A general ID, this is nothing special and is just a counter when a new line comes in. The NFC ID is the Uid (unique identifier) of the NFC tag. This is followed by the student's general information such as first name, last name and the class the student is in. Only in the database that keeps track of students' time records is also a column with the time + date attached.


3. Website

The website serves as a dashboard for modifying the database and is currently hosted on a PXL server owned by the student. However, it will need to be moved to a paid server in the future. On the website, there are several functions that allow for manipulation of the ”studenten_default” database. One of these functions is the ability to add new students to the database.

image

The website also has a function that allows for deletion of students from the database by inputting their unique NFC ID and clicking the "delete student" button.

image

Additionally, the website allows for editing NFC ID by inputting the student's information. This feature can be useful in cases such as when a student loses their NFC badge.

image

The website also allows for editing of a student's information by inputting their unique identification. This feature can be useful in cases such as when a student changes classes.

image

Finally, it is also possible to view student registrations and filter certain data from the "student" database.

image


4. PN532

What is NFC? NFC, or Near Field Communication, is a technology standard that is based on the principles of Radio Frequency Identification (RFID). It enables the wireless transmission of information over short distances, allowing for a more efficient and convenient exchange of information. This technology has become increasingly popular among consumers worldwide, as it simplifies transactions, digital content exchange, and electronic device connectivity with a simple touch. Furthermore, the technology is compatible with the vast majority of contactless cards and readers currently in use worldwide.

image

How does it work? The fundamental principle behind the functioning of NFC technology is inductive coupling, particularly for short-range implementation. To elaborate, the reader device generates a magnetic field by passing an electric current through a coil. When a tag, which also comprises of a coil, is brought within proximity, the field induces an electric current within the tag, without the need for any physical contact or wires. Once the initial connection is established, any stored data on the tag is wirelessly transmitted to the reader device.

image

NFC vs RFID The primary difference between RFID and NFC technology lies in the transmission range. RFID is generally utilized for longer distances, for example, some regions use RFID for automatic collection of road tolls. Additionally, if RFID tags are equipped with a power source, communication can occur over even longer distances. On the other hand, NFC has a limited transmission range of a few centimeters at most. Furthermore, in most smartphone-related applications, communication is initiated only when there is physical contact. Another important aspect to note is that NFC devices possess bidirectional capability, allowing them to function as either a reader or a tag. This feature enables the usage of a single piece of hardware such as a smartphone, for various applications.

image

PN532 NFC Module The PN532 is a highly advanced NFC (Near Field Communication) controller developed by NXP. It is built on the 80C51 microcontroller platform, enabling efficient contactless communication at a frequency of 13.56 MHz. This device also features support for MIFARE Classic 1K and MIFARE Classic 4K cards, resulting in increased transfer speeds of up to 424 kbit/s in both directions. Additionally, the PN532 boasts a substantial 40 Kb ROM and 1Kb RAM, making it suitable for emulating ISO14443 cards. The ISO/IEC 14443 series of standards provides guidelines for the parameters of identification cards and objects for international interchange, which the PN532 effectively adheres to.

image

Connection PN532 with Rasberry Pi 3 For the wiring diagram, the below diagram was applied. Using a wire, connect the diagram below from the rasberry pi headers to the headers (solder in yourself) of the PN532.

image

It is of importance to properly designate the appropriate communication protocol on the PN532. This project employs the use of the SPI communication protocol. The image below provided the appropriate positioning of the sliders. Additionally, as indicated in the table, the left slider button on the PN532 should be in the down position, while the right one should be in the up position.

image

After all configurations have been imported both software-wise with all proper libraries and hardware configurations with proper wiring and proper communication protocol chosen, the suitable code can be executed.


5. Link to projects

The following folders contain the corresponding readmes and code.


6. Possible extensions

  • Installing and running this project.

  • Export database to CSV file (log), possibly automatically per day/week/month/year

  • Security and performance of code: double scanned, allowed time between scanning

  • Website and database hosted on a better platform (local or paid server)

  • Additional extension: hang screen so students can follow if registration is complete

  • Making a casing for the NFC reader and RPI


7. Conclusion

This project has been finalized. All that needs to be done is to install the project in the method school, but due to lack of time, we have not been able to install this project. We received a late reply to the mail on which we thought to install them during the Christmas vacation.


Presence worked on the project:

  • 7/10: 3h
  • went to Kompas school: 3h
  • 26/10: 3h
  • 28/10: 3h
  • 14/11: 3h
  • 18/11: 3.5-4h
  • 21/11: 3h
  • 25/11: 2.5h
  • 2/12: 3h
  • 5/12: 3h
  • 9/12: 3.5h
  • 12/12: 1.5h
  • 16/12: 2h
  • 23/12: 3.5h
  • 13/01: 5h

About +- 45 hours (2 days a week in corda 3 or 7)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •