This project is based on Raspberry pi 1 and UART fingerprint scanner.
It is very easy to build and control. 
Fingerprint scanner is able to store 1000 fingerprints.
You can add new one, delete or even download image of scanned fingers.
Everything is controlled via telegram bot / or web-interface(in future)

Adding new finger is very easy:

*Push "Add new finger" in telegram bot and place your finger to scanner two times
*Write the name of the person, and it will be stored in text file with the number of the fingerprint( it is need to delete specific finger. )
* As soon as you added new finger, push "Start search", place your finger and this time relay will change its state

* Connect relay to door and you do not need any keys no more, use your finger to enter.


For this you will need an RPI1/2/3 (it doesn't matter)  with the Raspbian installed. You can get it here:

Boot up Raspbian and make some configuration.

sudo cp /boot/cmdline.txt /boot/cmdline_backup.txt

Edit the file:

sudo nano /boot/cmdline.txt

Delete any parameters involving the serial port "ttyAMA0" or "serial0" if it exist, which in this example is:


Which gives:

dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

Press CTRL+X to exit and save .

Next, you have to disable the serial getty service:

sudo systemctl stop serial-getty@ttyAMA0.service
sudo systemctl disable serial-getty@ttyAMA0.service

Enable UART

Enabling UART with minimum core frequency:

pi@raspberrypi:~ $ sudo nano /boot/config.txt

# Enable UART

Enabling UART with maximum core frequency:

pi@raspberrypi:~ $ sudo nano /boot/config.txt

# Enable UART

Install Python library for ZFM fingerprint sensors

~$ echo "deb wheezy main" | sudo tee -a /etc/apt/sources.list
~$ wget -O - | sudo apt-key add -
~$ sudo apt-get update
~$ sudo apt-get install python-fingerprint
~$ sudo usermod -a -G dialout pi
~$ cd /usr/share/doc/python-fingerprint/examples/

In my case i host telegram bot apart from rpi, so i created ssh secure public key to communicate with raspberry.

Login to server where the telegram bot is hosted:

server1:~# cd /root/
server1:~# ssh-keygen -t dsa

Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa): <PRESS ENTER TO ACCEPT DEFAULT>
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase): <PRESS ENTER FOR NO PASSPHRASE>
Enter same passphrase again: <PRESS ENTER FOR NO PASSPHRASE>
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/
The key fingerprint is:
41:03:aa:dc:cc:b9:39:50:65:bc:ee:7b:36:d2:64:7a root@server1

Copy the public key from 'server1' to 'raspberrypi'...

server1:~# scp /root/.ssh/

You can test it with 

ssh root@

Create Telegram Bot

You can check official guide on how to do this in just few steps:

Install some dependencies for bot 

sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev libjansson-dev libpython-dev make
apt-get update
apt-get -y install python-pip
pip install pytelegrambotapi 
pip install simplejson


(in my case i host bot on virtual server)

# -*- coding: utf-8 -*-
import config
import telebot
import os
import time
import requests
import subprocess
import simplejson
import sys
from telebot import types
from telebot import util

bot = telebot.TeleBot(config.token)

@bot.message_handler(commands=['help', 'start'])
def begin(message):
    markup = types.ReplyKeyboardMarkup(selective=True,row_width=2, resize_keyboard=True)
    markup.add('🔍Start search', '👆🏻Add new finger', u'✅Status')
    msg = bot.reply_to(message, 'Choose the action', reply_markup=markup)
    bot.register_next_step_handler(msg, process_step)

def name(message):
  sent = bot.send_message(, 'Type name')
  bot.register_next_step_handler(sent, hello)

def hello(message):
    open('username.txt', 'w').write(message.text)
    os.system("sh 2>/dev/null")
    bot.send_message(, 'Done')
    return begin(message)

def process_step(message):
    if message.text==u'🔍Start search':
        os.system("cat </dev/null |ssh root@ killall python 2>/dev/null")
        os.system("cat </dev/null |ssh root@ python /usr/share/doc/python-fingerprint/examples/ & 2>/dev/null")
        return begin(message)

    if message.text==u'👆🏻Add new finger':
            os.system("cat </dev/null |ssh root@ killall python 2>/dev/null")
            bot.send_message(, 'Place finger on the scaner...')
            output = os.system("ssh root@ python /usr/share/doc/python-fingerprint/examples/ > add.txt << EOF")
            from telebot import util
            large_text = open("add.txt", "rb").read()
            splitted_text = util.split_string(large_text, 3000)
            for text in splitted_text:
                   bot.send_message(, text)
                   return name(message)

    if message.text==u'✅Status':
            from telebot import util
            large_text = open("add.txt", "rb").read()
            splitted_text = util.split_string(large_text, 3000)
            for text in splitted_text:
                   bot.send_message(, text)
                   return begin(message)

        bot.send_message(, "Try again")

if __name__ == '__main__':
    while True:
        except Exception as ex:

Create additional bash script for name adding to "database"


number=$(sed -n '3p' < add.txt |awk '{print $4}')
if grep -R "New" add.txt 
sed -i s/$/_$number/ username.txt
sed -n '1p' username.txt >> database.txt
    echo not found


Relay connection

You can test the relay with python script, just create,paste the code and run it:

#!/usr/bin/env python

import time

import RPi.GPIO as GPIO

GPIO.setup(4, GPIO.OUT)
GPIO.output(4, GPIO.LOW)


GPIO.output(4, GPIO.HIGH)

Fingerprint scanner connection

To connect scanner you will need only 4 pins

And that's all, to test it you can run any of python library scripts that you have installed before. 
I will post modified Python fingerprint scanner files here, so just download them and overwrite and you are done.