VR ATmega328P with R305 Fingerprint Sensor: System Hangs on finger.begin() - No Response from Sensor

hey guys, I am working with an AVR ATmega328P microcontroller and an R305 fingerprint sensor. I have connected the sensor’s TX and RX pins to the AVR’s UART pins (D0 and D1) and am utilizing SoftwareSerial for communication. However, after calling finger.begin(), I am not receiving any confirmation from the sensor, and the system seems to hang at that point. Despite verifying the wiring connections to be correct, and replacing the fingerprint sensor, the system continues to hang at finger.begin(57600). I would appreciate any guidance on what might be causing this issue. this is my code:
SoftwareSerial mySerial(2, 3); // RX, TX
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);

void setup() {
Serial.begin(9600);
finger.begin(57600);
if (finger.verifyPassword()) {
Serial.println("Fingerprint sensor detected!");
} else {
Serial.println("Sensor not detected!");
}
}
SoftwareSerial mySerial(2, 3); // RX, TX
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);

void setup() {
Serial.begin(9600);
finger.begin(57600);
if (finger.verifyPassword()) {
Serial.println("Fingerprint sensor detected!");
} else {
Serial.println("Sensor not detected!");
}
}
Solution:
You are using SoftwareSerial on pins 2 and 3, but you're trying to communicate with the sensor using hardware UART pins (D0, D1). Either update mySerial to use pins 0 and 1 for hardware UART, or stick with SoftwareSerial and connect the fingerprint sensor to pins 2 and 3.
Jump to solution
2 Replies
Solution
wafa_ath
wafa_ath3mo ago
You are using SoftwareSerial on pins 2 and 3, but you're trying to communicate with the sensor using hardware UART pins (D0, D1). Either update mySerial to use pins 0 and 1 for hardware UART, or stick with SoftwareSerial and connect the fingerprint sensor to pins 2 and 3.
Dtynin
Dtynin3mo ago
Yeah, that was an oversight 😩😩, on it.. thanks for pointing out 👍🏽
Want results from more Discord servers?
Add your server