Close Menu
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
Facebook X (Twitter) Instagram
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
How To Electronics
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
How To Electronics
Home » RFID Based Attendance System using Arduino, RTC & LCD Display
Arduino Projects

RFID Based Attendance System using Arduino, RTC & LCD Display

Mamtaz AlamBy Mamtaz AlamUpdated:February 19, 20233 Comments4 Mins Read
Share Facebook Twitter LinkedIn Telegram Reddit WhatsApp
RFID Based Attendance System using Arduino
Share
Facebook Twitter LinkedIn Pinterest Email Reddit Telegram WhatsApp

Overview

In this project, we have designed RFID Based Attendance System using Arduino. EM-18 RFID Reader is a very simple yet effective module. It is an RFID module and is used for scanning RFID cards. It’s a new technology and is expanding day by day. Nowadays it is extensively used in offices where employees are issued an RFID card and their attendance is marked when they touch their card to the RFID reader. We have seen it in many movies that when someone places one’s card over some machine then the door opens or closes. In short, RFID Technology a new emerging technology that is quite useful.

In this project, we have interfaced RFID EM-18 Module with Arduino, RTC Module DS3231, and 20*4 LCD display. RFID Based Attendance System is a wonderful project for final year electronics & electrical students.

Some of the other versions of the RFID Attendance System is given below. You can follow these links too:
1. RFID RC522 Based Attendance System Using Arduino with Data Logger

You can also check the advanced version of the same project:
IoT Based RFID Attendance System Using Arduino ESP8266 & Adafruit.io


Components Required:

To design RFID Based Attendance System using Arduino, we require the following components:

S.N.Components NameQuantityPurchase Links
1Arduino UNO Board1Amazon | AliExpress
2EM-18 RFID Module1Amazon | AliExpress
320X4 LCD Display1Amazon | AliExpress
4Potentiometer 10K 1Amazon | AliExpress
5125Khz RFID Cards1Amazon | AliExpress
6RTC Module DS32311Amazon | AliExpress
7Buzzer 5V1Amazon | AliExpress
8LED 5mm Any Color2Amazon | AliExpress
9Push Button Switch4Amazon | AliExpress
10Connecting Wires20Amazon | AliExpress
11Breadboard1Amazon | AliExpress

RFID Based Attendance System using Arduino


Block Diagram:

This is the block diagram of our project RFID Based Attendance System using Arduino, RTC & LCD Display. Here Arduino UNO acts as a central processor for controlling all other components as input/output unit.

We have used the 5-volt power supply to power all the components used in this project. RFID Reader module is interfaced with Arduino to read the data from the RFID card/tag. Real-Time Clock (RTC) Module DS3231 is used to display the current time and date on the LCD as well as arriving and leaving time of the users. LCD displays every output like current date & time, information of users, no of staff present or absent, and menu options from 1 to 4.

Red & Green LED is used for the indication of arriving and leaving. Similarly, the buzzer produces sound whenever the interrupt is detected. The very important part of this block diagram is the EEPROM part. EEPROM stands for Electrically Erasable Programmable Read-Only Memory. It stores the data whenever the users swap the card over the RFID reader.



Circuit Diagram: RFID Based Attendance System using Arduino & LCD Display

RFID Based Attendance System using Arduino


Working of the RFID System

Functioning Principle of RFID Device is explained below:

• RFID (radio frequency identification) is a technique facilitating the identification of any product or item without the requirement of any line of sight between transponder and reader.

• RFID Structure is continuously composed of 2 main hardware components. The transponder is located on the product to be scanned and the reader can be either just a reader or a read & write device, depending upon the system design, technology employed, and the requirement. The RFID reader characteristically comprises a radio frequency module, a controlling unit for configurations, a monitor, and an antenna to investigate the RFID tags. In addition, a number of RFID readers are in-built with an extra interface allowing them to forward the data received to another system (control system or PC).

• RFID Tag – The actual data-carrying tool of an RFID structure, in general, comprise of an antenna (coupling element) and an electronic microchip.


Working of RFID Based Attendance System using Arduino:

In this project, we have designed an RFID based attendance system using Arduino. First, we store a set of RFID card data in our system. You can store any number of RFID data, but we have only stored 10 RFID tag numbers.

When the person with the correct RFID card comes & swipes his RFID card, his arrival time will be stored on the system using the EEPROM command displaying a “welcome” message on LCD. When the same person swipes his RFID card for the second time, the system will save it as his leaving time displaying “See You”. The interval between first card swap and second card swap is the total working hours that are stored as data.




Source Code/Program:

Before uploading the code to the Arduino board, edit the program else you won’t be able to get the desired result. Make sure to replace the RFID number with that present in your RFID tag. Also, change the timetable, and date in order to get the present time, date & day. Change the admin name and assign a particular admin name so that the admin can clear data.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
#include <LiquidCrystal.h>
#include <EEPROM.h>
#include "Wire.h"
 
#define I2C_ADDRESS 0x68
 
LiquidCrystal lcd(13,12,11,10,9,8);
 
#define SW1 A0
#define SW2 A1
#define SW3 A2
#define SW4 A3
 
int buzzer=6,red_led=5,green_led=4;
 
 
char* rfid_id[]={"1900E54250EE","1900E561BC21","18003D312034","14000AD871B7","000003D4EE39","02001047EABF","0200108156C5","0200108040D2","18003D858929","020010811182"};
char* names[]={"LOKESH","NANCY","ALEX","KEVIN","JOJO","PRINCE","TRACY","JIMMY","DANIEL","LAURA"};
int presence[10];
 
long pm=0;
int i=0,j=0, presentNum=0;
 
 
int decToBcd(int val){
  return( (val/10*16) + (val%10) );
}
 
int bcdToDec(int val){
  return( (val/16*10) + (val%16) );
}
 
int second, minute, hour, dayOfWeek, dayOfMonth, month, year;
int S=0, M=0, H=0,DOW=0, DOM=0, MONTH=0, YEAR=0;
int Min=0, Hour=0, totMin=0,totHour=0;
 
 
void setup() {  
              
  Wire.begin();
  Serial.begin(9600);
  lcd.begin(20,4);
  lcd.clear();
  setTime(00,27,15,03,22,05,18);
 
  pinMode(buzzer,OUTPUT);
  pinMode(red_led,OUTPUT);
  pinMode(green_led,OUTPUT);
  pinMode(SW1,INPUT_PULLUP);
  pinMode(SW2,INPUT_PULLUP);
  pinMode(SW3,INPUT_PULLUP);
  pinMode(SW4,INPUT_PULLUP);
  
  presentNum=EEPROM.read(1000);
  for(i=0;i<10;i++)
  presence[i]=EEPROM.read(i);
}
void setTime(int second, int minute, int hour, int dayOfWeek, int dayOfMonth, int month, int year){
  
  Wire.beginTransmission(I2C_ADDRESS);
  Wire.write(0);
  Wire.write(decToBcd(second));
  Wire.write(decToBcd(minute));
  Wire.write(decToBcd(hour));
  Wire.write(decToBcd(dayOfWeek));
  Wire.write(decToBcd(dayOfMonth));
  Wire.write(decToBcd(month));
  Wire.write(decToBcd(year));
  Wire.endTransmission();
}
void readTime(int *second,int *minute,int *hour,int *dayOfWeek,int *dayOfMonth,int *month,int *year){
  
  Wire.beginTransmission(I2C_ADDRESS);Wire.write(0);
  Wire.endTransmission();Wire.requestFrom(I2C_ADDRESS, 7);
  *second = bcdToDec(Wire.read() & 0x7f);
  *minute = bcdToDec(Wire.read());
  *hour = bcdToDec(Wire.read() & 0x3f);
  *dayOfWeek = bcdToDec(Wire.read());
  *dayOfMonth = bcdToDec(Wire.read());
  *month = bcdToDec(Wire.read());
  *year = bcdToDec(Wire.read());
}
void displayTime(){
  
  int HOUR;
  
  readTime(&second, &minute, &hour, &dayOfWeek, &dayOfMonth, &month,&year);
  if(hour>12)
  HOUR=hour-12;
  else
  HOUR=hour;
  if(j<2){lcd.clear();j++;}
 
  lcd.setCursor(1,0);
  if (HOUR<10)
  lcd.print("0");
 
  lcd.print(HOUR);lcd.print(":");
 
  if (minute<10)
  lcd.print("0");
  lcd.print(minute);
  lcd.print(":");
 
  if (second<10)
  lcd.print("0");
  lcd.print(second);
 
  lcd.setCursor(4,1);
  if(hour>12)
  lcd.print("PM");
  else
  lcd.print("AM");
  
  lcd.setCursor(12,0);
  if (dayOfMonth<10)
  lcd.print("0");
  lcd.print(dayOfMonth);
  lcd.print("/");
  if (month<10)
  lcd.print("0");
  lcd.print(month);
  lcd.print("/");
  lcd.print(year);
  lcd.print(" ");
  lcd.setCursor(11,1);
  
  switch(dayOfWeek){
  case 1: lcd.print(" Sunday   ");break;
  case 2: lcd.print(" Monday   ");break;
  case 3: lcd.print(" Tuesday  ");break;
  case 4: lcd.print("Wednesday ");break;
  case 5: lcd.print(" Thursday ");break;
  case 6: lcd.print(" Friday   ");break;
  case 7: lcd.print(" Saturday ");break;}
  
}
 
void conTime(int a, int b, int c )
{
 
int Hr;  
int h,  m,  s;
h=EEPROM.read(a);
m=EEPROM.read(b);
s=EEPROM.read(c);
  if(h>12)
  Hr=h-12;
  else
  Hr=h;
  lcd.print(" ");
  if (Hr<10)
  lcd.print("0");
 
  lcd.print(Hr);lcd.print(":");
 
  if (m<10)
  lcd.print("0");
  lcd.print(m);
  lcd.print(":");
 
  if (s<10)
  lcd.print("0");
  lcd.print(s);
 
  if(h>12)
  lcd.print(" PM");
  else
  lcd.print(" AM");
  
}
 
 
 
 
 
 
void loop()
{
  int i;
  char response[12];
  int ch;
  
  
top:
 
if(hour==8 && minute==30 && second==0){
  lcd.clear();
  lcd.setCursor(2,0);
  lcd.print("    Clearing");
  lcd.setCursor(2,1);
  lcd.print("Yesterday's data");
  
  
    
  for(i=0;i<10;i++){
  lcd.setCursor(4,3);  
  lcd.print("           ");
  delay(1000);
  lcd.setCursor(4,3);
  lcd.print("Please Wait");
  delay(1000);}
  lcd.clear();
  lcd.setCursor(7,1);
  lcd.print("CLEARED");
  delay(1000);
  EEPROM.write(1000,0);
  for(i=0;i<500;i++)
  EEPROM.write(i,0);
  presentNum=EEPROM.read(1000);
  for(i=0;i<10;i++)
  presence[i]=EEPROM.read(i);
  j=0;
}
 
 
 
 
 
  
  displayTime();
 
  lcd.setCursor(0,3);
  lcd.print("  Press 1 for menu  ");
  
  
  
  
  
  
  if(digitalRead(SW1)==0)
  {
     lcd.clear();lcd.setCursor(0,0);lcd.print(" 1. View attendance ");
     lcd.setCursor(0, 1); lcd.print(" 2. View all");
     lcd.setCursor(0, 2); lcd.print(" 3. Clear all");
     lcd.setCursor(0, 3); lcd.print(" 4. Go Back");
     delay(500);
     while(digitalRead(SW1)==HIGH && digitalRead(SW2)==HIGH && digitalRead(SW3)==HIGH && digitalRead(SW4)==HIGH);
 
      if(digitalRead(SW1)== LOW)//View attendance
    {
top1:lcd.clear(); lcd.setCursor(0,0); lcd.print("Total staffs   - "); lcd.print(10);
      presentNum=EEPROM.read(1000);
      lcd.setCursor(0,1); lcd.print("Staffs present - "); lcd.print(presentNum);
      lcd.setCursor(0,3); lcd.print("1.Detials");
      lcd.setCursor(11,3); lcd.print("4.Go Back");
      delay(500);
      while(digitalRead(SW1)==HIGH && digitalRead(SW4)==HIGH);
      
      if(digitalRead(SW4)==LOW){
      lcd.clear(); goto top;}
      
    
     if(digitalRead(SW1)==LOW){
      delay(500);
      for(i=0;i<10;i++)
      presence[i]=EEPROM.read(i);
      
      if(presentNum==0){
        lcd.clear();
        lcd.setCursor(2,1);
        lcd.print("No One Is Present");
        delay(2000);
      }
      lcd.clear();
      if(presence[0]==1 || presence[0]==2)
      {
        lcd.clear();
        lcd.setCursor(7,0);
        lcd.print(names[0]);
        
        lcd.setCursor(0,1);
        lcd.print("Arrive -");
        conTime(300,301,302);
        lcd.setCursor(0,2);
        lcd.print("Depart -");
        if(presence[0]==2)
        conTime(303,304,305);
        lcd.setCursor(0,3);
        lcd.print("1.Next");
        lcd.setCursor(11,3);
        lcd.print("4.Go Back");
        delay(500);
     while(digitalRead(SW1)==HIGH && digitalRead(SW4)==HIGH);
      
      if(digitalRead(SW4)==LOW){
      lcd.clear();
      goto top;}    
      }
     if(presence[1]==1  || presence[1]==2)
      {
        lcd.clear();
        lcd.setCursor(7,0);
        lcd.print(names[1]);
        
        lcd.setCursor(0,1);
        lcd.print("Arrive -");
        conTime(310,311,312);
        lcd.setCursor(0,2);
        lcd.print("Depart -");
        if(presence[1]==2)
        conTime(313,314,315);
        lcd.setCursor(0,3);
        lcd.print("1.Next");
        lcd.setCursor(11,3);
        lcd.print("4.Go Back");
        delay(500);
     while(digitalRead(SW1)==HIGH && digitalRead(SW4)==HIGH);
      
      if(digitalRead(SW4)==LOW){
      lcd.clear();
      goto top;}    
      }
      if(presence[2]==1 || presence[2]==2)
      {
        lcd.clear();
        lcd.setCursor(7,0);
        lcd.print(names[2]);
        
        lcd.setCursor(0,1);
        lcd.print("Arrive -");
        conTime(320,321,322);
        lcd.setCursor(0,2);
        lcd.print("Depart -");
       if(presence[2]==2)
        conTime(323,324,325);
        lcd.setCursor(0,3);
        lcd.print("1.Next");
        lcd.setCursor(11,3);
        lcd.print("4.Go Back");
        delay(500);
     while(digitalRead(SW1)==HIGH && digitalRead(SW4)==HIGH);
      
      if(digitalRead(SW4)==LOW){
      lcd.clear();
      goto top;}    
      }
      
      if(presence[3]==1 || presence[3]==2)
      {
        lcd.clear();
        lcd.setCursor(7,0);
        lcd.print(names[3]);
        
        lcd.setCursor(0,1);
        lcd.print("Arrive -");
        conTime(330,331,332);
        lcd.setCursor(0,2);
        lcd.print("Depart -");
        if(presence[3]==2)
        conTime(333,334,335);
        lcd.setCursor(0,3);
        lcd.print("1.Next");
        lcd.setCursor(11,3);
        lcd.print("4.Go Back");
        delay(500);
     while(digitalRead(SW1)==HIGH && digitalRead(SW4)==HIGH);
      
      if(digitalRead(SW4)==LOW){
      lcd.clear();
      goto top;}    
      }
      if(presence[4]==1 || presence[4]==2)
      {
        lcd.clear();
        lcd.setCursor(7,0);
        lcd.print(names[4]);
        
        lcd.setCursor(0,1);
        lcd.print("Arrive -");
        conTime(340,341,342);
        lcd.setCursor(0,2);
        lcd.print("Depart -");
        if(presence[4]==2)
        conTime(343,344,345);
        lcd.setCursor(0,3);
        lcd.print("1.Next");
        lcd.setCursor(11,3);
        lcd.print("4.Go Back");
        delay(500);
     while(digitalRead(SW1)==HIGH && digitalRead(SW4)==HIGH);
      
      if(digitalRead(SW4)==LOW){
      lcd.clear();
      goto top;}    
      }
 
 
     if(presence[5]==1 || presence[5]==2)
      {
        lcd.clear();
        lcd.setCursor(7,0);
        lcd.print(names[5]);
        
        lcd.setCursor(0,1);
        lcd.print("Arrive -");
        conTime(350,351,352);
        lcd.setCursor(0,2);
        lcd.print("Depart -");
        if(presence[5]==2)
        conTime(353,354,355);
        lcd.setCursor(0,3);
        lcd.print("1.Next");
        lcd.setCursor(11,3);
        lcd.print("4.Go Back");
        delay(500);
     while(digitalRead(SW1)==HIGH && digitalRead(SW4)==HIGH);
      
      if(digitalRead(SW4)==LOW){
      lcd.clear();
      goto top;}    
      }
 
      if(presence[6]==1 || presence[6]==2)
      {
        lcd.clear();
        lcd.setCursor(5,0);
        lcd.print(names[6]);
        
        lcd.setCursor(0,1);
        lcd.print("Arrive -");
        conTime(360,361,362);
        lcd.setCursor(0,2);
        lcd.print("Depart -");
        if(presence[6]==2)
        conTime(363,364,365);
        lcd.setCursor(0,3);
        lcd.print("1.Next");
        lcd.setCursor(11,3);
        lcd.print("4.Go Back");
        delay(500);
     while(digitalRead(SW1)==HIGH && digitalRead(SW4)==HIGH);
      
      if(digitalRead(SW4)==LOW){
      lcd.clear();
      goto top;}    
      }
 
 
      if(presence[7]==1 || presence[7]==2)
      {
        lcd.clear();
        lcd.setCursor(7,0);
        lcd.print(names[7]);
        
        lcd.setCursor(0,1);
        lcd.print("Arrive -");
        conTime(370,371,372);
        lcd.setCursor(0,2);
        lcd.print("Depart -");
        if(presence[7]==2)
        conTime(373,374,375);
        lcd.setCursor(0,3);
        lcd.print("1.Next");
        lcd.setCursor(11,3);
        lcd.print("4.Go Back");
        delay(500);
     while(digitalRead(SW1)==HIGH && digitalRead(SW4)==HIGH);
      
      if(digitalRead(SW4)==LOW){
      lcd.clear();
      goto top;}    
      }
 
 
      if(presence[8]==1 || presence[8]==2)
      {
        lcd.clear();
        lcd.setCursor(7,0);
        lcd.print(names[8]);
        
        lcd.setCursor(0,1);
        lcd.print("Arrive -");
        conTime(380,381,382);
        lcd.setCursor(0,2);
        lcd.print("Depart -");
        if(presence[8]==2)
        conTime(383,384,385);
        lcd.setCursor(0,3);
        lcd.print("1.Next");
        lcd.setCursor(11,3);
        lcd.print("4.Go Back");
        delay(500);
     while(digitalRead(SW1)==HIGH && digitalRead(SW4)==HIGH);
      
      if(digitalRead(SW4)==LOW){
      lcd.clear();
      goto top;}    
      }
 
 
      if(presence[9]==1 || presence[9]==2)
      {
        lcd.clear();
        lcd.setCursor(7,0);
        lcd.print(names[9]);
        
        lcd.setCursor(0,1);
        lcd.print("Arrive -");
        conTime(390,391,392);
        lcd.setCursor(0,2);
        lcd.print("Depart -");
        if(presence[9]==2)
        conTime(393,394,395);
        lcd.setCursor(0,3);
        lcd.print("1.Next");
        lcd.setCursor(11,3);
        lcd.print("4.Go Back");
        delay(500);
     while(digitalRead(SW1)==HIGH && digitalRead(SW4)==HIGH);
      
      if(digitalRead(SW4)==LOW){
      lcd.clear();
      goto top;}    
      }
      delay(500);
      lcd.clear();
      goto top1;
    }
  
    }
 
  
  
      if(digitalRead(SW4)==LOW){
      lcd.clear();
      goto top;}
 
     if(digitalRead(SW2)==LOW){
 
 
       lcd.clear();
       lcd.setCursor(3,1);
       lcd.print(" Details From");
       lcd.setCursor(5,2);
       DOM=EEPROM.read(1010);
       if (DOM<10)
       lcd.print("0");
       lcd.print(DOM);
       lcd.print("/");
       MONTH=EEPROM.read(1011);
       if (MONTH<10)
       lcd.print("0");
       lcd.print(MONTH);
       lcd.print("/");
       YEAR=EEPROM.read(1012);
       lcd.print(YEAR);
       delay(3000);
 
 
 
      
      lcd.clear();lcd.setCursor(7,0); lcd.print(names[0]);
      lcd.setCursor(0,1); lcd.print("Status- ");
      if(presence[0]==0) lcd.print("Absent");
      if(presence[0]==1) lcd.print("Present");
      if(presence[0]==2) lcd.print("Left");
      lcd.setCursor(0,2);lcd.print("Total Hours- ");lcd.print(EEPROM.read(900));lcd.print(":");lcd.print(EEPROM.read(901));
        lcd.setCursor(0,3);
        lcd.print("1.Next");
        lcd.setCursor(11,3);
        lcd.print("4.Go Back");
        delay(500);
     while(digitalRead(SW1)==HIGH && digitalRead(SW4)==HIGH);
      
      if(digitalRead(SW4)==LOW){
      lcd.clear();
      goto top;}  
 
 
      lcd.clear();lcd.setCursor(7,0); lcd.print(names[1]);
      lcd.setCursor(0,1); lcd.print("Status- ");
      if(presence[1]==0) lcd.print("Absent");
      if(presence[1]==1) lcd.print("Present");
      if(presence[1]==2) lcd.print("Left");
      lcd.setCursor(0,2);lcd.print("Total Hours- ");lcd.print(EEPROM.read(910));lcd.print(":");lcd.print(EEPROM.read(911));
        lcd.setCursor(0,3);
        lcd.print("1.Next");
        lcd.setCursor(11,3);
        lcd.print("4.Go Back");
        delay(500);
     while(digitalRead(SW1)==HIGH && digitalRead(SW4)==HIGH);
      
      if(digitalRead(SW4)==LOW){
      lcd.clear();
      goto top;}  
 
 
 
 
 
 
      lcd.clear();lcd.setCursor(7,0); lcd.print(names[2]);
      lcd.setCursor(0,1); lcd.print("Status- ");
      if(presence[2]==0) lcd.print("Absent");
      if(presence[2]==1) lcd.print("Present");
      if(presence[2]==2) lcd.print("Left");
      lcd.setCursor(0,2);lcd.print("Total Hours- ");lcd.print(EEPROM.read(920));lcd.print(":");lcd.print(EEPROM.read(921));
        lcd.setCursor(0,3);
        lcd.print("1.Next");
        lcd.setCursor(11,3);
        lcd.print("4.Go Back");
        delay(500);
     while(digitalRead(SW1)==HIGH && digitalRead(SW4)==HIGH);
      
      if(digitalRead(SW4)==LOW){
      lcd.clear();
      goto top;}  
 
      lcd.clear();lcd.setCursor(7,0); lcd.print(names[3]);
      lcd.setCursor(0,1); lcd.print("Status- ");
      if(presence[3]==0) lcd.print("Absent");
      if(presence[3]==1) lcd.print("Present");
      if(presence[3]==2) lcd.print("Left");
      lcd.setCursor(0,2);lcd.print("Total Hours- ");lcd.print(EEPROM.read(930));lcd.print(":");lcd.print(EEPROM.read(931));
        lcd.setCursor(0,3);
        lcd.print("1.Next");
        lcd.setCursor(11,3);
        lcd.print("4.Go Back");
        delay(500);
     while(digitalRead(SW1)==HIGH && digitalRead(SW4)==HIGH);
      
      if(digitalRead(SW4)==LOW){
      lcd.clear();
      goto top;}  
 
      lcd.clear();lcd.setCursor(7,0); lcd.print(names[4]);
      lcd.setCursor(0,1); lcd.print("Status- ");
      if(presence[4]==0) lcd.print("Absent");
      if(presence[4]==1) lcd.print("Present");
      if(presence[4]==2) lcd.print("Left");
      lcd.setCursor(0,2);lcd.print("Total Hours- ");lcd.print(EEPROM.read(940));lcd.print(":");lcd.print(EEPROM.read(941));
        lcd.setCursor(0,3);
        lcd.print("1.Next");
        lcd.setCursor(11,3);
        lcd.print("4.Go Back");
        delay(500);
     while(digitalRead(SW1)==HIGH && digitalRead(SW4)==HIGH);
      
      if(digitalRead(SW4)==LOW){
      lcd.clear();
      goto top;}  
 
      lcd.clear();lcd.setCursor(7,0); lcd.print(names[5]);
      lcd.setCursor(0,1); lcd.print("Status- ");
      if(presence[5]==0) lcd.print("Absent");
      if(presence[5]==1) lcd.print("Present");
      if(presence[5]==2) lcd.print("Left");
      lcd.setCursor(0,2);lcd.print("Total Hours- ");lcd.print(EEPROM.read(950));lcd.print(":");lcd.print(EEPROM.read(951));
        lcd.setCursor(0,3);
        lcd.print("1.Next");
        lcd.setCursor(11,3);
        lcd.print("4.Go Back");
        delay(500);
     while(digitalRead(SW1)==HIGH && digitalRead(SW4)==HIGH);
      
      if(digitalRead(SW4)==LOW){
      lcd.clear();
      goto top;}  
 
      lcd.clear();lcd.setCursor(5,0); lcd.print(names[6]);
      lcd.setCursor(0,1); lcd.print("Status- ");
      if(presence[6]==0) lcd.print("Absent");
      if(presence[6]==1) lcd.print("Present");
      if(presence[6]==2) lcd.print("Left");
      lcd.setCursor(0,2);lcd.print("Total Hours- ");lcd.print(EEPROM.read(960));lcd.print(":");lcd.print(EEPROM.read(961));
        lcd.setCursor(0,3);
        lcd.print("1.Next");
        lcd.setCursor(11,3);
        lcd.print("4.Go Back");
        delay(500);
     while(digitalRead(SW1)==HIGH && digitalRead(SW4)==HIGH);
      
      if(digitalRead(SW4)==LOW){
      lcd.clear();
      goto top;}  
 
      lcd.clear();lcd.setCursor(7,0); lcd.print(names[7]);
      lcd.setCursor(0,1); lcd.print("Status- ");
      if(presence[7]==0) lcd.print("Absent");
      if(presence[7]==1) lcd.print("Present");
      if(presence[7]==2) lcd.print("Left");
      lcd.setCursor(0,2);lcd.print("Total Hours- ");lcd.print(EEPROM.read(970));lcd.print(":");lcd.print(EEPROM.read(971));
        lcd.setCursor(0,3);
        lcd.print("1.Next");
        lcd.setCursor(11,3);
        lcd.print("4.Go Back");
        delay(500);
     while(digitalRead(SW1)==HIGH && digitalRead(SW4)==HIGH);
      
      if(digitalRead(SW4)==LOW){
      lcd.clear();
      goto top;}  
 
      lcd.clear();lcd.setCursor(7,0); lcd.print(names[8]);
      lcd.setCursor(0,1); lcd.print("Status- ");
      if(presence[8]==0) lcd.print("Absent");
      if(presence[8]==1) lcd.print("Present");
      if(presence[8]==2) lcd.print("Left");
      lcd.setCursor(0,2);lcd.print("Total Hours- ");lcd.print(EEPROM.read(980));lcd.print(":");lcd.print(EEPROM.read(981));
        lcd.setCursor(0,3);
        lcd.print("1.Next");
        lcd.setCursor(11,3);
        lcd.print("4.Go Back");
        delay(500);
     while(digitalRead(SW1)==HIGH && digitalRead(SW4)==HIGH);
      
      if(digitalRead(SW4)==LOW){
      lcd.clear();
      goto top;}  
 
      lcd.clear();lcd.setCursor(7,0); lcd.print(names[9]);
      lcd.setCursor(0,1); lcd.print("Status- ");
      if(presence[9]==0) lcd.print("Absent");
      if(presence[9]==1) lcd.print("Present");
      if(presence[9]==2) lcd.print("Left");
      lcd.setCursor(0,2);lcd.print("Total Hours- ");lcd.print(EEPROM.read(990));lcd.print(":");lcd.print(EEPROM.read(991));
        lcd.setCursor(0,3);
        lcd.print("1.Next");
        lcd.setCursor(11,3);
        lcd.print("4.Go Back");
        delay(500);
     while(digitalRead(SW1)==HIGH && digitalRead(SW4)==HIGH);
     delay(500);
      lcd.clear();
      goto top;
 
 
 
 
 
      
    
      }
 
 
 
 
    
     if(digitalRead(SW3)== LOW)
     {
       lcd.clear();
       lcd.setCursor(5,1);
       lcd.print("SHOW ADMIN ID");
       lcd.setCursor(11,3);
       lcd.print("4.Go Back");
      
      
       while(!Serial.available()){
        if(digitalRead(SW4)==LOW){
      lcd.clear();
      goto top;}
       }
 
 
      
       if(Serial.available()>0)
      {
        i=0;
        do
        {
            while(Serial.available()<=0);
            response[i]=Serial.read();
            Serial.print(response[i]);
            i++;
        }while(i<12);
        response[i]='\0';
      
        
        
        if(strcmp(response,rfid_id[4])==0)//User1 rfid received
        {
          lcd.clear();
          lcd.setCursor(0, 0);
          lcd.print("   ACCESS GRANTED   ");
          lcd.setCursor(0,1);
          lcd.print(" ADMIN - JOJO JOSON");
          analogWrite(buzzer,50); digitalWrite(green_led,HIGH); delay(1000);
          digitalWrite(buzzer,LOW); digitalWrite(green_led,LOW);delay(3000);
          lcd.setCursor(0,3);
          lcd.print("1.Clear");
          lcd.setCursor(11,3);
          lcd.print("4.Go Back");
          delay(500);
          while(digitalRead(SW1)==HIGH && digitalRead(SW4)==HIGH);
      
          if(digitalRead(SW4)==LOW){
          delay(500);
          lcd.clear();
          goto top;}
      
          
          
       if(digitalRead(SW1)==LOW){
       lcd.clear();
       lcd.setCursor(0,0);
       lcd.print("     ALL CLEARED! ");
       analogWrite(buzzer,50);
       delay(1500);
       digitalWrite(buzzer,LOW);
       delay(1500);
       //Clear attendance
       lcd.setCursor(0,1);
       lcd.print("New Date - ");
       lcd.setCursor(12,1);
       if (dayOfMonth<10)
       lcd.print("0");
       lcd.print(dayOfMonth);
       lcd.print("/");
       if (month<10)
       lcd.print("0");
       lcd.print(month);
       lcd.print("/");
       lcd.print(year);
       lcd.print(" ");
       for(i=0;i<1023;i++)
       EEPROM.write(i,0);
      
      
       EEPROM.write(1010,dayOfMonth);      
       EEPROM.write(1011,month);      
       EEPROM.write(1012,year);
      
            
    
        for(i=0;i<10;i++)
        presence[i]=EEPROM.read(i);
    
      
        presentNum=EEPROM.read(1000);
      
          
       lcd.setCursor(0,3);
       lcd.setCursor(11,3);
       lcd.print("4.Go Back");
       delay(500);
      while( digitalRead(SW4)==HIGH);
      
      if(digitalRead(SW4)==LOW){
      lcd.clear();
      goto top;}
      }}
 
      else
        {
          lcd.clear();
          lcd.setCursor(0,1);
          lcd.print("   ACCESS DENIED   ");
          lcd.setCursor(0, 2);
          lcd.print("     INVALID ID    ");
            
          analogWrite(buzzer,50);
          digitalWrite(red_led,HIGH);
          delay(1000);
          digitalWrite(buzzer,LOW);
          digitalWrite(red_led,LOW);
        lcd.setCursor(0,3);
       lcd.setCursor(11,3);
       lcd.print("4.Go Back");
       delay(500);
      while( digitalRead(SW4)==HIGH);
      
      if(digitalRead(SW4)==LOW){
      lcd.clear();
      goto top;}
          
          
        }  
      }
     }  
  }
 
    
  
    
    if(Serial.available()>0)
    {
        i=0;
        do
        {
            while(Serial.available()<=0);
            response[i]=Serial.read();
            Serial.print(response[i]);
            i++;
        }while(i<12);
        response[i]='\0';
 
        
        if(strcmp(response,rfid_id[0])==0)//User1 rfid received
        {
         if(presence[0]==0 || presence[0]==2){
          presence[0]=1;
          lcd.clear(); lcd.setCursor(7,0); lcd.print("WELCOME");
          lcd.setCursor(7, 2); lcd.print(names[0]); lcd.print(" !");
          analogWrite(buzzer,50); digitalWrite(green_led,HIGH); delay(1000);
          digitalWrite(buzzer,LOW); digitalWrite(green_led,LOW);delay(3000);
          EEPROM.write(300,hour);  EEPROM.write(301,minute);  EEPROM.write(302,second);
          presentNum++; EEPROM.write(1000,presentNum);lcd.clear();}
 
         else{
         presence[0]=2;
         lcd.clear(); lcd.setCursor(7,0); lcd.print("SEE YOU");
         lcd.setCursor(7, 2); lcd.print(names[0]); lcd.print(" !");
          analogWrite(buzzer,50); digitalWrite(green_led,HIGH); delay(1000);
          digitalWrite(buzzer,LOW); digitalWrite(green_led,LOW);delay(3000);
          EEPROM.write(303,hour); EEPROM.write(304,minute);  EEPROM.write(305,second);
          presentNum--;  EEPROM.write(1000,presentNum);
          H=EEPROM.read(300);
          M=EEPROM.read(301);
          Hour=hour-H;
          if(minute<M){ Hour--;
          Min=(60-(M-minute)); }
          if(minute>=M){ Min=minute-M; }
          totHour=EEPROM.read(900); totMin=EEPROM.read(901);totMin=totMin+Min;  
          if(totMin>=60){Hour++;totMin=totMin-60;}
          totHour=totHour+Hour;
          EEPROM.write(900,totHour);
          EEPROM.write(901,totMin);lcd.clear();}
          
        }
 
 
        
        else if(strcmp(response,rfid_id[1])==0)//User1 rfid received
        {
         if(presence[1]==0|| presence[1]==2){
          presence[1]=1;
          lcd.clear(); lcd.setCursor(7,0); lcd.print("WELCOME");
          lcd.setCursor(7, 2); lcd.print(names[1]); lcd.print(" !");
          analogWrite(buzzer,50); digitalWrite(green_led,HIGH); delay(1000);
          digitalWrite(buzzer,LOW); digitalWrite(green_led,LOW);delay(3000);
          EEPROM.write(310,hour);  EEPROM.write(311,minute);  EEPROM.write(312,second);
          presentNum++; EEPROM.write(1000,presentNum);lcd.clear();}
 
         else{
         presence[1]=2;
         lcd.clear(); lcd.setCursor(7,0); lcd.print("SEE YOU");
         lcd.setCursor(7, 2); lcd.print(names[1]); lcd.print(" !");
          analogWrite(buzzer,50); digitalWrite(green_led,HIGH); delay(1000);
          digitalWrite(buzzer,LOW); digitalWrite(green_led,LOW);delay(3000);
          EEPROM.write(313,hour); EEPROM.write(314,minute);  EEPROM.write(315,second);
          presentNum--;  EEPROM.write(1000,presentNum);lcd.clear();
          H=EEPROM.read(310);
          M=EEPROM.read(311);
          Hour=hour-H;
          if(minute<M){ Hour--;
          Min=(60-(M-minute)); }
          if(minute>=M){ Min=minute-M; }
          totHour=EEPROM.read(910); totMin=EEPROM.read(911);totMin=totMin+Min;  
          if(totMin>=60){Hour++;totMin=totMin-60;}
          totHour=totHour+Hour;
          EEPROM.write(910,totHour);
          EEPROM.write(911,totMin);lcd.clear();}
        }
       else if(strcmp(response,rfid_id[2])==0)//User1 rfid received
        {
         if(presence[2]==0 || presence[2]==2){
          presence[2]=1;
          lcd.clear(); lcd.setCursor(7,0); lcd.print("WELCOME");
          lcd.setCursor(7, 2); lcd.print(names[2]); lcd.print(" !");
          analogWrite(buzzer,50); digitalWrite(green_led,HIGH); delay(1000);
          digitalWrite(buzzer,LOW); digitalWrite(green_led,LOW);delay(3000);
          EEPROM.write(320,hour);  EEPROM.write(321,minute);  EEPROM.write(322,second);
          presentNum++; EEPROM.write(1000,presentNum);lcd.clear();}
 
         else{
         presence[2]=2;
         lcd.clear(); lcd.setCursor(7,0); lcd.print("SEE YOU");
         lcd.setCursor(7, 2); lcd.print(names[2]); lcd.print(" !");
          analogWrite(buzzer,50); digitalWrite(green_led,HIGH); delay(1000);
          digitalWrite(buzzer,LOW); digitalWrite(green_led,LOW);delay(3000);
          EEPROM.write(323,hour); EEPROM.write(324,minute);  EEPROM.write(325,second);
          presentNum--;  EEPROM.write(1000,presentNum);
          H=EEPROM.read(320);
          M=EEPROM.read(321);
          Hour=hour-H;
          if(minute<M){ Hour--;
          Min=(60-(M-minute)); }
          if(minute>=M){ Min=minute-M; }
          totHour=EEPROM.read(920); totMin=EEPROM.read(921);totMin=totMin+Min;  
          if(totMin>=60){Hour++;totMin=totMin-60;}
          totHour=totHour+Hour;
          EEPROM.write(920,totHour);
          EEPROM.write(921,totMin);lcd.clear();}  
        }
         else if(strcmp(response,rfid_id[3])==0)//User1 rfid received
        {
         if(presence[3]==0 || presence[3]==2){
          presence[3]=1;
          lcd.clear(); lcd.setCursor(7,0); lcd.print("WELCOME");
          lcd.setCursor(7, 2); lcd.print(names[3]); lcd.print(" !");
          analogWrite(buzzer,50); digitalWrite(green_led,HIGH); delay(1000);
          digitalWrite(buzzer,LOW); digitalWrite(green_led,LOW);delay(3000);
          EEPROM.write(330,hour);  EEPROM.write(331,minute);  EEPROM.write(332,second);
          presentNum++; EEPROM.write(1000,presentNum);lcd.clear();}
 
         else{
         presence[3]=2;
         lcd.clear(); lcd.setCursor(7,0); lcd.print("SEE YOU");
         lcd.setCursor(7, 2); lcd.print(names[3]); lcd.print(" !");
          analogWrite(buzzer,50); digitalWrite(green_led,HIGH); delay(1000);
          digitalWrite(buzzer,LOW); digitalWrite(green_led,LOW);delay(3000);
          EEPROM.write(333,hour); EEPROM.write(334,minute);  EEPROM.write(335,second);
          presentNum--;  EEPROM.write(1000,presentNum);
          H=EEPROM.read(330);
          M=EEPROM.read(331);
          Hour=hour-H;
          if(minute<M){ Hour--;
          Min=(60-(M-minute)); }
          if(minute>=M){ Min=minute-M; }
          totHour=EEPROM.read(930); totMin=EEPROM.read(931);totMin=totMin+Min;  
          if(totMin>=60){Hour++;totMin=totMin-60;}
          totHour=totHour+Hour;
          EEPROM.write(930,totHour);
          EEPROM.write(931,totMin);lcd.clear();}    
        }
          else if(strcmp(response,rfid_id[4])==0)//User1 rfid received
        {
         if(presence[4]==0 || presence[4]==2){
          presence[4]=1;
          lcd.clear(); lcd.setCursor(7,0); lcd.print("WELCOME");
          lcd.setCursor(7, 2); lcd.print(names[4]); lcd.print(" !");
         analogWrite(buzzer,50); digitalWrite(green_led,HIGH); delay(1000);
          digitalWrite(buzzer,LOW); digitalWrite(green_led,LOW);delay(3000);
          EEPROM.write(340,hour);  EEPROM.write(341,minute);  EEPROM.write(342,second);
          presentNum++; EEPROM.write(1000,presentNum);lcd.clear();}
 
         else{
         presence[4]=2;
         lcd.clear(); lcd.setCursor(7,0); lcd.print("SEE YOU");
         lcd.setCursor(7, 2); lcd.print(names[4]); lcd.print(" !");
          analogWrite(buzzer,50); digitalWrite(green_led,HIGH); delay(1000);
          digitalWrite(buzzer,LOW); digitalWrite(green_led,LOW);delay(3000);
          EEPROM.write(343,hour); EEPROM.write(344,minute);  EEPROM.write(345,second);
          presentNum--;  EEPROM.write(1000,presentNum);
          H=EEPROM.read(340);
          M=EEPROM.read(341);
          Hour=hour-H;
          if(minute<M){ Hour--;
          Min=(60-(M-minute)); }
          if(minute>=M){ Min=minute-M; }
          totHour=EEPROM.read(940); totMin=EEPROM.read(941);totMin=totMin+Min;  
          if(totMin>=60){Hour++;totMin=totMin-60;}
          totHour=totHour+Hour;
          EEPROM.write(940,totHour);
          EEPROM.write(941,totMin);lcd.clear();}    
        }
          else if(strcmp(response,rfid_id[5])==0)//User1 rfid received
        {
         if(presence[5]==0 || presence[5]==2){
          presence[5]=1;
          lcd.clear(); lcd.setCursor(7,0); lcd.print("WELCOME");
          lcd.setCursor(7, 2); lcd.print(names[5]); lcd.print(" !");
          analogWrite(buzzer,50); digitalWrite(green_led,HIGH); delay(1000);
          digitalWrite(buzzer,LOW); digitalWrite(green_led,LOW);delay(3000);
          EEPROM.write(350,hour);  EEPROM.write(351,minute);  EEPROM.write(352,second);
          presentNum++; EEPROM.write(1000,presentNum);lcd.clear();}
 
         else {
         presence[5]=2;
         lcd.clear(); lcd.setCursor(7,0); lcd.print("SEE YOU");
         lcd.setCursor(7, 2); lcd.print(names[5]); lcd.print(" !");
          analogWrite(buzzer,50); digitalWrite(green_led,HIGH); delay(1000);
          digitalWrite(buzzer,LOW); digitalWrite(green_led,LOW);delay(3000);
          EEPROM.write(353,hour); EEPROM.write(354,minute);  EEPROM.write(355,second);
          presentNum--;  EEPROM.write(1000,presentNum);
          H=EEPROM.read(350);
          M=EEPROM.read(351);
          Hour=hour-H;
          if(minute<M){ Hour--;
          Min=(60-(M-minute)); }
          if(minute>=M){ Min=minute-M; }
          totHour=EEPROM.read(950); totMin=EEPROM.read(951);totMin=totMin+Min;  
          if(totMin>=60){Hour++;totMin=totMin-60;}
          totHour=totHour+Hour;
          EEPROM.write(950,totHour);
          EEPROM.write(951,totMin);lcd.clear();}  
        }
 
 
          else if(strcmp(response,rfid_id[6])==0)//User1 rfid received
        {
         if(presence[6]==0 || presence[6]==2){
          presence[6]=1;
          lcd.clear(); lcd.setCursor(7,0); lcd.print("WELCOME");
          lcd.setCursor(5, 2); lcd.print(names[6]); lcd.print(" !");
          analogWrite(buzzer,50); digitalWrite(green_led,HIGH); delay(1000);
          digitalWrite(buzzer,LOW); digitalWrite(green_led,LOW);delay(3000);
          EEPROM.write(360,hour);  EEPROM.write(361,minute);  EEPROM.write(362,second);
          presentNum++; EEPROM.write(1000,presentNum);lcd.clear();}
 
         else{
         presence[6]=2;
         lcd.clear(); lcd.setCursor(7,0); lcd.print("SEE YOU");
         lcd.setCursor(5, 2); lcd.print(names[6]); lcd.print(" !");
          analogWrite(buzzer,50); digitalWrite(green_led,HIGH); delay(1000);
          digitalWrite(buzzer,LOW); digitalWrite(green_led,LOW);delay(3000);
          EEPROM.write(363,hour); EEPROM.write(364,minute);  EEPROM.write(365,second);
          presentNum--;  EEPROM.write(1000,presentNum);
          H=EEPROM.read(360);
          M=EEPROM.read(361);
          Hour=hour-H;
          if(minute<M){ Hour--;
          Min=(60-(M-minute)); }
          if(minute>=M){ Min=minute-M; }
          totHour=EEPROM.read(960); totMin=EEPROM.read(961);totMin=totMin+Min;  
          if(totMin>=60){Hour++;totMin=totMin-60;}
          totHour=totHour+Hour;
          EEPROM.write(960,totHour);
          EEPROM.write(961,totMin);lcd.clear();}  
        }
 
          else if(strcmp(response,rfid_id[7])==0)//User1 rfid received
        {
         if(presence[7]==0 || presence[7]==2){
          presence[7]=1;
          lcd.clear(); lcd.setCursor(7,0); lcd.print("WELCOME");
          lcd.setCursor(7, 2); lcd.print(names[7]); lcd.print(" !");
          analogWrite(buzzer,50); digitalWrite(green_led,HIGH); delay(1000);
          digitalWrite(buzzer,LOW); digitalWrite(green_led,LOW);delay(3000);
          EEPROM.write(370,hour);  EEPROM.write(371,minute);  EEPROM.write(372,second);
          presentNum++; EEPROM.write(1000,presentNum);lcd.clear();}
 
         else{
         presence[7]=2;
         lcd.clear(); lcd.setCursor(7,0); lcd.print("SEE YOU");
         lcd.setCursor(7, 2); lcd.print(names[7]); lcd.print(" !");
          analogWrite(buzzer,50); digitalWrite(green_led,HIGH); delay(1000);
          digitalWrite(buzzer,LOW); digitalWrite(green_led,LOW);delay(3000);
          EEPROM.write(373,hour); EEPROM.write(374,minute);  EEPROM.write(375,second);
          presentNum--;  EEPROM.write(1000,presentNum);
          H=EEPROM.read(370);
          M=EEPROM.read(371);
          Hour=hour-H;
          if(minute<M){ Hour--;
          Min=(60-(M-minute)); }
          if(minute>=M){ Min=minute-M; }
          totHour=EEPROM.read(970); totMin=EEPROM.read(971);totMin=totMin+Min;  
          if(totMin>=60){Hour++;totMin=totMin-60;}
          totHour=totHour+Hour;
          EEPROM.write(970,totHour);
          EEPROM.write(971,totMin);lcd.clear();}    
        }
 
 
          else if(strcmp(response,rfid_id[8])==0)//User1 rfid received
        {
         if(presence[8]==0 || presence[8]==2){
          presence[8]=1;
          lcd.clear(); lcd.setCursor(7,0); lcd.print("WELCOME");
          lcd.setCursor(7, 2); lcd.print(names[8]); lcd.print(" !");
          analogWrite(buzzer,50); digitalWrite(green_led,HIGH); delay(1000);
          digitalWrite(buzzer,LOW); digitalWrite(green_led,LOW);delay(3000);
          EEPROM.write(380,hour);  EEPROM.write(381,minute);  EEPROM.write(382,second);
          presentNum++; EEPROM.write(1000,presentNum);lcd.clear();}
 
         else{
         presence[8]=2;
         lcd.clear(); lcd.setCursor(7,0); lcd.print("SEE YOU");
         lcd.setCursor(7, 2); lcd.print(names[8]); lcd.print(" !");
          analogWrite(buzzer,50); digitalWrite(green_led,HIGH); delay(1000);
          digitalWrite(buzzer,LOW); digitalWrite(green_led,LOW);delay(3000);
          EEPROM.write(383,hour); EEPROM.write(384,minute);  EEPROM.write(385,second);
          presentNum--;  EEPROM.write(1000,presentNum);
          H=EEPROM.read(380);
          M=EEPROM.read(381);
          Hour=hour-H;
          if(minute<M){ Hour--;
          Min=(60-(M-minute)); }
          if(minute>=M){ Min=minute-M; }
          totHour=EEPROM.read(980); totMin=EEPROM.read(981);totMin=totMin+Min;  
          if(totMin>=60){Hour++;totMin=totMin-60;}
          totHour=totHour+Hour;
          EEPROM.write(980,totHour);
          EEPROM.write(981,totMin);lcd.clear();}    
        }
 
         else if(strcmp(response,rfid_id[9])==0)//User1 rfid received
        {
         if(presence[9]==0 || presence[9]==2){
          presence[9]=1;
          lcd.clear(); lcd.setCursor(7,0); lcd.print("WELCOME");
          lcd.setCursor(7, 2); lcd.print(names[9]); lcd.print(" !");
          analogWrite(buzzer,50); digitalWrite(green_led,HIGH); delay(1000);
          digitalWrite(buzzer,LOW); digitalWrite(green_led,LOW);delay(3000);
          EEPROM.write(390,hour);  EEPROM.write(391,minute);  EEPROM.write(392,second);
          presentNum++; EEPROM.write(1000,presentNum);lcd.clear();}
 
         else{
         presence[9]=2;      
         lcd.clear(); lcd.setCursor(7,0); lcd.print("SEE YOU");
         lcd.setCursor(7, 2); lcd.print(names[9]); lcd.print(" !");
          analogWrite(buzzer,50); digitalWrite(green_led,HIGH); delay(1000);
          digitalWrite(buzzer,LOW); digitalWrite(green_led,LOW);delay(3000);
          EEPROM.write(393,hour); EEPROM.write(394,minute);  EEPROM.write(395,second);
          presentNum--;  EEPROM.write(1000,presentNum);
          H=EEPROM.read(390);
          M=EEPROM.read(391);
          Hour=hour-H;
          if(minute<M){ Hour--;
          Min=(60-(M-minute)); }
          if(minute>=M){ Min=minute-M; }
          totHour=EEPROM.read(990); totMin=EEPROM.read(991);totMin=totMin+Min;  
          if(totMin>=60){Hour++;totMin=totMin-60;}
          totHour=totHour+Hour;
          EEPROM.write(990,totHour);
          EEPROM.write(991,totMin);lcd.clear();}  
        }
       EEPROM.write(1000,presentNum);
       for(i=0;i<10;i++)
       EEPROM.write(i,presence[i]);
      
      
        
        
        
    }
    
  
}

To understand the full working and how to deal with the project watch the video tutorial below. Also to learn about code editing from the same video below.


Video Preview & Tutorial:

RFID Based Attendance System Using Arduino
Watch this video on YouTube.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
Previous ArticleMeasure Acceleration with Accelerometer ADXL335 & Arduino
Next Article Arduino DS3231 Real Time Clock with Alarm & Temperature

Related Posts

DC Energy Meter using Arduino

Build a DC Energy Meter using Arduino – 32V/5A

Updated:August 26, 20252K
Interfacing ADXL375 Accelerometer with Arduino

Interfacing ADXL375 Accelerometer with Arduino (±200g)

Updated:June 28, 2025
PZEM-004T Arduino Energy Meter

DIY AC Energy Meter using PZEM-004T & Arduino

Updated:March 6, 20258K
Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Updated:February 2, 20259K
Password Based Door Lock Security System Using Arduino & Keypad

Password Based Door Lock Security System Using Arduino & Keypad

Updated:February 2, 20252436K
Earthquake Detector Alarm with with Accelerometer & Arduino

Earthquake Detector Alarm with Accelerometer & Arduino

Updated:February 2, 2025661K
View 3 Comments

3 Comments

  1. ANUSH KUMAR on October 18, 2018 7:59 PM

    sir. your coding was awesome and i need some clarification regarding adding persons.we tried to change the code for adding persons but we can’t. can you please give any idea about this?

    Reply
  2. mahesh on June 11, 2021 8:55 PM

    time automaticaly reset when arduino power cut , what can i do

    Reply
  3. Srusthidhar Lenka on July 7, 2022 8:54 PM

    First upload this code with correct time ,and after that use ‘ // ‘ symbol before setTime and again upload this code

    Reply

CommentsCancel reply

Latest Posts
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

May 31, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

May 10, 2026
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

May 2, 2026
A Guide to Sourcing Obsolete ICs for Vintage Projects

Beyond AliExpress: A Guide to Sourcing Obsolete ICs for Vintage Projects

April 21, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

April 27, 2026
Building a Smart Sensor Node with a BLE Microcontroller

Building a Smart Sensor Node with a BLE Microcontroller

February 26, 2026
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

April 27, 2026
DIY Colorimeter using AS7265x Spectroscopy Sensor & ESP32

DIY Colorimeter using AS7265x Spectroscopy Sensor & ESP32

February 1, 2026
Top Posts & Pages
  • 12V DC to 220V AC Inverter Circuit & PCB
    12V DC to 220V AC Inverter Circuit & PCB
  • IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
    IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
  • IoT Based Drinking Water Quality Monitoring with ESP32
    IoT Based Drinking Water Quality Monitoring with ESP32
  • LD2410 Sensor with ESP32 - Human Presence Detection
    LD2410 Sensor with ESP32 - Human Presence Detection
  • ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
    ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
  • DIY IoT Water pH Meter using pH Sensor & ESP32
    DIY IoT Water pH Meter using pH Sensor & ESP32
  • Buck Converter: Basics, Working, Design & Application
    Buck Converter: Basics, Working, Design & Application
  • How to use Modbus RTU with ESP32 to read Sensor Data
    How to use Modbus RTU with ESP32 to read Sensor Data
Categories
  • Arduino Projects (197)
  • Articles (60)
    • Learn Electronics (19)
    • Product Review (15)
    • Tech Articles (28)
  • Electronics Circuits (46)
    • 555 Timer Projects (21)
    • Op-Amp Circuits (7)
    • Power Electronics (13)
  • IoT Projects (204)
    • ESP32 MicroPython (7)
    • ESP32 Projects (81)
    • ESP32-CAM Projects (15)
    • ESP8266 Projects (76)
    • LoRa/LoRaWAN Projects (22)
  • Microcontrollers (38)
    • AMB82-Mini IoT AI Camera (4)
    • BLE Projects (18)
    • STM32 Projects (19)
  • Raspberry Pi (93)
    • Raspberry Pi Pico Projects (57)
    • Raspberry Pi Pico W Projects (12)
    • Raspberry Pi Projects (24)
Follow Us
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
About Us

“‘How to Electronics’ is a vibrant community for electronics enthusiasts and professionals. We deliver latest insights in areas such as Embedded Systems, Power Electronics, AI, IoT, and Robotics. Our goal is to stimulate innovation and provide practical solutions for students, organizations, and industries. Join us to transform learning into a joyful journey of discovery and innovation.

Copyright © How To Electronics. All rights reserved.
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us

Type above and press Enter to search. Press Esc to cancel.

Ad Blocker Enabled!
Ad Blocker Enabled!
Looks like you're using an ad blocker. Please allow ads on our site. We rely on advertising to help fund our site.