arduino electronic fingerprint lock, AS608/FPM10A interoperability

tags: arduino  MCU

The previous article only had pictures, so today I will talk a little bit about the production process.
This is also a ghost project of the school. I never knew what to do. Later, I saw on the Internet that some college students installed fingerprint locks in their dormitories. I was immediately inspired and I did it myself. One!

Material, arduino UNO development board; optical fingerprint module, model AS608/FPM10A; steering gear or electromagnetic lock;
I saw a lot of materials when I made it myself. The capacitive fingerprint module is cheaper, such as the small wafer on the mobile phone. I think the optical accuracy of the punch card is better. , The number of fingerprints that can be stored is large, and it seems to be "tall".
As for the source code, the source code here refers only to the source code of the fingerprint module. It is available on GitHub and is very easy to use. Download and unzip the package. Place the package in the libraries folder of arduino. Open the arduino. File-example-open that folder, inside
enroll is a fingerprint input program, one finger is pasted twice
delete, enter the number you entered before to delete
fingerprint, check the match, paste the finger you have recorded, and display the matching value. The higher the value, the better the fit.
These three are probably commonly used. Almost all the so-called source codes seen on the Internet are to pull out the things in the fingerprint library and paste them. There is no tutorial. It is recommended to download the complete installation package on GitHub and import it into the local arduino library.

There are 6 wires in total, 4 of them can be used. I'm not in school now, and things are not at hand. I forgot specifically, most of them are power positive and negative, and two communication wires: TX, RX and development board The opposite connection above will do. The voltage must match, mine is 5V, even 3.3V on the development board will flash.

Finally, it is a small step to debug this fingerprint module. After all, it is only a finger and the computer screen will feedback a message. The difficulty lies in connecting it to the "lock". Originally, I bought one directly on Taobao. Locks are the kind of locks that can be locked and unlocked as soon as electricity is applied. Due to the limited funding, it happens that the laboratory has a steering gear. Following the opinions of the boss, it is enough to use the steering gear to simulate unlocking. There is no need to get a lock, as long as it is a mechanical device.
The fingerprint program in the library just mentioned is used here to make such a logical judgment. When the matching value reaches X, it will give the servo a signal and let it drive the bolt to rotate to simulate unlocking. So I transformed the library code and integrated the little knowledge about steering gear I learned before.

Insert the servo rotation related code in the last position of the fingerprint library. Originally, it should output the matching value and fingerprint label when the fingerprint is matched. Now it will drive the servo to rotate first, and then output the number to achieve the purpose of unlocking and releasing. .
Finally, I also added a little material: LED lights.
If the fingerprints do not match, give RED a signal, that is, the red light is on,
If it matches, it will give a signal to BLUE while driving the servo, and the blue light will be on. (The color is defined by yourself here, I use what I have in the laboratory)
Above in order to open the production idea, below, upload the code

#include <Adafruit_Fingerprint.h>
#include <Servo.h>    
// On Leonardo/Micro or others with hardware serial, use those! #0 is green wire, #1 is white
// uncomment this line:
// #define mySerial Serial1

// For UNO and others without hardware serial, we must use software serial...
// pin #2 is IN from sensor (GREEN wire)
// pin #3 is OUT from arduino  (WHITE wire)
// comment these two lines if using hardware serial
SoftwareSerial mySerial(2, 3);
Servo myservo;        
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
int bluePin = 10; 
int redPin=11;
int pos = 0;         
void setup()  
{
  Serial.begin(9600);
  pinMode(redPin, OUTPUT);
  pinMode(bluePin,OUTPUT);
  myservo.attach(9); 
  //while (!Serial);  // For Yun/Leo/Micro/Zero/...
  delay(100);
  Serial.println("\n\nAdafruit finger detect test");

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

  finger.getTemplateCount();
  Serial.print("Sensor contains "); Serial.print(finger.templateCount); Serial.println(" templates");
  Serial.println("Waiting for valid finger...");
}

void loop()                  
{
  getFingerprintIDez();
  delay(200);            //don't ned to run this at full speed.
}

uint8_t 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 p;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      return p;
    case FINGERPRINT_IMAGEFAIL:
      Serial.println("Imaging error");
      return p;
    default:
      Serial.println("Unknown error");
      return p;
  }

  // OK success!

  p = finger.image2Tz();
  switch (p) {
    case FINGERPRINT_OK:
      Serial.println("Image converted");
      break;
    case FINGERPRINT_IMAGEMESS:
      Serial.println("Image too messy");
      return p;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      return p;
    case FINGERPRINT_FEATUREFAIL:
      Serial.println("Could not find fingerprint features");
      return p;
    case FINGERPRINT_INVALIDIMAGE:
      Serial.println("Could not find fingerprint features");
      return p;
    default:
      Serial.println("Unknown error");
      return p;
  }
  
 
  p = finger.fingerFastSearch();
  if (p == FINGERPRINT_OK) {
    Serial.println("Found a print match!");
    
    //open the door
  } else if (p == FINGERPRINT_PACKETRECIEVEERR) {
    Serial.println("Communication error");
    return p;
  } else if (p == FINGERPRINT_NOTFOUND) {
    Serial.println("Did not find a match");
    return p;
  } else {
    Serial.println("Unknown error");
    return p;
  }   
  

  Serial.print("Found ID #"); Serial.print(finger.fingerID); 
  Serial.print(" with confidence of "); Serial.println(finger.confidence);
  

  return finger.fingerID;
}


int getFingerprintIDez() {
  uint8_t p = finger.getImage();
  if (p != FINGERPRINT_OK)  return -1;

  p = finger.image2Tz();
  if (p != FINGERPRINT_OK)  return -1;

  p = finger.fingerFastSearch();
  if (p != FINGERPRINT_OK)  {
    digitalWrite(redPin,HIGH);
    delay(200);
    digitalWrite(redPin,LOW);
    delay(5);
    return -1;
  }
  Serial.print("Found ID #"); Serial.print(finger.fingerID); 
  Serial.print(" with confidence of "); Serial.println(finger.confidence);
    digitalWrite(bluePin, HIGH);
    digitalWrite(bluePin, LOW); 
    delay(5); 
     for(pos = 0; pos<90; pos+=1){
            myservo.write(pos);            
            delay(15);                       
    }
    
    for(pos = 90; pos>=1; pos -= 1) {
          myservo.write(pos);           
          delay(15);                    
    }

The code is a bit C-based and almost can be seen. If it is recommended to do it, you should also learn to learn the code rules of arduino. This is easier to understand than the single-chip computer hhhh. This code is fully integrated. Define the relevant interfaces and materials yourself. Of course, if you have no financial constraints, it is better to have a ready-made lock. It seems that you can use any transistor to drive it, but I bought a transistor. .
mi has funds.

In the picture at the time, I entered the thumb but not the index finger, so the red light was on when the index finger was attached, and the robotic arm did not turn.
In another picture postlink
The other two are pictures that have been unlocked, and the blue light is on but not photographed, but you can see that the steering gear has turned a certain angle. Anyway, it's relatively simple (carry forward hardcore punk style)
That's it.
According to the national policy, you can’t go to school now. Some things are not photographed, and the specific process is forgotten. It will be updated in the future. I was soaked in the laboratory for several days, and the things were made on the last day of 2019. In the end, an independent power supply was added. After all, it is impossible to install a fingerprint lock on the door to connect to a computer. The project will only be closed at the end of 2020, and can rest for a long time.

The first time you write a blog, the code word is not easy. Just like the idea and content if it is helpful to you.

Intelligent Recommendation

AS608 fingerprint module

AS608 fingerprint module 1. Introduction Two, appearance 3. AS608 module pin description Four, system resources Six, development process Seven, the principle of use Eight, STM32 program to sum up 1. I...

AS608 optical fingerprint module

Directory Guidelines 1. Fingerprint concept 1. The origin of fingerprints 2. The uniqueness of fingerprints 2. Fingerprint detection 1. How to Obtain 2. Fingerprint recognition advantage: Disadvantage...

esp8266 interoperability with arduino

Pin connected: VCC and ground in series 3.3v CH_PD RX and TX according to the code corresponding contact (code is below) GDN no other ground code with the inside example softwareserialexample Code #in...

Fingerprint lock

// This question is mainly written to the SET custom method. It should be noted that the overload of the operator cannot be written directly like sort (), but to overload in the structure....

Password electronic lock with ARDUINO UNO Bluetooth HC05 LCD1602-IIC

Original content ---- Please explain the reprint. Material (just main): Material name Number Arduino UNO 1 LCD1602A - IIC (to take IIC adapter board) 1 Rectangular button 3 * 4 (can also be homemade) ...

More Recommendation

AS608 fingerprint module development tutorial

One. Introduction The AS608 fingerprint recognition module mainly refers to the fingerprint module made of the AS608 fingerprint recognition chip of Hangzhou Shengyuan Chip Technology Co., Ltd. (Synoc...

Brief description of AS608 fingerprint module

The AS608 fingerprint module is equipped with serial port and USB communication interface. Users do not need to study complex image processing and fingerprint recognition algorithms, and can control t...

[Arduino] Capacitive Fingerprint Reader Capacitive Fingerprint Reader

reference Capacitive Fingerprint Reader User Manual Module appearance overall: Main control board: sensor: Interface introduction As you can see from the picture above, the module has 6 interfaces: VC...

Arduino-based fingerprint to unlock box

A system block diagram II. Hardware 1.Arduino UNO Development Board 2. Bluetooth Module HC-05 2.AS608 optical fingerprint module 3.HC_SR501 human body sensing module 4. LED light ring 5.12V relay 612V...

NC17508 fingerprint lock

Meaning: There can only be one number in a fixed-length range. Here you can use set to merge an interval. algorithm: 1. Overload operators and modify the sorting operation. 2. When the distance betwee...

Copyright  DMCA © 2018-2025 - All Rights Reserved - www.programmersought.com  User Notice

Top