SUNROM ELECTRONICS

Fingerprint Sensor(R305) with Interface Board(PIC)

Easy to use protocol with LEDs, SW and built in controller.

Fingerprint Sensor(R305) with Interface Board(PIC)

Sunrom Part# 1125

Available We dispatch same day if ordered by 4PM (excluding holidays), then courier usually takes 2-5 days.
Quantity Pricing
Quantity :
Price
1-49 :
Rs.3,100/- (0%)
50-99 :
Rs.2,945/- (5%)
100+ :
Rs.2,790/- (10%)

The fingerprint sensor is combination of R305 FP+PIC MCU board that can read different fingerprints and store in its own flash memory. The sensor can perform three functions namely Add(Enroll) , Empty Database or Search Database and return the ID of stored fingerprint.

Any of three functions can be called simply by making the pin low of the sensor or pressing onboard three switches. The response is either error or ok which is indicated by onboard LED. The response is also returned as single serial data byte. The return byte is a valid ID or error code. The response byte is a single byte at 9600 bps thus making whole sensor very easy to use. We have provided indicating LEDs and function switch already so it’s ready to use when you receive it. Just give power and start using the sensor using onboard switches. Then you can move on making external application using these functions. 

Features

  • Easy to use
  • Status LEDs
  • Function Switches
  • Single byte response
  • Works at 5V
  • UART 9600bps response

Inputs and Outputs of Sensor

Input: Two ways to trigger the function of fingerprint sensor

  1. Onboard switch: Add, Empty or Search.
  2. 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

  1. Onboard LEDs: ERROR or OK
  2. 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.

Application Example

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. 

All three functions of fingerprint sensor are trigged by simply making the sensor's pin low for 50 milisecond and waiting for answer of single byte. If function executes fine we switch on OK LED for 1 second. If error then we switch on ERROR led for 1 second.

You can further expand this example code to send data to PC using MCU TX pin or add an LCD to show various functions and IDs returned. 

//     Author:	Sunrom Technologies  28/5/2012
//     Board: Fingerprint Sensor Demo  Model: 1125  at Sunrom.com
//     The program will show how to interface sunrom fingerprint sensor
//	model 1125 with any 8051 MCU.
//	All three functions of fingerprint sensor are trigged
//	by simply making the sensor's pin low and waiting for answer of single byte.
//	It will output serial string to its TXD pin to view output on PC.
//	Instead of PC you can also write code to use LCD for functions.
//      Compiler: Keil C51        MCU: AT89S52

#include <REGX51.H> // standard 8051 defines

// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// -=-=-=-=- Hardware Defines -=-=-=-=-=-=-=
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

//Switches on MCU
sbit SW_ADD 		= P1^0;
sbit SW_EMPTY 	        = P1^1;
sbit SW_SEARCH 	= P1^2;

// LEDs on MCU
sbit LED_ERR 	        = P1^6;
sbit LED_OK 	        = P1^7;

// Fingerprint functions
sbit FP_ADD 		= P3^2;
sbit FP_EMPTY 	        = P3^3;
sbit FP_SEARCH 	= P3^4;

// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// -=-=-=-=- Variables				 -=-=-=-=
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
char response;

// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// -=-=-=-=- Wait for character -=-=-=-=-==-=
// -=-=-=-=- from serial port  -=-=-=-=-=-=-=
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
char mygetchar(void)
{
	char c;
	while(!RI);
	RI =0;
	c = SBUF;
	return SBUF;
}

// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// -=-=-=-=- Delay X milisecond -=-=-=-=-=-=-=
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
void delay_ms(unsigned int x)	 // delays x msec (at fosc=11.0592MHz)
{
	unsigned char j=0;
	while(x-- > 0)
	{
		for (j=0; j<125; j++){;}
	}
}

// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// -=-=-=-=- Main Program -=-=-=-=-=-=-=
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
void main()
{
	// -=-=- Intialize variables -=-=-=
	response = 0;
		
	// -=-=- Intialise Serial Port -=-=-=
	//Sets up MCU to use 9600 bps @ 11.059 MHz Crystal
	SCON = 0x52; // 8-bit UART mode
	TMOD = 0x20; // timer 1 mode 2 auto reload
	TH1= 0xfd; // 9600 8-n-1
	TR1 = 1; // run timer1
	
	// -=-=- Program Loop -=-=-=
	while(1)
	{
		
///////// Add			
			if(SW_ADD==0)	// check for Add switch
			{				
				// Trigger Add Function
				FP_ADD = 0;
				delay_ms(50);
				FP_ADD = 1;
				
				// Check response byte
				response = mygetchar(); //loop till character received
				if(response==0xFF) // if error
				{
					// Do something like LCD error print
					LED_ERR = 0; // LED ON for 1 Sec
					delay_ms(1000);
					LED_ERR = 1;
				} else
				{					
					// response variable has the newly added ID
					// Do something like LCD ID print like add succesful with ID
					// for Demo we just switch on OK LED
					LED_OK = 0; // LED ON for 1 Sec
					delay_ms(1000);
					LED_OK = 1;					
				}
			}
			
///////// Empty			
			if(SW_EMPTY==0)	// check for Add switch
			{				
				// Trigger Empty Function
				FP_EMPTY = 0;
				delay_ms(50);
				FP_EMPTY = 1;
				
				// Check response byte
				response = mygetchar(); //loop till character received
				if(response==0xFF) // if error
				{
					// Do something like LCD error print for empty failed
					LED_ERR = 0; // LED ON for 1 Sec
					delay_ms(1000);
					LED_ERR = 1;
				} else
				{					
					// Do something like LCD print for empty success
					// for Demo we just switch on OK LED
					LED_OK = 0; // LED ON for 1 Sec
					delay_ms(1000);
					LED_OK = 1;					
				}
			}
			
///////// Search			
			if(SW_SEARCH==0)	// check for Add switch
			{				
				// Trigger Add Function
				FP_SEARCH = 0;
				delay_ms(50);
				FP_SEARCH = 1;
				
				// Check response byte
				response = mygetchar(); //loop till character received
				if(response==0xFF) // if error
				{
					// Do something like LCD error print
					LED_ERR = 0; // LED ON for 1 Sec
					delay_ms(1000);
					LED_ERR = 1;
				} else
				{					
					// response variable has the found ID in database
					// Do something like LCD ID print like Search succesful with ID
					// for Demo we just switch on OK LED
					LED_OK = 0; // LED ON for 1 Sec
					delay_ms(1000);
					LED_OK = 1;					
				}
			}						
	} // end while
}// end main

Note: The unit is tested before dispatch. There is no warranty for fingerprint module as it easily get damage with wrong voltage or high voltage given to it.

Leave this empty: