https://github.com/inqnuam/adafruit-fingerprint
Adafruit Fingerprint Sensor controller
https://github.com/inqnuam/adafruit-fingerprint
electron nodejs typescript
Last synced: 3 months ago
JSON representation
Adafruit Fingerprint Sensor controller
- Host: GitHub
- URL: https://github.com/inqnuam/adafruit-fingerprint
- Owner: Inqnuam
- Created: 2022-01-16T10:58:20.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-28T13:48:05.000Z (over 4 years ago)
- Last Synced: 2026-03-07T19:43:12.172Z (5 months ago)
- Topics: electron, nodejs, typescript
- Language: TypeScript
- Homepage:
- Size: 199 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Introduction
Control Adafruit fingerprint sensor through serial port.
Works with both NodeJS ABI and ElectronJS ABI.
Linux, macOS and Windows supported.
## Install
```bash
npm i https://github.com/Inqnuam/adafruit-fingerprint
```
# Hardware Requirements
- FT232 USB to TTL UART converter
- Adafruit Fingerprint Sensor
## Hardware Wiring
Sensor > USB Converter
red - 3V3
yellow - RXD
white - TXD
black - GND
# Usage
## Hardware used in this example
- [DSD TECH USB to TTL Adaptator](https://www.amazon.fr/dp/B07BBPX8B8/ref=cm_sw_em_r_mt_dp_CNJT32V60SDS3QKBAQK0?_encoding=UTF8&psc=1)
- [DollaTek Adafruit Fingerprint Sensor](https://www.amazon.fr/dp/B07PRMXXXN/ref=cm_sw_em_r_mt_dp_P8WWEHGRS0TMMRWNSJA4?_encoding=UTF8&psc=1)
```js
//import { Fingerprint } from "adafruit-fingerprint"
const Fingerprint = require("adafruit-fingerprint").Fingerprint
// change devicePath with a real device path or use serialNumber option
const devicePath = "/dev/tty.usbserial-B60M4YN" // or something like "COM3" on Windows
const sensorOptions = {
// init with sensor serial port path
serialPort: devicePath,
// serialNumber: "xxxxxx",
baudRate: 57600,
// ...
}
const finger = new Fingerprint(sensorOptions)
finger.on("ready", async (s) => {
console.log("✅ Fingerprint Sensor is ready")
// get count of registered fingerprints
const totalTemplates = await finger.getTemplateCount()
console.log("Total fingerprints:", totalTemplates)
})
finger.on("port-error", (err) => {
console.log(err)
})
finger.on("port-close", (err) => {
console.log(err)
})
```