Introduction: Attendance System Using MYSQL With Raspberry Pi and RFID-RC522

Picture of Attendance System Using MYSQL With Raspberry Pi and RFID-RC522

Introduction to Our Project:

In thisproject we are taking data from RFID reader which is connected to Node MCU V3 and saving it to PHPMYADMIN database running on Raspberry pi.

Step 1: Installation of All Software

Picture of Installation of All Software

a) Raspbian OS:

This is the recommended os for raspberry pi. You can also installed other OS from third party. Raspbian OS is debian based OS. We can install it from noobs installer. you can Download here

b) Python idle:

This is the software we get in raspbian os. For this project we have used python script.

c) Putty:

we are using putty for remote access of Raspberry Pi.you can Download here

d) Win32DiskImager:

This software is used to burn Raspbian Os on SD Card. you can Download here

e) SDFormatter:

This software is used to format memory card. you can Download here

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 if you don't know what is LAMP, it is an abbreviation of Linux, Apache, MySQL and PHP. So if you have windows or may be MAC then you have to install WAMP and MAMP respectively. So what we are explaining that is only for 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 apche page like the image above Here we are using PHPMYADMIN that is the web interface of MySQL so for that 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

Step 2: Component Used:

Picture of Component Used:

For this project you need :

a )Raspberry pi

b) Node MCU V3

c)RFID Reader with Tag

d) Jumper Wire

a )Raspberry pi:

This is the latest version of raspberry pi. In this we have inbuilt Bluetooth and wi-fi, unlike previously we have to use Wi-Fi dongle in one of its usb port. There are total 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 Port and 1 Ethernet slot, one HDMI port, 1 audio output port and 1 micro usb port and also many other things you can see the diagram on right side. And also we 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 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.)

b) Node MCU V3:

NodeMCU is an open source IOT platform. It includes firmware which runs on the ESP8266 Wi- Fi 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.

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.

Step 3: How to Used NodeMCU in Arduino IDE

Picture of How to Used NodeMCU in Arduino IDE

Step1:

Firstly open the Arduino IDE.

Step2:

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_esp8266...

then click ok

Step 3:

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

Step4:

Restart your Arduino IDE Step5: Now goto Tools then Select like figure 3

Step 4: Circuit Diagram

Picture of Circuit Diagram

In this you have two circuit diagrams are given above:

First Connection is for Node MCU with RFID RC522

and Second is for Node MCU with Raspberry Pi.

Here are the connections for First Circuit:

RFID-RC522NODE MCU

SDA(SS) -- GPIO2

MOSI -- GPIO13

MISO -- GPIO12

SCK -- GPIO14

GND -- GND

3.3V -- 3.3V

RST -- not connected

IRQ -- not connected

and Second Circuit Connection is given above in second figure.

Step 5: Importing Necessary Library for NodeMCU

Here we are using RFID RC522. So you have to import MFRC522.

Here is a GitHub link:

https://github.com/miguelbalboa/rfid

Step 6: Code for Project

Code of this project is given below or you can download source code in GitHub link

Step 7: Video of Project

The whole project description are given in the above video

we've given our level of best to make you understand this project. Still if you have any doubt feel free comment us below

So finally if all things will go well. Definitely you will enjoy this project.

you also mail us on info@deligence.com

And if you want to learn more about these type of project then feel free to visit our youtube channel link

Thanks & Regards,

Deligence Technologies

Comments

SoonC1 (author)2017-11-05

Is there anyone who has been able to complete this project by following the instructions provided?

deligence (author)SoonC12017-11-06

Hello,

Are you facing any problem is completing this project? Do let us know. We'll be happy to support you.

Regards,
Sanjay Kumar

rcañete (author)2017-10-06

RFID.h: No such file or directory
i Already imported the required library

but it says there's no RFID.h in https://github.com/miguelbalboa/rfid
what to do ???

deligence (author)rcañete2017-10-23

Can you try with any RFID example program? Just to ensure that RFID is installed. The error message suggest that RFID is still not installed.

JayE42 (author)2017-09-02

Good Day! May I ask what should I do when an error appear:

RFID.h: No such file or directory?

deligence (author)JayE422017-09-03

You need to import the required library for compiling rfid-rc522, I've mentioned that in the above instructable on STEP 5

rcañete (author)deligence2017-10-06

same problem

RubénH31 (author)2017-09-13

Excellent project! I'm getting the components to be able to build it. I am not familiar with web page programming and I have the following question: do I have to create my own website to store the database? Thank you very much for your contribution.

VascoM7 (author)2017-06-01

Hello,

Very interesting project.

I just don't understand why you need the ESP8266. You could connect the RFID card reader directly to the Raspberry Pi.

Cheers

deligence (author)VascoM72017-06-01

Yes, we can do but here actually
nodemcu(esp8266) is throwing data to raspberry pi through it's serial
port which is connected to raspberry pi USB port. And here we are
getting rfid data through nodemcu code named nodemcu.ino and we are sending it
to phpmyadmin database through one python script named rfiddatabase.py
which we are running on raspberry pi.

Still any doubt feel free to ask

Thanks

RichardC337 (author)deligence2017-06-26

Why via serial? you have chosen to use an ESP8266 board but are using a standard serial to connect to the PI, you done need an esp8266 board for that. If you are plugging it in via serial using the PIs GPIO pins directly does the same thing.

deligence (author)RichardC3372017-06-27

Actually here our code is running on nodemcu only, and we are taking that serial data which is coming from nodemcu, you can chose arduino as well for that.

And yes we can do this project with raspberry pi only, Soon we will post that also where we don't need nodemcu.

Still any doubt please ask

Thanks

Ahmedqatar (author)2017-06-01

Very intreseted!

About This Instructable

4,195views

43favorites

License:

Bio: We are a team of IoT & Embedded Systems developers. We are working in Raspberry Pi and Arduino.
More by deligence:Controlling Servo Motor From Terminal With Precise Angle Using Raspberry PiSnake Detection SystemControl Home Appliance With Raspberry Pi Using Django
Add instructable to: