numberpad unlock

how or can i use a usb number pad and use it to "unlock" my arduino so nosy hands cant touch switches in my car that engage the arduino.

Probably the first step is to remove the USB electronics and connect the keyboard matrix to digital pins on the Arduino. Then the Arduino sketch can require a set of keypad inputs to activate.

okay so how can identify the proper way to use them or will it be just as simple as detecting a input to an arduino pin. now my question is what kind of program is needed to detect the right pin in compinations..

Google. keypad lock arduino Some examples on these forums also and maybe in the Playground on this web site.

If you don't need a high level of security you should be able to rig something up with maybe 3 or 4 of the little push switches such as are used for RESET on the Arduino board. Your code could require a certain sequence - not just limited to 4 presses - to unlock.

...R

awesome and how could i use that reset to start i up would i use something along the line of an if statement? how can i save input from the key pad so i can compare an input with the correct combination? I assume just biased on variables .

cminke:
awesome and how could i use that reset to start i up would i use something along the line of an if statement? how can i save input from the key pad so i can compare an input with the correct combination? I assume just biased on variables .

In case of confusion I only referred to RESET to draw your attention to the sort of switch I was talking about. The actual reset switch would not play any part in the security device.

Your code needs to be organized into different functions and all but the security checking function will do nothing unless a variable (perhaps called codeValid) is true.

The security checking function will change that variable from false to true if the correct code sequence is entered.

…R

thanks man but i relized i dont understand something first..... i have a full # dad.. but only a usb connection... will i have to wire each button to the arduino or whats the best wireing option?

cminke: i have a full # dad.. but only a usb connection

I don't understand

... will i have to wire each button to the arduino or whats the best wireing option?

Yes the switches must be wired to the Arduino pins - one pin for each switch.

In setup() set switch pins as inputs with pinMode(switchApin, INPUT_PULLUP); and then when you read that pin with switchAState = digitalRead(switchApin); it will normally be HIGH or 1. Your switch will then connect between that pin and GND and when you push the switch it will connect the pin to GND and while it is pressed digitalRead() will get a LOW or 0 value.

There are switch examples in the Arduino IDE.

...R