Go Down

Topic: MODIFIED - SECRET KNOCK DOOR LOCK (Read 11358 times) previous topic - next topic

RaymondBotha

Feb 21, 2010, 10:14 am Last Edit: Feb 21, 2010, 12:56 pm by RaymondBotha Reason: 1
Hi all, I've done a bunch of modifications to Steve Hoefer's code for his Secret Knock Detecting Door Lock. This is the changes that I've made:

-Added a Hall Effect Sensor to determine if the door is open or closed.
-Swapped the gear motor with a servo.
-Added a Serial LCD feedback screen.
-Added a yellow LED.
-Added a bunch of extra features.
-Used the Arduino Mega.

[size=14]Fritzing Diagram:[/size]





[size=14]THE CODE:

Version 0.1: http://www.mediafire.com/?ghww3o5qde2
Version 0.2: http://www.mediafire.com/?nzd4yjojnzm (Easier to read code, UART LCD Interface)

[/size]

[size=14]MORE FILES ARE AVAILABLE AT http://mediafire.com/knocklock[/size]

This will be the first project I'm gonna build when my Arduino arrives from SparkFun.

If there is something wrong with the wiring or code, please post it here. My code really needs to be refined a bit too.

I might also connect the servo's power pin directly to the input voltage from my AC/DC adapter.


Please post any comments or advice.  ;)

RaymondBotha

#1
Feb 21, 2010, 10:21 am Last Edit: Feb 21, 2010, 01:23 pm by RaymondBotha Reason: 1
For some strange reason, you can't click on the download link, just copy and paste it into your browser window and you won't get a 403 error.

EDIT: Fixed

RaymondBotha

#2
Feb 21, 2010, 10:34 am Last Edit: Feb 21, 2010, 12:57 pm by RaymondBotha Reason: 1
I'm gonna update the code in a few minutes to use the UART and not the SoftwareSerial library.

EDIT: Done.

mowcius

Quote
-Used the Arduino Mega.

Maybe not such a positive thing.

Looks good though. I hope you have fun with your arduino  ;)

Mowcius

RaymondBotha

Quote
Maybe not such a positive thing.

Looks good though. I hope you have fun with your arduino  Wink

Mowcius


Why is using the Mega a bad thing? I would understand that if this project was more permanent, but please motivate.

mowcius

Quote
Why is using the Mega a bad thing? I would understand that if this project was more permanent, but please motivate.

It is fine for a temporary project it's just that you could have done it on a normal arduino so a lot of people will try to flame you for that  ;D

The mega is great though cos it gives you more program space.

I do like the project though. Why did you detect whether the door is open or not?

Mowcius

RaymondBotha

Quote
It is fine for a temporary project it's just that you could have done it on a normal arduino so a lot of people will try to flame you for that  Grin

The mega is great though cos it gives you more program space.

I do like the project though. Why did you detect whether the door is open or not?

Mowcius


Yeah, I'd only make a project permanent if it was really useful. Overall I like the mega because of more flexibility, you're right about using a duemilanove or just the atmega for a more permanent solution. But it won't do any harm to use the mega, 'cos I don't plan to get another arduino, it's just a prototyping hobby for me.

I detected whether the door was open or not just because it would add a bit more action to the LEDs and the LCD, it's cool to see an LED light up and a line appear on the LCD when the door closes or opens. I've also coded it to not turn the lock when the door is open, I forgot to mention that I added a secret knock locking function and not just unlocking like the Steve Hoefer original code did. Updating...  ::)

RaymondBotha

#7
Feb 22, 2010, 09:00 pm Last Edit: Feb 22, 2010, 09:30 pm by RaymondBotha Reason: 1
[size=16]UPDATE:[/size]

[size=14]Forgot to mention that my code also does locking on the right knock.[/size]

[size=16]VERSION 0.3:[/size]

[size=14]-Locking Button
-Smarter LCD Line Output[/size]

Link: http://www.mediafire.com/download.php?jwxzjwn1jdy

srylul

instead of knockings, it would be fun with a recorded noise in mp3 format to unlock. or music, bad taste wouldnt get in... nofx:open, elvis:closed.

RaymondBotha

Quote
instead of knockings, it would be fun with a recorded noise in mp3 format to unlock. or music, bad taste wouldnt get in... nofx:open, elvis:closed.


:D

mowcius

Hmm, maybe something simpler. Or if you are into a bit of elvis, get it to play it and only let people in who can identify the song!

Mowcius

RaymondBotha

Detecting a beat is relatively easy, it can make a cool project.

srylul

And the serious use; my phone can be my key. Hard to copy if the code resides embedded in some kind of noise. Access to the file mght be needed. Doable?

nuclearUSA16120

I have been working on some code for a similar (in principle) device that uses a pattern of turning the door knob as an input method. It is currently binary based for simplicity (a turned door handle corresponds to a 1 and a not turned knob a 0, this works because it is a time-based program) but I am working on a method that uses the knob as a rotary combination lock.

RaymondBotha

Quote
I have been working on some code for a similar (in principle) device that uses a pattern of turning the door knob as an input method. It is currently binary based for simplicity (a turned door handle corresponds to a 1 and a not turned knob a 0, this works because it is a time-based program) but I am working on a method that uses the knob as a rotary combination lock.


Now, THAT would be cool!

Quote
And the serious use; my phone can be my key. Hard to copy if the code resides embedded in some kind of noise. Access to the file mght be needed. Doable?


Yes, that could work great, you can record a very complex series of about 25 knocks and then save it on the arduino and your phone. On your phone you can just use a MP3 file. You can play it back quickly, like 5 knocks a second. In 5 seconds you can unlock the door.

Go Up