Hi,
I am in the process of doing my thesis for my studies. My topic is biometric login to IT systems.
I am making a physical module for collecting fingerprints from users based on the Arduino UNO WiFi Rev2 microcontroller and Waveshare UART Fingerprint Reader. Unfortunately, I have a problem with communication between these two elements.
According to the documentation of the fingerprint scanner, commands should be sent via the UART port. As an example, I will use the command to get the total number of users (point 2.6 in the communication protocol file).
I send 8 bytes {0xF5, 0x09, 0x00, 0x00, 0x00, 0x00, 0x09, 0xF5} to the serial port, unfortunately I do not receive any response from the module. I tested the connection on HardwareSerial Serial1 (pin 0, pin 1) and SoftwareSerial (pin 2, pin 3) and (pin 10, pin 11).
I also tested the efficiency of the scanner itself by connecting it via USB-to-UART module to the computer and using the software provided by the producer. The scanner responds correctly.
I would be very grateful for any hint!
Fingerprint Scanner: UART Fingerprint Reader - Waveshare Wiki
Scanner communication protocol: 注意: (waveshare.com)
I am attaching a sample program, the connections I use in it are:
FINGERPRINT SCANNER | ARDUINO UNO WIFI REV2 |
---|---|
VCC | 5V |
GND | GND |
TXD | 0 |
RXD | 1 |
void setup()
{
Serial.begin(9600);
Serial1.begin(19200);
Serial.println("===== START =====");
userCount();
Serial.println("===== END =====");
}
void loop() {}
void userCount()
{
byte cmd[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
byte checkSum = 0;
cmd[0] = 0xF5;
cmd[1] = 0x09;
cmd[7] = 0xF5;
checkSum = 0;
for(int i=1; i<6; i++)
{
checkSum = checkSum^cmd[i];
}
cmd[6] = checkSum;
Serial.println("Sent:");
for(int i=0; i<8; i++)
{
Serial1.write(cmd[i]);
Serial.print(cmd[i]);
Serial.print(' ');
}
Serial.println();
delay(10000);
Serial.println("Received:");
byte temp=0;
while(Serial1.available()>0)
{
temp = Serial1.read();
Serial.print(temp);
Serial.print(' ');
}
}