{"id":48409,"date":"2018-01-26T10:02:49","date_gmt":"2018-01-26T10:02:49","guid":{"rendered":"http:\/\/randomnerdtutorials.com\/?p=48409"},"modified":"2022-05-30T09:33:40","modified_gmt":"2022-05-30T09:33:40","slug":"fingerprint-sensor-module-with-arduino","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/fingerprint-sensor-module-with-arduino\/","title":{"rendered":"Guide to Fingerprint Sensor Module with Arduino (FPM10A)"},"content":{"rendered":"\n<p>This post is an introductory guide on how to use the Fingerprint Sensor Module with the Arduino. We&#8217;ll show you how to enroll a new fingerprint ID, and how to find a fingerprint match.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Watch the Video Demonstration<\/h2>\n\n\n<p style=\"text-align:center\"><iframe width=\"720\" height=\"405\" src=\"https:\/\/www.youtube.com\/embed\/r-opSIx66TE?rel=0\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introducing the Fingerprint Sensor Module<\/h2>\n\n\n\n<p><a href=\"https:\/\/makeradvisor.com\/tools\/fingerprint-sensor-module\/\" target=\"_blank\" rel=\"noreferrer noopener\">Fingerprint sensor modules<\/a>, like the one in the following figure, made fingerprint recognition more accessible and easy to add to your projects. This means that is is super easy to make fingerprint collection, registration, comparison and search.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/makeradvisor.com\/tools\/fingerprint-sensor-module\/\" target=\"_blank\" rel=\"noreferrer noopener\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" width=\"429\" height=\"389\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/12\/fingerprint-sensor-module-f.jpg?resize=429%2C389&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-48426\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/12\/fingerprint-sensor-module-f.jpg?w=429&amp;quality=100&amp;strip=all&amp;ssl=1 429w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/12\/fingerprint-sensor-module-f.jpg?resize=300%2C272&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 429px) 100vw, 429px\" \/><\/a><\/figure><\/div>\n\n\n\n<p>These modules come with FLASH memory to store the fingerprints and work with any microcontroller or system with TTL serial. These modules can be added to security systems, door locks, time attendance systems, and much more.<\/p>\n\n\n\n<p>Prices for this sensor greatly vary from $10 to $50. We recommend checking the <a href=\"https:\/\/makeradvisor.com\/fingerprint-sensor-module\/\" target=\"_blank\" rel=\"noreferrer noopener\">Fingerprint sensor module on Maker Advisor<\/a> that compares the price in different stores. The fingerprint sensor modules featured on Maker Advisor should be compatible with this guide.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Specifications<\/h3>\n\n\n\n<p>Here&#8217;s the specifications of the <a href=\"https:\/\/makeradvisor.com\/tools\/fingerprint-sensor-module\/\" target=\"_blank\" rel=\"noreferrer noopener\">fingerprint sensor module<\/a> we&#8217;re using (you should check your sensor datasheet or the specifications provided by your supplier &#8211; they shouldn&#8217;t be much different than these):<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Voltage supply: DC 3.6 to 6.0V<\/li><li>Current supply: &lt;120mA<\/li><li>Backlight color: green<\/li><li>Interface: UART<\/li><li>Bad rate: 9600<\/li><li>Safety level: five (from low to high: 1,2,3,4,5)<\/li><li>False Accept Rate (FAR): &lt;0.001% (security level 3)<\/li><li>False Reject Rate (FRR): &lt;1.0% (security level 3)<\/li><li>Able to store 127 different fingerprints<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Sensor Pinout<\/h3>\n\n\n\n<p>The sensor has six pins that are labeled in the figure below.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"750\" height=\"451\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/01\/arduino-fingerprint-pins-labeled-1.jpg?resize=750%2C451&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-51264\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/01\/arduino-fingerprint-pins-labeled-1.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/01\/arduino-fingerprint-pins-labeled-1.jpg?resize=300%2C180&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n\n<p>The fingerprint sensor module used in this project came with really thin wires, so soldering breadboard-friendly wires was needed. We recommend using different colors according to the pin function. In our case:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>DNC &#8211; white wires<\/li><li>VCC &#8211; red wire<\/li><li>TX &#8211; blue wire<\/li><li>RX &#8211; green wire<\/li><li>GND &#8211; black wire<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"750\" height=\"420\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/01\/wires-soldered.jpg?resize=750%2C420&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-51265\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/01\/wires-soldered.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/01\/wires-soldered.jpg?resize=300%2C168&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n\n<p>The following table shows how to wire the sensor to the Arduino.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Fingerprint Sensor<\/strong><\/td><td><strong>Arduino<\/strong><\/td><\/tr><tr><td>VCC<\/td><td><span class=\"rnthl rntcred\">5V<\/span> (it also works with 3.3V)<\/td><\/tr><tr><td>TX<\/td><td>RX (<span class=\"rnthl rntcblue\">digital pin 2<\/span>, software serial)<\/td><\/tr><tr><td>RX<\/td><td>TX (<span class=\"rnthl rntcgreen\">digital pin 3<\/span>, software serial)<\/td><\/tr><tr><td>GND<\/td><td><span class=\"rnthl rntcblack\">GND<\/span><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Installing the Adafruit Fingerprint Sensor Library<\/h2>\n\n\n\n<p>The easiest way to control the fingerprint sensor module with the Arduino is by using the Adafruit library for this sensor. Follow the next instructions to install the library:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Click here to download the <a href=\"https:\/\/github.com\/adafruit\/Adafruit-Fingerprint-Sensor-Library\/archive\/master.zip\" target=\"_blank\" rel=\"noreferrer noopener\">Adafruit Fingerprint Sensor library<\/a>. You should have a .zip folder in your Downloads folder<\/li><li>Unzip the .zip folder and you should get Adafruit-Fingerprint-Sensor-Library-master folder<\/li><li>Rename your folder from &nbsp;<del>Adafruit-Fingerprint-Sensor-Library-master<\/del> folder to&nbsp; <strong>Adafruit_Fingerprint_Sensor_Library folder<\/strong><\/li><li>Move the folder to your Arduino IDE installation libraries folder<\/li><li>Finally, re-open your Arduino IDE<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Enroll a New Fingerprint<\/h2>\n\n\n\n<p>Having the fingerprint sensor module wired to the Arduino, follow the next steps to enroll a new fingerprint. Make sure you&#8217;ve installed the Adafruit Fingerprint Sensor library previously.<\/p>\n\n\n\n<p><strong>1.<\/strong> In the Arduino IDE, go to <strong>File<\/strong> &gt; <strong>Examples<\/strong> &gt; <strong>Adafruit<\/strong> <strong>Fingerprint<\/strong> <strong>Sensor<\/strong> <strong>Library<\/strong> &gt; <a href=\"https:\/\/raw.githubusercontent.com\/RuiSantosdotme\/Random-Nerd-Tutorials\/master\/Projects\/Fingerprint\/enroll.ino\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Enroll<\/strong><\/a>.<\/p>\n\n\n\n<p><strong>2.<\/strong> Upload the code, and open the serial monitor at a baud rate of 9600.<\/p>\n\n\n\n<p><strong>3.<\/strong> You should enter an ID for the fingerprint. As this is your first fingerprint, type 1 at the top left corner, and then, click the <strong>Send<\/strong> button.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"761\" height=\"260\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/12\/enroll-serial-monitor.jpg?resize=761%2C260&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-48430\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/12\/enroll-serial-monitor.jpg?w=761&amp;quality=100&amp;strip=all&amp;ssl=1 761w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/12\/enroll-serial-monitor.jpg?resize=300%2C102&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 761px) 100vw, 761px\" \/><\/figure><\/div>\n\n\n\n<p><strong>4.<\/strong> Place your finger on the scanner and follow the instructions on the serial monitor.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/01\/enroll-finger.jpg?quality=100&#038;strip=all&#038;ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"421\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/01\/enroll-finger.jpg?resize=750%2C421&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-51266\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/01\/enroll-finger.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/01\/enroll-finger.jpg?resize=300%2C168&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/a><\/figure><\/div>\n\n\n\n<p>You&#8217;ll be asked to place the same finger twice on the scanner. If you get the &#8220;<strong>Prints matched!<\/strong>&#8221; message, as shown below, your fingerprint was successfully stored. If not, repeat the process, until you succeed.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"587\" height=\"344\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/12\/enroll-serial-monitor-match-f.jpg?resize=587%2C344&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-48432\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/12\/enroll-serial-monitor-match-f.jpg?w=587&amp;quality=100&amp;strip=all&amp;ssl=1 587w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/12\/enroll-serial-monitor-match-f.jpg?resize=300%2C176&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 587px) 100vw, 587px\" \/><\/figure><\/div>\n\n\n\n<p>Store as many fingerprints you want using this method.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Finding a Match<\/h2>\n\n\n\n<p>You now should have several fingerprints saved on different IDs. To find a match with the fingerprint sensor, follow the next instructions.<\/p>\n\n\n\n<p><strong>1.<\/strong> In the Arduino IDE, go to <strong>File<\/strong> &gt; <strong>Examples<\/strong> &gt; <strong>Adafruit<\/strong> <strong>Fingerprint<\/strong> <strong>Sensor<\/strong> <strong>Library<\/strong> &gt; <a href=\"https:\/\/raw.githubusercontent.com\/RuiSantosdotme\/Random-Nerd-Tutorials\/master\/Projects\/Fingerprint\/fingerprint_match.ino\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Fingerprint <\/strong><\/a>and upload the code to your Arduino board.<\/p>\n\n\n\n<p><strong>2.&nbsp;<\/strong>Open the Serial Monitor at a baud rate of 9600. You should see the following message:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"589\" height=\"338\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/12\/fingerprint-match-1.jpg?resize=589%2C338&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-48436\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/12\/fingerprint-match-1.jpg?w=589&amp;quality=100&amp;strip=all&amp;ssl=1 589w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/12\/fingerprint-match-1.jpg?resize=300%2C172&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 589px) 100vw, 589px\" \/><\/figure><\/div>\n\n\n\n<p><strong>3.&nbsp;<\/strong>Place the finger to be identified on the scan.<\/p>\n\n\n\n<p><strong>4.<\/strong> On the serial monitor, you can see the ID that matches the fingerprint. It also shows the confidence &#8211; the higher the confidence, the similar the fingerprint is with the stored fingerprint.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"589\" height=\"341\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/12\/fingerprint-match-2.jpg?resize=589%2C341&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-48437\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/12\/fingerprint-match-2.jpg?w=589&amp;quality=100&amp;strip=all&amp;ssl=1 589w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/12\/fingerprint-match-2.jpg?resize=300%2C174&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 589px) 100vw, 589px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Project Example &#8211; Show Fingerprint Match on OLED display<\/h2>\n\n\n\n<p>In this project example, we&#8217;ll enroll two fingerprints from two different persons. Then, we&#8217;ll display a greeting message accordingly to the match found, on an OLED display.<\/p>\n\n\n\n<p>To learn more about the OLED display read: <a href=\"https:\/\/randomnerdtutorials.com\/guide-for-oled-display-with-arduino\/\" target=\"_blank\" rel=\"noreferrer noopener\">Guide for OLED Display with Arduino<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Parts required<\/h3>\n\n\n\n<p>For this example you&#8217;ll need the following parts:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/01\/parts-required.jpg?quality=100&#038;strip=all&#038;ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"376\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/01\/parts-required.jpg?resize=750%2C376&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-51267\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/01\/parts-required.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/01\/parts-required.jpg?resize=300%2C150&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/a><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/makeradvisor.com\/tools\/compatible-arduino-uno-r3-board\/\" target=\"_blank\" rel=\"noreferrer noopener\">Arduino UNO<\/a>&nbsp;\u2013 read&nbsp;<a href=\"https:\/\/makeradvisor.com\/best-arduino-starter-kits\/\" target=\"_blank\" rel=\"noreferrer noopener\">Best Arduino Starter Kits<\/a><\/li><li><a href=\"https:\/\/makeradvisor.com\/fingerprint-sensor-module\/\" target=\"_blank\" rel=\"noreferrer noopener\">Fingerprint sensor module<\/a><\/li><li><a href=\"https:\/\/makeradvisor.com\/tools\/oled-display-128x64-0-96-inch\/\" target=\"_blank\" rel=\"noreferrer noopener\">0.96 inch OLED display<\/a><\/li><li><a href=\"https:\/\/makeradvisor.com\/tools\/mb-102-solderless-breadboard-830-points\/\" target=\"_blank\" rel=\"noreferrer noopener\">Breadboard<\/a><\/li><li><a href=\"https:\/\/makeradvisor.com\/tools\/jumper-wires-kit-120-pieces\/\" target=\"_blank\" rel=\"noreferrer noopener\">Jumper Wires<\/a><\/li><\/ul>\n\n\n<p>You can use the preceding links or go directly to <a href=\"https:\/\/makeradvisor.com\/tools\/?utm_source=rnt&utm_medium=post&utm_campaign=post\" target=\"_blank\">MakerAdvisor.com\/tools<\/a> to find all the parts for your projects at the best price!<\/p><p style=\"text-align:center;\"><a href=\"https:\/\/makeradvisor.com\/tools\/?utm_source=rnt&utm_medium=post&utm_campaign=post\" target=\"_blank\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/10\/header-200.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\"><\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Schematics<\/h3>\n\n\n\n<p>Here&#8217;s the wiring diagram you should follow to make the circuit for this project.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/01\/fingerprint_OLED_schematic_bb.png?quality=100&#038;strip=all&#038;ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"776\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/01\/fingerprint_OLED_schematic_bb.png?resize=1200%2C776&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-51269\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/01\/fingerprint_OLED_schematic_bb.png?w=1428&amp;quality=100&amp;strip=all&amp;ssl=1 1428w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/01\/fingerprint_OLED_schematic_bb.png?resize=300%2C194&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/01\/fingerprint_OLED_schematic_bb.png?resize=768%2C497&amp;quality=100&amp;strip=all&amp;ssl=1 768w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/01\/fingerprint_OLED_schematic_bb.png?resize=1024%2C663&amp;quality=100&amp;strip=all&amp;ssl=1 1024w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/a><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Installing the 0.96 inch OLED libraries<\/h3>\n\n\n\n<p>To control the OLED display you need the&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/adafruit\/Adafruit_SSD1306\" target=\"_blank\">adafruit_SSD1306.h<\/a>&nbsp;and the&nbsp;<a href=\"https:\/\/github.com\/adafruit\/Adafruit-GFX-Library\" target=\"_blank\" rel=\"noreferrer noopener\">adafruit_GFX.h<\/a>&nbsp;libraries. Follow the next instructions to install those libraries.<\/p>\n\n\n\n<p>1. Open your Arduino IDE and go to&nbsp;<strong>Sketch&nbsp;<\/strong>&gt;&nbsp;<strong>Include Library<\/strong>&nbsp;&gt;&nbsp;<strong>Manage Libraries<\/strong>. The Library Manager should open.<\/p>\n\n\n\n<p>2. Type \u201c<strong>SSD1306<\/strong>\u201d in the search box and install the SSD1306 library from Adafruit.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"788\" height=\"443\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/install-ssd1306-adafruit-library.png?resize=788%2C443&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Installing SSD1306 OLED Library ESP8266 ESP32 Arduino\" class=\"wp-image-85156\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/install-ssd1306-adafruit-library.png?w=788&amp;quality=100&amp;strip=all&amp;ssl=1 788w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/install-ssd1306-adafruit-library.png?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/install-ssd1306-adafruit-library.png?resize=768%2C432&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 788px) 100vw, 788px\" \/><\/figure>\n\n\n\n<p>3. After installing the SSD1306 library from Adafruit, type \u201c<strong>GFX<\/strong>\u201d in the search box and install the library.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"786\" height=\"443\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/install-gfx-library-adafruit.png?resize=786%2C443&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Installing GFX Library ESP8266 ESP32 Arduino\" class=\"wp-image-85157\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/install-gfx-library-adafruit.png?w=786&amp;quality=100&amp;strip=all&amp;ssl=1 786w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/install-gfx-library-adafruit.png?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/05\/install-gfx-library-adafruit.png?resize=768%2C433&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 786px) 100vw, 786px\" \/><\/figure>\n\n\n\n<p>4. After installing the libraries, restart your Arduino IDE.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Code<\/h3>\n\n\n\n<p>Before uploading the code, you need to enroll different fingerprints from different persons. Go to &#8220;<strong>Enroll a New Fingerprint&#8221;<\/strong> section above, upload the given code and follow the instructions to enroll two fingerprints.<\/p>\n\n\n\n<p>Then, modify the code so that the fingerprint IDs match the name of the persons enrolled &#8211; scroll down to page for an explanation of the code. Finally, you can upload the code provided.<\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">\/*********\n  Rui Santos\n  Complete project details at http:\/\/randomnerdtutorials.com  \n*********\/\n\n#include &lt;Wire.h&gt;\n#include &lt;Adafruit_GFX.h&gt;\n#include &lt;Adafruit_SSD1306.h&gt;\n#define OLED_RESET 4\nAdafruit_SSD1306 display(OLED_RESET);\n\n#include &lt;Adafruit_Fingerprint.h&gt;\n#include &lt;SoftwareSerial.h&gt;\nSoftwareSerial mySerial(2, 3);\n\nAdafruit_Fingerprint finger = Adafruit_Fingerprint(&amp;mySerial);\nint fingerprintID = 0;\nString IDname;\n\nvoid setup(){\n  \/\/Fingerprint sensor module setup\n  Serial.begin(9600);\n  \/\/ set the data rate for the sensor serial port\n  finger.begin(57600);\n  \n  if (finger.verifyPassword()) {\n    Serial.println(&quot;Found fingerprint sensor!&quot;);\n  } \n  else {\n    Serial.println(&quot;Did not find fingerprint sensor :(&quot;);\n    while (1) { delay(1); }\n  }\n\n  \/\/OLED display setup\n  Wire.begin();\n  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);\n  \/\/displays main screen\n  displayMainScreen();\n}\n\nvoid loop(){\n  displayMainScreen();\n  fingerprintID = getFingerprintIDez();\n  delay(50);\n  if(fingerprintID == 1 || fingerprintID == 3 || fingerprintID == 4 || fingerprintID == 5){\n    IDname = &quot;Sara&quot;;\n    displayUserGreeting(IDname);            \n  }  \n  else if(fingerprintID == 2){\n    IDname = &quot;Rui&quot;;  \n    displayUserGreeting(IDname);            \n  }\n}\n\n\/\/ returns -1 if failed, otherwise returns ID #\nint getFingerprintIDez() {\n  uint8_t p = finger.getImage();\n  if (p != FINGERPRINT_OK)  return -1;\n\n  p = finger.image2Tz();\n  if (p != FINGERPRINT_OK)  return -1;\n\n  p = finger.fingerFastSearch();\n  if (p != FINGERPRINT_OK)  return -1;\n  \n  \/\/ found a match!\n  Serial.print(&quot;Found ID #&quot;); \n  Serial.print(finger.fingerID); \n  Serial.print(&quot; with confidence of &quot;); \n  Serial.println(finger.confidence);\n  return finger.fingerID; \n}\n\nvoid displayMainScreen(){\n  display.clearDisplay();\n  display.setTextSize(1);\n  display.setTextColor(WHITE);\n  display.setCursor(7,5);\n  display.println(&quot;Waiting fingerprint&quot;);\n  display.setTextSize(1);\n  display.setTextColor(WHITE);\n  display.setCursor(52,20);\n  display.println(&quot;...&quot;);  \n  display.display();\n  delay(2000);\n}\n\nvoid displayUserGreeting(String Name){\n  display.clearDisplay();\n  display.setTextColor(WHITE);\n  display.setTextSize(2);\n  display.setCursor(0,0);\n  display.print(&quot;Hello&quot;);\n  display.setCursor(0,15);\n  display.print(Name); \n  display.display();\n  delay(5000);\n  fingerprintID = 0; \n}\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/Random-Nerd-Tutorials\/raw\/master\/Projects\/Fingerprint\/Fingerprint_oled.ino\" target=\"_blank\">View raw code<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Importing libraries<\/h3>\n\n\n\n<p>The code starts by importing the needed libraries to write in the OLED display, and creates an <span class=\"rnthl rntliteral\">Adafruit_SSD1306<\/span> object called display.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>#include &lt;Wire.h&gt;\n#include &lt;Adafruit_GFX.h&gt;\n#include &lt;Adafruit_SSD1306.h&gt;\n#define OLED_RESET 4\nAdafruit_SSD1306 display(OLED_RESET);<\/code><\/pre>\n\n\n\n<p>We also need to import the libraries needed for the fingerprint sensor: <span class=\"rnthl rntliteral\">Adafruit_Fingerprint.h<\/span> and <span class=\"rnthl rntliteral\">SoftwareSerial.h<\/span>.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>#include &lt;Adafruit_Fingerprint.h&gt;\n#include &lt;SoftwareSerial.h&gt;<\/code><\/pre>\n\n\n\n<p>The following line&nbsp;sets software serial on pins 2 and 3. <span class=\"rnthl rntcblue\">Pin 2<\/span> as RX, and <span class=\"rnthl rntcgreen\">Pin 3<\/span> as TX.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>SoftwareSerial mySerial(2, 3);<\/code><\/pre>\n\n\n\n<p>Then, we create a an <span class=\"rnthl rntliteral\">Adafruit_Fingerprint<\/span> object called <span class=\"rnthl rntliteral\">finger<\/span> on the serial pins we&#8217;ve set previously.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>Adafruit_Fingerprint finger = Adafruit_Fingerprint(&amp;mySerial);<\/code><\/pre>\n\n\n\n<p>The next two lines create variables to hold the fingerprint ID and the IDname.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>int fingerprintID = 0;\nString IDname;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">setup()<\/h3>\n\n\n\n<p>In the <span class=\"rnthl rntliteral\">setup()<\/span>, both the fingerprint sensor and the OLED display are initialized. We also print a message on the serial monitor so that we know if the fingerprint sensor was found successfully.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>void setup(){\n \/\/Fingerprint sensor module setup\n Serial.begin(9600);\n \/\/ set the data rate for the sensor serial port\n finger.begin(57600);\n \n if (finger.verifyPassword()) {\n   Serial.println(\"Found fingerprint sensor!\");\n } \n else {\n   Serial.println(\"Did not find fingerprint sensor :(\");\n   while (1) { delay(1); }\n }\n\n\/\/OLED display setup\n Wire.begin();\n display.begin(SSD1306_SWITCHCAPVCC, 0x3C);\n \/\/displays main screen\n displayMainScreen();\n}<\/code><\/pre>\n\n\n\n<p><strong>Recommended reading:<\/strong> <a rel=\"noreferrer noopener\" aria-label=\"Guide for I2C OLED Display with Arduino (opens in a new tab)\" href=\"https:\/\/randomnerdtutorials.com\/guide-for-oled-display-with-arduino\/\" target=\"_blank\">Guide for I2C OLED Display with Arduino<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">loop()<\/h3>\n\n\n\n<p>In the <span class=\"rnthl rntliteral\">loop()<\/span>, the code displays the main screen on the OLED display &#8211; this is done in the <span class=\"rnthl rntliteral\">displayMainScreen()<\/span> function. Then, the code is continuously checking for incoming fingerprints. If the sensor founds a saved fingerprint, the Arduino saves the corresponding ID in the <span class=\"rnthl rntliteral\">fingerprintID<\/span> variable.<\/p>\n\n\n\n<p>Then, the code has an if\/else statement to check the ID the fingerprint corresponds to. You should edit the following lines of code with the corresponding IDs and names.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>if(fingerprintID == 1 || fingerprintID == 3 || fingerprintID == 4 || fingerprintID == 5){\n  IDname = \"Sara\";\n  displayUserGreeting(IDname); \n} \nelse if(fingerprintID == 2){\n  IDname = \"Rui\";<\/code><\/pre>\n\n\n\n<p>Sometimes, the sensor will recognize a fingerprint better if it is saved several times in different IDs. After identifying the ID name, the OLED displays a greeting &#8211; this is done in the <span class=\"rnthl rntliteral\">displayUserGreeting()<\/span> function,<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Demonstration<\/h2>\n\n\n\n<p>Now, when a person with a saved fingerprint places the finger on the sensor, it displays a greeting message.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/01\/demonstration.jpg?quality=100&#038;strip=all&#038;ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"456\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/01\/demonstration.jpg?resize=750%2C456&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-51272\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/01\/demonstration.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/01\/demonstration.jpg?resize=300%2C182&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/a><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Wrapping Up<\/h2>\n\n\n\n<p>In this post we&#8217;ve shown you how to use the fingerprint sensor module: enroll fingerprints and find a match.<\/p>\n\n\n\n<p>Sometimes the sensor has a hard time identifying the fingerprint if you don\u2019t place your finger very similarly to when you\u2019ve saved it &#8211; specially women&#8217;s fingerprints (we have no idea why this happens). We\u2019ve noticed that the sensor works better if you place your finger slowly on the scanner.<\/p>\n\n\n\n<p>In our opinion, the fingerprint sensor module works quite well, and it is an affordable way to add biometrics recognition to your projects.<\/p>\n\n\n\n<p>You may also like the following projects:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/randomnerdtutorials.com\/arduino-mini-course\/\" target=\"_blank\" rel=\"noreferrer noopener\">Free Arduino Mini Course<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/nextion-display-with-arduino-getting-started\/\" target=\"_blank\" rel=\"noreferrer noopener\">Nextion Display with Arduino \u2013 Getting Started<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/guide-to-neo-6m-gps-module-with-arduino\/\" target=\"_blank\" rel=\"noreferrer noopener\">Guide to NEO-6M GPS Module with Arduino<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/arduino-step-by-step-projects\/\">Arduino Step-by-step Projects Course<\/a><\/li><\/ul>\n\n\n\n<p>Thanks for reading.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post is an introductory guide on how to use the Fingerprint Sensor Module with the Arduino. We&#8217;ll show you how to enroll a new fingerprint ID, and how to &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Guide to Fingerprint Sensor Module with Arduino (FPM10A)\" class=\"read-more button\" href=\"https:\/\/randomnerdtutorials.com\/fingerprint-sensor-module-with-arduino\/#more-48409\" aria-label=\"Read more about Guide to Fingerprint Sensor Module with Arduino (FPM10A)\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":5,"featured_media":51304,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[303,2,267,302,269,264,10],"tags":[],"class_list":["post-48409","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-0-arduino","category-arduino","category-arduino-project","category-0-guide","category-guide-project","category-project","category-a-tutorials"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/01\/thumbnail.jpg?fit=1280%2C720&quality=100&strip=all&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/48409","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/comments?post=48409"}],"version-history":[{"count":1,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/48409\/revisions"}],"predecessor-version":[{"id":111412,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/48409\/revisions\/111412"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/51304"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=48409"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=48409"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=48409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}