Back to engineering archive

Record 012 / Firmware and control

Fingerprint and keypad access controller

An access control interface combining fingerprint input, keypad entry and local feedback.

Firmware development
Fingerprint interfaceKeypadAccess logic

Firmware flow

How a released keypad key is handled

Selected keypad input and backspace branch.

A press is remembered. After release, a valid key is mapped and the timeout restarts. In the shown backspace branch, the final character is removed only when the input is not empty.

This is only part of the password-entry routine. It does not show password comparison, fingerprint verification or door control.

Read the implementation

getPasswordFromKeypad excerpt · selected source lines 110–130. Source inspection is not a hardware test.

    uint8_t currentKey = keypad.getKey();
    lcd.setCursor(0, 0);
    lcd.print("Enter Password:");

    if (currentKey != I2C_KEYPAD_NOKEY) {
      lastKey = currentKey;
      wasPressed = true;
    } else if (wasPressed) {
      wasPressed = false;

      if (lastKey < 16) {
        char key = keymap[lastKey];
        startTime = millis(); // 🔄 Reset timeout on key press

        switch (key) {
          case 'D':  // Backspace
            if (inputBuffer.length() > 0) {
              inputBuffer.remove(inputBuffer.length() - 1);
              Serial.println("Deleted last character");
            }
            break;
Open the exact source-level diagram
CheckIs a key pressed?Read the keypad and show the password prompt.
Result · YesRemember the pressed key
Check · NoWas a valid key just released?Continue only after a recorded press, with a key index below 16.
Action · YesLook up the key and reset the timeout
Result · YesRemove the last character
Result · NoLeave this shown branch

Technical notes

Entry and enrolment

handleKeypadInput() handles keypad entry; addFingerprint() handles fingerprint enrolment.

Stepper actuation

stepperMove() handles motion separately from input parsing.

Local status feedback

The local display and serial interfaces provide feedback during device interaction.

Engineering archiveArchive record

Project enquiries

Discuss your project.

Tell us what you’re developing and where you need engineering support.

Discuss your project