Fingerprint Sensor(R305) with Interface Board(PIC)
Input: Two ways to trigger the function of fingerprint sensor
- Onboard switch: Add, Empty or Search.
- Make pin low from external microcontroller for 5ms as per function required to be executed.
Outputs(Response): Two ways to monitor output response after a function is executed
- Onboard LEDs: ERROR or OK
- Read byte after executing function
Types of function
There are namely three functions you can call for the fingerprint sensor. We will see each in brief.
Add(Enroll) Function: Adds a fingerprint to database and return a byte of newly added ID. Return values are from 0x00 to 0xFE. In case of error like no finger placed, return code is 0xFF. Here 0xFF means error executing function
Search Function: When a finger is put and search funtion is called, it returns a matching ID if found in its existing memory. Return values are from 0x00 to 0xFE. In case of error like no finger placed, return code is 0xFF. Here 0xFF means error executing function.
Empty Function: When you wish to empty all fingerprint data stored on sensor you can use this function. After executing this function, you will get 0xCC as OK or 0xFF in case of error.
We will use an example of AT89S52 MCU to interface but can be any MCU like AT89C51 or AVR or PIC. Since the sample code is in C language. The logic will remain same across all C compilers.