Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connecting a relay to work with solenoid #15

Closed
VarunKumaran opened this issue Sep 19, 2021 · 3 comments
Closed

Connecting a relay to work with solenoid #15

VarunKumaran opened this issue Sep 19, 2021 · 3 comments

Comments

@VarunKumaran
Copy link

Is there a way to trigger a small 5V relay when the fingerprint is matched with the stored prints ??

@unseemlycoder
Copy link
Contributor

Yes, it's possible. Ideally you could set up an automation on Home Assistant to trigger on match but if you want to execute it within the microcontroller. Assuming relay signal is connected on pin 7 of an esp32:

void setup()
{
// ... //  

  pinMode(7,OUTPUT);
  digitalWrite(7,HIGH);

// ... //
}

uint8_t getFingerprintID() {

// ... //
if (p == FINGERPRINT_OK) {
    Serial.println("Match!");
    lastID = finger.fingerID;
    lastConfidenceScore = finger.confidence;
  
    digitalWrite(7,LOW);
    delay(500);
    digitalWrite(7,HIGH);

    return p;
    }
// ... //
}

@unseemlycoder
Copy link
Contributor

Referenced in #20
Addition of a GPIO pin for relay modulation.

@VarunKumaran
Copy link
Author

Hiii @unseemlycoder I worked around the problem and got a solution a year back itself and I was a noob back then 😅.. anyway thanks for reminding me to close the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants