ARDUINO TUTORIAL · PHYSICAL AI PROTOTYPING Arduino Project Hub (17 Respects) ↗

Arduino Fingerprint Sensor & Solenoid Lock w/LCD

How to build, wire, and code a biometric access control security system with LEDs, piezo buzzer, and custom 1602 LCD animations—using an LLM as a collaborative engineering partner throughout the entire physical computing bench build.

Direct Technical Summary This project pairs an optical biometric fingerprint module (AS608/FPM10A) with an Arduino Uno, 5V optoisolated relay, 12V electromagnetic solenoid door strike, and an I2C 1602 character LCD. When an authorized fingerprint is enrolled and scanned, the relay energizes the solenoid for 3 seconds, illuminates a green LED, sounds an access chime, and scrolls custom animated LCD glyphs. Unauthorized scans trigger a pulsing red LED, quick warning beeps, and a custom stop-sign animation.
PROJECT DESCRIPTION

Arduino Fingerprint Sensor & Solenoid Lock w/LCD

In this tutorial, I'll share how I built a fingerprint-controlled solenoid lock with LEDs and a buzzer for user feedback. While similar tutorials exist, this project demonstrates how capable and practical a well made LLM can be as a collaborator in the entire design and build process. You'll see how we worked together to overcome challenges, and I'll even share some surprisingly insightful and humorous moments we had along the way.

LCD displaying Place Finger / Access Denied with Red LED lit
PLACE FINGER // ACCESS DENIED (RED LED ILLUMINATED)

This project documents my experience building an Arduino-based fingerprint access control system, with an AI app as my collaborative partner that performed great at the time. This conversation and build occurred in May of 2024. There was a turn of events that caused me to shelf this project as a video but I decided to try and utilize it as an online tutorial text based tutorial. But this wasn't just a collaborative effort; it was a test. I deliberately pushed the AI model boundaries, introducing challenges and uncertainties to see how effectively it could guide me through the process. The goal was to demonstrate the capabilities of AI as a prototyping partner, showcasing its ability to brainstorm, code, wire, and troubleshoot, even when faced with deliberate ambiguity.

I have added excerpts from the chat.

Oh...with my direction, Google Gemini Advanced wrote this entire tutorial.

DEVICES & COMPONENTS

Hardware Components & Specs

Arduino UNO WiFi Rev2 or Uno R3 MCU QTY: 1
CONTROLLER BRAIN

Arduino Uno WiFi Rev2 (or Uno R3)

Controls UART sensor, I2C display, relay coil & feedback.

CIRCUIT ROLE: Microcontroller Brain
Optical Fingerprint Reader Sensor Module BIOMETRIC QTY: 1
OPTICAL SCANNER

Optical Fingerprint Reader Sensor

57600 baud SoftwareSerial (Pin 2 = RX, Pin 3 = TX) biometric verification.

CIRCUIT ROLE: Biometric Scanner
I2C LCD 1602 Module DISPLAY QTY: 1
VISUAL USER FEEDBACK

I2C LCD 1602 Display Module

Connected to A4 (SDA) & A5 (SCL); renders custom animations and access prompts.

CIRCUIT ROLE: Visual User Feedback
HiLetgo 5V Relay Module with OPTO Isolation RELAY QTY: 1
HIGH-POWER ISOLATION

HiLetgo 5V Relay with Opto-Isolation

Pin 7 controls relay; isolates 12V lock current from Arduino 5V logic.

CIRCUIT ROLE: Solenoid Power Switch
ATOPLEE Electromagnetic Solenoid Lock ACTUATOR QTY: 1
PHYSICAL ACTUATOR

ATOPLEE Solenoid Lock

Electromagnetic strike; powered via external 12V DC power supply.

CIRCUIT ROLE: Physical Actuator
Piezo Buzzer AUDIO QTY: 1
AUDITORY FEEDBACK

Buzzer, Piezo

Digital Pin 8; generates confirmation and warning tones.

CIRCUIT ROLE: Auditory Feedback
5mm Green LED OPTICAL QTY: 1
STATUS INDICATOR

5mm Green LED

Connected to Digital Pin 9; illuminates when authorized fingerprint access is granted.

CIRCUIT ROLE: Access Granted (Pin 9)
5mm Red LED OPTICAL QTY: 1
STATUS INDICATOR

5mm Red LED

Connected to Digital Pin 10; illuminates when unauthorized fingerprint access is denied.

CIRCUIT ROLE: Access Denied (Pin 10)
330 Ohm Resistor PASSIVE QTY: 2
LED PROTECTION

Resistor 330 ohm

Cathodes connected to GND rail through current limiting resistors.

CIRCUIT ROLE: LED Protection
Jumper wires and Breadboard HARDWARE QTY: 1 SET
BREADBOARD INTERCONNECTS

Jumper wires (generic)

Male-to-male and male-to-female breadboard jumpers.

CIRCUIT ROLE: Interconnects
UCTRONICS DC Variable Voltage Power Supply POWER QTY: 1
AUXILIARY SOLENOID SUPPLY

UCTRONICS DC Variable Power Supply

Adjustable buck-boost constant voltage/current bench regulator dialed to 12.0V DC.

CIRCUIT ROLE: 12V DC Auxiliary Supply
Software & Tools: Arduino IDE
•
AI Collaborator: Google Gemini Advanced

EXAMPLE 1: Setting the Stage

I began with a collection of components: an Arduino UNO, a fingerprint sensor, a solenoid lock, LEDs, an LCD screen, a buzzer, resistors, and jumper wires. I presented these to the LLM with a simple prompt:

User:

"I've got my UNO. I have a fingerprint sensor. I have a solenoid lock... some LEDs. I have a 16 by 2 LCD screen. I have a buzzer and of course some resistors and jumper wires. What do you think?"

The AI, unfazed by the open-ended nature of the prompt, immediately grasped the concept and suggested building a fingerprint-based security system.

AI:

"That sounds like a great setup for an interactive security project... you could build a fingerprint-based security system..."

This initial exchange demonstrated the LLM's ability to understand my intent and provide a clear direction for the project, even with minimal information.

EXAMPLE 2: Seeking Wiring Guidance

To ensure the hardware was connected correctly, I sought guidance from the AI on wiring the fingerprint sensor. I was initially unsure about the TX and RX connections:

Layout of everything on the table positioned where I wanted it all before wiring
LAYOUT OF EVERYTHING ON THE TABLE POSITIONED WHERE I WANTED IT ALL BEFORE WIRING.
User:

"Green wire (TX) - Connect this to Digital Pin 3 on the Arduino (SoftwareSerial RX). Sends data to the Arduino. White wire (RX) - Connect this to Digital Pin 2 on the Arduino (SoftwareSerial TX). Receives data from the Arduino."

The LLM, demonstrating its expertise in Arduino wiring, quickly clarified the correct connections:

AI:

"For the fingerprint sensor, if the green wire labeled 'TD' in the sensor diagram corresponds to data output, it should go to Arduino pin 2. The white wire (data input) should then go to Arduino pin 3. This swap ensures that TX and RX communicate correctly with the SoftwareSerial library."

This clarification ensured proper communication between the sensor and the Arduino, highlighting the value of having an AI assistant that can provide accurate guidance and prevent potential errors.

EXAMPLE 3: Seeking Clarification on Circuit Design

I had a little trouble remembering if the resistor should connect to the cathode or anode of the LED
I HAD A LITTLE TROUBLE REMEMBERING IF THE RESISTOR SHOULD CONNECT TO THE CATHODE OR ANODE OF THE LED.

While wiring the LEDs, I had a question about the circuit design and how to incorporate the resistor.

User:

"Change so the resistor is from the cathode to the ground rail."

The AI, demonstrating its understanding of circuit fundamentals, provided the correct wiring instructions and even updated the commented code line to reflect the change:

AI:

"Red LED cathode connects to Arduino GND through a 330-ohm resistor—controls access denied feedback."

This interaction highlights the LLM's ability to provide clear explanations and adapt to specific circuit requirements, ensuring the project is built correctly.

EXAMPLE 4: Encountering a Debugging Challenge

Arduino IDE Compiler Error Inspection

During the development process, I encountered a compilation error: "'getFingerprintIDez' was not declared in this scope." This error, while unintentional, provided an opportunity to test the AI's debugging capabilities.

User:

"/Users/videotronicmaker/Documents/Arduino/VTM_Finger_LCD_Video-vers.-final/VTM_Finger_LCD_Video-vers.-final.ino: In function 'void loop()':... error: 'getFingerprintIDez' was not declared in this scope..."

The AI, demonstrating its expertise in Arduino programming, quickly identified the issue:

AI:

"The error messages you're seeing are due to missing the getFingerprintIDez function declaration and some structural issues in the provided code snippet. We need to ensure that all functions used are properly declared and defined in your Arduino sketch."

This rapid and accurate diagnosis highlighted the LLM's ability to assist with debugging, even when faced with unexpected errors.

EXAMPLE 5: Refining the Code: Buzzer and LCD Behavior

Screen shot of the portion of the chat where the llm adjusted the code
SCREEN SHOT OF THE PORTION OF THE CHAT WHERE THE LLM ADJUSTED THE CODE.

To achieve the desired functionality for the buzzer and LCD, I requested specific behaviors from the LLM:

User:

"The buzzer currently beeps every one or two seconds Non-Stop... The LCD screen should start off by showing the words touch sensor..."

The AI, demonstrating its understanding of Arduino programming and the project requirements, responded with the updated code, incorporating the requested changes. This illustrated its ability to understand complex instructions and generate accurate code to achieve the desired outcome.

EXAMPLE 6: Achieving Success

Correct display on LCD showing Access Granted
CORRECT DISPLAY ON LCD SHOWING, "ACCESS GRANTED"

After several rounds of adjustments and testing, the satisfying moment of completion arrived. I placed my finger on the sensor, and it worked! The solenoid lock clicked open, the green LED illuminated, and the LCD displayed "Access Granted."

User:

"Hey, it works! It works!"

AI:

"That's fantastic news, T-shin! I'm glad to hear everything is working as intended."

This successful outcome was a testament to the collaborative process and demonstrated the effectiveness of the LLM as a prototyping partner. It highlighted the ability of AI to assist in bringing projects to fruition, even with the challenges and uncertainties that arise along the way.

DEEP COLLABORATION

The HumAIn Touch

Top-down workbench view of GPT-4 and Arduino prototyping session

While most of our interaction focused on the technical aspects of building the fingerprint access control system, there were moments that revealed a deeper level of collaboration. One such instance occurred during our discussion about incorporating an LCD expansion shield into the project.

I was considering whether to add the shield and explained my thought process to the LLM:

User:

"Okay, I got these other components. I don't know. I'm kind of winging it right here, but I've had these things for a while. I never use them. They're a little tricky to code, but they look cool. So here's what I have. I have a multi-purpose Shield v2 from Key Studio. That's the Arduino, they make Arduino-type products from China. Key Studio with a K. So I have that little Shield, and then I have their 16x2 LCD Expansion Shield. Pick one or none. Tell me, do you think it's worth incorporating? Because the LCD Shield has these buttons, and I don't see how the buttons could work in this project. And anyway, what are your thoughts?"

The LLM, after considering my input, offered its perspective on the potential benefits and drawbacks of including the shield:

AI:

"Considering your project's needs, the 16x2 LCD Expansion Shield could be very useful, especially since it includes buttons. These buttons could offer user interaction, like manually overriding the lock or resetting the system. However, if adding complexity doesn't align with your project goals, sticking with your current setup is perfectly fine. The multi-purpose Shield might not be necessary for this specific project but could be useful for future projects with more varied requirements."

After hearing its thoughts, I agreed with its assessment:

User:

"Okay, I agree. Yeah, I figured I'd just throw it out there and give you a chance to maybe tell me something I didn't know. But, yeah, we are threading the same tapestry of understanding."

This exchange demonstrates a deeper level of interaction where we're not just exchanging information, but also acknowledging each other's perspectives and engaging in collaborative decision-making. It highlights the potential for AI to be more than just a tool; it can be a partner in exploration and problem-solving.

This example better illustrates the "hum-AI-n touch" in our collaboration, showcasing the ability to engage in a thoughtful discussion and reach a mutual understanding, even when faced with design choices and project complexities.

CONCLUSION

Conclusion

Demonstration of correct fingerprint recognition and green LED lit
DEMONSTRATION OF CORRECT FINGERPRINT RECOGNITION AND GREEN LED LIT.

This project was more than just a collaborative effort; it was a testament to the capabilities of AI as a prototyping partner. By deliberately introducing challenges and uncertainties, I was able to showcase the AI's ability to adapt, problem-solve, and guide me towards a successful outcome. The final result was a functional fingerprint access control system, built through a dynamic exchange of ideas and expertise, proving that AI can be a powerful tool for makers of all levels.

The Next Big Thing

This experience opens up exciting possibilities for AI-assisted prototyping. Imagine tackling more complex Arduino projects, such as IoT devices or multi-sensor systems, with an AI collaborator by your side. The future of making is collaborative, and this project is a testament to its potential.

SCHEMATIC & WIRING

Layout:

Hardware Wiring Layout for Arduino Fingerprint Sensor and Solenoid Lock
FIGURE: COMPLETE HARDWARE WIRING ARCHITECTURE (12V SOLENOID ISOLATION VIA RELAY)
FIRMWARE

Full Production Arduino C++ Sketch

VTM_Finger_LCD.ino
/* Fingerprint Access Control System Code Created by Spark - VideotronicMaker's Personal AI Assistant AI directed by VideotronicMaker Date: May 5, 2024 Description: This Arduino sketch uses an Adafruit Fingerprint sensor to authenticate users via fingerprints. When an authorized fingerprint is detected, a relay is activated, a green LED lights up, and a success message is displayed on the LCD; if unauthorized, a red LED lights up and an error message is displayed along with a stop sign animation. */ #include <Wire.h> #include <LiquidCrystal_I2C.h> #include <Adafruit_Fingerprint.h> #include <SoftwareSerial.h> // Pin Configuration SoftwareSerial mySerial(2, 3); // RX (Pin 2), TX (Pin 3) for fingerprint sensor LiquidCrystal_I2C lcd(0x27, 16, 2); // Set the LCD I2C address (0x27) Adafruit_Fingerprint finger(&mySerial); // Initialize fingerprint sensor with SoftwareSerial const int buzzerPin = 8; // Buzzer pin const int relayPin = 7; // Relay pin (solenoid lock) const int greenLEDPin = 9; // Green LED pin (Granted) const int redLEDPin = 10; // Red LED pin (Denied) // Custom characters for stop sign and arrow animations byte stopSign1[8] = { 0b00000, 0b01110, 0b11111, 0b11111, 0b11111, 0b01110, 0b00000, 0b00000 }; byte stopSign2[8] = { 0b00000, 0b00000, 0b01110, 0b11111, 0b11111, 0b01110, 0b00000, 0b00000 }; byte arrow1[8] = { 0b00000, 0b00000, 0b00000, 0b11111, 0b01110, 0b00100, 0b00000, 0b00000 }; byte arrow2[8] = { 0b00000, 0b00000, 0b11111, 0b11111, 0b01110, 0b00100, 0b00000, 0b00000 }; // Forward declarations int getFingerprintIDez(); void handleAccessGranted(); void handleAccessDenied(); void resetState(); void setup() { Serial.begin(9600); // Initialize LCD lcd.init(); lcd.backlight(); lcd.setCursor(0, 0); lcd.print("VideotronicMaker"); lcd.setCursor(0, 1); lcd.print("Touch Sensor"); // Set pin modes pinMode(buzzerPin, OUTPUT); pinMode(relayPin, OUTPUT); pinMode(greenLEDPin, OUTPUT); pinMode(redLEDPin, OUTPUT); // Initialize fingerprint sensor mySerial.begin(57600); finger.begin(57600); if (finger.verifyPassword()) { lcd.setCursor(0, 1); lcd.print(" "); lcd.setCursor(0, 1); lcd.print("Sensor ready"); Serial.println("Fingerprint sensor is ready."); } else { lcd.setCursor(0, 1); lcd.print(" "); lcd.setCursor(0, 1); lcd.print("Init error"); Serial.println("Fingerprint sensor initialization failed."); } // Register custom animation glyphs lcd.createChar(0, stopSign1); lcd.createChar(1, stopSign2); lcd.createChar(2, arrow1); lcd.createChar(3, arrow2); delay(2000); resetState(); } void loop() { lcd.setCursor(0, 0); lcd.print("VideotronicMaker"); lcd.setCursor(0, 1); lcd.print("Touch Sensor"); // Check if a finger is detected if (finger.getImage() == FINGERPRINT_OK) { int id = getFingerprintIDez(); if (id == -1) { handleAccessDenied(); } else { handleAccessGranted(); } resetState(); } delay(100); } void handleAccessDenied() { digitalWrite(relayPin, LOW); digitalWrite(redLEDPin, HIGH); digitalWrite(greenLEDPin, LOW); lcd.clear(); lcd.setCursor(0, 0); lcd.print("Access Denied"); Serial.println("Access Denied - Unauthorized fingerprint."); // Animate stop signs across row 2 for (int i = 0; i < 16; i++) { lcd.setCursor(i, 1); lcd.write(byte(i % 2)); delay(150); } // 3 short warning beeps for (int i = 0; i < 3; i++) { tone(buzzerPin, 1000, 200); delay(300); } delay(2000); } void handleAccessGranted() { digitalWrite(relayPin, HIGH); // Energize solenoid lock digitalWrite(redLEDPin, LOW); digitalWrite(greenLEDPin, HIGH); lcd.clear(); lcd.setCursor(0, 0); lcd.print("Access Granted"); Serial.println("Access Granted - Authorized fingerprint."); tone(buzzerPin, 1000, 3000); // 3-second confirmation chime // Animate scrolling progress arrows for (int i = 0; i < 16; i++) { lcd.setCursor(i, 1); lcd.write(byte(2 + (i % 2))); delay(150); } delay(3000); } void resetState() { digitalWrite(relayPin, LOW); digitalWrite(redLEDPin, LOW); digitalWrite(greenLEDPin, LOW); lcd.clear(); lcd.setCursor(0, 0); lcd.print("VideotronicMaker"); lcd.setCursor(0, 1); lcd.print("Touch Sensor"); delay(2000); } int getFingerprintIDez() { uint8_t p = finger.image2Tz(); if (p != FINGERPRINT_OK) return -1; p = finger.fingerFastSearch(); if (p != FINGERPRINT_OK) return -1; Serial.print("Fingerprint ID: "); Serial.println(finger.fingerID); return finger.fingerID; }

Join the Community Discussion

View the original discussion thread, respectful feedback, and wiring comments on Arduino Project Hub.

BENCH FAQ // HARDWARE TROUBLESHOOTING

Frequently Asked Questions

Critical bench wiring guidance, power supply specifications, optical sensor serial communication, and fail-secure solenoid mechanics.

1. Can I power the 12V solenoid lock directly from the Arduino 5V header? +
No. An electromagnetic solenoid lock draws between 1A and 2A of inrush current at 12V DC. Powering it directly from an Arduino Uno 5V pin will cause immediate brownouts and permanently damage the onboard 5V linear voltage regulator. You must power the solenoid with a dedicated 12V 2A external DC power supply switched through a 5V optoisolated relay module, with a 1N4007 flyback diode across the solenoid coil to clamp inductive back-EMF spikes.
2. Why connect the AS608 fingerprint sensor to SoftwareSerial (Pins 2 & 3) instead of Pins 0 and 1? +
Hardware Serial pins 0 (RX) and 1 (TX) on the Arduino Uno share the onboard USB UART bridge used for flashing code and streaming debug logs to the Serial Monitor. Connecting the optical biometric module to SoftwareSerial on Pins 2 and 3 at 57600 baud isolates the sensor communication, leaving the hardware USB serial connection completely free for live telemetry and troubleshooting.
3. What happens during a power outage? Does the solenoid door lock stay locked? +
Yes. The ATOPLEE electromagnetic lock is a fail-secure mechanism. When unpowered, a heavy-duty internal helical spring pushes the beveled steel bolt forward into the door strike plate pocket. Electrical power is only drawn for the brief 3-second authorization pulse when the relay energizes the coil to retract the bolt.
4. How do I enroll new fingerprints into the optical scanner's onboard flash memory? +
Flash the official Adafruit Fingerprint library enroll example sketch onto your Arduino Uno first. Open the Serial Monitor at 9600 baud and follow the interactive prompts to place your finger twice to store the biometric template to an ID slot (1 to 127). Once enrolled into the sensor's non-volatile onboard EEPROM, upload the main VTM access control sketch.
5. Why is an optoisolated relay module required instead of a single transistor? +
An optoisolated relay module provides optical air-gap isolation between the sensitive 5V Arduino digital MCU and the high-current 12V inductive solenoid circuit. The internal optocoupler transmits switching triggers via an infrared LED and phototransistor, preventing high-voltage coil collapse spikes and RF noise from resetting the Arduino processor or corrupting the I2C LCD character display.