Shop OBEX P1 Docs P2 Docs Learn Events
RFID Dorm Lock — Parallax Forums

RFID Dorm Lock

Billy KBilly K Posts: 14
edited 2006-12-03 18:57 in Robotics
Although my projects are never "finished" this one is fully operational, so it's completed enough to be here. The RFID door lock makes getting in our room much simpler, now instead of putting in the key, turning it, turning it back, and pulling it out, we simply hold our card to the door and it unlocks! The trickiest part of this project was of course the lack of tools in a dorm room and lack of supplies. The servo is held on with sticky wax, a paper clip is used for the linkage, duct tape is another material used, and the whole thing is mounted on a scrap 2x4 as not to damage the door. A bs2 runs the program, and a servo turns the lock. I plan on adding a button later (to lock/unlock the door from the inside without a card), a separate lm7805 vreg for the rfid reader (the one on the super carrier board is getting VERY hot, is this normal?) and a relay to power down the servo when not in use. Attached are a few pics and the source code for the program (just a highly modified version of the code provided for the rfid reader)
lock1.jpg
lock2.jpg
And yes, those are twisty ties used for some of the wiring.
459 x 800 - 101K
400 x 969 - 77K

Comments

  • Kevin WoodKevin Wood Posts: 1,266
    edited 2006-11-16 18:44
    In addition to adding another voltage regulator, you might want to mount the BoE to the 2x4 using standoffs. This will give some air circulation around the board.
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2006-11-16 19:22
    billyk,

    Nice!... you might want to implement a TIMEOUT in your SERIN routine to conserve power.

    LOW Enable                                 ' activate the reader 
      SERIN RX, T2400, [noparse][[/noparse]WAIT($0A), STR buf\10] ' wait for hdr + ID 
    HIGH Enable                                ' deactivate reader
    


    Refer to pg 3
    http://www.parallax.com/dl/docs/prod/audiovis/RFID-Reader-v1.2.pdf
    "The current consumption of the module will increase dramatically when the module is active."

    To implement a TIMEOUT, you might try something like this...

    LOW Enable                                               ' activate the reader 
      SERIN RX, T2400, 1000, NoData, [noparse][[/noparse]WAIT($0A), STR buf\10] ' wait for hdr + ID 
    NoData:                                                  ' <------------------ Jump here if no data received after 1 second 
    HIGH Enable                                              ' deactivate reader 
    Pause 500                                                ' <------------------ Pause for 1/2 second (give things a rest)
    



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • John R.John R. Posts: 1,376
    edited 2006-11-16 19:35
    Red Green would be proud! (If the women don't find you handsome, make sure they find you handy!)

    Awsome job in making things work with what you have available.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John R.

    8 + 8 = 10

    Post Edited (John R.) : 11/16/2006 9:34:31 PM GMT
  • Billy KBilly K Posts: 14
    edited 2006-11-16 20:30
    Thanks for all the advice! I'll make the modifications and post new pics & results as soon as I can get to it (it will probably be after thanksgiving as I'm going home and will bring back parts)

    Billy
  • Billy KBilly K Posts: 14
    edited 2006-11-16 22:57
    Main:
      LOW Enable                                    ' activate the reader
      SERIN RX, T2400, 1000, NoData, [noparse][[/noparse]WAIT($0A), STR buf\10] ' wait for hdr + ID
      HIGH Enable
     GOTO Check_List
    
    NoData:                                         ' Jump here if no data received after 1 second
        HIGH Enable                                 ' deactivate reader
        PAUSE 500                                   ' wait half second
      GOTO Main                                     ' loop
    
    Check_List:
    .......
    


    we'll see how that works, it's kind of a big production to re-program the stamp as it's mounted on the door and no one has a laptop with a serial port. Update on how the "pause" works later tonight

    EDIT: IT WORKS!!!
    and now it looks cooler because the enable light blinks roll.gif

    Post Edited (billyk) : 11/16/2006 11:29:18 PM GMT
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-11-17 01:21
    Haha, reminds me of when my best friend in college took apart his dorm doorknob, electrically isolated the knob from the ring and spliced a 120V zip line to each section. Touch only the knob and enter normally, accidentally touch the ring too and ZAP! He called it his hillbilly dorm security system. He almost got kicked out of the dorm when his RA entered his room on a suprise contraband inspection and touched both parts. He was written up for that, but they didn't recognize the arc welder in the corner made from a knife switch, jug of salt water and two carbon rods from the inside of batteries (which was the actual cause of the electrical outages eminating from his room and reason for inspecting his room).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.

    Post Edited (Paul Baker (Parallax)) : 11/17/2006 1:25:06 AM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2006-11-17 03:36
    billyk,

    Glad it works!...SO is the regulator still getting "as hot" as before or is it not a noticeable difference?

    Paul.... sounds familiar smile.gif ..now the question is, why would there be a need for an arc welder in a freshman dorm room? hmmmm

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-11-17 04:53
    To make sculptures out of pilfered cafeteria silverware, of course [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • Billy KBilly K Posts: 14
    edited 2006-11-17 06:06
    It's a little bit cooler but I'm going to get a separate regulator because I still think it's getting too hot. It's almost unbearable to hold my finger to the side of the heatsink. I've double checked the wiring (I don't think it's a short because it doesn't get hot until the rfid reader is hooked up), put it on standoffs, and it still heats up in less than 2 minutes. (I've tested it without the servo too) I looked it up, and the reader draws .090 amps, the stamp .003 amps. That's nowhere near 1 amp which is the max of the 2940. Could it be a defective regulator?

    Also, you guys need to stop giving me dangerous like homemade arc welders! I don't want to get kicked out of school before I'm even half done with my freshman year!
    And our silverware does suck too.

    EDIT: Just a question, why is the 2940 used instead of the 7805?

    Post Edited (Billy K) : 11/17/2006 6:31:02 AM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-11-17 16:15
    Billy,
    ·
    ··· The LM2940 is a Low-Dropout Regulator.· It’s a little more efficient than a 7805 and less susceptible to thermal runaway.· The regulator on your board is most likely getting hot because of the combined current draw of the RFID and the Servo.· The servo being the more likely culprit.· You shouldn’t need to add an extra regulator.· That would actually end up consuming more current in the long run.· Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2006-11-17 16:20
    Billy K,

    What is the supply voltage you are powering the RFID Dorm Lock with? That could be the source of most of your heat.


    The 2940 is used because it is a low-dropout regulator which will work down to 6 volts.
    The 7805 requires more current just to sit there and do nothing than the 2940 does and will only work down to about 7 volts.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Billy KBilly K Posts: 14
    edited 2006-11-17 17:56
    I'm using an unregulated 12v 1a power supply from parallax. http://www.parallax.com/detail.asp?product_id=750-00007. As to the idea that the servo is the probable culprit, I've let it sit without the servo and the current draw from the rfid reader and stamp alone makes it heat up. Thanks again for all your advice. I appreciate it! smile.gif
    And here's what I plan to build when I get the parts in a week. (Just turning off the servo)
    rfidwithservo.jpg
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2006-11-17 18:45
    Billy K,

    12V dropped to 5V across·a linear regulator is going to need to dissipate 7V in the form of HEAT. If your circuit requires 200mA,
    that's 1.4Watts of HEAT that the regulator must deal with·.... P = I * V

    Use a power supply that is closer to your operating voltage and the regulator will be much happier.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 11/17/2006 11:19:10 PM GMT
  • Billy KBilly K Posts: 14
    edited 2006-11-17 20:16
    Thanks! Looks like I'll be purchasing the 7.5v wall wart soon.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-11-18 00:58
    Yes, now knowing the power source that is definitely your culprit.· I for some reason thought you had a battery on this.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2006-11-20 02:32
    Beau Schwabe (Parallax) said...

    billyk,

    Nice!... you might want to implement a TIMEOUT in your SERIN routine to conserve power.

    LOW Enable                                 ' activate the reader 
      SERIN RX, T2400, [noparse][[/noparse]WAIT($0A), STR buf\10] ' wait for hdr + ID 
    HIGH Enable                                ' deactivate reader
    


    Refer to pg 3
    http://www.parallax.com/dl/docs/prod/audiovis/RFID-Reader-v1.2.pdf
    "The current consumption of the module will increase dramatically when the module is active."

    To implement a TIMEOUT, you might try something like this...

    LOW Enable                                               ' activate the reader 
      SERIN RX, T2400, 1000, NoData, [noparse][[/noparse]WAIT($0A), STR buf\10] ' wait for hdr + ID 
    NoData:                                                  ' <------------------ Jump here if no data received after 1 second 
    HIGH Enable                                              ' deactivate reader 
    Pause 500                                                ' <------------------ Pause for 1/2 second (give things a rest)
    



    Thanks for Posting this will help in a project where i may use a battery pack with a RFID-Reader
    I do not know if i would of thought of doing it that way

    Sam

    ·
  • Billy KBilly K Posts: 14
    edited 2006-11-21 05:31
    planning on adding a few more features when I get parts.
    1. A switch that senses when the door is closed. This way, the RFID reader will only be turned on when it is closed, and the servo will only move into a locked position if it is closed.
    2. A pushbutton switch on the inside. This will allow us to lock and unlock the door from the inside of the room without a card when the door is closed. If the door is in an open position and the button is pressed, I plan on adding a feature where if the door is closed within 10 seconds, the door automatically locks behind me.
  • boeboyboeboy Posts: 301
    edited 2006-11-22 21:27
    That is·cool have you thought of adding a buzzer so that when it unlocks it will beep?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lets see what this does... KA BOOM (note to self do not cross red and black)

    Post Edited (boeboy) : 12/23/2006 2:50:39 PM GMT
  • jdoleckijdolecki Posts: 726
    edited 2006-11-23 07:08
  • Billy KBilly K Posts: 14
    edited 2006-11-27 04:10
    Little update. I got a 7.5v 300ma transformer and hooked it up. The voltage jumps from around 11v to 9v as the card reader turns on and off due to the timeout. This caused the stamp to constantly reset itself. To fix this, I added (2) 1000uf electrolytics to the power supply and that fixed the issue, but vin still reads around 10v. Can I add a few resistors in parallel to the transformer to cause the voltage to drop further? Or is there a better soluton? (and would a ~40ohm resistor be best?)
  • Matt BattleMatt Battle Posts: 172
    edited 2006-11-28 17:26
    Have you tried using a voltage regulator?
  • Billy KBilly K Posts: 14
    edited 2006-11-28 18:45
    yup, it's on a voltage regulator. a 2940ct.
  • SawmillerSawmiller Posts: 276
    edited 2006-12-03 18:57
    you could use a diode to drop a bit of the voltage.

    dan
Sign In or Register to comment.