Installation of All Software
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.
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.
d) Win32DiskImager:
This software is used to burn Raspbian Os onto a SD Card. You can download it here.
e) SDFormatter:
This software is used to format a memory card. You can download it 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 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.)
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.
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.
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.
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.
Step 4:
Restart your Arduino IDE
Step 5:
Now go to Tools, then Select like figure 3.
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
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
Source: Attendance System Using MYSQL with Raspberry and RFID-RC522