Sparkfun Fingerprint Sensor Przewodnik programowania

sales@adh-tech.com.tw
Programming Guide
GT-GT-NUCL1633K1 Version 1.3
May 4th, 2022
http://www.adh-tech.com.tw
The information of this document contained herein is exclusive property and confidential document of ADH-Tech Unauthorized reproduction, duplication, use or disclosure of this document will be deemed as infringement.
1
Version
Date
Description
V1.0
Nov 18, 2021
Created
V1.1
Nov 29, 2021
Modify Chapter 6 example
V1.2
Apr 29, 2022
Add UART, LED,Touch command. Modify Enrolled/Identify Flow
V1.3
May 4th, 2022
Modify Get entry ID
sales@adh-tech.com.tw
Revision History
http://www.adh-tech.com.tw
The information of this document contained herein is exclusive property and confidential document of ADH-Tech Unauthorized reproduction, duplication, use or disclosure of this document will be deemed as infringement.
2
sales@adh-tech.com.tw
http://www.adh-tech.com.tw
Table of content
Revision History .......................................................................................................................... 2
Table of content .......................................................................................................................... 3
1. Introduction ................................................................................................................................... 4
1.1 Fingerprinter ..................................................................................................................... 4
1.2 Feature .............................................................................................................................. 4
2. Packet Structure ............................................................................................................................ 5
2.1 Command Packet (Command) ......................................................................................... 5
2.2 Response Packet (Acknowledge) ..................................................................................... 5
2.3 Data Packet (Data)............................................................................................................ 5
3. Command Summary ....................................................................................................................... 6
4. ACK Code ........................................................................................................................................ 7
5. Command Details ............................................................................................................................ 8
5.1 Open ................................................................................................................................. 8
5.2 Close ................................................................................................................................. 9
5.3 UART Control .................................................................................................................. 9
5.4 LED Control ................................................................................................................... 10
5.5 Check finger pressing status(IsPressFinger) .................................................................. 10
5.6 Enroll .............................................................................................................................. 11
5.7 Delete one fingerprint(DeleteID) ................................................................................... 13
5.8 Delete all fingerprints(DeleteAll) ................................................................................... 13
5.9 Get enrolled fingerprint count(GetEnrollCount) ............................................................ 14
5.10 1:N Identification(Identify) ............................................................................................ 15
5.11 Get entry ID(GetEntryID) .............................................................................................. 16
5.12 Get firmware version ...................................................................................................... 16
5.13 Enroll Cancel .................................................................................................................. 17
6. Protocol: Flowchart ....................................................................................................................... 19
Example: Enrollment ...................................................................................................................... 19
Example: Identification .................................................................................................................. 20
The information of this document contained herein is exclusive property and confidential document of ADH-Tech Unauthorized reproduction, duplication, use or disclosure of this document will be deemed as infringement.
3
sales@adh-tech.com.tw
http://www.adh-tech.com.tw
1. Introduction
1.1 Fingerprinter
The ADH-Tech GT-NUCL1633K1 is one chip fingerprint reader designed to integrate products with a UART interface.
The module is built-in a high-quality hybrid sensor with sufficient effective area. The active area allows stable imaging and the ability to cope with mass-market applications needing both security and convenience. The reader within low power consumption microcontroller and the fingerprint algorithm on it.
1.2 Feature
Sensor
Ultra-thin hybrid sensor SPI sensor image output Resolution up to 508 DPI Works well with dry, wet, or rough fingerprints.
The sensor has an SPI interface. Ultra high resolution makes fingerprint algorithms easy to develop and realize.
MCU/Algorithm
1:1 Verification, 1:N Identification Reading & writing fingerprint template(s) from/to the device High-accuracy and high-speed fingerprint identification technology Convenient & Safe & FacilitationJust one touch and easy to enroll and recognize.
The information of this document contained herein is exclusive property and confidential document of ADH-Tech Unauthorized reproduction, duplication, use or disclosure of this document will be deemed as infringement.
4
OFFSET
ITEM
TYPE
DESCRIPTION
0
0xF5
BYTE
Command start code1
1
command
BYTE
Command type
2
P1
BYTE
Command parameter 1
3
P2
BYTE
Command parameter 2
4
P3
BYTE
Command parameter 3
5
P4
BYTE
Command parameter 4
6
Check Sum
BYTE
XOR check Sum
OFFSET[1]^...^ OFFSET[5] = Check Sum
7
0xF5
BYTE
Command end code 2
OFFSET
ITEM
TYPE
DESCRIPTION
0
0xF5
BYTE
Response start code1
1
Command
BYTE
Often the same as the command type
2
Q1
BYTE
Response parameter 1
3
Q2
BYTE
Response parameter 2
4
Q3 (ACK)
BYTE
Response parameter 3
5
0x00
BYTE
Reserved.
6
Check Sum
BYTE
XOR check Sum
OFFSET[1]^...^ OFFSET[5] = Check Sum
7
0xF5
BYTE
Response end code2
OFFSET
ITEM
TYPE
DESCRIPTION
0
0xF5
BYTE
Data start code1
1~Len
Data
N BYTES
N bytes Data
Len+1
Check Sum
BYTE
XOR check Sum
OFFSET[1]^...^ OFFSET[Len] = Check Sum
Len+2
0xF5
BYTES
Data end code2
sales@adh-tech.com.tw
2. Packet Structure
2.1 Command Packet (Command)
2.2 Response Packet (Acknowledge)
http://www.adh-tech.com.tw
2.3 Data Packet (Data)
The information of this document contained herein is exclusive property and confidential document of ADH-Tech Unauthorized reproduction, duplication, use or disclosure of this document will be deemed as infringement.
5
Number (HEX)
Alias
Description
A0
Open
Initialization
A1
Close
Termination
B4
LED Control
LED On/Off
B5
Is Press Finger
Check if the finger is placed on the sensor
01
Enroll
An enrollment function
04
Delete ID
Delete the fingerprint with the specified ID
05
Delete All
Delete all fingerprints from the database
09
Get User Count
Get enrolled fingerprint count
0C
Identify
1:N Identification of the captured fingerprint image with the database
0D
Get Entry ID
Get an unused ID
26
Get firmware version
Get firmware version
92
Enroll Cancel
Break the enrollment sequences
sales@adh-tech.com.tw
http://www.adh-tech.com.tw
3. Command Summary
In a command package, the second byte for the command code may be one of the following:
The information of this document contained herein is exclusive property and confidential document of ADH-Tech Unauthorized reproduction, duplication, use or disclosure of this document will be deemed as infringement.
6
ACK Parameter
Value
Description
ACK_SUCCESS
0x00
Command execute success
ACK_FAIL
0x01
Command execute fail
ACK_FULL
0x04
The database is full
ACK_NOUSER
0x05
The specified ID is unregistered
ACK_USER_EXIST
0x07
The specified ID is registered
ACK_TIMEOUT
0x08
Timeout during capturing finger
ACK_WRONG_FORMAT
0x09
Template wrong format
ACK_BREAK
0x18
Abort current command
ACK_INVALID_PARAMETER
0xB0
Input invalid parameter
ACK_FINGER_IS_NOT_PRESSED
0xB1
Finger is not pressed
ACK_COMMAND_NO_SUPPORT
0xB4
Command not support
ACK_ENROLL_OVEREXPOSURE
0xB5
Finger image is overexposure
ACK_ENROLL_MOVE_MORE
0xB6
Finger moved too less.
ACK_ENROLL_MOVE_LESS
0xB7
Finger moved too much.
ACK_ENROLL_DUPLICATE
0xB8
Finger position is duplicated.
ACK_FINGER_PRESS_NOT_FULL
0xB9
Finger press is not full.
ACK_ENROLL_POOR_QUALITY
0xBA
Finger image quality is poor.
sales@adh-tech.com.tw
http://www.adh-tech.com.tw
4. ACK Code
In a response package, the Q3 will return the execution result, and it may be of the following:
The information of this document contained herein is exclusive property and confidential document of ADH-Tech Unauthorized reproduction, duplication, use or disclosure of this document will be deemed as infringement.
7
Byte
1 2 3 4 5 6 7
8
CMD
0xF5
0xA0
0 0 Flag
0
CHK
0xF5
ACK
0xF5
0xA0
Hi(Len)
Low(Len)
0 0 CHK
0xF5
Byte
1
2Len+1
Len+2
Len+3
DATA
0xF5
Data
CHK
0xF5
Offset
Description
0
Device ID : 0x01
1
Reserved : default 0x00.
2
FW release date [0] : Day, [1] : Month [2] : Year (Low byte), [3] : Year (High byte)
6
Reserved : default 0x00.
10
Sensor type
sales@adh-tech.com.tw
5. Command Details
5.1 Open
Check the device connection status and initalize sensor status.
Flag:
1: Read FW date and module.
Hi(Len):
FW module and date length high byte.
Low(Len):
FW module and date length low byte.
http://www.adh-tech.com.tw
Data structure (11 Bytes):
If the Flag is set to 0, the data package will not return.
The information of this document contained herein is exclusive property and confidential document of ADH-Tech Unauthorized reproduction, duplication, use or disclosure of this document will be deemed as infringement.
8
Byte
1 2 3 4 5 6 7
8
CMD
0xF5
0xA1
0 0 0 0 CHK
0xF5
ACK
0xF5
0xA1
0 0 ACK
0
CHK
0xF5
Byte
1 2 3 4 5 6 7 8 CMD
0xF5
0xA3
Index
0 0 0
CHK
0xF5
ACK
0xF5
0xA3
0 0 ACK
0
CHK
0xF5
sales@adh-tech.com.tw
5.2 Close
Close command does nothing. (Reserved)
ACK:
ACK_SUCCESS
5.3 UART Control
UART baud rate setting.
http://www.adh-tech.com.tw
Baudrate Index:
1: 9600 2:19200 3:115200 4:230400 5:460800 6:921600
ACK:
ACK_SUCCESS
The information of this document contained herein is exclusive property and confidential document of ADH-Tech Unauthorized reproduction, duplication, use or disclosure of this document will be deemed as infringement.
9
Byte
1 2 3 4 5 6 7 8 CMD
0xF5
0xB4
switch
0 0 0
CHK
0xF5
ACK
0xF5
0xB4
0 0 ACK
0
CHK
0xF5
Byte
1 2 3 4 5 6 7
8
CMD
0xF5
0xB5
0 0 0 0 CHK
0xF5
ACK
0xF5
0xB5
Status
0
ACK
0
CHK
0xF5
sales@adh-tech.com.tw
http://www.adh-tech.com.tw
5.4 LED Control
Control LED on/off.
Switch:
0: On 1: Off
ACK:
ACK_SUCCESS
5.5 Check finger pressing status(IsPressFinger)
This command is used to check finger. This function can be replaced by reading touch signal.
Status:
0: Is Not Pressed 1: Is Pressed
ACK:
ACK_SUCCESS ACK_FINGER_IS_NOT_PRESSED
The information of this document contained herein is exclusive property and confidential document of ADH-Tech Unauthorized reproduction, duplication, use or disclosure of this document will be deemed as infringement.
10
Byte
1 2 3 4 5 6 7
8
CMD
0xF5
0x01
USER ID_H
USER ID_L
0
Reserved 0x00
CHK
0xF5
ACK
0xF5
0x01
USER ID_H
USER ID_L
ACK
0
CHK
0xF5
sales@adh-tech.com.tw
http://www.adh-tech.com.tw
5.6 Enroll
Before enrollment, you can call “Get Entry ID 0x0D” to get an unregistered ID (1~N) and set it to the USER_ID (2nd~3rd bytes). Start a registration, and you shall repeatedly call the Enroll command till the enroll result (2nd byte) of the response packet has become from 0x01 to 0x03. You shall use the Enroll command (8+1) times this way. The first enroll command is setting the user ID. If there is no finger pressed on the sensor for each sampling time in 8 seconds, the enrollment will be canceled. The enrollment flow can be interrupted by each command except Enroll and
IsPressFinger.
USER ID_H :
USER ID high byte.
USER ID_L :
USER ID low byte
Note: User ID value is 1~N
Reserved:
Value Must be 0.
ACK :
ACK_SUCCESS ACK_FAIL ACK_USER_EXIST ACK_INVALID_PARAMETER ACK_ ENROLL_OVEREXPOSURE ACK_ENROLL_MOVE_MORE ACK_ENROLL_MOVE_LESS ACK_ENROLL_DUPLICATE ACK_FINGER_PRESS_NOT_FULL ACK_ENROLL_POOR_QUALITY
The information of this document contained herein is exclusive property and confidential document of ADH-Tech Unauthorized reproduction, duplication, use or disclosure of this document will be deemed as infringement.
11
Byte
1 2 3 4 5 6 7
8
CMD
0xF5
0x01
0 0 0 0 CHK
0xF5
ACK
0xF5
ENROLL RESULT
ENROLL PROGRESS
0
ACK
0
CHK
0xF5
sales@adh-tech.com.tw
http://www.adh-tech.com.tw
.
ENROLL RESULT:
0x01: Continue 0x03: Final enroll
ENROLL PROGRESS:
Percentage, 1 - 8.
ACK :
ACK_SUCCESS ACK_FAIL
You shall keep sending the Enroll command until ENROLL RESULT is 0x03. The enrollment is completed while 0x03 is received. The following takes three sampling times, for example:
Example: ID=1
The 1st command: F5 01 00 01 00 00 xx F5 (set ID) Return : F5 01 00 00 00 00 xx F5
The 2nd command: F5 01 00 00 00 00 xx F5 (press finger) Return : F5 01 01 00 00 00 xx F5
The 3rd command: F5 01 00 00 00 00 xx F5 (press finger) Return : F5 01 02 00 00 00 xx F5
……..
The last command: F5 01 00 00 00 00 xx F5 (enroll success) Return : F5 03 08 00 00 00 xx F5
The information of this document contained herein is exclusive property and confidential document of ADH-Tech Unauthorized reproduction, duplication, use or disclosure of this document will be deemed as infringement.
12
Byte
1 2 3 4 5 6 7
8
CMD
0xF5
0x04
USER ID_H
USER ID_L
0 0 CHK
0xF5 ACK
0xF5
0x04
0 0 ACK
0
CHK
0xF5
Byte
1 2 3 4 5 6 7
8
CMD
0xF5
0x05
0 0 0 0 CHK
0xF5
ACK
0xF5
0x05
0 0 ACK
0
CHK
0xF5
sales@adh-tech.com.tw
5.7 Delete one fingerprint(DeleteID)
USER ID_H :
USER ID high byte.
USER ID_L :
USER ID low byte
Note: User ID value is 1~N
ACK :
ACK_SUCCESS ACK_NOUSER ACK_INVALID_PARAMETER
Example: Delete ID=1
Command: F5 04 00 01 00 05 F5
Return : F5 04 00 00 00 04 F5
5.8 Delete all fingerprints(DeleteAll)
http://www.adh-tech.com.tw
ACK :
ACK_SUCCESS
Example: Delete all ID
Command: F5 05 00 00 00 05 F5
Return : F5 05 00 00 00 05 F5
The information of this document contained herein is exclusive property and confidential document of ADH-Tech Unauthorized reproduction, duplication, use or disclosure of this document will be deemed as infringement.
13
Byte
1 2 3 4 5 6 7
8
CMD
0xF5
0x09
0 0 0 0 CHK
0xF5
ACK
0xF5
0x09
USERCOUNT _H
USERCOUNT _L
ACK
0
CHK
0xF5
sales@adh-tech.com.tw
5.9 Get enrolled fingerprint count(GetEnrollCount)
ACK :
ACK_SUCCESS ACK_NOUSER
Example: Get user count
Command: F5 09 00 00 00 00 09 F5
Return: F5 09 00 02 00 00 0B F5 (Two ID exists)
http://www.adh-tech.com.tw
The information of this document contained herein is exclusive property and confidential document of ADH-Tech Unauthorized reproduction, duplication, use or disclosure of this document will be deemed as infringement.
14
Byte
1 2 3 4 5 6 7
8
CMD
0xF5
0x0C
0 0 0 0 CHK
0xF5
ACK
0xF5
0x0C
USER ID_H
USER ID_L
0 0 CHK
0xF5
sales@adh-tech.com.tw
http://www.adh-tech.com.tw
5.10 1:N Identification(Identify)
This function supports breaks when capturing a finger. This command will recognize and respond to the user ID. If the user can not be found, the ID shall return 0, and the 5th return ACK. Otherwise
USER ID_H :
USER ID high byte.
USER ID_L :
USER ID low byte
ACK :
ACK_SUCCESS ACK_NOUSER ACK_FAIL
Example:
Command: F5 0C 00 00 00 00 0C F5
Identify success: ID=2
Return: F5 0C 00 02 00 00 CHK F5
Identify Not Found: ID=0
Return: F5 0C 00 00 00 00 0C F5
The information of this document contained herein is exclusive property and confidential document of ADH-Tech Unauthorized reproduction, duplication, use or disclosure of this document will be deemed as infringement.
15
Byte
1 2 3 4 5 6 7
8
CMD
0xF5
0x0D
0 0 0 0 CHK
0xF5
ACK
0xF5
0x0D
USER ID_H
USER ID_L
ACK
0
CHK
0xF5 Byte
1 2 3 4 5 6 7
8
CMD
0xF5
0x26
0 0 0 0 CHK
0xF5
ACK
0xF5
0x26
Hi(Len)
Low(Len)
ACK
0
CHK
0xF5
Byte
1
2Len+1
Len+2
Len+3
sales@adh-tech.com.tw
5.11 Get entry ID(GetEntryID)
Return an unused ID (1~N).
USER ID_H :
USER ID high byte.
USER ID_L :
USER ID low byte
Note: Unused ID value is 1~N
ACK :
ACK_SUCCESS ACK_FULL
http://www.adh-tech.com.tw
5.12 Get firmware version
Get firmware information
Hi(Len):
Firmware version length high byte
Low(Len):
Firmware version length low byte
ACK:
ACK_SUCCESS
The information of this document contained herein is exclusive property and confidential document of ADH-Tech Unauthorized reproduction, duplication, use or disclosure of this document will be deemed as infringement.
16
DATA
0xF5
Version Data
CHK
0xF5
Offset
Description
0
Sensor type
12
Year
13
Month
14
Day
15
Version
18
TBD
39
TBD
Byte
1 2 3 4 5 6 7
8
CMD
0xF5
0x92
USER ID_H
USER ID_L
0 0 CHK
0xF5
ACK
0xF5
0x92
USER ID_H
USER ID_L
ACK
0
CHK
0xF5
sales@adh-tech.com.tw
The version data include sensor type, enroll type, and module version.
Version data structure (40 Bytes) :
http://www.adh-tech.com.tw
5.13 Enroll Cancel
Interrupt the enrollment sequence and erase the template data of ID.
USER ID_H :
USER ID high byte.
USER ID_L :
USER ID low byte
Note: User ID value is 1~N
Reserved:
Value Must be 0.
The information of this document contained herein is exclusive property and confidential document of ADH-Tech Unauthorized reproduction, duplication, use or disclosure of this document will be deemed as infringement.
17
sales@adh-tech.com.tw
ACK :
ACK_SUCCESS ACK_FAIL
http://www.adh-tech.com.tw
The information of this document contained herein is exclusive property and confidential document of ADH-Tech Unauthorized reproduction, duplication, use or disclosure of this document will be deemed as infringement.
18
sales@adh-tech.com.tw
6. Protocol: Flowchart
Example: Enrollment
http://www.adh-tech.com.tw
The host can use “Is Press Finger (0xB5) command or check Touch I/O pin (TP_HI)” to detect finger is pressed or not.
The information of this document contained herein is exclusive property and confidential document of ADH-Tech Unauthorized reproduction, duplication, use or disclosure of this document will be deemed as infringement.
19
sales@adh-tech.com.tw
Example: Identification
http://www.adh-tech.com.tw
The host can use “Is Press Finger (0xB5)” command or check “Touch I/O pin (TP_HI)” to detect finger is pressed or not.
The information of this document contained herein is exclusive property and confidential document of ADH-Tech Unauthorized reproduction, duplication, use or disclosure of this document will be deemed as infringement.
20
Loading...