Arduino Projects

Biometric Student Attendance System with Database using VB.net & Arduino

Introduction:

 

Biometric Student Attendance System with Database- In this tutorial, you will learn how to make a Biometric Student Attendance system and save the records in a database whether a particular student is Present, Late, or absent. This is a completely wireless system the transmitter and receiver have no physical connection. The computer application is designed in visual basic 2010 express edition. In this project two Arduino’s are used, one as the Transmitter which is connected with the Fingerprint module and the other one as the receiver which is connected with the Laptop.


In part1 of the biometric student attendance system, I explained how to make a very basic GUI application; in this episode, I explained how to add text boxes, labels, and timers, etc.

In this episode, I will not explain the things which I have already explained in my previous tutorials. I highly recommend first watch my previous tutorials based on the fingerprint module and then you can resume from here.

In this project, I will explain

  1. Complete circuit diagram explanation.
  2. GUI attendance application
  3. How to install a Xampp Server.
  4. How to create a database.
  5. How to connect a database with the GUI Attendance application

Amazon Links:

Arduino Nano USB-C Type (Recommended)

433 MHz Transmitter and Receiver Modules:

Fingerprint Module:

12v Adaptor:

DISCLAIMER:

Please Note: these are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!

 



Biometric Student Attendance System Transmitter Circuit Diagram:

Biometric Student Attendance System with Database

This is the Transmitter side circuit diagram. As you can see 433Mhz RF transmitter data pin is connected with the Arduino’s pin number 12. The 5 volt and GND pins of the Transmitter module are connected with the Arduino’s 5v and GND.

The 5 volt and GND pins of the fingerprint module are connected with the Arduino’s 5v and ground. The TX pin of the fingerprint module is connected with the Arduino’s pin number 4 while the RX of the fingerprint module is connected with the Arduino’s pin number5.


Biometric Student Attendance System Receiver Circuit Diagram:

Biometric Student Attendance System with Database

The 5v and GND pins of the 433Mhz receiver module are connected with the Arduino’s 5v and GND. While the data pin of the receiver module is connected with the Arduino’s pin number 11. This Arduino will be connected with the Laptop.

Biometric student attendance application:

Biometric Student Attendance System with Database

This is a GUI application designed for the Biometric student attendance system. As you can see this form has a total of  10 textboxes, 5 buttons, and a data grid.   The names of the textboxes are txt_search, txt_roll, txt_name, txt_class, txt_present, txt_late, txt_absent, TextBox1, txt_mins, and txt_timer.

The button names are btn_search, btn_save, btn_update, btn_delete, and Button1.while the name of the data grid is DataGridView1.

For the Automatic attendance, I have added some timers and for the Serial communication, I added one Serial Port.


Biometric student attendance system application programming:


Xampp Server Installation and Basic Setup:

After you are done with the basic GUI form designing and programming then the next step is to download and install the Xampp Server. For the step by step installation, and database connectivity watch the video tutorial given at the end of this Article.

Biometric Student Attendance System Arduino Programming:

In this project two programs are used, one program is written for the Transmitter side Arduino and the other program is written for the receiver side, Arduino. Let’s first start with the transmitter programming.

Fingerprint Biometric student attendance TX side Arduino Programming:

#include <Adafruit_Fingerprint.h>
#include <VirtualWire.h>
#include <SoftwareSerial.h>

int getFingerprintIDez();
const int transmit_pin = 12;
char data ;

// pin #4 is IN from sensor (GREEN wire)
// pin #5 is OUT from arduino (WHITE wire)
SoftwareSerial mySerial(4, 5);

Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);

// commands for students

char msg[7] = {‘a’}; // student1
char msg1[7] = {‘b’}; // student2
char msg2[7] = {‘c’}; // student3

void setup()
{
Serial.begin(9600);
vw_set_tx_pin(transmit_pin);
vw_setup(2000); // Bits per sec

Serial.println(“fingertest”);

// set the data rate for the sensor serial port
finger.begin(57600);

if (finger.verifyPassword()) {
Serial.println(“Found fingerprint sensor!”);
} else {
Serial.println(“Did not find fingerprint sensor :(“);
while (1);
}

Serial.println(“Waiting for valid finger…”);

}

void loop() // run over and over again
{

getFingerprintIDez();
}

uint8_t getFingerprintID() {
uint8_t p = finger.getImage();
switch (p) {
case FINGERPRINT_OK:
Serial.println(“Image taken”);
break;
case FINGERPRINT_NOFINGER:
Serial.println(“No finger detected”);
return p;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println(“Communication error”);
return p;
case FINGERPRINT_IMAGEFAIL:
Serial.println(“Imaging error”);
return p;
default:
Serial.println(“Unknown error”);
return p;
}

// OK success!

p = finger.image2Tz();
switch (p) {
case FINGERPRINT_OK:
Serial.println(“Image converted”);
break;
case FINGERPRINT_IMAGEMESS:
Serial.println(“Image too messy”);
return p;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println(“Communication error”);
return p;
case FINGERPRINT_FEATUREFAIL:
Serial.println(“Could not find fingerprint features”);
return p;
case FINGERPRINT_INVALIDIMAGE:
Serial.println(“Could not find fingerprint features”);
return p;
default:
Serial.println(“Unknown error”);
return p;
}

// OK converted!
p = finger.fingerFastSearch();
if (p == FINGERPRINT_OK) {
Serial.println(“Found a print match!”);
} else if (p == FINGERPRINT_PACKETRECIEVEERR) {
Serial.println(“Communication error”);
return p;
} else if (p == FINGERPRINT_NOTFOUND) {
Serial.println(“Did not find a match”);
return p;
} else {
Serial.println(“Unknown error”);
return p;
}

// found a match!
Serial.print(“Found ID #”); Serial.print(finger.fingerID);
Serial.print(” with confidence of “); Serial.println(finger.confidence);
}

// returns -1 if failed, otherwise returns ID #
int getFingerprintIDez() {
uint8_t p = finger.getImage();
if (p != FINGERPRINT_OK) return -1;

p = finger.image2Tz();
if (p != FINGERPRINT_OK) return -1;

p = finger.fingerFastSearch();
if (p != FINGERPRINT_OK) return -1;

// found a match!
Serial.print(“Found ID #”); Serial.print(finger.fingerID);
Serial.print(” with confidence of “); Serial.println(finger.confidence);

if(finger.fingerID == 2)
{

vw_send((uint8_t *)msg, 1); // change this number according to the sensor values
vw_wait_tx(); // Wait until the whole message is gone
delay(1000);
}
if(finger.fingerID == 3)
{
vw_send((uint8_t *)msg1, 1); // change this number according to the sensor values
vw_wait_tx(); // Wait until the whole message is gone
delay(1000);
}

else
return finger.fingerID;
// Serial.println(“Invalid User\n”);
}



Transmitter side Arduino program explanation:

Before you start the programming, first of all, make sure that you download all these libraries. As you can see this is the same exact program used in my previous fingerprint based student attendance system. In this program, I made only one change which is I defined a pin for the transmitter. While the rest of the program is exactly the same. Now let’s have a look at the receiver side programming.

Fingerprint Biometric student attendance RX side Arduino Programming:

// receiver.pde

#include <VirtualWire.h>

const int receive_pin = 11;

void setup()

{

delay(1000);

Serial.begin(9600);  // Debugging only

Serial.println(“setup”);

// Initialise the IO and ISR

vw_set_rx_pin(receive_pin);

vw_set_ptt_inverted(true); // Required for DR3100

vw_setup(2000);     // Bits per sec

vw_rx_start();       // Start the receiver PLL running

}

void loop()

{

uint8_t buf[VW_MAX_MESSAGE_LEN];

uint8_t buflen = VW_MAX_MESSAGE_LEN;

if (vw_get_message(buf, &buflen)) // Non-blocking

{

int i;

// Message with a good checksum received, dump it.

//Serial.print(“Got: “);

for (i = 0; i < buflen; i++)

{

char c = (buf[i]);

if( c == ‘a’)

{

Serial.println(“1001”);

delay(1000);

}

if( c == ‘b’) // for right side

{

Serial.println(“1002”);

delay(1000);

}

}

}

}

Receiver Side Arduino Program Explanation:

I started off by defining a pin for the 433Mhz Radio Frequency module data pin.

In the void setup function, I activated the serial communication and selected 9600 as the baud rate. Make sure you use the same baud rate in the computer GUI application. The virtual wire set rx pin function takes only one argument as the input which is the receiver data pin. Then I activated the virtual wire and selected 2000 as the communication speed.

Then starts the void loop function.

We simply read the message, in my case I am sending only one character from the transmitter. This character when received by the receiver is stored in the variable c. then using the if conditions we check whether the received character is a or b. if the received character is a then send a roll number 1001 to the computer application and if the received character is b then send a roll number 1002 to the computer application.


Watch Video Tutorial:

 

 

Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Leave a Reply

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

Back to top button