 This is a fingerprint sensor. What it does is you take your finger, you put it onto the sensor, it takes an image of your finger, does a bunch of processing and then detects whether it's a fingerprint that's already in the system or not, and if it is you can do something. For example, one thing I want to do later on in this channel, and I should put up a picture on the screen of what it would look like, I have a 3D design for a fingerprint scanner that would be used to open a garage door. So I'll take my finger, scan it here, if it's matched it would go and open the garage door and if the door is currently opened, put your finger on it and then it will scan your finger and go and close the garage door. There's different types of fingerprint sensors. This is an optical one and if you look closely, you can kind of see this prism inside. And what's happening is you're shooting out a ray of light and it's bouncing off the bridges on your finger which create your fingerprint. Then it bounces off of that and goes back into the sensor and the sensor uses a bunch of image processing and a couple different algorithms to take a fingerprint and these rays of lights that are coming in and detect some kind of pattern on your finger. I'll put a picture up on the screen. It uses the bridges to kind of get this like zigzag pattern and it registers that to your finger and then your finger to an ID. I'm pretty sure this can hold up to like 100 fingerprints which is really cool. So the first thing you do is run an enroll program on your Arduino. You scan fingers whatever you want and assign them to an ID. Then you go and run the normal program which is where you can connect it to your garage door or whatever and then when you scan your finger it's going to run through the current IDs that have been entered during that enrollment program and if your finger matches then it's going to go and open the garage door. In most of these videos we've went and we've written the code from absolute scratch but Arduino does have a really nice library and pre-grain examples for how to use the sensor so we're just going to go through that and then we're going to add to it if we want to do anything specific. For example here's a little sneak peek. I have the Arduino here. I'm going to connect it to the computer and you can see every two seconds the sensor is going to turn on and scan. Wait two seconds it's going to turn on and scan. So if my finger is on there I'm going to turn on yellow while it's searching and then green or red if it's matching a fingerprint or not. So I'm going to put the right finger on this time. It's going to scan yellow red put it in a better position maybe. Oh and there we go finally we get a match. It seems like these aren't totally accurate like our phone sensors because of the way it works because it bounces light and the light has to bounce back exactly like it used to when you first scanned and enrolled the fingerprint versus when your phone it has more detail in the way it works so you can kind of like roll your finger right and left and when you're enrolling a finger on your phone it asks you to put it on a couple times and try different angles and stuff this just tells you hey put it on and that's it. One thing we can do to get around this is when we 3D print a case we can make like some bars or something that makes your finger always go in the same exact spot so you don't sometimes hit it here sometimes hit it here sometimes hit it here where you make like some kind of finger hole that fits perfectly for my thumb and it positions it every time in the right place so we don't have a bit of inconsistency. One thing you can also do is get a couple scans of your fingers at different angles register each one of those as its own ID so let's say the first 10 IDs are the same thumb at different angles and then it would match one of the 10 IDs. Right now it's the bare minimum it takes you put your finger on the sensor it takes a picture processes it stores it onto the sensor and then that's it. Open up your Arduino editor go into tools manage libraries and then when you get this little search window up in the top here just search up finger print. When you search for a fingerprint you're going to get the option of adafruit fingerprint sensor library install that the latest version doesn't really matter which one go into file examples and then down here we're going to find adafruit fingerprint sensor library and there's a couple different options you can have blank change password delete empty database enroll fingerprint led control pass through or show fingerprint templates the ones that we're going to use is enroll and fingerprint so the first one we're going to use is enroll let's go and open that up and what's happening in the enroll one is it's connecting to your sensor it's accessing the flash memory in the sensor it's going to go down here we could see that we're ready to enroll a fingerprint it's going to activate a function that reads our fingerprint and then it's going to take an image it has a couple different options it's either going to take an image it's going to say there's some kind of error either communication imaging or unknown and then once it takes an image it's going to go and save it to your sensor right here we can see that the image is converted and that processing of converting an image is exactly that picture I showed earlier where it scans the ridges of your fingers and creates some kind of pattern and links that to your finger and to an ID so once that's done we can see at the bottom here where we can see okay converted creating model for a number and then that ID is going to get stored right down here it might be a little complicated I recommend you take a minute to go and read through this whole program and understand each step but I'm not going to do that right now right now we're just focused on getting a fingerprint on here so go ahead and upload that to your Arduino and once that's done open up tools serial monitor once you run your program and you open up your serial manager this is what you'll see right here it's just going through the process of the first thing is turning on the program checking if a sensor exists checking some settings and things that you can change throughout the program here and at the bottom you can see ready to enroll a fingerprint please type in the ID number from 1 to 127 if you want to save this finger so we're going to go here in the top in the search bar and type in number one and it's going to start searching and you can see that your sensor turns on and there's a big red light I'm going to take my finger put it on here hold it you can see image taken image converted remove finger place the same finger again we're going to pick up the sensor try and place it in the same area boom stored so now we can see prints matched ID one stored ready to enroll a fingerprint you can go and add as many as you want or as 127 worth of fingers now that we have enrolled a finger into the sensor the next step is to go and activate the sensor normally and see if we can get a match on any of the IDs that are currently stored on the sensor so we're going to go again into file examples all the way down to fingerprint sensor library and let's go and grab fingerprint so I took this file this fingerprint file and I made really a couple changes to it nothing crazy I told it to turn on LEDs depending on the situation so here we're running a function called finger search if we found a print it's going to run this if we have an error it's going to run this if we did not find a match it's going to run this and then another and an error oh and then also at the top right here when it initially starts searching for a finger before it actually finds a finger and then converts it and does all the processing when it just starts looking for fingers I have it turn on this yellow led so let's go and upload this to the Arduino quickly now we can see here we have a yellow led a green led and a red led when I grab the sensor and I put my finger on it it's going to turn yellow and then it's going to go green or red depending on if I match or not so I'm going to put the wrong finger on so it's going to go yellow and red because it's the wrong finger now let's put my finger on it again boom we matched so now I want yellow and green now where I put that line to turn on the green led right down over here found a print match this is where you can go absolutely insane you can put anything in here you can make a function that opens up a garage door you can technically if you knew how to do it you can connect your Arduino to your car and even have it start your car based off of your fingerprint would not recommend that these sensors aren't the best security in the world but they're still pretty good you can have it unlock a door to your room or you can have let's say the closet door locked with this where you can make yourself a safe and use this kind of technology to go and lock it if you enjoyed this video and you want to see more stuff using the specific sensor I think this sensor itself can have a whole series we can put it on literally everything we can make doors unlock with it we can make it turn on let's say like you want to make coffee and to make coffee you have to use this fingerprint sensor like how cool would that be so we can go absolutely crazy with the sensor if you have any ideas in chat any meme robots you want to make with this let me know I'd love to do that again if you enjoyed this video please do give it a like and we'll see you in the next one