参考
模块外观
整体:
主控板:
传感器:
接口介绍
由上图可以看到,该模块有6个接口:
- VCC - 3.3V或5V
- GND - 接地
- TXD - 指纹模块串口发送,对应单片机串口接收
- RXD - 指纹模块串口接收,对应单片机串口发送
- WAKE - 指纹头唤醒,可不接,IO
- RST - 指纹模块复位,可不接,IO
连接Arduino
各接口对应的连接情况如下:
传感器模块 | Arduino |
VCC | 3.3V或5V |
GND | GND |
TXD | D10 |
RXD | D11 |
WAKE | D8 |
RST | D9 |
#include <SoftwareSerial.h>
#include "finger.h"
void setup()
{
// Open serial communications (connect to PC) and wait for port to open:
Serial.begin(115200);
while (!Serial)
{
; // wait for serial port to connect. Needed for native USB port only
}
pinMode(Finger_RST_Pin , OUTPUT);
digitalWrite(Finger_RST_Pin , LOW);
delay(100);
digitalWrite(Finger_RST_Pin , HIGH);
pinMode(Finger_WAKE_Pin , INPUT);
Finger_SoftwareSerial_Init();
Finger_Wait_Until_OK();
}
void loop()
{
Analysis_PC_Command();
// If in sleep mode, turn on the auto wake-up function of the finger,
//begin to check if the finger is pressed, and wake up the module and match it
if(Finger_SleepFlag == 1)
{
Auto_Verify_Finger();
}
}