Introduction: Nintendo Keyless Entry System
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
(this is a great way to re-purpose a dead Cd-Rom as long as it will open and close)
-Classic Nintendo Controller
(mouser P/N: 782-H11A2782-H11A2 or similar)
-Male Molex power connector
-Green and Red Led
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:
solder / solder iron
pcb project board or breadboard
2 AA batteries
Step 2: Cd-Rom Prerequisites
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.
Molex Power Connector
2AA batteries and a 9V battery
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:
Select + Start= 207
no button being pressed = 255
Step 6: Everything Working 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:
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:
(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.
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:
Take advantage of the Sleep function of the Arduino
have the image taken by Processing emailed to me or better yet, sent to my phone.