Fingerprint Scanner - TTL (GT-521F32) with a backend Database.

Hey Guys, I am thinking about getting one of those modules to use to authenticate on a door.

But since I have more than one door, and I also don’t want to check the security in the module directly, because it will be exposed, I want to be able to send the Data to my Backend Server, currently Python Flask, to analyze.

I have the following Questions:

  • -Is it possible to use this module with the esp 8266, or to be more specific, the Wemos D1 mini.

    -Is it possible to pull the data off the scanner and send it to my Server

    -Do I need extra Software to compare those Fingerprints on the Server, and if that’s the Case, are there any known Python Libraries for this purpose that have proven to work with this modules data ?

    -If I send the Data to the server anyways, wouldn’t it be cheaper to just buy a camera, put a glas plate above it, and send the resulting image to the Server ?


  • Is it possible to use this module with the esp 8266, or to be more specific, the Wemos D1 mini.

    Yes, you can use the sensor with those microcontrollers or really any microcontroller that supports 3.3 volt TTL serial.

    Is it possible to pull the data off the scanner and send it to my Server

    If you look at the [programming guide there is a command to capture an image from the sensor. You could then send that image back to your server for verification.

    Do I need extra Software to compare those Fingerprints on the Server, and if that’s the Case, are there any known Python Libraries for this purpose that have proven to work with this modules data ?

    Yes, you would need additional software to analyze the captured image and verify it. I’m not aware of any python libraries for this device but it’s possible someone has written one. If anyone knows the answer to this, please post. :slight_smile:

    If I send the Data to the server anyways, wouldn’t it be cheaper to just buy a camera, put a glas plate above it, and send the resulting image to the Server ?

    Depends on if you can find a camera and glass plate that costs less than $36.00 and is capable of working with the rest of your system. These modules are essentially low resolution cameras you can talk to over serial and are designed to process fingerprints from the get go. I’ve not seen anything I think would work cheaper, but I haven’t looked very hard either.

    These are made to do the authentication on board, but I do feel you could use them to gather fingerprint images and authenticate them elsewhere. Sadly, I don’t have any code or tutorials that show how you would do this but the programming guide appears to have the information needed to write your own code.](https://cdn.sparkfun.com/assets/learn_tutorials/7/2/3/GT-521F52_Programming_guide_V10_20161001.pdf)

    My fingerprint chasing friend, there are python libraries available for this sensor, but it looks like they’re setup for the RPi at this point in time. Should be relatively simple to integrate them into any linux setup. Take a look at the user group over here:

    https://github.com/QuickCorp/pyGT511C3

    Not to advertise for another company, but it looks like they actually even support it if you’re willing to donate 100 dollars - really good deal if you’re looking to integrate it into an actual non hobby application. I would check it out if I were looking to use it.

    Just a side note, in regards to your question about the alternative of using a camera - I would take a look over here: https://www.raspberrypi.org/blog/raspir … t-scanner/

    While doing it with a raspi is probably not the cheapest possible method, it’s still going to cost a LOT more, and require a lot more work to essentially reinvent the wheel that is the GT-521F32. Personally I would not waste the energy.

    First of all, thanks for the amazing help so far.

    I am currently seeking to use this device in my Hobby Project, though I wouldn’t exclude the possibilty that this might turn into a commercial thing.

    I currently have my Flask Backend setup on my Raspberry Pi anyways, and since the Server is inteded to stay in the same home that the Smarthome Devices in my Ecosystem function, I don’t really see why this should change.

    The link to the library is appreciated a lot. I think I will get one of those nice things ordered and test around with it a little bit.

    Edit: Checking out this Lib, it needs the sensor hooked up to the pi itself ^^. I think I am gonna look for general Fingerprint Image processing Libraries instead. Worst Case I would have to get into this Stuff and code one myself, that would eat up some time but would still be a possibility ^^.

    Even if this is off topic, one quick Question: Sparkfun sadly doesn’t have any PN532 Boards right ? I didn’t find one upon searching. Can someone recommend a PN532 Board that has an antenna that is not fixed to the board ?

    Sorry, we don’t carry the PN532.

    A Google search should help you find a vendor that does though. :slight_smile:

    Ok now I got the Sensor set up and everything. It works great, though the Arduino Library doesnt implement the function to get an image from the sensor, wich is totally understandably, considering the arduino doesn’t have enough sram to save the image. But I hava an SD Card module attached to my Arduino, and I would also consider sending it to my server byte by byte. Now I am not great in Cpp, but I tried to modify the library to at least send the stuff to my serial monitor, however it only returns some seemingly random results like “85 170 1 0 0 0 0 0 48 0 48 1”. Yes I know this is limited by the “i < 12” but changing the 12 to like 150 makes it print nothing(I guess the device returns an error)

    Library used: https://github.com/sparkfun/Fingerprint_Scanner-TTL

    void FPS_GT511C3mod::GetImage()
    {
    	if (UseSerialDebug) Serial.println("FPS - GetImage");
    	Command_Packet* cp = new Command_Packet();
    	cp->Command = Command_Packet::Commands::GetImage;
    	byte* packetbytes = cp->GetPacketBytes();
    	delete cp;
    	SendCommand(packetbytes, 12);
    	PrintResponse();
    	delete packetbytes;
    }
    
    void FPS_GT511C3mod::PrintResponse()
    {
    	byte firstbyte = 0;
    	bool done = false;
    	_serial.listen();
    	while (done == false)
    	{
    		firstbyte = (byte)_serial.read();
    		if (firstbyte == Response_Packet::COMMAND_START_CODE_1)
    		{
    			done = true;
    		}
    	}
    	Serial.println(firstbyte);
    	for (int i=1; i < 12; i++)
    	{
    		while (_serial.available() == false) delay(10);
    		Serial.println(_serial.read());
    	}
    	if (UseSerialDebug)
    	{
    		Serial.print("FPS - RECV: ");
    		Serial.println();
    		Serial.println();
    	}
    };
    

    In the Library, the function is commented out with the following notice:

    // Gets an image that is 258x202 (52116 bytes) and returns it in 407 Data_Packets
    // Use StartDataDownload, and then GetNextDataPacket until done
    // Returns: True (device confirming download starting)
    	// Not implemented due to memory restrictions on the arduino
    	// may revisit this if I find a need for it
    //bool FPS_GT511C3::GetImage()
    //{
    	// Not implemented due to memory restrictions on the arduino
    	// may revisit this if I find a need for it
    	//return false;
    //}
    

    However, StartDataDownload and GetNextDataPacket is not implemented either.

    I know this is a huge thing to ask, but If someone happens to know an answer, I would be infinitely thankful.

    You can just give me a help on how to implement StartDataDownload and GetNextDataPacket and how to use it.

    I know this a lot to ask, but I normaly don’t work that close to hardware. :slight_smile:

    I hope I may add a similar question to this thread:

    I have two GT-521F32 sensors. One is for managing a database for authorized users (enroll new users, delete users etc)

    The other sensor is to authenticate the operators for a kind of Intercom system. The database of the authenticating sensor will be synchronized to the management sensor.

    I have started to write a library for all required functions with Lazarus/Free Pascal on a Raspberry Pi.

    So far, no problems with Enroll/Delete/Authenticate etc.

    But when it comes to the point where I want to download a template to the host (GetTemplate 0x70) I am running into troubles:

    Firstly, when I send the 12byte GetTemplate command (0x55,0xAA,0x01,0x00,…0x70…) at once to the sensor, I will only get 4bytes in return from the acknowledge of the sensor. (No matter how long I wait).

    Secondly, by debugging the code, I step with the debugger through the send command sequence of 12 byte, thus introducing a delay between the 12 send bytes.

    In that case I will get a 12 byte response but this response will be NACK with 0x100F (Device Error).

    As I said before, the procedures to send the command package and to receive the acknowledge package work flawlessly with Enroll/Delete/Authenticate etc.

    Has anyone made similar experiences before?

    Does the GetTemplate function really work?