Introduction: Nintendo Keyless Entry System

Use a Classic Nintendo controller to lock and unlock your door! The output from the Controller is read by an arduino and it looks for a particular combination of buttons, once the combination is entered it sends a signal to eject a Cd-Rom Drive which pushes or pulls the lock. I started making this project like I always do; with what I have on hand. So if you have the same stuff lying around it can be assembled for very little cost.



Once activated NoKES (NintendOKeyless Entry System) will be blinking letting you know that it is alert and keeping guard. Once the Start button is pressed on the controller, the arduino starts recording what buttons are pressed, converts them into a number and adds them together. When you press Start + Select the Arduino compares that number to the combination that you have set.

If you enter an Incorrect combination the arduino activates an attached circuit and plays a sound. It then sends a serial signal to processing and snaps a picture with an attached Webcam (so if someone is messing with your lock you have a picture of them).

If you enter a correct combination the arduino sends a signal to the cd-rom to eject and thus will lock or unlock the door. Upon a correct combination a signal is also sent to processing which plays a sound.

When idle NoKES will "listen" for vibrations with a peizo element that is attached to the door. If someone knocks on the door the vibration is sensed and a signal is sent to the Processing sketch. The Processing sketch will take another picture letting you know who stopped by. NoKES is constructed to be independent from processing in the sense that if you don't have your arduino connected to a computer it will work on its own, you just won't get the pictures or a confirmation sound when a correct combination is entered.

Step 1: Parts List

Main Components:

-Arduino

-Cd-Rom Drive
(this is a great way to re-purpose a dead Cd-Rom as long as it will open and close)

-Classic Nintendo Controller

-Opto-isolator(s)
(mouser P/N: 782-H11A2782-H11A2 or similar)

-Male Molex power connector

-Green and Red Led

Optional Parts:
WebCam
Piezoelectric element
Speaker
something electronic that makes a sound when you press a button
I used a circuit that was in a dinosaur pillow.

Other stuff you will/may need:
wires
solder / solder iron
pcb project board or breadboard
USB cable(s)
2 AA batteries
9V battery
electric tape

Software:
-NoKES_source.zip

Step 2: Cd-Rom Prerequisites

Before you dive too deep into this project you're going to want to confirm that you have a usable Cd-Rom Drive.

Check to make sure that your Cd-rom will open and close with a battery pack and make sure that the Cd-Rom will not close on it's own after being open. I have noticed that some Cd-Trays will close automatically after being open for several seconds I'm not sure if this is a Firmware or Software thing so best to check it out.

You can skip this whole step if you'll be using a wal-wart type power supply to power the Cd-Rom Drive I've found that using a wal-wart works best.

Items:
Molex Power Connector
2AA batteries and a 9V battery
Electrical Tape

Start by removing the unused wires from the Molex Connector
you will only need the red and the black wires.

set up the batteries like the diagram and tape or adhere them together.

this gives you ~12V .
Enough to eject the Cd-Rom Drive

Connect and Test the eject button

you may have to reset the cd-rom by disconnecting and reconnecting the molex a couple of times I'm not sure why I had too but once it opens once it will open and close fine until the power is disconnected.


Step 3: Arduino Eject Test

Open the "NoKES_eject_test" sketch in the Arduino Program and upload it to I/O board

With the arduino powered off and the power disconnected from your cd-rom, connect your Opt-Isolator as shown below

connect your power supply to the cd-rom ensure that it opens and closes by pressing the eject button
power on the arduino and reset immediately

the arduino should blink a few times and the Cd Tray will eject on it's own.

Step 4: NES Controller Re-Wire

I had a hard time finding a female NES connector so I had to use something else. I had on hand a male USB cable, a USB/PS2 connector and a Female PS2 connector, if you have a Male and a Female USB connector you can use that. You actually can use any male/female connector combination as long as it has at least 5 wires. My wiring diagram its a bit confusing going from NES>USB>USB/PS2>ARDUINO so just look at the wiring diagram and get the wires where they belong by any means available to you.

Step 5: Getting Data From NES to Arduino

Connect your NES controller to the Arduino as shown in the previous step.
open the "NoKES _Read_Test" sketch and upload to I/O board.
once it has been uploaded activate the serial monitor button.
pressing a button on a controller should display it's decimal value in the serial monitor window:

A= 127
B= 191
Select= 223
Start= 239
Left= 253
Right= 254
Up=247
Down= 251
Select + Start= 207
no button being pressed = 255

Step 6: Everything Working Together?

Now that each piece is working separately, it's time to test them together:
with everything connected upload the "NoKES_Main" sketch

Press Start to tell NoKES to start recording your input
Press A then B
Press Start and Select at the SAME TIME
the door should open.

change the value of int "nescode" to change the combination

Once this is working you should grasp it well enough to add more things. The code is heavily commented.


Step 7: Talking to Processing

I'm not going to go into great detail here but you need the following:

Processing (http://processing.org)
WinVDIG
NoKES_Comrade Sketch (included with NoKES_source.zip)

Connect your Arduino and Webcam and run the sketch, pictures are saved in the sketch's folder.

if you need help with this or anything else leave me a comment

Step 8: Warnings

Things to consider if you plan on using this device to actually lock something:

Power Source:
(Batteries Die / Electricity Goes Out)
You would want to find a method to power the Arduino and Cd-Rom with Electricity from your Home but in the event of a power outage have some way to switch to battery power.

Combination Method:
NoKES only looks at the VALUE of your combination code NOT the order it was entered:
"A + B + Left"
is the same as
"Left + B + A"

Things I wanted to Add:

Sleep
Take advantage of the Sleep function of the Arduino

Email:
have the image taken by Processing emailed to me or better yet, sent to my phone.

Comments

author
mspearin (author)2009-09-29

Where is the best place to buy an Arduino online?? Cheap?

author
GASSYPOOTS (author)mspearin2012-03-20

radio shack

author
dnicky2288 (author)mspearin2010-12-28

Amazon

author
Electronics Man (author)2011-07-25

Awsome!!!

author
Crimson-Deity (author)2011-01-06

Is there a way to send the bytes another way? Since I don't have a NES controller i'd really like to just use buttons insted!

Is this possible?

author
mooser11 (author)2010-06-13

ummmmmm. how would you physically get through the door way if there are wires and strings in the way

author
Steve121 (author)2009-07-12

Can you use the Nokes without connecting to the computer ?

author
action_owl (author)Steve1212009-07-15

yes - but no sound/video

author
Paul Smith (author)action_owl2010-01-25

Get a Wave Shield

author
Mdob (author)2010-01-13

Hello, I am having some troubles getting the knock sensor to work.  I have written a program to output the piezo value but it still just returns 0.  I am sure that the piezo works.  I just want to make sure that it is analog pin 4 that the piezo goes in (i have checked others but they return unchanging numbers but pin 4 is the only one outputting 0).  I apologize if this is a stupid question.

Thank you.
MDob

author
childB (author)2009-08-20

I just used a relay instead of the whole junk with the optoisolator...

author
stephenniall (author)2009-08-08

gonna do this with a key switch *momentary* soldered up to the Switch on the cd drive with 4 lil bolt things and one big one and if i can get working a pc wired up to the cd drive so when i scan a barcode it tells the pc to open the drive

author
Madrias357 (author)2009-07-09

But technically, all I would have to do is quietly push on the drive door and it auto-unlocks.

author
action_owl (author)Madrias3572009-07-15

its supposed to be on the inside of the door, with the controller on the outside

author
cafriend (author)2009-06-28

This is begging for the Konami code. =]

author
Kuhan (author)2009-06-09

awww... if it read order, it would be UUDDLRLRBA

author
pikaj00 (author)2008-12-15

hey everyone, im going to atempt this project but i had a few questions, what are the specs of th opto-solaters because that part number doesnt exist on mouser. and what are the spec of the male molex power connector. im sorry if im new but but is it eg. 9 pin to 9pin male to male or male to female. thanks for anyhelp.

author
Derin (author)pikaj002009-05-22

If you get the molex from a PSU,be sure to get the 6 pin DIP on the mainboard.It's an optocoupler as well.

author
action_owl (author)pikaj002008-12-15

the Molex has 4 Pins it's just like this one:
http://upload.wikimedia.org/wikipedia/commons/thumb/3/31/Molex_female_connector.jpg/800px-Molex_female_connector.jpg

you can cut one off of an old power supply if you have one

the opto-isolator is still available at mouser for $0.46:
http://www.mouser.com/Search/Refine.aspx?Keyword=782-H11A2
you may want to get two in case something unfortunate happens to one

keep us posted on your progress
_

author
krizzit (author)2009-05-14

Hey, This is a really cool project :P I was wondering if it was possible to just use a lap top instead of the Arduino? and what changes would be required. Im sure all you would have to do is plug and play but i could be wrong.

author
Phetra (author)2009-04-11

I really interesting about this. But it seem like very blank to me. I have very little knowledge about this device, would you please detail about WinVDIG, NoKES_Comrade Sketch and Arduino? thanks///

author
action_owl (author)Phetra2009-04-20

Hi Phetra, here's the basics: the locking mechanism is controlled with a device called an "Arduino" the Arduino communicates with a computer by using software called "Processing". WinVDIG allows you to use a webcam in processing and NOKES_Comrade is a sketch I made to tie everything together. If you're a bit confused it may help to look at arduino.cc and processing.org, I don't reccommned this as your first Arduino project though.

author
Lithium Rain (author)2009-01-24

Maybe I'm missing something, but is this inside or outside of the room you are protecting? Because if it is outside it seems like it could be very easily circumvented by just snapping the wire that connects it to the CD tray. Although I guess with that lock, it's really just to deter the honest/lazy people, as the saying goes. :D It's very very cool though. 5 stars and faved!

author
action_owl (author)Lithium Rain2009-01-27

the locking parts are on the inside of the room, and the nes controller or a connector for an nes controller would be on the outside of the door. I would of had to drill a hole in my wall (or door) to run the connector for the NES controller to the outside and I'm not allowed to do that in my apartment. So this was sorta just for fun

author
grundisimo (author)action_owl2009-04-04

just run it under the door although if someone was mean enough they could disconect the controller and push the connection back under the door and make it impossible to get in without a door ram

author
Lithium Rain (author)action_owl2009-01-27

I see. Still a really great project. :D

author
the_burrito_master (author)2009-02-16

wow lol that's so cool the coolest part is the nes controller!

author
computer_guy (author)2009-02-07

can i use a gamecube comtroler or any at all?

author
DavidRobertson (author)2009-01-14

In step 2, do you mean hardware or software not firmware or software? Because firmware is software.

author

What I meant was that I wasn't sure if the firmware on the Cd-Rom chipset was what closed the tray or if some driver or routine or (something) on the computer was responsible for closing it.

author
skinzy (author)2009-01-07

Love it!!!! Where is that initial sound from?

author
action_owl (author)skinzy2009-01-12

Tenchi Muyo :)

author
skinzy (author)action_owl2009-01-12

OK, Where the heck can I get that? Do you have a copy you can post? I've looked and looked and now I have blisters on my fingers from googling... :-)

author
action_owl (author)skinzy2009-01-12

it's in the "NoKES_Source.zip" file on step 1 it's in: Processing/data/valid.mp3

author
rpprdud (author)2008-12-15

OMG!!! This is SSSSOOOOO Amazing!!!!!!!! I had a little problem telling that the CD drive was on the wall not the door though! Could you please say that in the details. But GENIUS IDEA THOUGH! THANKS FOR THINKING IT UP!!!!

author
MatthewMetcalf (author)2008-12-12

Can you take the controller with you when you leave, then plug it into the door? If so I would think that would make it 10 times more secure, because people would have no ideal what they needed to plug in to the door to open it.

author

that was the original idea but I have nowhere to put a Female USB plug at, on my door, (I can't drill any holes in my apt.) it could easily work that way though

author
Sandisk1duo (author)2008-12-11

Awesome! what's teh name of the song in the video?

author
action_owl (author)Sandisk1duo2008-12-12

Thanks,

"Me Vs. Heidi"
by "I Am Robot and Proud"

www.robotandproud.com/
http://www.myspace.com/iamrobotandproud

author
ax89 (author)2008-12-11

Nice idea, with good stuff for failed attempts (photo). Kinda clumsy having to push START though. Should be able to just enter any numbers - any number press after a delay of 3 secs (or whatever) should start a new sequence. If the locking thing was reversed so the movable part of the lock was mounted on the door, then the CD tray would be less exposed to damage when it is in the open position. Or maybe add a sensor so if the door is opened the tray retracts (even more cool!). Great idea and nice implementation too!

author
Coffee bean (author)2008-12-10

Sweet i bet you could wire it the heavy duty solenoid and use it for your front door

author
techball (author)2008-12-09

You, Sir, are a genius... finally i have a use for my new arduino board and my old cd drives...

author
action_owl (author)techball2008-12-09

awesome! let me know if you run into any snags

author
srhadaham (author)2008-12-09

so in concept you could get this to work with a wireless remote (would require more parts and labor)

author
RKlenka (author)2008-12-09

I have been planning on something like this for awail now but could not think of a easy locking system, i even tracked down powered deadbolts, but if there is one thing i have many of its unused cd drives

author
Jedi Ronin (author)2008-12-09

*stares, mouth agape, then falls to his knees and bows*

author
phalanx447 (author)2008-12-08

So, in theory, this could be done with any controller, as long as there is the proper software to read the input?

author
action_owl (author)phalanx4472008-12-09

Yup!
and the arduino site has some methods for interfacing different controllers:

http://www.arduino.cc/playground/Main/InterfacingWithHardware

(scroll down to Input Devices)

author
luxl85 (author)2008-12-08

So cool. In it i clearly know what Nintendo Keyless