Introduction: Fingerprint Based Biometric Voting Machine Using Arduino
We all are aware of the existing electronic voting machine where the user has to press a button to cast the vote. But these machines have been criticized for tempering since the beginning. So the government is planning to introduce a fingerprint-based voting machine where users can cast the vote based on his/her fingerprint impression. This system will not only remove the possibility of duplicate votes but also prevent any kind of manipulation.
So in this project, we are going to build a prototype of a Biometric voting machine using the Arduino Uno, TFT display, and Fingerprint Sensor.
We previously used R305 Fingerprint Sensor with NodeMCU to build a Biometric based Attendance System but here we will use the advanced GT-511C3 fingerprint sensor with Arduino.
Step 1: Components Required to Build Biometric Voting Machine
Step 2: Circuit Diagram for Biometric Voting Machine Using Arduino
Circuit Diagram for this project is very simple as we are only connecting the TFT display and fingerprint sensor module with Arduino Uno. VCC and GND pins of the fingerprint sensor are connected to 5V and GND pins of Arduino while TX and RX pins are connected to digital pin 11 & 12 of Arduino Uno.
The 2.4” TFT LCD screen is an Arduino Shield and can be directly mounted on Arduino Uno, as shown in the below image. TFT display has 28 pins that perfectly fit into Arduino Uno, so I had to solder the fingerprint sensor on the backside of Arduino.
Step 3: Source Code and Step by Step Code Explanation
The complete code for this Fingerprint Voting System Project using Arduino is given at the end of the article; here we are explaining some important functions of the code.
The code uses the SPFD5408, Software Serial, and FPS_GT511C3 libraries. SPFD5408 library is the modified version of the original Adafruit Library. These library files can be downloaded from the links given below:
After including the libraries and defining some important parameters, we can get into the programming part. There are three sections involved in this program. One is creating a UI of a voting machine, second is getting the touch-points for buttons & detecting the buttons based on the touch and finally calculating the results and save them into Arduino’s memory.
1. Creating UI:
I have created a simple UI with three buttons and the name of the project. The TFT display library allows you to draw Lines, Rectangle, Circles, Chars, Strings and a lot more of any preferred color and size. Here two rectangular buttons are created using fillRoundRect and drawRoundRect functions. Syntax for tft.drawRoundRect function is given below:
tft.drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color)
x0= X co-ordinate of the starting point of rectangular
y0= Y coordinate of the starting point of rectangular
w = Width of the rectangular
h = Height of the Rectangular
radius= Radius of the round corner
color = Colour of the Rect.
tft.drawRoundRect(0, 0, 319, 240, 8, WHITE); //Page border
tft.fillRoundRect(10, 70, 220, 50, 8, GOLD);
tft.drawRoundRect(10, 70, 220, 50, 8, WHITE); //Vote
tft.fillRoundRect(10, 160, 220, 50, 8, GOLD);
tft.drawRoundRect(10, 160, 220, 50, 8, WHITE); //Enroll
tft.fillRoundRect(10, 250, 220, 50, 8, GOLD); //Result
tft.drawRoundRect(10, 250, 220, 50, 8, WHITE);
2. Getting the Touch-Points and Detecting Buttons:
Now in the second section of the code, we will detect the button touchpoints and then use these points to predict the button. ts.getPoint() function is used to detect the user touch on TFT display. ts.getPoint gives the Raw ADC values for the touched area. These RAW ADC values are then converted to Pixel Coordinates using the map function.
TSPoint p = ts.getPoint();
if (p.z > ts.pressureThreshhold)
p.x = map(p.x, TS_MAXX, TS_MINX, 0, 320);
p.y = map(p.y, TS_MAXY, TS_MINY, 0, 240);
Now, since we know the X and Y coordinates for each button, we can predict where the user has touched by using the ‘if’ statement.
if (p.x > 70 && p.x < 120 && p.y > 10 && p.y < 220 && p.z > MINPRESSURE && p.z < MAXPRESSURE)
When a voter presses the candidate button, he will be asked to scan the finger on the fingerprint sensor. If finger ID is authorized then the voter is allowed to vote. If any Non-registered user wants to vote then the fingerprint module will not detect its ID into the system and the display will show ‘Sorry You Can’t Vote ’.
int id = fps.Identify1_N();
if (id <200)
msg = "Candidate 1";
The last step is getting the vote count from EEPROM memory and comparing the votes of all three candidates. A Candidate with the highest votes wins. The result can only be accessed from the serial monitor and will not be displayed on the TFT screen.
if((vote1 > vote2 && vote1 > vote3))
Step 4: Testing the Fingerprint Voting System Using Arduino
To test the project, connect the Arduino Uno to the laptop and upload the given code. Once the code is uploaded, the TFT display should display the candidate’s name. When someone taps on a candidate name, the machine will ask to scan the fingerprint scanner. If the fingerprint is valid, then the user vote will be counted, but in case, the pattern doesn’t match with the records of the database, access to cast a vote will be denied. The total number of votes for each candidate will be stored in EEPROM and a candidate having the highest number of votes will win.
I hope you enjoyed the tutorial and learned something useful. If you have any queries, please let us know in the comment section below, and also follow us on Instructable for more such interesting projects.