How To Enroll New Fingerprint ID In Fingerprint Sensor R307 Using Arduino Uno By Technoesolution | #arduinotutorial

January 30, 2022

Description

Hello, In a previous article I explain "How to delete unwanted finger ID from sensor" & In this article, I will show you how to "Enroll New fingerprint ID in fingerprint Sensor Using Arduino". To perform this tutorial first add Adafruit Fingerprint ID in your Arduino IDE. I have already explained how to add this library in Arduino IDE you can check out the previous article. I provide the Library link below. I have already made a tutorial video on this topic you can refer to my Youtube Channel for the tutorial.

Watch out the video If reading bores you.

If you got this article helpful then subscribe to our blog as well as our youtube channel for more interesting projects.

Material Required:-

[ Following links are affiliated links, if you buy from them we will get some bonus from it. ]

Sr.No

Product Name

Quantity

Best Buy Link

1

Arduino Uno

1

https://amzn.to/3nCSn4j

2

R307 Fingerprint Sensor

1

https://amzn.to/33DqFgR

3

Breadboard + Jumper Wires

1

https://amzn.to/3fIWUO5

Adafruit Fingerprint Sensor Library:- [Download]

Circuit Diagram:-

Refer above circuit diagram to make proper Connections.

Arduino Code:-

/*
   Hello guys welcome back to "Techno-E-Solution"
   Tutorial Name:- How To Enroll New Fingerprint ID In Fingerprint Sensor R307 Using Arduino Uno 
   Tutorial Video:- https://youtu.be/EpgBC4lx-iE
*/

#include <Adafruit_Fingerprint.h>
SoftwareSerial mySerial(2, 3);
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);

void setup()  
{
  Serial.begin(9600);
  while (!Serial);  // For Yun/Leo/Micro/Zero/...
  delay(100);
  Serial.println("\n\nDelete Finger");

  // set the data rate for the sensor serial port
  finger.begin(57600);
  
  if (finger.verifyPassword()) {
    Serial.println("Found fingerprint sensor!");
  } else {
    Serial.println("Did not find fingerprint sensor :(");
    while (1);
  }
}


uint8_t readnumber(void) {
  uint8_t num = 0;
  
  while (num == 0) {
    while (! Serial.available());
    num = Serial.parseInt();
  }
  return num;
}

void loop()                     // run over and over again
{
  Serial.println("Please type in the ID # (from 1 to 127) you want to delete...");
  uint8_t id = readnumber();
  if (id == 0) {// ID #0 not allowed, try again!
     return;
  }

  Serial.print("Deleting ID #");
  Serial.println(id);
  
  deleteFingerprint(id);
}

uint8_t deleteFingerprint(uint8_t id) {
  uint8_t p = -1;
  
  p = finger.deleteModel(id);

  if (p == FINGERPRINT_OK) {
    Serial.println("Deleted!");
  } else if (p == FINGERPRINT_PACKETRECIEVEERR) {
    Serial.println("Communication error");
    return p;
  } else if (p == FINGERPRINT_BADLOCATION) {
    Serial.println("Could not delete in that location");
    return p;
  } else if (p == FINGERPRINT_FLASHERR) {
    Serial.println("Error writing to flash");
    return p;
  } else {
    Serial.print("Unknown error: 0x"); Serial.println(p, HEX);
    return p;
  }   
}


You can Buy me coffee If you go this article is helpful.