Template: Capacitive Fingerprint Reader B STM32 guide

From Waveshare Wiki
Jump to: navigation, search


Working with STM32/Arduino

Connect the corresponding STM32/Arduino and fingerprint module according to the connection method.
Connect the USB port of the Open103Z/Arduino UNO with the PC, and then choose the corresponding UART port:
Capacitive Fingerprint Reader (B) 28.png
CMD0: Check if the fingerprint is connected normally.
CMD1: Check if a finger is detected.
CMD2: Add a fingerprint.
CMD3: Delete the fingerprint.
CMD4: Verify the fingerprint (1:1).
CMD5: Verify fingerprints.
CMD6: Check the ID which is not being used (minimum number).
CMD7: Check the number of fingerprints added.
CMD8: Upload a fingerprint image to the host from the Fingerprint Reader.
CMD9: Download a fingerprint image to the Fingerprint Reader from the host.

Note: Arduino does not have CMD8 and CMD9 instructions because of the memory, and packet loss will occur when using the 115200 baud rate.
How to modify:
1. Use software to make changes.
2. Use the following command to make changes.
Capacitive Fingerprint Reader (B) 29.png
Set to 115200 baud rate:
55 AA 00 00 02 00 05 00 03 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0e 01
Set to 57600 baud rate:
55 AA 00 00 02 00 05 00 03 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0d 01
The return value after successful setup is:
AA 55 01 00 02 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 01

Working with Raspberry Pi

Open the Serial Port

Enter the commands:

sudo raspi-config

Capacitive Fingerprint Reader90.png
Capacitive Fingerprint Reader91.png
Capacitive Fingerprint Reader92.png
Capacitive Fingerprint Reader93.png
Capacitive Fingerprint Reader94.png
Reboot:

sudo reboot

Install wiringpi

sudo apt install git-core
sudo git clone https://github.com/WiringPi/WiringPi
cd WiringPi/
sudo ./build
#Check the wiringpi version, usually above 2.70
gpio -v

Install python Library

#python3's serial port library
sudo apt-get install python3-serial
#serial library for python2
sudo apt-get install python-serial

Download the Demo

wget https://files.waveshare.com/upload/1/1d/Capacitive-Fingerprint-Reader%28B%29-Code.zip
unzip unzip Capacitive-Fingerprint-Reader\(B\)-Code
cd cd Capacitive-Fingerprint-Reader\(B\)-Code/RaspberryPi/

How to Use

C

cd c
make 
sudo ./test

Python

cd python
sudo python main.py

Python3

cd python3
sudo python3 main.py