ESP32 PSRAM Timer Camera X

Hi guys please im having ESP32 PSRAM Timer Camera X and i bought Finger Print Sensor Unit (FPC1020A), please could someone help me create some test code if fingerprint sensor is working. Its connected via Grove Cable. I cant make it work.... like im not getting any value .. Maybe i just doing some mistake with rx, tx. i just dont know how to make it.

#include "M5_FPC1020A.h"

FingerPrint Finger;

void setup() {
Serial.begin(115200);
delay(2000);

Serial.println("FingerPrint Sensor Setup");


uint8_t rx = 13;
uint8_t tx = 4;

Finger.begin(&Serial2, rx, tx);

}

void loop() {

uint8_t addUserResult = Finger.fpm_addUser(1, 1);

if (addUserResult == ACK_SUCCESS) {
    Serial.println("User added successfully!");
} else {
    Serial.print("Failed to add user. Error code: ");
    Serial.println(addUserResult);
}

// Compare fingerprints

uint8_t compareResult = Finger.fpm_compareFinger();

if (compareResult == ACK_SUCCESS) {
    Serial.println("Fingerprints match!");
} else if (compareResult == ACK_NOUSER) {
    Serial.println("No fingerprints enrolled.");
} else if (compareResult == ACK_TIMEOUT) {
    Serial.println("Fingerprint matching timeout.");
} else {
    Serial.print("Fingerprints do not match. Error code: ");
    Serial.println(compareResult);
}

delay(10000); 

}

void loop() {
// Print the current add mode
Serial.println(Finger.fpm_readAddMode());

// Add a user with user number 21 and permission 1
uint8_t addUserResult = Finger.fpm_addUser(21, 1);
// Print the result of adding the user
Serial.print("Add user result: ");
Serial.println(addUserResult);

// Print additional details for debugging
for (int i = 0; i < 9; i++) {
Serial.print("RxBuf[");
Serial.print(i);
Serial.print("]: ");
Serial.println(Finger.RxBuf[i], HEX);
}

output when the finger is not placed on the fingerprint:
1
Add user result: 1
RxBuf[0]: FF
RxBuf[1]: 0
RxBuf[2]: 0
RxBuf[3]: 0
RxBuf[4]: 0
RxBuf[5]: 0
RxBuf[6]: 0
RxBuf[7]: 0
RxBuf[8]: 0

output when the finger is placed on the fingerprint:
Add user result: 1
RxBuf[0]: FF
RxBuf[1]: FF
RxBuf[2]: FF
RxBuf[3]: FF
RxBuf[4]: FF
RxBuf[5]: FF
RxBuf[6]: FF
RxBuf[7]: FF
RxBuf[8]: 0

and when I try to test 100x by putting my finger... I have Add user result: 0 but the chance is 1/100. So could it be the fingerprint unit is broken?
User added successfully!
RxBuf[0]: F5
RxBuf[1]: 3
RxBuf[2]: 0
RxBuf[3]: 0
RxBuf[4]: 0
RxBuf[5]: 0
RxBuf[6]: 3
RxBuf[7]: F5
RxBuf[8]: 0
1

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.