
The UID and password are saved in MySQL, so, it need to read before
identification loop. The section 3-5-3 would describe in more detail.
3. Two-tier identification loop
The double is the keypad password and RFID tag, the state diagram
shows as following:
Keypad
password
identification
RFID Tag
identification
Error < 3
Error < 3
Error > 2: Alarm()
Error > 2: Alarm()
Ok: Door_open()
Figure 34. The Two-tier Identification State Diagram
z Keypad password identify: The first identification is password
identify, the user input the password via keypad, the process then
compares it with the MySQL passwords, if identification is right
then goes to next state which is RFID tag identify, if not the
process does not change the state and counts the error flag, the
alarm would invoke when error flag > 2.
z RFID tag identify: The second identification is RFID tag identify,
the user puts the tag near to RFID’s antenna for the RFID reader
detecting, the process then compares it with the MySQL UID, if
identification is right then opens the door and goes to keypad
password identify, if not the process does not change the state and
counts the error flag, the alarm would invoke when error flag > 2.
3-5-3 MySQL Database Access
The ‘MyFamily’ database was created in MySQL. It included a table
which was ‘member’. The following table shows the fields in ‘member’
table:
56