TIMER AND PASSWORD

Hello everyone,I'm trying to make a project but I've never done anything with Arduino and I really need help.
The project is this:
Connect an LCD display, a keypad 4x4, and a relay to Arduino. Set a timer with the keypad and a password. At the end of the time, the relay switch on. If you enter the correct password the timer stop. With two failed attempts password switch on the same realy.
Unfortunately i'm not able to write the program and the connection diagram.
Can anyone help me in this project? I would be really grateful.
Thank you

So, where are you stuck? What have you tried?

We are no code monkeys that just write the code for you. Although we are willing to help you do it :wink:

Sorry, you are right. This is the code that I got for now, but it affects only the password. Can you tell me if it is correct and how do I enter the LCD display? thank you.

#include <Keypad.h>
#define LED 13
const byte ROWS = 4;
const byte COLS = 4;
char keyInsert[6];

int i = 0;
int j = 0;
int s = 0;
int x = 0;

char code[7]= "11ABCD";
char Keys[ROWS][COLS]=
{
{'1','2','3','A'} ,
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
byte colPins[4] = {5,4,3,2};
byte rowPins[4] = {9,8,7,6};

Keypad keypad = Keypad( makeKeymap(Keys), rowPins, colPins, ROWS, COLS);

void setup(){
Serial.begin(9600);
pinMode(LED,OUTPUT);
}

void loop(){
char key = keypad.getKey();
if (i==0){
Serial.println("Insert PIN to verify...");
i++;
}
if (key != NO_KEY && j<6){
Serial.print("*");

keyInsert[j]=key;
j++;
}
if(key == '*') {
Serial.println();
Serial.println("Verifyng the code...");
delay(1000);
for(s=0; s<6;s++){
if(keyInsert==code~~){
x++;
}
}
if(x==6){
Serial.println("The code is correct");
digitalWrite(LED,HIGH);~~

~~ }else{
Serial.println("The code is incorrect, please retry");
delay(2000);
x=0;
i=0;
j=0;
}
}
if(key == '#'){
x=0;
i=0;
j=0;
digitalWrite(LED,LOW);
}
}~~

Please usr code tags so there is no strike-through.

#include <Keypad.h>
#define LED 13
const byte ROWS = 4; 
const byte COLS = 4;
char keyInsert[6];

int i = 0;
int j = 0;
int s = 0;
int x = 0;

char code[7]= "11ABCD";
char Keys[ROWS][COLS]=
{
{'1','2','3','A'} ,
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
byte colPins[4] = {5,4,3,2}; 
byte rowPins[4] = {9,8,7,6}; 
 
Keypad keypad = Keypad( makeKeymap(Keys), rowPins, colPins, ROWS, COLS);
 
void setup(){
  Serial.begin(9600);
  pinMode(LED,OUTPUT);
}
 
void loop(){
  char key = keypad.getKey();
  if (i==0){
    Serial.println("Insert PIN to verify...");
    i++;
  }
  if (key != NO_KEY && j<6){
    Serial.print("*");
    
    keyInsert[j]=key;
    j++;
  }
   if(key == '*') {
      Serial.println();
      Serial.println("Verifyng the code...");
      delay(1000);
      for(s=0; s<6;s++){
        if(keyInsert==code){
          x++;
      }
    } 
      if(x==6){
        Serial.println("The code is correct"); 
        digitalWrite(LED,HIGH); 
     
      }else{
        Serial.println("The code is incorrect, please retry");
        delay(2000);
        x=0;
        i=0;
        j=0;
       }
      }  
    if(key == '#'){
        x=0;
        i=0;
        j=0;
        digitalWrite(LED,LOW); 
    }    
}

Keypad_password.ino (1.21 KB)

Alright, that was the second part. But where are you stuck?

And which LCD do you use?
Did you watch the documentation and examples for that LCD?
Did they work?

Unfortunately i'm not able to write the program and the connection diagram.

Why not, after all this is your project.