DEV Community

Cover image for Build a fingerprint-controlled servo lock with Raspberry Pi
Joyce Lin
Joyce Lin

Posted on

Build a fingerprint-controlled servo lock with Raspberry Pi

Create a secure, biometric access control system that unlocks a servo-powered latch when it detects an enrolled fingerprint. Perfect for geocache boxes, garage doors, or any physical access control application.

Controlling servo through Viam web app

What You'll Build

A complete fingerprint authentication system using:

  • R503 fingerprint sensor for biometric scanning and enrollment
  • Servo motor controlling a physical latch mechanism
  • Raspberry Pi 4 running the Viam robotics server
  • Custom control logic that triggers the servo when fingerprints match

Technical workflow diagram

Key Features

  • Fingerprint Management: Enroll up to 200 different fingerprints across multiple slots, with support for enrolling the same finger multiple times to improve recognition reliability under varying angles and pressure.
  • Automated Latch Control: Servo automatically moves to open position (180°) when authorized fingerprint detected, then returns to closed position (90°) after configurable timeout (default 30 seconds).
  • Remote Configuration: Use Viam's web interface to test components, enroll new fingerprints via JSON commands, and monitor sensor readings in real-time.
  • Extensible Design: Build mobile or web apps using Viam's SDKs to create user-friendly enrollment interfaces for others to add their fingerprints.

Hardware Requirements

  • Raspberry Pi 4 with USB flash drive
  • R503 fingerprint sensor
  • USB-to-serial adapter for sensor connectivity
  • Servo motor (SG90 or similar)
  • Jumper wires and connection materials
  • Optional: 3D-printed or custom enclosure and latch mechanism

Fingerprint detected using sensor

Implementation Highlights

The tutorial walks through complete setup including Raspberry Pi OS installation, SSH configuration, Viam platform setup, component wiring diagrams, and step-by-step fingerprint enrollment using JSON commands. The modular design separates sensor detection, servo control, and coordination logic for easy customization.

Ready to build your own biometric lock? Follow the complete step-by-step tutorial 👉 Enable physical access using a fingerprint sensor.

Top comments (0)