Shop OBEX P1 Docs P2 Docs Learn Events
Rental door lock control — Parallax Forums

Rental door lock control

dbjdbj Posts: 75
edited 2006-10-27 03:30 in BASIC Stamp
···· I am looking into building a door lock controler for rental properties, I was thinking about using a six digit code that can be generated from formula.
Use three of the digit's for day of the year and two for time in and time out
and one for length of stay in days.
··· ·I think that a DS1302 would be a good timekeeping chip but I·dont know which basic stamp would be more pratical, I would think since this is a battery controlled device, that sleep mode would be needed but I·also·feel that sometype of scratch pad ram would be·needed to store the time out, so the lock can be activated at the end of their stay. I·have· some·experience with BsP24 and Bs2 Boe. I don't know anything about the new Propeller Chip and the method of writing program for it. Does anyone know of any similar projects using the DS1302 chip?
············································ Thanks David

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-10-22 23:22
    I may be misuderstanding your premise, but Im not sure how your formula would work or is secure. Wouldn't the required code be changing constantly since it is time based? If so, you would have to explain the coding so they could generate the correct code, and that only leaves the length of stay as an easy 1 digit number that someone who hasn't paid can guess.

    The best way I see to tackle the idea is with an RFID card/reader. If the locks are networked with a central unit it is simple enough to tell the lock which card to accept. If they aren't networked, you can use RFID cards with some memory on them that gets programmed with the length of stay information (typically an end of stay time). Then you can use the time keeper chip to compare the time. If the second method is used, you will need to program the locks with a master RFID # that can be opened at any time (a master RFID·key). And charge a deposit to cover the loss of the renter's card if they don't return it. In the case of non return, you can reset the lock to another RFID card. This can be done externally via a means of holding the master key to the reader for 10 seconds, then the next RFID tag to come in contact becomes the new user key.

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

    Parallax, Inc.
  • dbjdbj Posts: 75
    edited 2006-10-23 02:37
    The way that the numbers are secured is the number 38 is a rolling number that is added to the curent day not properly shown on flowchart, that number would be known by the person giveing out the code. As far as the length of the stay is normaly 3-7 days but if they went over 9 they would have to get a second code. There is a Lock on the market that is a standalone battery powered unit that you have to log into a website to generate 6 digit number for the lock that lets you in and locks the door at the time you put into the web site, without ever comunicating with the lock. Each lock cost $486.00 and a yearly fee of
    $86.00 per lock!! with 50 rooms thats upfront cost of $28600.00 and a yearly fee of $4300
    Ouch.. You can buy a electronic door lock with 4x3 keypad for $87.00. Saftey is a important so what would be a good level of encription for a project like this? And would the
    propeller chip be able to count the number of days of the year from the DS1302 chip?
    Thanks David
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2006-10-23 07:04
    I don't think battery powered would be a viable option here, for a couple of reasons.

    First, I think for fire code/electrical code safety, you need to design your circuit so that in a power outage, the lock would automatically open. This prevents people from being trapped in the event of an emergency. A battery would have no effective emergency override.

    Second, if the battery was easily overridden, your lock would be ineffective, since anybody could bypass it if they wanted.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-10-23 07:12
    I can't really follow your flowchart, but what you are trying to do is possible. You may want to design it so the signature is the end date of the rental and the door lock ID. An algorithm would be used to transform the base information into the user code. When the code is entered into the door lock the inverse algorithm is performed by the lock, compares the lock ID against it's own then makes sure the date is in the future. The start time isn't nessesary unless you are selling a future rental. The propeller is actually overkill, for the number of units you need, the SX would be economical and sufficiently powerful. The BS2 would also work. Something to consider is the energy required to unlock the door, this may·be a killer if the unit is battery operated.·You dont need to implement any strong encryption, just enough to scramble any obvious decyphering of the codes.

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

    Parallax, Inc.
  • Beau SchwabeBeau Schwabe Posts: 6,560
    edited 2006-10-23 14:24
    dbj,

    To add to Paul’s comments... "...You don’t need to implement any strong encryption...", you could include a three strikes and your out scheme where if a wrong code were entered
    after the third attempt it would lock the unit so no further codes could be entered. This could be indefinite until reset by a master key or it could be under a timed interval to self-reset.

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

    IC Layout Engineer
    Parallax, Inc.
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2006-10-23 17:18
    An interesting project David, have you thought about RFID for entry. You could have several tags per rental property coded for varying lengths of stay. The code could be written to set the lock timer on the first read yet it would still allow entry until time ran out, beyond that another tag with a different code would be needed. It would cycle through the tags but not allow any tag to be used consecutively. A missing tag would just mean dl'ing a new ID into the stamp. The locks could be mains powered with battery back up, I'm sure you are thinking they will prevent entry but always allow exit.

    I hope you dont mind this input its way off what your thinking I just took an interest in your project, especially when I saw the cost comparisons.

    Jeff T.
  • dbjdbj Posts: 75
    edited 2006-10-24 00:52
    Hey thanks for the comments I read your posts all the time and see all the thought that is put into your comments. The current lock that I talked about the lock is a pass threw on the inside and with a key and keypad from the outside.It runs on three D cells and will run over a year on a set of batterys, it uses a small dc motor that has a gear redutcion to lock and unlock the door, Was thinking about what Paul said to use inverse algorithm that would be tied to the end date and the door lock ID. this seems to be hard consitering that 265 days X 24 hours = 6300 points to store in memory . Is a eerom type memory what would not be erased if the battery was being replaced, the clock would have a backup litium battery to keep time during battery replacement. I also thought it would be nice to let the coustomer enter his own code after the first code had been entered so that it would be easy for them to remember, I noticed the DS1320 has a low power mode , does the SX have this also? ad how would you tie the two together so the would go into low power mode at the same time and wake up with the·unlock key to be followed buy the six digit code.·I also like the idea of the three strikes your out that would detour kids from playing with the keypad. How long woud you deactivate the key pad·?·Thanks David

    Post Edited (dbj) : 10/24/2006 1:09:28 AM GMT
  • dbjdbj Posts: 75
    edited 2006-10-24 00:59
    Sorry I forgot to send the pic of the Lock I would like to use for this project.··· Thanks David
    528 x 300 - 36K
  • BeanBean Posts: 8,129
    edited 2006-10-24 01:06
    David,
    The SX does have a "sleep" mode. But I would think it would be better to completely power down the SX, and make a keypress power it up.
    Then the SX can latch it's own power on.

    Sleep mode is more for a device that need to "do something" every couple of seconds or so. Like a digital thermostat for your house.
    Every 10 seconds or so, it wakes-up checks the time, temperature, and temperature setting, turn on/off heat as needed, go back to sleep.

    I would think that 99.9% of the time this thing will be idle. And even in sleep mode those milliAmps add up.

    Very interesting project.
    I can't beleive there is nothing already on the market. Or are you just trying to DIY it ?
    Since this is on the outside of a door, have you looked into putting a small solar panel on it with niMh batteries ? You might be able to make it last many years (until the batteries fail to charge).

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    "People who are willing to trade their freedom for·security deserve neither and will lose both." Benjamin Franklin


    Post Edited (Bean (Hitt Consulting)) : 10/24/2006 1:11:40 AM GMT
  • dbjdbj Posts: 75
    edited 2006-10-24 01:15
    Hey bean DIY for shure, The code for the Sx is It similar to bs2 and how could one calculate the power consumption. even if the batterys lasted eight months it would be ok. Thanks David
  • NateNate Posts: 154
    edited 2006-10-24 16:52
    David,

    I just finished a simliar project that was used on lockboxes.· When sleeping the unit draws about 0.01uA (10 nA) according to my 5 1/2 digit bench multimeter.

    Bean's idea of using a keypress to re-power the SX after a period if inactivity sounds intriguing.· As usual, I have finished a project and now think there may be a better way......


    Nate

    ·
  • dbjdbj Posts: 75
    edited 2006-10-27 03:30
    From what I can see it would be best to use a external clock because I need a very stable clock signal, does anyone Know of any examples of useing the DS1302 with the SX28 chip. I found a very nice electronic keypad lock for $36.00 on ebay it has a 3x4 key pad with seven wires no backlight glow in the dark, could I use the SX28 i/o pins for kepad imputs instead of haveing a decoder chip for the keypad, I have a SX Tech Tool Kit PRO. Should I start a new thread in the SX/ forum or can this one be moved? Thanks David

    Post Edited (dbj) : 10/27/2006 3:35:31 AM GMT
Sign In or Register to comment.