Attendance System Using MYSQL with Raspberry and RFID-RC522

Installation of All Software

Attendance System Using MYSQL with Raspberry and RFID-RC522

a) Raspbian OS:

This is the recommended OS for Raspberry Pi. You can also installed another OS from a third party. Raspbian OS is a Debian based OS. We can install it from the NOOBS installer. You can download it here.

Installation of All Software

b) Python IDLE:

This is the software we get in Raspbian OS. For this project we have used a Python script.

c) PuTTY:

We are using PuTTY for remote access of Raspberry Pi. You can download it here.

PuTTY

d) Win32DiskImager:

This software is used to burn Raspbian Os onto a SD Card. You can download it here.

Win32DiskImager

e) SDFormatter:

This software is used to format a memory card. You can download it here.

SDFormatter

f) Installation of LAMP Server and PHPMYADMIN:

First of all let us clear one thing, that we are using LAMP Server for this project. In case you don't know what LAMP is, it is an abbreviation of Linux, Apache, MYSQL and PHP. So if you have Windows or MAC, then you have to install WAMP and MAMP respectively. So what we are explaining is only for the LAMP server.

And here are the steps for installing LAMP server:

1. Install Apache:

 sudo apt-get install apache2

2. Install MySQL:

sudo apt-get install mysql-server

3. Install PHP:

sudo apt-get install php5 libapache2-mod-php5

4. Restart Server:

sudo /etc/init.d/apache2 restart

5. Check Apache

http://localhost/

If you install these steps successfully, then you will get the Apache page like the image above. Here we are using PHPMYADMIN as the web interface of MYSQL, so you have to install that also and the command for that is:

sudo apt-get install phpmyadmin

g) Installation of Arduino IDE:

You can download the latest Arduino IDE from this link: https://www.arduino.cc/en/Main/Software

Components Used:

For this project you need:

  • Raspberry Pi
  • NodeMCU V3
  • RFID Reader with Tag
  • Jumper Wire

a) Raspberry Pi:

This is the latest version of Raspberry Pi. In this we have inbuilt Bluetooth and WiFi, unlike previously we've had to use a WiFi dongle in one of its USB port. There are a total of 40 pins in RPI3. Of the 40 pins, 26 are GPIO pins and the others are power or ground pins (plus two ID EEPROM pins).

There are 4 USB ports, 1 Ethernet slot, 1 HDMI port, 1 audio output port and 1 micro USB port; as well, there are many other things you can see the diagram on right side. We also have one micro SD card slot wherein we have to installed the recommended Operating System on micro SD card. There are two ways to interact with your Raspberry Pi. Either you can interact directly through HDMI port by connecting HDMI to VGA cable and use a keyboard and mouse, or else you can interact from any system through SSH (Secure Shell). (For example in Windows you can interact from PuTTY SSH.)schematic attendance system using mysql with raspberry and rfid rc522

b) NodeMCU V3:

NodeMCU is an open source IOT platform. It includes firmware which runs on the ESP8266 WiFi SoC from hardware which is based on the ESP-12 module. The term “NodeMCU” by default refers to the firmware rather than the dev kits.

NodeMCU V3

c) RFID-RC522 Reader with Tag:

There are cheap RFID modules that can read and write Mifare's tags and being sold at several web stores, like eBay and included with many “starter kits” nowadays. Simply search RFID-RC522 (MF-RC522). The microcontroller and card reader uses SPI for communication (chip supports I2C and UART protocols but not implemented on library). The card reader and the tags communicate using a 13.56MHz electromagnetic field.

RFID-RC522 Reader with Tag

How to Use NodeMCU in Arduino IDE

Step 1:

Firstly open the Arduino IDE.

Step 2:

Go to the File, then click on preferences tab like Figure 1. Now you have to copy in the additional board manager URL –http://arduino.esp8266.com/stable/package_esp8266com_index.json

Then click OK.

How to Use NodeMCU in Arduino IDE

Step 3:

Now go to the Tools, then select Board Manager to open the window like Figure 2. Just scroll down on that window and search for esp8266 by ESP8266 Community and then click on the install button.

ESP8266 Community and then click on the install button

Step 4:

Restart your Arduino IDE

Step 5:

Now go to Tools, then Select like figure 3.

Now go to Tools, then Select like figure

Circuit Diagram

Two circuit diagrams are given below. The first connection is for NodeMCU with RFID-RC522 and the second is for NodeMCU with Raspberry Pi.

Here are the connections for the first circuit:

RFID-RC522 — NodeMCU

  • SDA(SS) — GPIO2
  • MOSI — GPIO13
  • MISO — GPIO12
  • SCK — GPIO14
  • GND — GND
  • 3.3V — 3.3V
  • RST — not connected
  • IRQ — not connected

Circuit Diagram

And the second circuit connection is given below here.

And the second circuit connection is given below here.

Importing Necessary Library for NodeMCU

Here we are using RFID-RC522. So you have to import MF-RC522. Here is a GitHub link: https://github.com/miguelbalboa/rfid

Schematics

Schematics

Source: Attendance System Using MYSQL with Raspberry and RFID-RC522


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top