- Mga Kinakailangan na Bahagi
- Diagram ng Circuit
- How Fingerprint Attendance System works
- Code Explanation
Ayon sa mga mananaliksik mula sa Pen state University, ang mga tao ay mas malamang na magtiwala sa mga makina sa mga tao, na malamang na maliwanag mula sa amin na inilalantad ang aming ATM pin sa isang makina nang napakadali. Ngayon, sa mundo kung saan ang AI, pag-aaral ng Machine, Chat bot, Smart Speaker, Robots atbp ay aktibong umuunlad, ang synergy na ito sa pagitan ng mga tao at mga robot ay nakatakda lamang upang madagdagan. Ngayon, mula sa mga kolektor ng tulay sa tulay hanggang sa pag-check-out sa mga kahera na lahat ng bagay sa ating paligid ay pinalitan ng mga makina upang mas madali at mas mahusay ang gawain. Upang makasabay sa yugto, sa proyektong ito magtatayo kami ng isang Sistema ng Pagdalo ng Bio-sukatan gamit ang mga AVR microcontroller upang mapalitan ang manu-manong pamamaraan ng pagdalo. Ang system na ito ay magiging mas maaasahan at mahusay dahil makatipid ito ng oras at maiwasan ang mga dodger.
Ang mga sistema ng pagdalo ng fingerprint ay kaagad na magagamit nang direkta mula sa merkado, ngunit ano ang mas masaya kaysa sa pagbuo ng isa? Bumuo din kami ng iba't ibang uri ng Attendance Systems nang mas maaga mula sa isang simpleng RFID based Attendance system sa isang IoT based biometric Attendance system na gumagamit ng Arduino at Raspberry Pi. Sa proyektong ito, ginamit namin ang fingerprint Module at AVR (atmega32) upang irehistro ang pagdalo. Sa pamamagitan ng paggamit ng fingerprint sensor, ang system ay magiging mas ligtas para sa mga gumagamit. Ang mga sumusunod na seksyon ay nagpapaliwanag ng mga teknikal na detalye ng paggawa ng isang Biometric Attendance System na nakabatay sa fingerprint gamit ang AVR.
Mga Kinakailangan na Bahagi
- Atmega32 -1
- Module ng fingerprint (r305) -1
- Mga pindutan ng Push Button o membrane - 4
- Mga LED -2
- 1K Resistor -2
- 2.2K risistor -1
- Power 12v adapter
- Mga kumokonekta na mga wire
- Buzzer -1
- 16x2 LCD -1
- PCB o Bread Board
- RTC Module (ds1307 o ds3231) -1
- LM7805 -1
- 1000uf, 10uf capacitor -1
- Burgstips lalaki babae
- DC JACK (opsyonal)
- BC547 Transistor -1
Sa circuit ng system ng pagdalo ng fingerprint na ito, ginamit namin ang module ng Fingerprint Sensor upang patunayan ang pagkakakilanlan ng isang tao o empleyado sa pamamagitan ng pagkuha ng kanilang input ng finger-print sa system. Gumagamit kami dito ng 4 na mga pindutan ng push upang magpatala, Tanggalin, Pagtaas at Pagbawas ng data sa pag-print ng daliri . Ginagamit ang Key 1 para sa pagpapatala ng isang bagong tao sa system. Kaya't kapag nais ng gumagamit na magpatala ng isang bagong daliri, kailangan niyang pindutin ang key 1 pagkatapos ay tinanong siya ng LCD na maglagay ng daliri sa sensor ng fingerprint nang dalawang beses pagkatapos ay humihiling ito para sa isang ID ng empleyado. Katulad nito, ang key 2 ay may dobleng pag-andar, tulad ng kapag nagpatala ng bagong daliri ang gumagamit, kung gayon kailangan niyang pumili ng finger-print IDsa pamamagitan ng paggamit ng isa pang dalawang mga key na katulad ng 3 at 4. Ngayon ang gumagamit ay kailangang pindutin ang key 1 (oras na ito ang key na ito kumilos tulad ng OK) upang magpatuloy sa napiling ID. At ginagamit din ang key 2 para i- reset o tanggalin ang data mula sa EEPROM ng microcontroller.
Kinukuha ng module ng sensor ng daliri ang naka-print na imahe ng daliri at pagkatapos ay i-convert ito sa katumbas na template at nai-save ang mga ito sa memorya nito ayon sa napiling ID ng microcontroller. Ang lahat ng proseso ay inuutusan ng microcontroller, tulad ng pagkuha ng isang imahe ng pag-print ng daliri; i-convert ito sa mga template at pag-iimbak bilang ID atbp. Maaari mo ring suriin ang iba pang mga proyekto ng sensor ng pag-print ng daliri, kung saan binuo namin ang system ng seguridad ng sensor ng pag-print ng daliri at machine ng pagboto ng sensor ng fingerprint.
Diagram ng Circuit
Ang kumpletong diagram ng circuit para sa proyekto ng sistema ng pagdalo na nakabatay sa fingerprint, ay ipinapakita sa ibaba. Mayroon itong Atmega32 microcontroller para sa pagkontrol sa lahat ng proseso ng proyekto. Ang pindutan ng itulak o lamad ay ginagamit para sa pagpapatala, pagtanggal, pagpili ng mga ID para sa pagdalo, isang buzzer ang ginagamit para sa pahiwatig at isang 16x2 LCD upang turuan ang gumagamit sa kung paano gamitin ang makina.
As shown in the circuit diagram, push or membrane buttons are directly connected to pin PA2 (ENROL key 1), PA3(DEL key 2), PA0(UP key 3), PA1(DOWN key 4) of microcontroller with respect to the ground or PA4. And a LED is connected at pin PC2 of microcontroller with respect to ground through a 1k resistor. Fingerprint module’s Rx and Tx directly connected at Serial pin PD1 and PD3 of microcontroller. 5v supply is used for powering the whole circuit by using LM7805 voltage regulator which is powered by 12v dc adaptor. A buzzer is also connected at pin PC3. A 16x2 LCD is configured in 4-bit mode and its RS, RW, EN, D4, D5, D6, and D7 are directly connected at pin PB0, PB1, PB2, PB4, PB5, PB6, PB7 of microcontroller. RTC module is connected at I2Cpin PC0 SCL and PC1 SDA. And PD7 is used as soft UART Tx pin for getting the current time.
How Fingerprint Attendance System works
Whenever user place his finger over fingerprint module then fingerprint module captures finger image, and search if any ID is associated with this fingerprint in the system. If fingerprint ID is detected then LCD will show Attendance registered and in the same time buzzer will beep once.
Along with the fingerprint module, we have also used an RTC module for Time and date data. Time and date are running continuously in the system, so Microcontroller can take time and date whenever a true user places his finger over fingerprint sensor and then save them in the EEPROM at the allotted slot of memory.
User may download the attendance data by pressing and holding key 4. Connect supply to circuit and wait and after some time, LCD will show ‘Downloading….’. And user can see the attendance data over serial monitor, here in this code software UART is programmed at pin PD7-pin20 as Tx to send data to terminal. User also needs a TTL to USB converter to see the attendance data over serial terminal.
And if the user wants to delete all the data then he/she has to press and hold key 2 and then connect power and wait for some time. Now after some time LCD will show ‘Please wait…’ and then ‘Record Deleted successfully’. These two steps are not shown in demonstration video given in the end.
Code Explanation
Complete code along with the video for this biometric attendance system is given at the end. Code of this project is a little bit lengthy and complex for beginner. Hence we have tried to take descriptive variables to make good readability and understanding. First of all, we have included some necessary header file then written macros for different-different purpose.
#define F_CPU 8000000ul #include #include
After this, we have declared some variables and arrays for fingerprint command and response. We have also added some functions for fetching and setting data to RTC.
void RTC_stp() { TWCR=(1<
Then we have some functions for LCD which are responsible to drive the LCD. LCD driver function is written for 4-bit mode drive. Followed by that we also have some UART driver functions which are responsible for initializing UART and exchanging data between fingerprint sensor and microcontroller.
void serialbegin() { UCSRC = (1 << URSEL) - (1 << UCSZ0) - (1 << UCSZ1); UBRRH = (BAUD_PRESCALE >> 8); UBRRL = BAUD_PRESCALE; UCSRB=(1<
Now we have some more UART function but they are software UART. It is used for transferring saved data to the computer via serial terminal. These functions are delay-based and don’t use any type of interrupt. And for UART only tx signal will work and we have hardcoded baud rate for soft UART as 9600.
void SerialSoftWrite(char ch) { PORTD&=~(1<<7); _delay_us(104); for(int i=0;i<8;i++) { if(ch & 1) PORTD-=(1<<7); else PORTD&=~(1<<7); _delay_us(104); ch>>=1; } PORTD-=(1<<7); _delay_us(104); } void SerialSoftPrint(char *str) { while(*str) { SerialSoftWrite(*str); str++; } }
Followed by that we have functions that are responsible for displaying the RTC time in the LCD. The below given functions are used for writing attendance data to EEPROM and reading attendance data from EEPROM.
int eeprom_write(unsigned int add,unsigned char data) { while(EECR&(1<
The below function is responsible for reading fingerprint image and convert them in template and matching with already stored image and show result over LCD.
void matchFinger() { // lcdwrite(1,CMD); // lcdprint("Place Finger"); // lcdwrite(192,CMD); // _delay_ms(2000); if(!sendcmd2fp((char *)&f_detect,sizeof(f_detect))) { if(!sendcmd2fp((char *)&f_imz2ch1,sizeof(f_imz2ch1))) { if(!sendcmd2fp((char *)&f_search,sizeof(f_search))) { LEDHigh; buzzer(200); uint id= data; id<<=8; id+=data; uint score=data; score<<=8; score+=data; (void)sprintf((char *)buf1,"Id: %d",(int)id); lcdwrite(1,CMD); lcdprint((char *)buf1); saveData(id); _delay_ms(1000); lcdwrite(1,CMD); lcdprint("Attendance"); lcdwrite(192,CMD); lcdprint("Registered"); _delay_ms(2000); LEDLow; }
Followed by that we have a function that is used for enrolling a new finger and displaying the result or status on LCD. Then the below function is used for deleting stored fingerprint from the module by using id number and show status of the same.
void deleteFinger() { id=getId(); f_delete=id>>8 & 0xff; f_delete=id & 0xff; f_delete=(21+id)>>8 & 0xff; f_delete=(21+id) & 0xff; if(!sendcmd2fp(&f_delete,sizeof(f_delete))) { lcdwrite(1,CMD); sprintf((char *)buf1,"Finger ID %d ",id); lcdprint((char *)buf1); lcdwrite(192, CMD); lcdprint("Deleted Success"); } else { lcdwrite(1,CMD); lcdprint("Error"); } _delay_ms(2000); }
Below function is responsible for sending attendance data to serial terminal via soft UART pin PD7 and TTL to USB converter.
/*function to show attendence data on serial moinitor using softserial pin PD7*/ void ShowAttendance() { char buf; lcdwrite(1,CMD); lcdprint("Downloding…."); SerialSoftPrintln("Attendance Record"); SerialSoftPrintln(" "); SerialSoftPrintln("S.No ID1 ID2 Id3 ID4 ID5 "); //serialprintln("Attendance Record"); //serialprintln(" "); //serialprintln("S.No ID1 ID2 Id3 ID4 ID5"); for(int cIndex=1;cIndex<=8;cIndex++) { sprintf((char *)buf,"%d " "%d:%d:%d %d/%d/20%d " "%d:%d:%d %d/%d/20%d " "%d:%d:%d %d/%d/20%d " "%d:%d:%d %d/%d/20%d " "%d:%d:%d %d/%d/20%d ", cIndex, eeprom_read((cIndex*6)),eeprom_read((cIndex*6)+1),eeprom_read((cIndex*6)+2),eeprom_read((cIndex*6)+3),eeprom_read((cIndex*6)+4),eeprom_read((cIndex*6)+5), eeprom_read((cIndex*6)+48),eeprom_read((cIndex*6)+1+48),eeprom_read((cIndex*6)+2+48),eeprom_read((cIndex*6)+3+48),eeprom_read((cIndex*6)+4+48),eeprom_read((cIndex*6)+5+48), eeprom_read((cIndex*6)+96),eeprom_read((cIndex*6)+1+96),eeprom_read((cIndex*6)+2+96),eeprom_read((cIndex*6)+3+96),eeprom_read((cIndex*6)+4+96),eeprom_read((cIndex*6)+5+96), eeprom_read((cIndex*6)+144),eeprom_read((cIndex*6)+1+144),eeprom_read((cIndex*6)+2+144),eeprom_read((cIndex*6)+3+144),eeprom_read((cIndex*6)+4+144),eeprom_read((cIndex*6)+5+144), eeprom_read((cIndex*6)+192),eeprom_read((cIndex*6)+1+192),eeprom_read((cIndex*6)+2+192),eeprom_read((cIndex*6)+3+192),eeprom_read((cIndex*6)+4+192),eeprom_read((cIndex*6)+5+192)); SerialSoftPrintln(buf); //serialprintln(buf); } lcdwrite(192,CMD); lcdprint("Done"); _delay_ms(2000); }
Below function is used for deleting all the attendance data from the microcontroller’s EEPROM.
void DeleteRecord() { lcdwrite(1,CMD); lcdprint("Please Wait…"); for(int i=0;i<255;i++) eeprom_write(i,10); _delay_ms(2000); lcdwrite(1,CMD); lcdprint("Record Deleted"); lcdwrite(192,CMD); lcdprint("Successfully"); _delay_ms(2000); }
In the main function we will initialize all the used module and gpio pins. Finally, all-controlling event are performed in this as shown below
while(1) { RTC(); // if(match == LOW) // { matchFinger(); // } if(enrol == LOW) { buzzer(200); enrolFinger(); _delay_ms(2000); // lcdinst(); } else if(delet == LOW) { buzzer(200); getId(); deleteFinger(); _delay_ms(1000); } } return 0; }
The complete working set-up is shown in the video linked below. Hope you enjoyed the project and learnt something new. If you have any questions leave them in the comment section or use the forums for other technical questions.