Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino 101 Fingerprint Identification System

View and Edit Project In Cirkit DesignerImage of Arduino 101 Fingerprint Identification System

Circuit Documentation

Summary of the Circuit

This circuit consists of an Arduino 101 microcontroller board interfaced with an R307 fingerprint sensor. The purpose of the circuit is to utilize the Arduino 101 to communicate with the R307 sensor, process fingerprint data, and perform actions based on the fingerprint recognition results. The Arduino 101 provides the necessary computational power and connectivity, while the R307 sensor captures and processes the fingerprint data.

Component List

Arduino 101

R307 Fingerprint Sensor

Wiring Details

Arduino 101

R307 Fingerprint Sensor

Documented Code

Arduino 101 Code

/*
 * Arduino Interface with R307 Fingerprint Sensor
 * This code interfaces the Arduino 101 with the R307 fingerprint sensor.
 * The sensor's TX pin is connected to the Arduino's RX pin (D0).
 * The sensor's RX pin is connected to the Arduino's TX pin (D1).
 * The sensor's VCC pin is connected to the Arduino's 5V pin.
 * The sensor's GND pin is connected to the Arduino's GND pin.
 */

#include <Adafruit_Fingerprint.h>

// Define the pins for the fingerprint sensor
#define rxPin 0
#define txPin 1

// Create the fingerprint sensor object
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&Serial1);

void setup() {
  // Initialize serial communication
  Serial.begin(9600);
  while (!Serial);
  Serial.println("Adafruit Fingerprint sensor demo");

  // Initialize the fingerprint sensor
  finger.begin(57600);
  if (finger.verifyPassword()) {
    Serial.println("Found fingerprint sensor!");
  } else {
    Serial.println("Did not find fingerprint sensor :(");
    while (1) { delay(1); }
  }
}

void loop() {
  // Put your main code here, to run repeatedly:
  getFingerprintID();
  delay(50); // Add a small delay to avoid overwhelming the sensor
}

void getFingerprintID() {
  uint8_t p = finger.getImage();
  switch (p) {
    case FINGERPRINT_OK:
      Serial.println("Image taken");
      break;
    case FINGERPRINT_NOFINGER:
      Serial.println("No finger detected");
      return;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      return;
    case FINGERPRINT_IMAGEFAIL:
      Serial.println("Imaging error");
      return;
    default:
      Serial.println("Unknown error");
      return;
  }

  // OK success!
  p = finger.image2Tz();
  switch (p) {
    case FINGERPRINT_OK:
      Serial.println("Image converted");
      break;
    case FINGERPRINT_IMAGEMESS:
      Serial.println("Image too messy");
      return;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      return;
    case FINGERPRINT_FEATUREFAIL:
      Serial.println("Could not find fingerprint features");
      return;
    case FINGERPRINT_INVALIDIMAGE:
      Serial.println("Could not find fingerprint features");
      return;
    default:
      Serial.println("Unknown error");
      return;
  }

  // OK converted!
  p = finger.fingerFastSearch();
  if (p == FINGERPRINT_OK) {
    Serial.println("Found a print match!");
  } else if (p == FINGERPRINT_PACKETRECIEVEERR) {
    Serial.println("Communication error");
  } else if (p == FINGERPRINT_NOTFOUND) {
    Serial.println("Did not find a match");
  } else {
    Serial.println("Unknown error");
  }
}

R307 Fingerprint Sensor Code

The R307 fingerprint sensor does not have user-accessible code as it is a hardware module with pre-programmed firmware. Communication with the sensor is handled by the Arduino 101 through the provided library and code above.