×

PC Control These demos and projects allow the robot to be controlled via a computer.

ArbotiX Commander Control - These demos and projects control the Robot using the ArbotiX Commander, the handheld Arduino based remote control.

Direct Control - These demos and projects control the Robot directly from sensors connected directly to the Robot's control board.

Pose Control - These demos and projects allow you to create and playback a sequence of poses.

Serial Control - These demos and projects control the robot using a serial packet protocol.

Standalone - These demos and projects are deisgned to let your robot function without a computer or additional microcontroller.

Wireless Control - These demos and projects allow you to control the robot wirelessly - usually by replacing the Serial Connection with XBee modules.

Reference - These articles have technical details regarding the control and operation of the robot.

×

More info here

RFID Door Lock

Garage Door Opener
mt_ignore
Standalone
mt_ignore
PC Control (Setup Only)

In this tutorial, we will set up a door latch that can be opened with the swipe of an RFID Tag! We will program a list of acceptable 'key' cards that will unlatch the door for a specified amount of time. This is a really simple project, but it does require that you alter your door jamb, so be prepared to do some wood work if you the strike plate to fit securely and flush.

If you haven't already, make sure to go through the RFIDuino Getting Started Guide to get your libraries and hardware setup.

Hardware Required

Note that using a straight door latch solenoid requires power to unlock the door. If you lose power, you will be effectively locked out and unable to open your door until power is returned to the system. With the electronic strike plate, you can still use your regular key to open the door in the case of a power outage. Choose wisely.

Get your RFID Tag Data

b_500_500_16777215_00__images_projects_rfidDoorLock_RFIDuino_basic.png
  1. Connect your RFIDuino to your PC's USB.
  2. Open RFIDuino_helloworld onto your board. You can find this sketch under
    File>Examples>RFIDuino>RFIDuino_helloworld
  3. You will need to make sure the code is adjusted for your RFIduino hardware.
    v1.2 shields (2 pin antenna, 'REV 1.2' printed on the board) will need the following code
    RFIDuino myRFIDuino(1.2);     //initialize an RFIDuino object for hardware version 1.2
    v1.1 shields (4-pin antenna, no version number printed on the board) will need the following code
    RFIDuino myRFIDuino(1.1);     //initialize an RFIDuino object for hardware version 1.1

    Both lines of code are available in the RFIDuino_helloworld sketch, simply uncomment the one you don't need.

    If you are still unsure about what hardware you are using, see this page

  4. Connect a micro USB cable from your computer to your Geekduino
  5. Load RFIDuino_helloworld3 onto your board using the upload button in the Arduino IDE.
  6. Once loaded, you can leave your board connected to your computer - you will need this connection to power the board and to communicate with the computer
  7. Open the Serial Monitor.
    Tools -> Serial Monitor

    The serial monitor should be set to its default settings ('No Line ending', 9600 baud)

  8. Swipe a tag across the RFIDuino antenna. The green light will light up and your buzzer will make a noise.
  9. The Serial Monitor will display 5 numbers. These numbers make up the ID of your tag.
  10. Copy down these numbers for future use. It can be handy to write the ID on a sticky note and attach it to the tag. NOTE: You will need the ID for at least one tag for the next step.

Wiring and Programming

b_500_500_16777215_00__images_projects_rfidDoorLock_rfiduino-door-lock_bb.png

  1. Connect your components as shown here.
  2. Open RFIDuino_demo3_lockbox_multi onto your board. You can find this sketch under
    File>Examples>RFIDuino>RFIDuino_demo3_lockbox_multi
  3. You will need to make sure the code is adjusted for your RFIduino hardware.
    v1.2 shields (2 pin antenna, 'REV 1.2' printed on the board) will need the following code
    RFIDuino myRFIDuino(1.2);     //initialize an RFIDuino object for hardware version 1.2
    v1.1 shields (4-pin antenna, no version number printed on the board) will need the following code
    RFIDuino myRFIDuino(1.1);     //initialize an RFIDuino object for hardware version 1.1

    Both lines of code are available in the RFIDuino_demo3_lockbox_multi sketch, simply uncomment the one you don't need.

    If you are still unsure about what hardware you are using, see this page. The RFID Experimenter's Kit comes with the version 1.2 shield.

  4. Modify the code for the number of cards you want by editing line 58. For example, if you have three cards, use the code
    #define   NUMBER_OF_CARDS 3     //total numer of key cards that the system will respond to.  		
  5. You will also need to modify the sketch to include the IDs of the tags that you want to include. These IDs can be found using the Hello World sketch. Find the block of code starting at line 62 - it looks like this.
    byte keyTag[NUMBER_OF_CARDS][5] ={
    {0,0,0,0,0},  //Tag 1 //commenting each tag with a description can help you keep track of them
    {0,0,0,0,0},  //Tag 2
    {0,0,0,0,0}, //Tag 3
    {0,0,0,0,0},//Tag 4
    }; 		
    Now insert the IDs for your tags. If we had three key tags, our code might look something like
    byte keyTag[NUMBER_OF_CARDS][5] ={
    {77,0,44,22,242},  //Tag 1 //commenting each tag with a description can help you keep track of them
    {200,1,4,98,236},  //Tag 2
    {23,64,4,25,1}, //Tag 3
    }; 		
  6. Connect a micro USB cable from your computer to your Geekduino
  7. Load RFIDuino_demo3_lockbox_multi onto your board using the upload button int the Arduino IDE.
  8. Once loaded, you disconnect the USB cable from your computer..
  9. Swipe any of the 'key' tags across the RFIDuino antenna. The green light will light up and your buzzer play three different notes. Additionally, the solenoid will fire.
  10. Swipe any tag that is not the 'key' tag across the RFIDuino antenna. The red light will light up and your buzzer play three monotone notes. The solenoid will not react.

Mounting

Once you're sure that you have it programmed and the latch releases when you swipe the correct RFID Tag, mount it in your door frame. We had a metal frame door with glass windows, so it was an easy call putting the RFID Reader behind the glass. You may want to mount the antenna in a weatherproof box for accessibility and keep the ~duino and other electronics indoors for safety.

There are instructions with the strike plate that should help you mount that. We recommend keeping the plate as flush as you can to the wall it's mounted to, and to be careful when running wires through a wall.

Code Overview

This code is a modified version of RFIDuino_demo2. This code stores the key tags in a 2-dimensional array (think of it as an array of arrays). When a key is scanned, it is compared to every ID in the 2-dimensional array. If the tag is present, the system unlocks - if not, the system stays locked.

RFIDuino Functions used in this example

×

PC Control These demos and projects allow the robot to be controlled via a computer.

ArbotiX Commander Control - These demos and projects control the Robot using the ArbotiX Commander, the handheld Arduino based remote control.

Direct Control - These demos and projects control the Robot directly from sensors connected directly to the Robot's control board.

Pose Control - These demos and projects allow you to create and playback a sequence of poses.

Serial Control - These demos and projects control the robot using a serial packet protocol.

Standalone - These demos and projects are deisgned to let your robot function without a computer or additional microcontroller.

Wireless Control - These demos and projects allow you to control the robot wirelessly - usually by replacing the Serial Connection with XBee modules.

Reference - These articles have technical details regarding the control and operation of the robot.

×

More info here

Feedback Form


Search