Simple Arduino Virtual Keypad

10K522

Intro: 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

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

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

2 Comments

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

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