DIY motorized door locking mechanism Using Arduino RFID & Servo Motor - A Simple Keyless Door Lock

Поділитися
Вставка
  • Опубліковано 5 лис 2024

КОМЕНТАРІ • 118

  • @BMonsterLaboratory
    @BMonsterLaboratory  3 роки тому +1

    The code could probably be cleaned up a bit but overall, this was a fun project. Give it a try! Thanks for watching~

    • @archiehaigh4796
      @archiehaigh4796 3 роки тому

      Hi BMonster, is there any way of adding more than one rfid card to the code? Thanks.

    • @BMonsterLaboratory
      @BMonsterLaboratory  3 роки тому +1

      @@archiehaigh4796 I didn't forget about ya. Before I answer I want to test it out first so I'm not posting confusion :) I will try it out this evening and let you know.

    • @BMonsterLaboratory
      @BMonsterLaboratory  3 роки тому

      I added a video and code for 2 ID cards on the Facebook page. I declared my second tag ID as "String tagUID2" and set up a 2nd if/else statement in the loop for the 2nd tag. See the post and let me know what ya think.

    • @archiehaigh4796
      @archiehaigh4796 3 роки тому +1

      @@BMonsterLaboratory thank you, is there any way you can send the updated code by email as I don’t have Facebook. Thank you.

    • @BMonsterLaboratory
      @BMonsterLaboratory  3 роки тому

      @@archiehaigh4796 i'm emailing it to you now

  • @carlososo66
    @carlososo66 3 роки тому +1

    excellent video this helped me a lot, thanks 😁

    • @BMonsterLaboratory
      @BMonsterLaboratory  3 роки тому

      Carlitos, that's awesome! I hope you enjoy future Arduino videos. Thank you for this message. Take care! 👊

  • @Joewest2k11
    @Joewest2k11 3 роки тому +2

    Hello BMonster Lab.
    First of all I enjoy watching your tutorials 😁 I learned a lot about electronics in a short time span. Can you do one favor. could u please upload the schematics for this particular project.
    Thank you.

    • @BMonsterLaboratory
      @BMonsterLaboratory  3 роки тому

      Hi Joe! Great to hear! I just posted the video and code on my Facebook page. For some reason I can't post code in the comment section here.
      facebook.com/BMonster-Laboratory-101410418059806/

  • @Jonas-kj1ke
    @Jonas-kj1ke 3 роки тому +1

    Also very good toutorial

  • @TheRealPompeiiBaby
    @TheRealPompeiiBaby Рік тому +1

    hello! I'm planning to use a servo-operated lock for a project of mine, and was wondering is you still had a link to that specific lock? It's nice that a wire can be fed into the handle. I think I found it but so far nothing has given me a side-view to verify it's hollow. Thanks a lot!

    • @BMonsterLaboratory
      @BMonsterLaboratory  Рік тому

      Hi there! I got this on Amazon. Do a search with ASIN:B07SHS9TQH that should pull it up

  • @terryterry1655
    @terryterry1655 8 місяців тому +1

    Possible to verify payment before unlocking.great for vending machine as well as Airbnb.thx

  • @Linux-Lover-f2b
    @Linux-Lover-f2b 4 місяці тому +1

    I can't figure out how to add multiple tags. I tried adding a comma like you said but then neither of my tags work. Right now, I can use only one tag. Thanks!

    • @BMonsterLaboratory
      @BMonsterLaboratory  4 місяці тому

      hi! You can use an array of strings to store the allowed UIDs and then check if the scanned tag's UID matches any of the allowed UIDs. Try this. The sketch for this video was posted to Facebook. After modifying it, it would look like this.
      #include
      #include
      #include
      MFRC522 mfrc522(53, 5); // MFRC522 mfrc522(SS_PIN, RST_PIN)
      Servo myservo;
      int angle = 0;
      // Array to store UIDs of allowed tags. Change these values to your tag UIDs.
      String allowedTags[] = {"F9 8A D2 A3", "YOUR_SECOND_TAG_UID", "YOUR_THIRD_TAG_UID"};
      int numAllowedTags = sizeof(allowedTags) / sizeof(allowedTags[0]);
      int redLEDPin = 8;
      int greenLEDPin = 9;
      void setup() {
      myservo.attach(3);
      SPI.begin(); // Init SPI bus
      mfrc522.PCD_Init(); // Init MFRC522
      pinMode(redLEDPin, OUTPUT); //LED startup sequence
      pinMode(greenLEDPin, OUTPUT);
      digitalWrite(redLEDPin, HIGH);
      delay(200);
      digitalWrite(greenLEDPin, HIGH);
      delay(200);
      digitalWrite(redLEDPin, LOW);
      delay(200);
      digitalWrite(greenLEDPin, LOW);
      Serial.begin(9600); // Initialize serial communications
      }
      void loop() {
      // Look for new cards
      if (!mfrc522.PICC_IsNewCardPresent()) {
      return;
      }
      // Select one of the cards
      if (!mfrc522.PICC_ReadCardSerial()) {
      return;
      }
      // Reading from the card
      String tag = "";
      for (byte i = 0; i < mfrc522.uid.size; i++) {
      tag.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
      tag.concat(String(mfrc522.uid.uidByte[i], HEX));
      }
      tag.toUpperCase();
      // Check if the scanned tag is in the list of allowed tags
      bool accessGranted = false;
      for (int i = 0; i < numAllowedTags; i++) {
      if (tag.substring(1) == allowedTags[i]) {
      accessGranted = true;
      break;
      }
      }
      if (accessGranted) {
      // If the tag is allowed
      Serial.println("Access Granted");
      digitalWrite(greenLEDPin, HIGH); // Green LED sequence
      delay(200);
      digitalWrite(greenLEDPin, LOW);
      delay(200);
      digitalWrite(greenLEDPin, HIGH);
      delay(200);
      digitalWrite(greenLEDPin, LOW);
      delay(200);
      myservo.write(180);
      delay(5000);
      myservo.write(0);
      } else {
      // If the tag is not allowed
      Serial.println("Access Denied");
      digitalWrite(redLEDPin, HIGH); // Red LED sequence
      delay(200);
      digitalWrite(redLEDPin, LOW);
      delay(200);
      digitalWrite(redLEDPin,

    • @BMonsterLaboratory
      @BMonsterLaboratory  4 місяці тому

      You are scanning each card for it's own unique UID ? just checkin' 👍

  • @MAALCOLMX.
    @MAALCOLMX. 2 роки тому +1

    good video but it keeps on giving me an error "wARNING: Communication failure, is the MFRC522 properly connected?

    • @BMonsterLaboratory
      @BMonsterLaboratory  2 роки тому

      Hey there! Do you have the correct Arduino board and COM port selected in IDE? Hopefully that's all it is.

  • @ouisaleouizgane7680
    @ouisaleouizgane7680 2 роки тому +1

    Hello thanks for explaining, I'm going to program a gaz sensor for my final project the gaz sensor+ buzzer + led it's working for me but i don't know how to program with it a servomotor is there any code for all these please, or can i have help I'm not good in programmation

    • @BMonsterLaboratory
      @BMonsterLaboratory  2 роки тому +1

      hi there! I'm not sure what a gaz sensor is. Is this a gas sensor? Like a CO2 or methane sensor with a buzzer and led flashing lights? What is the purpose of the servo motor in your setup? It sounds like a great project...just need more detail. I would be happy to help however I can. Thanks for asking!

    • @ouisaleouizgane7680
      @ouisaleouizgane7680 2 роки тому

      Yeah it's a gaz sensor for all gaz toxic , the servo motor should be turning the gaz off when the gaz is on , i just tried to modify my code with how u programs the servo motor it's working but not following the gaz , i hope u can help me cuz i have a close deadline
      It's a methane sensor with a buzzer and led flashing lights

    • @ouisaleouizgane7680
      @ouisaleouizgane7680 2 роки тому

      If it's possible i can send u more on Instagram or Whatsapp or any app u have , thank you

  • @thetechgamer7762
    @thetechgamer7762 2 роки тому +1

    Hi thank you for the Amazing video, can you tell me where I can find that code

    • @thetechgamer7762
      @thetechgamer7762 2 роки тому +1

      @Bmonster lab

    • @BMonsterLaboratory
      @BMonsterLaboratory  2 роки тому

      hi there! I posted it on Facebook under #SimpleKeylessDoorLock it's too large to post in the description. Thanks for the kind comment! 👍

    • @BMonsterLaboratory
      @BMonsterLaboratory  2 роки тому

      most recent code is posted to Facebook because it doesn't fit on UA-cam. I an email it if you don't have Facebook.

  • @marticgaming6680
    @marticgaming6680 7 місяців тому +1

    Hi ! is there a way to not use the LEDs and also just use the default rfid card and tag given , while letting the code work ? because i have been trying and editing it doesnt work out.

    • @BMonsterLaboratory
      @BMonsterLaboratory  7 місяців тому

      I just replied to your email. I hope it was helpful. If you still have questions, feel free to ask

  • @phuocohuu6526
    @phuocohuu6526 2 роки тому +1

    Hello BMonster Laboratory, Can i change Arduino mega 2560 to arduino uno r3?

    • @BMonsterLaboratory
      @BMonsterLaboratory  2 роки тому

      Hi there! yes, you can switch from mega to uno in the IDE. click the tools tab on the top left, click on the "board" drop down menu, click Arduino AVR Boards and select "UNO" from the drop down menu. Also, make sure you have the right port selected under the tools tab. Hope that helps! This video may help with getting started - ua-cam.com/video/UiQ7bEZdvOg/v-deo.html

  • @archiehaigh4796
    @archiehaigh4796 3 роки тому +1

    hi, I was just wondering is there any way of editing the code so that if you hold the rfid card on the sensor for 5 seconds, it leaves the servo motor in the unlocked position. This would be really helpful as the lock is going on a room that people go in so I would need to leave the door unlocked at times so that they can get in? Thanks so much.

    • @BMonsterLaboratory
      @BMonsterLaboratory  3 роки тому

      Sure, this can be done. I will have to play around with the code...I'm not a c++ expert yet :)
      I'm traveling ast the moment but will work on this later today.

    • @archiehaigh4796
      @archiehaigh4796 3 роки тому +1

      @@BMonsterLaboratory thank you so much.

    • @BMonsterLaboratory
      @BMonsterLaboratory  3 роки тому +1

      @@archiehaigh4796 I just emailed the code to you. I think I may add a video using the code I just sent you. Let me know how it goes! good luck

  • @ryanrahman8069
    @ryanrahman8069 2 роки тому +1

    Hello I am having an issue with the part about the serial monitor. I am not quite sure why. I checked both my pins and they were correct but nothing popped up in the serial monitor. Any suggestions?

    • @BMonsterLaboratory
      @BMonsterLaboratory  2 роки тому

      Hi Ryan. make sure your setup baud speed matches the baud on your serial monitor. if you use "Serial.begin(9600);" in setup, set it to 9600 on the monitor in the drop down tab. hope that helps!

  • @Jonas-kj1ke
    @Jonas-kj1ke 3 роки тому +1

    Can i somehow also add an ir remote to unlock the door without standing up?

    • @BMonsterLaboratory
      @BMonsterLaboratory  3 роки тому

      Yes, you can. Here is an example of how to control a servo motor using IR. learn.adafruit.com/using-an-infrared-library/controlling-a-servo-with-ir-1 I can help if you need anymore instruction. good luck to you~

    • @BMonsterLaboratory
      @BMonsterLaboratory  3 роки тому

      If you look at the adafruit code - you can copy the IR portion out of the code example. You can alter it to fit your project. That would be the easiest way to get it done. Also, you might want a stronger IR signal than the one they give you in the Elegoo Mega kit.

  • @brankend
    @brankend 3 роки тому +1

    Can you tell me what is the thing connecting the servo with the lock
    Can I use a paper clip?

    • @BMonsterLaboratory
      @BMonsterLaboratory  3 роки тому

      Hi there! That metal piece is from a toy that I took apart. It was attached to a servo in a robot toy. I have also used a large paper clip and bent it to have the same "L" angle so it doesn't slip out of the servo arm. Try the paper clip - it actually works well!

    • @brankend
      @brankend 3 роки тому +1

      @@BMonsterLaboratory thanks
      I have another question if you can help
      I have a rotating door lock unlike this one
      I tried just taping the servo motor horn to it
      It managed to turn it around but when it came to locking it didn't have enough power (I have the micro servo 9g)
      Do you think having a 10kg.cm servo will work?

    • @brankend
      @brankend 3 роки тому +1

      The one I'm using is around 1.3 or 1.8 kg.cm

    • @BMonsterLaboratory
      @BMonsterLaboratory  3 роки тому

      It may just be an issue of repositioning your servo to get an angle it can use to rotate the lock closed. You may want to experiment with different ways to get the servo to open and close the lock. For instance, you may have to put your servo under the lock rather than to the side. You may be better off using some kind of flexible wire or string rather than a paper clip. Perhaps there’s a way to extend the arm of your servo so it can move the lock easier…maybe explore that idea. The 9g servo is not all that strong (about 2.5kg-cm) so a bigger servo may help in your situation.
      Sometimes deadbolt locks have some wiggle room and they don’t go though a strike plate easily. Perhaps you could manually check the lock and how easy it operates. It’s hard to say if a 10kg-cm is necessary but then again it may get the job done pretty well. I like the idea of a larger servo anyway. It if works better, great! Otherwise, you have a nice strong servo or 2 for another project! Sorry I don’t have a better answer for ya

    • @brankend
      @brankend 3 роки тому +1

      @@BMonsterLaboratory it's fine the answer is more than good enough
      Really appreciate your help
      Wish you a good day

  • @dhruvseth23
    @dhruvseth23 Рік тому +1

    Hii there!
    Can you please provide the breadboard schematics?

    • @BMonsterLaboratory
      @BMonsterLaboratory  Рік тому +1

      For the breadboard, it's just 2 leds. The ground rail is connected to Arduino ground pin. Both short pins of the leds are connected to that same ground rail.
      The long pin of the 2 leds are each connected to a 220ohm resistor which is connected to pin 8 and 9 on the Arduino. That's it. Hope that helps 👍

  • @ghoumamohamed
    @ghoumamohamed Рік тому +1

    when i want to open it manually the servo will resist and i can't get new position (opened) any idea how to solve this ?

    • @BMonsterLaboratory
      @BMonsterLaboratory  Рік тому +1

      If your closed angle is 0, close the lock and reattach the servo. the servo will go to 180 when the lock is open. You may also need to disconnect your servo power and rotate arm to 0 (locked) position. Be sure it's disconnected and don't use excessive force or attempt to move the arm beyond its normal range of motion. I think that should do it! Have fun 👊👍

    • @ghoumamohamed
      @ghoumamohamed Рік тому +1

      @@BMonsterLaboratory I'm going to try this, thank you so much very clear and informative video👏

    • @BMonsterLaboratory
      @BMonsterLaboratory  Рік тому +1

      @@ghoumamohamed you're welcome. best of luck on your projects.

  • @Lowgraphic0
    @Lowgraphic0 Рік тому +1

    Can you please give me the whole code except for the LED part? Thx in advance

    • @BMonsterLaboratory
      @BMonsterLaboratory  Рік тому

      hello! I found the code on the Facebook post and removed the LED functionality. Here it is.
      #include
      #include
      #include
      MFRC522 mfrc522(53, 5); // MFRC522 mfrc522(SS_PIN, RST_PIN)
      Servo myservo;
      int angle=0;
      String tagUID = "F9 8A D2 A3"; // String to store UID of tag. Change it with your tag's UID
      void setup() {
      myservo.attach(3);
      SPI.begin(); // Init SPI bus
      mfrc522.PCD_Init(); // Init MFRC522
      }
      void loop() {
      // Look for new cards
      if (!mfrc522.PICC_IsNewCardPresent()) {
      return;
      }
      // Select one of the cards
      if (!mfrc522.PICC_ReadCardSerial()) {
      return;
      }
      //Reading from the card
      String tag = "";
      for (byte i = 0; i < mfrc522.uid.size; i++)
      {
      tag.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
      tag.concat(String(mfrc522.uid.uidByte[i], HEX));
      }
      tag.toUpperCase();
      //Checking the card
      if (tag.substring(1) == tagUID) //change here the UID of the card/cards that you want to give access
      {
      myservo.write(180);
      delay(5000);
      myservo.write(0);
      }
      else
      {
      // If UID of tag is not matched.
      Serial.println ("Access Denied");
      }
      }

    • @Lowgraphic0
      @Lowgraphic0 Рік тому +1

      @@BMonsterLaboratory thanks so much(going to sub and tell my friend about this channel)

    • @BMonsterLaboratory
      @BMonsterLaboratory  Рік тому

      @@Lowgraphic0 Awesome. thanks~!

  • @steftech
    @steftech 2 роки тому +1

    It tells communication failure and i cant find why can you help me please

    • @BMonsterLaboratory
      @BMonsterLaboratory  2 роки тому

      Do you have the correct board and port selected under the tools drop down menu in IDE?

  • @Richie_
    @Richie_ 2 роки тому +1

    My servo keeps buzzing in locked and unlocked positions. Like it's trying to move further.

    • @BMonsterLaboratory
      @BMonsterLaboratory  2 роки тому +1

      Hey Rich! This happens to me when I don't have sufficient power to the servo. Are you using an external 5-6v power supply? Is your lock too heavy or is if difficult to lock and unlock?

    • @Richie_
      @Richie_ 2 роки тому +1

      @@BMonsterLaboratory I haven't attached a lock yet. I will try using my bench power supply. I've had it setup on a breadboard. I will set it up again later and will let you know how it goes.

    • @BMonsterLaboratory
      @BMonsterLaboratory  2 роки тому +1

      @@Richie_ sounds good. Just don't power motors from arduino. Use a breadboard power supply.

    • @Richie_
      @Richie_ 2 роки тому +1

      @@BMonsterLaboratory it seems ok now. What is the code int lock = 4; do? what is the value 4?

    • @BMonsterLaboratory
      @BMonsterLaboratory  2 роки тому

      int is a data-type. lock is defined pin 4 on the Arduino board. Check out Arduino reference page and cplusplus.com tutorials for references. It's very helpful.

  • @ginoantenucci6424
    @ginoantenucci6424 3 роки тому

    Where does the 220 ohm resisters go?

    • @BMonsterLaboratory
      @BMonsterLaboratory  3 роки тому

      the 220ohm resistor is between pin 8 and 9 and the positive leg of the LED. the negative leg of the LED goes straight to the ground rail. So, pin 8 and 9 of the Elegoo board to the resistor then to the positive side of the LED. You just want to control current through the LED so it doesn't burn out - therefore, we put a resistor between the led and the pin on our microcontroller.

    • @BMonsterLaboratory
      @BMonsterLaboratory  3 роки тому

      If you're just starting out, it can be tricky.

  • @archiehaigh4796
    @archiehaigh4796 3 роки тому +1

    Hi, I am not on Facebook, is there any other way that you can send the code to me so that I can make this project?

    • @BMonsterLaboratory
      @BMonsterLaboratory  3 роки тому

      #include
      #include
      #include
      MFRC522 mfrc522(53, 5); // MFRC522 mfrc522(SS_PIN, RST_PIN)
      Servo myservo;
      int angle=0;
      String tagUID = "F9 8A D2 A3"; // String to store UID of tag. Change it with your tag's UID
      int redLEDPin = 8;
      int greenLEDPin = 9;
      void setup() {
      myservo.attach(3);
      SPI.begin(); // Init SPI bus
      mfrc522.PCD_Init(); // Init MFRC522
      pinMode(redLEDPin, OUTPUT); //LED startup sequence
      pinMode(greenLEDPin, OUTPUT);
      digitalWrite(redLEDPin, HIGH);
      delay(200);
      digitalWrite(greenLEDPin, HIGH);
      delay(200);
      digitalWrite(redLEDPin, LOW);
      delay(200);
      digitalWrite(greenLEDPin, LOW);
      }
      void loop() {
      // Look for new cards
      if ( ! mfrc522.PICC_IsNewCardPresent()) {
      return;
      }
      // Select one of the cards
      if ( ! mfrc522.PICC_ReadCardSerial()) {
      return;
      }
      //Reading from the card
      String tag = "";
      for (byte i = 0; i < mfrc522.uid.size; i++)
      {
      tag.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
      tag.concat(String(mfrc522.uid.uidByte[i], HEX));
      }
      tag.toUpperCase();
      //Checking the card
      if (tag.substring(1) == tagUID) //change here the UID of the card/cards that you want to give access
      {
      digitalWrite(greenLEDPin, HIGH); //Green LED sequence
      delay(200);
      digitalWrite(greenLEDPin, LOW);
      delay(200);
      digitalWrite(greenLEDPin, HIGH);
      delay(200);
      digitalWrite(greenLEDPin, LOW);
      delay(200);
      myservo.write(180);
      //digitalWrite(greenLed, HIGH);
      delay(5000);
      //digitalWrite(greenLed, LOW);
      myservo.write(0);
      }
      else
      {
      // If UID of tag is not matched.
      Serial.println ("Access Denied");
      digitalWrite(redLEDPin, HIGH); //Red LED sequence
      delay(200);
      digitalWrite(redLEDPin, LOW);
      delay(200);
      digitalWrite(redLEDPin, HIGH);
      delay(200);
      digitalWrite(redLEDPin, LOW);
      delay(200);
      }
      }

    • @BMonsterLaboratory
      @BMonsterLaboratory  3 роки тому

      I posted the code in the comments here. In the past it would change the format. Let me know if that works...I can always send it by email. Good luck to ya, Archie! Take care~👍

    • @BMonsterLaboratory
      @BMonsterLaboratory  3 роки тому

      By the way, I plan on posting some other options using this lock and servo setup. Hope you'll check that out as well.

    • @archiehaigh4796
      @archiehaigh4796 3 роки тому +1

      @@BMonsterLaboratory hi, the code changed format, pls could you send the code file to me by email. Thanks

    • @BMonsterLaboratory
      @BMonsterLaboratory  3 роки тому +1

      @@archiehaigh4796 email bmonsterlaboratory@gmail.com and I'll send in a reply. Also make sure you have the 3 libraries installed

  • @ginoantenucci6424
    @ginoantenucci6424 3 роки тому +1

    Please help on 9:15 i cant find where does pins go

    • @BMonsterLaboratory
      @BMonsterLaboratory  3 роки тому

      Hi Gino! The red wire is connected to pin 9 on the mega board. The red wire is connected to a 220ohm resistor which is connected to the positive side of the green led. The ground (-) side of the green led is connected to the ground rail of the breadboard. The red led is connected the same way except it's at pin 8. Hope that helps!

    • @ginoantenucci6424
      @ginoantenucci6424 3 роки тому

      @@BMonsterLaboratory is it jumper or female to male wires

    • @BMonsterLaboratory
      @BMonsterLaboratory  3 роки тому +1

      @@ginoantenucci6424 all the wires connected to the breadboard from the Mega board are male to male. the wires connecting the red an green leds are male to male.

    • @ginoantenucci6424
      @ginoantenucci6424 3 роки тому +1

      @@BMonsterLaboratory thx so much

    • @BMonsterLaboratory
      @BMonsterLaboratory  3 роки тому

      @@ginoantenucci6424 You're welcome. Glad to help out

  • @soapzyy_8607
    @soapzyy_8607 2 роки тому +1

    it says no such file in directory what do i do?

    • @soapzyy_8607
      @soapzyy_8607 2 роки тому +1

      Arduino: 1.8.19 (Windows 10), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"
      dump:3:10: fatal error: MFRC522.h: No such file or directory
      #include
      ^~~~~~~~~~~
      compilation terminated.
      exit status 1
      MFRC522.h: No such file or directory
      This report would have more information with
      "Show verbose output during compilation"
      option enabled in File -> Preferences.

    • @BMonsterLaboratory
      @BMonsterLaboratory  2 роки тому

      Hi Soapzyy! In Arduino IDE: Go to tools - manage libraries - search "MFRC522"- download -
      go to sketch - include library - add .zip library - and select the MFRC522 file you just downloaded.
      be sure to include
      #include
      #include
      in your code, just as you see here. That should get you set up.
      I posted the code on out Facebook page - search #SimpleKeylessDoorLock
      Code was way too long to post on UA-cam.

    • @BMonsterLaboratory
      @BMonsterLaboratory  2 роки тому

      see my previous reply. hope it helps!

  • @joebillman
    @joebillman 10 місяців тому

    Hey I was wondering if you could email the code to me because it will be faster. Thanks!

    • @BMonsterLaboratory
      @BMonsterLaboratory  10 місяців тому

      Hey! Ya, sure. Send me email at bmonsterlaboratory@gmail.com I'm happy to send it 👍

  • @GagesMindstormsCreations
    @GagesMindstormsCreations 3 роки тому +1

    I can't get the code.

    • @BMonsterLaboratory
      @BMonsterLaboratory  3 роки тому

      Hi Gage! Go to facebook and do a search for #SimpleKeylessDoorLock - you'll see it in the video description. Let me know if you still have trouble.

  • @shorabhossainsomrat
    @shorabhossainsomrat Рік тому +1

    Please give me the code

    • @shorabhossainsomrat
      @shorabhossainsomrat Рік тому +1

      Circuit diagram please

    • @BMonsterLaboratory
      @BMonsterLaboratory  Рік тому

      here it is
      #include
      #include
      #include
      MFRC522 mfrc522(53, 5); // MFRC522 mfrc522(SS_PIN, RST_PIN)
      Servo myservo;
      int angle=0;
      String tagUID = "F9 8A D2 A3"; // String to store UID of tag. Change it with your tag's UID
      int redLEDPin = 8;
      int greenLEDPin = 9;
      void setup() {
      myservo.attach(3);
      SPI.begin(); // Init SPI bus
      mfrc522.PCD_Init(); // Init MFRC522
      pinMode(redLEDPin, OUTPUT); //LED startup sequence
      pinMode(greenLEDPin, OUTPUT);
      digitalWrite(redLEDPin, HIGH);
      delay(200);
      digitalWrite(greenLEDPin, HIGH);
      delay(200);
      digitalWrite(redLEDPin, LOW);
      delay(200);
      digitalWrite(greenLEDPin, LOW);
      }
      void loop() {
      // Look for new cards
      if ( ! mfrc522.PICC_IsNewCardPresent()) {
      return;
      }
      // Select one of the cards
      if ( ! mfrc522.PICC_ReadCardSerial()) {
      return;
      }
      //Reading from the card
      String tag = "";
      for (byte i = 0; i < mfrc522.uid.size; i++)
      {
      tag.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
      tag.concat(String(mfrc522.uid.uidByte[i], HEX));
      }
      tag.toUpperCase();
      //Checking the card
      if (tag.substring(1) == tagUID) //change here the UID of the card/cards that you want to give access
      {
      digitalWrite(greenLEDPin, HIGH); //Green LED sequence
      delay(200);
      digitalWrite(greenLEDPin, LOW);
      delay(200);
      digitalWrite(greenLEDPin, HIGH);
      delay(200);
      digitalWrite(greenLEDPin, LOW);
      delay(200);
      myservo.write(180);
      //digitalWrite(greenLed, HIGH);
      delay(5000);
      //digitalWrite(greenLed, LOW);
      myservo.write(0);
      }
      else
      {
      // If UID of tag is not matched.
      Serial.println ("Access Denied");
      digitalWrite(redLEDPin, HIGH); //Red LED sequence
      delay(200);
      digitalWrite(redLEDPin, LOW);
      delay(200);
      digitalWrite(redLEDPin, HIGH);
      delay(200);
      digitalWrite(redLEDPin, LOW);
      delay(200);
      }
      }

    • @BMonsterLaboratory
      @BMonsterLaboratory  Рік тому

      see 8:01 for rfid reader wiring. 👍

  • @nyantun5315
    @nyantun5315 3 роки тому +1

    Can I get a code

    • @BMonsterLaboratory
      @BMonsterLaboratory  3 роки тому

      Hi Nyan. Check the facebook page (link is on the banner). It should be listed under the video post. Let me know if you can't find it.

    • @nyantun5315
      @nyantun5315 3 роки тому +1

      @@BMonsterLaboratory I am totally newbie can I ask you ‘’if I want to hold the servo in 35 degrees when the card place and release to 0 when card is remove’’ what do I type in?

    • @BMonsterLaboratory
      @BMonsterLaboratory  3 роки тому +1

      @Nyan Tun my initial thought would be to use a While loop. If the condition is true in a while loop (holding your card to the scanner) the loop will execute. The loop will continue until false (you remove your card from the scanner) - the loop will terminate. It may take me some time to set my project back up to test it out but this should point you in the right direction I believe.

  • @Spark_plug815
    @Spark_plug815 2 роки тому +1

    bro can u help me now !!! im cant use code MFRC522.h
    Arduino: 1.8.18 (Windows 10), Board: "Arduino Uno"
    Arduino-Security-Access-Lock-RFID-MFRC522:7:10: fatal error: MFRC522.h: No such file or directory
    #include
    ^~~~~~~~~~~
    compilation terminated.
    exit status 1
    MFRC522.h: No such file or directory
    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.
    pls help me!!

    • @BMonsterLaboratory
      @BMonsterLaboratory  2 роки тому

      Hi there.
      You need to install the MFRC522 library. Go to "manage libraries" in your IDE and search "MFRC522". Install it from there.

    • @Spark_plug815
      @Spark_plug815 2 роки тому

      @@BMonsterLaboratory thanks bro 👍🏽👍🏽 appreciate you

  • @southerncharmoutdoors6639
    @southerncharmoutdoors6639 2 роки тому +1

    Hey BMonster could you please email me the code for the project. Thanks!

    • @BMonsterLaboratory
      @BMonsterLaboratory  2 роки тому

      #include
      #include
      #include
      MFRC522 mfrc522(53, 5); // MFRC522 mfrc522(SS_PIN, RST_PIN)
      Servo myservo;
      int angle=0;
      String tagUID = "F9 8A D2 A3"; // String to store UID of tag. Change it with your tag's UID
      int redLEDPin = 8;
      int greenLEDPin = 9;
      void setup() {
      myservo.attach(3);
      SPI.begin(); // Init SPI bus
      mfrc522.PCD_Init(); // Init MFRC522
      pinMode(redLEDPin, OUTPUT); //LED startup sequence
      pinMode(greenLEDPin, OUTPUT);
      digitalWrite(redLEDPin, HIGH);
      delay(200);
      digitalWrite(greenLEDPin, HIGH);
      delay(200);
      digitalWrite(redLEDPin, LOW);
      delay(200);
      digitalWrite(greenLEDPin, LOW);
      }
      void loop() {
      // Look for new cards
      if ( ! mfrc522.PICC_IsNewCardPresent()) {
      return;
      }
      // Select one of the cards
      if ( ! mfrc522.PICC_ReadCardSerial()) {
      return;
      }
      //Reading from the card
      String tag = "";
      for (byte i = 0; i < mfrc522.uid.size; i++)
      {
      tag.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
      tag.concat(String(mfrc522.uid.uidByte[i], HEX));
      }
      tag.toUpperCase();
      //Checking the card
      if (tag.substring(1) == tagUID) //change here the UID of the card/cards that you want to give access
      {
      digitalWrite(greenLEDPin, HIGH); //Green LED sequence
      delay(200);
      digitalWrite(greenLEDPin, LOW);
      delay(200);
      digitalWrite(greenLEDPin, HIGH);
      delay(200);
      digitalWrite(greenLEDPin, LOW);
      delay(200);
      myservo.write(180);
      //digitalWrite(greenLed, HIGH);
      delay(5000);
      //digitalWrite(greenLed, LOW);
      myservo.write(0);
      }
      else
      {
      // If UID of tag is not matched.
      Serial.println ("Access Denied");
      digitalWrite(redLEDPin, HIGH); //Red LED sequence
      delay(200);
      digitalWrite(redLEDPin, LOW);
      delay(200);
      digitalWrite(redLEDPin, HIGH);
      delay(200);
      digitalWrite(redLEDPin, LOW);
      delay(200);
      }
      }

    • @BMonsterLaboratory
      @BMonsterLaboratory  2 роки тому

      Hi R Lewis! Try the code I posted. I'm surprised it fit. You can also find it on Facebook search #simplekeylessdoorlock

    • @southerncharmoutdoors6639
      @southerncharmoutdoors6639 2 роки тому +1

      Okay I can just copy and paste it into arduino ide?

    • @BMonsterLaboratory
      @BMonsterLaboratory  2 роки тому

      @@southerncharmoutdoors6639 yes. It should work

    • @southerncharmoutdoors6639
      @southerncharmoutdoors6639 2 роки тому +1

      Okay thanks