From past one month I was planning to make an RFID door lock system. But I wanted something cool. I am huge fan of Xmen. I love Wolverine and Cyclops. So create an RFID based door lock system, where if you swipe the right card, cyclops known "eyes" will turn green and servo will open giving a beeping sound through a buzzer. If you swipe the wrong card, cyclops eyes will turn red. So here is how I made.
VideoThis video contains the time line of the project. I have given full instructions in this hackster along with schematic and code. (At the end of the instructions in this video, I have also created a timeline of how I created the cyclops image.)
InstructionsMaking the "Cyclops" base
In this step, we will make the base of cyclops. This base will be used to stick cyclops image along with a WS2812B LED strip with 10 LEDs. So lets get started.
Making the Circuit
Now we will make the circuit. Use this schematic to make the circuit.
Also refer the below connections while making the circuit.
And this is how it should look like.
Code
Our code is pretty simple. If an authorized RFID tag is swiped, then show ascending and descending green pattern on LED strip along with opening servo and triggering buzzer two times. If not then show red color pattern with triggering buzzer three times. I have given the code in the attachment below.
This is our main logic. Please change the UID of card when you are using it. You don't need to program it separately for finding the UID. Simply upload this sketch and
if (content.substring(1) == "86 AB 84 A5") //change here the UID of the card/cards that you want to give access
{
Serial.println("Card Identified");
digitalWrite(7, HIGH);
delay(200);
digitalWrite(7, LOW);
delay(200);
digitalWrite(7, HIGH);
delay(200);
digitalWrite(7, LOW);
Serial.println();
granted();
myservo.write(179);
for (int i = 0; i < (NUMPIXELS / 2) + 1; i++) {
strip.setPixelColor(i, strip.Color(255, 0, 0));
strip.setPixelColor(NUMPIXELS - i, strip.Color(255, 0, 0));
strip.show();
delay(35);
}
delay(3000);
for (int i = 0; i < (NUMPIXELS / 2) + 1; i++) {
strip.setPixelColor(i, strip.Color(0, 0, 0));
strip.setPixelColor(NUMPIXELS - i, strip.Color(0, 0, 0));
strip.show();
delay(50);
}
myservo.write(90);
}
I hope you liked my project.
Follow me here for regular updates on my hobby projects and tutorials:
Facebook : https://www.facebook.com/vikkey321/
Hackster : https://www.hackster.io/vikkey321
Comments
Please log in or sign up to comment.