Template: Capacitive Fingerprint Reader B Pi guide
From Waveshare Wiki
Revision as of 11:40, 14 October 2021 by Waveshare-eng11 (talk | contribs) (Created page with "For Development boards like the Raspberry Pi, Arduino, STM32, only the UART interface is supported. <br /> ==Connection== {|class="wikitable" ! Fingerprint Reader (B) !! Raspb...")
For Development boards like the Raspberry Pi, Arduino, STM32, only the UART interface is supported.
Connection
Fingerprint Reader (B) | Raspberry Pi | Description |
---|---|---|
VCC | 3.3V | Power input |
GND | GND | Ground |
TXD | RXD | UART data output |
RXD | TXD | UART data input |
RST | GPIO5 | Reset pin (low active) |
Enable the Serial port of Pi
- Open the terminal of the Raspberry Pi
- Type command sudo raspi-config
- Choose Interface Options -> Serial -> No -> Yes
- Disabled the login shell function and enable the hardware serial port.
Download the demo codes
Open the terminal of the Raspberry Pi and run the following commands.
cd wget https://www.waveshare.com/w/upload/e/e3/Capacitive-Fingerprint-Reader-B-Code.zip unzip Capacitive-Fingerprint-Reader-B-Code.zip cd Capacitive-Fingerprint-Reader-B-Code/
Install Libraries
- Install wiringpi
sudo apt-get install wiringpi # An upgrade may be required for raspberry PI 4B: cd /tmp wget https://project-downloads.drogon.net/wiringpi-latest.deb sudo dpkg -i wiringpi-latest.deb gpio -v # Running gpio-v to check if the version is 2.52, If it is not, you need to check the installation again.
- BCM2835 library:
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.60.tar.gz sudo tar zxvf bcm2835-1.60.tar.gz cd bcm2835-1.xx sudo ./configure make sudo make check sudo make install
- Note: You can also go to http://www.airspayce.com/mikem/bcm2835/index.html for newest libraries.
- Install the python2 library
sudo apt-get update sudo apt-get install python-pip sudo pip install RPi.GPIO sudo apt-get install python-serial
- Install the python3 library
sudo apt-get update sudo apt-get install python3-pip sudo pip3 install RPi.GPIO sudo apt-get install python3-serial
Testing the example
Open the terminal of the Raspberry Pi and run the following commands.
- C example
cd ~/Capacitive-Fingerprint-Reader-B-Code/RaspberryPi/c sudo make sudo ./test
- python example
cd ~/Capacitive-Fingerprint-Reader-B-Code/RaspberryPi/Python sudo python main.py
- python3 example
cd ~/Capacitive-Fingerprint-Reader-B-Code/RaspberryPi/Python3 sudo python3 main.py
After running the example, the prompt printed in the terminal, you need to type the defined commands to enable the testing function:
- CMD0:
- Check if the fingerprint is connected normally
- CMD1:
- Check if a finger is detected
- CMD2:
- Add a fingerprint
- CMD3:
- Detect fingerprints
- CMD4:
- Verify fingerprint (1:1)
- CMD5:
- Verify fingerprints
- CMD6:
- Check the ID which is not be used (minimum number)
- CMD7:
- Check the number of fingerprinted 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