PDA

View Full Version : [Contest Entry] Front Door Security via Phidget RFID Reader



fish123456
10-10-2007, 11:26 PM
Front Door Security via Phidget RFID Reader

I was inspired to do this project when I saw some of the other uses that an RFID passive reader has been used for. I noticed that many people have created a system whereby they install a reader on the outside of their front door and use an RFID tag to unlock it, and let themselves in. I wanted even more control over my front door, so I added the ability to remotely lock/unlock the door from any computer with internet acces, or as is shown in the video, a cell phone. Now I can control access to my house from anywhere. In addition, I found that the RFID key fob I used would charge even on the other side of the door and transmit back to the reader through the door. Now I don't have to worry about mounting something on the outside of my door, which makes it that less "interesting" for would be thieves or passerbys (and makes it much less aggravating for my land lord! :happy: ) Thanks for running these contests, they are a great way to expo projects.

Equipment Used:
Phidget RFID Kit (http://www.trossenrobotics.com/store/p/3604-Phidget-RFID-Kit-EM4102-.aspx)
Kwikset Powerbolt 1000 (got it on e-bay for $65)
A couple relays, a pc board, and some wire
Laptop
Cell phone (not necessary, but fun)Software:
Visual Studio .NET 2005
C#
Phidget RFID API
IIS on Windows Vista
http://www.youtube.com/watch?v=QlXXhzSfChg

Alex
10-15-2007, 03:35 PM
Hey fish!

Sorry, I didn't realize no one replied to you yet.

This is a pretty cool project! The cell phone feature is a sweet add on:) What sort of obstacles did you have to overcome?

BTW, thanks for the submission! We have you entered in the contest.

fish123456
10-15-2007, 04:21 PM
Hi Alex, thanks for responding. I was hoping someone did!

As far as obstacles to overcome --

The biggest difficulty I had was wrapping the Phidget .NET API to allow for easier programming. For example, I wanted the ability for clients to add tags that it considers "interesting." That way, the client is only notified when an interesting tag comes or goes, with all others considered non-interesting. I found that I had to take the Event that is generated by the API and then asynchronously dispatch the event to all clients. Otherwise, I was getting all sorts of runtime errors. I'm sorry I can't be more specific about the errors, but they were resolved after making the wrapper class dispatch them asynchronously instead of synchronously.

Another challenge I faced was creating a web application that consumed the wrapper DLL I mentioned in the above paragraph. I ran into some issues with the development server included in Visual Studio 2005 not maintaining a valid reference to the Outputs[] array in the RFID class. That issue is not completely fixed and sometimes the web server has to be restarted. IIS doesn't seem to have this issue, and since you would normally only use IIS and not a development server, I didn't spend a lot of time on it.

As far as non-software-related obstacles -- soldering the wires onto the Kwikset was not much fun. I accidentally soldered two contacts together and had a heck of a time desoldering it! Oh yeah, I burnt my finger once on my soldering iron, too! I'm quite the noob when it comes to soldering. :happy: I would do it all over again, though, because it was fun.

Matt
10-15-2007, 05:21 PM
I love the cell phone aspect of this. People pay thousands of dollars to pull this kind of thing off currently and you've just shown that it doesn't need to cost that much. Of course, the "real world" isn't populated with brilliant geeks that know how to do this, but one can imagine an off the shelf wifi enabled RFID door lock that has a little software program you run on your PC to allow people to use their phones to unlock their doors.

And then the world will freak out over peoples new ability to "hack" into your house pointing out all the potential weaknesses. The whole time forgetting that a crowbar is still much easier and faster choice of criminals RFID or none. LOL.

Well done my friend. I think this one will start to get quite popular in the RFID circles. Thanks for the killer demo video, BTW!

fish123456
10-15-2007, 06:17 PM
Thanks for the praise, Matt. I agree with you when you say that people will be quick to point out the weaknesses in that anyone can hack this if they know your server IP address. This was a concern of mine even though I agree that it's easier to kick the door in or use a crowbar. I was happy when I discovered that I could mount the RFID reader on the inside of the door instead of putting something on the outside that might attract unwanted attention. Also, a mechanism similar to that of Windows where multiple unsuccessful attempts to "login" would lock the user out for XX mins is easily implemented. Of course, someone could purposely lock you out, quite literally, by constantly failing the login challenge. Just more challenges to overcome. :happy:

fish123456
11-22-2007, 07:38 PM
I would like to ask the community if anyone has any ideas on how to evolve this project by adding wireless connectivity. This can either be through some standardized wireless protocol such as bluetooth, ZigBee, RF, wireless usb, or something else completely. I'm basically trying to remove the computer from being connected to the lock, but the computer could (and probably should) still be connected remotely. Also, I would like to keep a relatively small footprint, self-contained if possible. It might be asking a lot, but after looking around online, I'm not sure what do.

Thanks!

Alex
11-22-2007, 09:00 PM
We'll be getting a new RFID product in hopefully in the next two months that might work perfectly with this. It doesn't have a high level API like the Phidget reader, but all of the serial commands are published so you can build your own wrapper with it. The really cool thing about this new system is that it is completely modular. Basically you have a base board that has a set of headers that you plug in different RFID reader/writer modules into it (125kHz & 13.56MHz). Here's a screenshot of the socket board itself:

http://forums.trossenrobotics.com/gallery/files/2/ibtechUSB_thumb.jpg (http://forums.trossenrobotics.com/gallery/showimage.php?i=22&c=3)

JonHylands
11-23-2007, 08:45 AM
I would look at using a more embedded solution - basically a single board computer (like a gumstix). You also need to think about what will happen when the power goes out.

- Jon

Alex
11-23-2007, 09:30 AM
That's the beauty of this new system we'll be getting. The company that we are getting these from said that most of the projects that come out of their products are embedded solutions. I'm not too sure if this is using a combo of the module and the socket board or just the modules themselves. I'll have to look into this more once we get them in.

fish123456
11-24-2007, 12:13 PM
I would look at using a more embedded solution - basically a single board computer (like a gumstix). You also need to think about what will happen when the power goes out.

- Jon

Thanks Jon. I've check out the gumstix offerings before and determined that they are probably too expensive for what I need. I love the robustness of the gumstix setups, but at close to $200 each, it's hard to justify the additional cost, although adding bluetooth could be just the wireless functionality I need. These would be a good last-ditch solution, assuming I could use a battery to power the device (something that's probably not viable).

fish123456
11-24-2007, 12:16 PM
That's the beauty of this new system we'll be getting. The company that we are getting these from said that most of the projects that come out of their products are embedded solutions. I'm not too sure if this is using a combo of the module and the socket board or just the modules themselves. I'll have to look into this more once we get them in.

Hopefully the product and any necessary modules will be "affordable" enough to play with for a hobbyist. I wish I had the budget of a small company to justify some research!

JonHylands
11-24-2007, 12:32 PM
There are other options in the more-embedded areas - things like SitePlayer, and serial bluetooth modules.

- Jon

Alex
11-24-2007, 12:33 PM
One of our top priorities is to keep the costs of our products down as much as possible on our products. I don't believe anything was over $100, except for the kits containing more than one product.

Alex
11-24-2007, 12:37 PM
Hey Jon, do you have any links to serial bluetooth modules? We've been looking for some good ones that are appealing to the hobbyist and researcher, but haven't found anything yet.

I'll have to look into SitePlayer a little more. Never heard of it till now, but it looks really interesting. The module in the upper right of the following link looks almost identical to one of the modules we'll be carrying:
http://www.siteplayer.com/main_content.htm

JonHylands
11-28-2007, 03:47 PM
The only ones I've seen are what SparkFun carries:

http://www.sparkfun.com/commerce/categories.php?cPath=16_115

- Jon

Matt
11-28-2007, 04:33 PM
Check this thread out :) Pretty simple solution.
http://www.rfidtoys.net/forum/forum_posts.asp?TID=52

Alex
11-29-2007, 11:32 AM
The only ones I've seen are what SparkFun carries:

http://www.sparkfun.com/commerce/cat...p?cPath=16_115 (http://www.sparkfun.com/commerce/categories.php?cPath=16_115)

I'm a little confused Jon.

I never saw any bluetooth RFID readers on that page. I only saw bluetooth dongles/modems. I'm not quite sure what this little guy does though:

http://www.sparkfun.com/commerce/product_info.php?products_id=8494

fish123456
11-29-2007, 02:49 PM
Check this thread out :) Pretty simple solution.
http://www.rfidtoys.net/forum/forum_posts.asp?TID=52

Pretty much all the solutions mentioned by Amal and company are either too large, too expensive, or a combination of both. I like the embedded bluetooth module idea as I believe the size of the devices to be small enough. However, the data sent to the bluetooth still has to be interpreted in code to determine whether or not to unlock the door.

The only other option I am considering is the USB-RJ45 extender. One of the posters from the aforementioned thread mentioned that he got a good signal even over 50ft of CAT-5.

ekoos7
12-08-2007, 03:04 PM
I like it very cool. I have built a few things with and for mobiles like video for CCTV and so on. And I have made an app to control my Turret via .Net compact on my HTC TyTn. I have also made quite a few Java mobile applications I might just make a J2ME mobile turret control for most other mobiles. But again I like your idea as over here in South Africa we are becoming more security aware by the day. We already have over 20K murders this year alone! For a total population of 46mil.

Dave
12-11-2007, 04:25 PM
I never saw any bluetooth RFID readers on that page. I only saw bluetooth dongles/modems.


Well, you could probably just hook up a Blue Smirf module to the Tx/Rx lines on the Parallax reader and talk to it with a USB bluetooth dongle.

Neo55378008
05-17-2008, 11:41 PM
I don't know C# so this might be a really simple question but how did you create the web interface? Does the site simply call the executable you made or can C# code be run directly from IIS? Also can this be implimented on a Linux machine with Apache?

Adrenalynn
05-18-2008, 01:01 AM
Have a look at the Mono project, and welcome to the forum!

http://www.mono-project.com (http://www.mono-project.com)

fish123456
05-18-2008, 10:38 AM
I don't know C# so this might be a really simple question but how did you create the web interface? Does the site simply call the executable you made or can C# code be run directly from IIS? Also can this be implimented on a Linux machine with Apache?

I wrote the code in C# for ASP.NET running on IIS. It's really not that difficult. Simply add a reference to the Phidget-provided DLL, then you add two buttons to the form and add some handlers for button_clicked events. In the handler you instantiate the reader, perform the operation that locks/unlocks the door (in my case, pulsing the 0 or 1 output), and voila, the relay temporarily closes the circuit to lock/unlock the door.

As far as hosting on Linux, I know there is a way to run ASP.NET apps under Linux (probably through Apache) but have not played around with it. Good luck.

Adrenalynn
05-18-2008, 11:05 AM
>> As far as hosting on Linux, I know there is a way to run ASP.NET apps under Linux

We ran Chilisoft in our Datacenters for that task.

http://www.sun.com/software/chilisoft/

ztrabelyk
02-05-2009, 01:54 PM
Hi there! I am glad to finally see some posts on this project excellent work! The question I have is the web interfaced with the password lock/unlock option. I am strong on the RFID and electronics front however the web interface is new and interesting and I wonder if you have source for the development of it?

Kyle

elios
02-05-2009, 03:55 PM
welcome along, i have only just found this thread.. lol. there is a company in New Zealand currently developing a lock for garage doors, automatic gates, doors, you name it. it works on the bluetooth output of your cellphone....

once you get in a range of about 1 meter, can be set up to something like 30m, it will automatically unlock whatever it is... and once you get out side that range, it unlocks what ever it is.

i have a link somewhere.... i will have to go trawling

Adrenalynn
02-05-2009, 04:01 PM
That probably belongs in OT or outside of RFID, Elios - it's not RFID related, RFID != Bluetooth.

Ztrabelyk, welcome to the forum! Have you looked at Amal Graafstra's book "RFID Toys"? (http://www.trossenrobotics.com/store/p/3607-RFID-Toys.aspx)It has a fair bit of interesting RFID source code and related projects.

elios
02-05-2009, 04:06 PM
well, he did ask...

Adrenalynn
02-05-2009, 04:33 PM
Naw, he asked about source-code for RFID projects controlled via a web control, not commercial bluetooth applications.

Ztrab' : Are you just needing client-server architecture code? Practical .NET 2.0 Networking Projects is a great resource there too, although I can probably post some snippets that'd get you started since you already have experience with the internals of reading and dealing with RFID itself.

elios
02-05-2009, 04:48 PM
I would like to ask the community if anyone has any ideas on how to evolve this project by adding wireless connectivity. This can either be through some standardized wireless protocol such as bluetooth, ZigBee, RF, wireless usb, or something else completely. I'm basically trying to remove the computer from being connected to the lock, but the computer could (and probably should) still be connected remotely. Also, I would like to keep a relatively small footprint, self-contained if possible. It might be asking a lot, but after looking around online, I'm not sure what do.

Thanks!

*coughs

Adrenalynn
02-05-2009, 05:25 PM
Oh - I was talking about the person we were responding to rather than 9 month old posts...

elios
02-05-2009, 05:27 PM
hehe. i didnt read the date. ~~woops. ;) o well

ztrabelyk
02-09-2009, 11:47 AM
Actually a little of both, I would like to know how the web interface is set up to bridge the web/hardware gap. For example, if we put aside RFID for a sec, how do I create the same lock/unlock website to control a 5 volt signal, to simply turn on an LED? I know it is basic but do I need some sort of web server running that validates the password then communicates through the serial port?

Adrenalynn
02-09-2009, 02:56 PM
It could be a web server, or it could be a custom server just over TCP/IP.

My own personal choice would be an Apache webserver with either PHP or the Apache webserver with a CGI (Common Gateway Interface) written in C.

The short view of the architecture would be:

Browser connects to Apache, which serves up a PHP script, prompts for login, checks the login against a MySQL database. Device states are also stored in the database, or queried real-time. PHP generates a dynamic page which displays the device status and some buttons to turn the LED on and off for example. Click a button, PHP gets the button state, opens the serial port to your controller, generates some command that the controller requires, controller reads the state change and then does whatever it does to change the state.

Without more specific requirements (for example: what controller/MCU? What operating system on the server?), that's probably as close as I'd be comfortable getting.

I've been thinking about writing-up an XBee wireless with Parallax reader with output from the XBee into a digital relay to control the door strike, where the XBee is the MCU.

fish123456
02-11-2009, 07:07 PM
The company that puts out the RFID Reader I used, Phidget, has a DLL you consume. If you are familiar with C#/Visual Studio .NET, you create a web application and add a reference to the Phidget DLL. I just set up two image buttons, and when they are clicked, if the PIN is correct, I toggle power to output 0 or 1 on the Phidget board, triggering the relay to close the circuit that locks/unlocks the door. I think I lost the source :(, or I would post, but it's pretty straight-forward. I mean, you still need the Kwikset Powerbolt hardware.