Introduction: Simple Arduino Virtual Keypad

Picture of Simple Arduino Virtual Keypad

Hello i just  created this simple keypad to unlock doors or do some other stuff
requirements:
computer(any os)
arduino
optional for building relay switch
relay 5v
diode 1n4007
resistor 270 ohm
optocoupler 
external supply

Step 1: Bulding Relay Switch

Picture of Bulding Relay Switch

Step 2: Upload Code to Arduino

char inData[20];
char inChar=-1;
byte index = 0;

void setup(){

  Serial.begin(9600);
  pinMode(12, OUTPUT);
}





char Comp(char* This){

  while(Serial.available() > 0)
  
  {
    if(index < 19)
    {
      inChar = Serial.read();
      inData[index] = inChar;
      index++;
      inData[index] = '\0';
    }
  }

  if(strcmp(inData,This)  == 0){
    for(int i=0;i<19;i++){
      inData[i]=0;
    }
    index=0;
    return(0);

  }
  else{
    return(1);


  }
}


void loop()
{
  if(Comp("6729")==0){
    Serial.write("GRANTED");
    digitalWrite(12,HIGH);
    delay(50000);
    digitalWrite(12, LOW);
          }
   
 

}

Step 3: Changing Password

Picture of Changing Password

if you want more than 19 digits just change "char inData[20];"to number you need and all 19 to your number-1

Step 4: Run Arduino Virtual Keypad

now all you need to do is unpack ziped files and open (for windows)application.windows32 and run sketch_130540a.exe

Comments

Amarotica (author)2015-06-16

Thanks for the tutorial! I will definitely build this soon. One question, could I use a arduino 4*4 keypad instead of the pc and do you have any idea how I could make the ABCD buttons each turn on a different relay?

Thanks again

lmowry (author)2014-01-30

Thanks! This really looks fun;) next chance I get I'm going to check this out. Thank you again

About This Instructable

7,079views

52favorites

License:

More by shadowinfinity:kinect 3d face recognition lockPC controlled ARDUINO pan camsimple arduino virtual keypad
Add instructable to: