Keypad Entry Lock

An up to six digit number code that enables you to unlock a secret container.

Apr 10, 2019

65827 views

47 respects

Immagine

Components and supplies

1

5 mm LED: Green

1

Breadboard (generic)

1

Arduino UNO

1

9V battery (generic)

1

keypad

1

Jumper wires (generic)

1

SG90 Micro-servo motor

1

5 mm LED: Red

1

Resistor 220 ohm

Project description

Code

Code

c_cpp

Code

c_cpp

Downloadable files

Back View

Back View

Immagine

Back View

Back View

Immagine

Front View

Front View

Immagine

Comments

Only logged in users can leave comments

Immagine
Immagine

hofhiens621

a year ago

I also tested the code and found it not quite worthy of burglars. The code only waits for the correct keys to be pressed, while any keys pressed in between will not matter. There are two if statements within lines 33 - 41; replace them with this code and it will work. I also included the serial print statements so you can see your inputs in the serial monitor. if(key != NO_KEY) { if (key == '*' || key == '#') { position = 0; LockedPosition(true); Serial.println(key); } if (key != password[position]) {position = 0; LockedPosition(true); Serial.println(key); } if (key == password[position]) { position ++; Serial.println(key); } }

Immagine
Immagine

Anonymous user

2 years ago

i cant find the circuit diagram!

Immagine
Immagine

bschae5081

2 years ago

It's a great project. Here's the thing. Try hitting random keys with 4, 2, 7 randomly thrown in there. It still unlocks. Any way to fix that?

Immagine
Immagine

hofhiens621

a year ago

See my most recent comment.

Immagine
Immagine

kaivalya19

2 years ago

In my same code it is showing that Arduino: 1.8.13 (Windows 10), Board: "Arduino Uno" Multiple libraries were found for "Servo.h" lock:2:10: fatal error: Keypad.h: No such file or directory Used: C:\\Users\\Admin\\Documents\\Arduino\\libraries\\Servo #include <Keypad.h> Not used: C:\\Program Files (x86)\\Arduino\\libraries\\Servo ^~~~~~~~~~ compilation terminated. exit status 1 Keypad.h: No such file or directory This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences. Can you help me out.Please

Immagine
Immagine

UrekMazino

2 years ago

You should download the respective library Sketch >> Include Library >> Manage Libraries.. >> It sill show a new window, look for the library "Keypad" by Mark Stanley and Install it It sill show a new window, look for the library "Servo" by Michael Margolis and Install it Those are the one that should solve this.

Immagine
Immagine

Anonymous user

2 years ago

Ive never attempted any of these projects. Is there a more clear wiring schematic that I can follow. Or step by step instructions?

Immagine
Immagine

Anonymous user

2 years ago

https://drive.google.com/file/d/1cDwoOGePrVwzq2nr6Vq05JQnBwQedhgd/view

Immagine
Immagine

gregarduino

2 years ago

Hi. I see that there is no shematic for the wiring of this project. I created one based on the code. You can go check it out with the link below. https://drive.google.com/file/d/1cDwoOGePrVwzq2nr6Vq05JQnBwQedhgd/view?usp=sharing

Immagine
Immagine

mediumrhinoceros294

2 years ago

thanks, it looks helpful

Immagine
Immagine

zackkennedy42

2 years ago

The code isn't working for me and I am a beginner, any code that I can try would be much appreciated.

Immagine
Immagine

JohanSanju06

2 years ago

Really a great project..... My first ever arduino project....... Can you share the schematic clearly as i cannot understand where the pin is located. Thank you and once again great project

Immagine
Immagine

geek25

2 years ago

gregarduino posted a schematic

Immagine
Immagine

charlielidstone

2 years ago

Very neat. I'm trying to create a lock system with much of the same parts you are using, but I'm wondering how your code knows the value of the user input when all the keys are represented using chars. I'm pretty new to the keypad library as well as using arrays so forgive me if I don't make sense. -charlie

Immagine
Immagine

nijlvaraan

2 years ago

to me it gives the error: C:\\Users\\XXXX\\Documents\\Arduino\\code_keypad\\code_keypad.ino:6:18: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] char* password = "XXX"; ^~~~~ can anyone help me please?

Immagine
Immagine

Anonymous user

2 years ago

Did you figure it out? I am having the same problem.

Immagine
Immagine

Anonymous user

2 years ago

PLEASE I NEED THE VIDEO ABOUT THE PROJECT

Immagine
Immagine

Anonymous user

2 years ago

Hello, I see you guys understand how a keypad works, can you help me in my project plz ?

Immagine
Immagine

Anonymous user

2 years ago

Simple but very cool code. It works perfectly. Congratulations. Jorge

Immagine
Immagine

Anonymous user

2 years ago

Hi. I see that there is no shematic for the wiring of this project. I created one based on the code. You can go check it out with the link below. https://drive.google.com/file/d/1cDwoOGePrVwzq2nr6Vq05JQnBwQedhgd/view?usp=sharing

Immagine
Immagine

Anonymous user

2 years ago

where is the circuit diagram

Immagine
Immagine

hockey1alex

2 years ago

thanks so much

Immagine
Immagine

geek25

2 years ago

thanks

Immagine
Immagine

Anonymous user

2 years ago

Any one help me with keypad programing. I need to run a program based on the input entered using keypad. For example. If i press 1000 in key pad and press a push button the led to be glow one second. If i press the start button again it should run a program again for one second. * button to clear the input # button to confirm the input. Any one can help me with coding

Immagine
Immagine

Anonymous user

2 years ago

Thank you so much for sharing your ideas with us! It will be a big help for us whose an amateur of this

Immagine
Immagine

Anonymous user

2 years ago

i havent touched an arduino in years and im out of practice, but i remember trying to write a program similar to this years ago. if im not mistaken, this code has teh same issue, correct me if im wrong.... basically, if i remember correctly, the code says the pw position is 0, and if the key entered is a correct pw char, then the position advances one, and when it advances 3 positions, the lock opens. so, again, correct me if im wrong here, but this means that if someone comes up and randomly hits, say "66987676898678686876-4-4567896568587698765986576-2-98324058923583420580834058509-7" the lock will open because the 4, 2, and 7 advanced it 3 steps, but there is no instance for incorrect inputs. really, if someone wanted to hack it intelligently, they would just enter 0-9 until it opens, max of 3x assuming a 3 digit code (less than 2x in this instance).

Immagine
Immagine

Anonymous user

2 years ago

where is diagram

Immagine
Immagine

Anonymous user

2 years ago

Hi. I see that there is no shematic for the wiring of this project. I created one based on the code. You can go check it out with the link below. https://drive.google.com/file/d/1cDwoOGePrVwzq2nr6Vq05JQnBwQedhgd/view?usp=sharing

Immagine
Immagine

Anonymous user

2 years ago

awesome project!!! love it. thank you so much

Immagine
Immagine

Anonymous user

2 years ago

I really like the project but in the code the "#include<Keypad.h>" is giving me error. It tells ,e that doesn't exist. Could you please help me. I really like the project.

Immagine
Immagine

Anonymous user

2 years ago

I have the exact same problem, please tell me if you solved it.

Immagine
Immagine

Anonymous user

2 years ago

do you still need help? i got the solution

Immagine
Immagine

Anonymous user

2 years ago

you need to download the library from the sketch. if you go to Sketch>Include Library>Manage Library and from there download the library

Immagine
Immagine

Anonymous user

2 years ago

I am having the same problem

Immagine
Immagine

Anonymous user

2 years ago

Where is the proper schematic for this project? Still love the Idea though !!

Immagine
Immagine

catlover856

3 years ago

awesome project!!! love it. thank you so much

Immagine
Immagine

bschae5081

3 years ago

It's a great project. Here's the thing. Try hitting random keys with 4, 2, 7 randomly thrown in there. It still unlocks. Any way to fix that?

Immagine
Immagine

ueb0906519

3 years ago

PLEASE I NEED THE VIDEO ABOUT THE PROJECT

Immagine
Immagine

ragingxfire

3 years ago

I keep geting this error:C:\\Users\\----\\Documents\\Arduino\\code\\code.ino:5:18: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] char* password = "427"; // change the password here, just pick any 3 numbers ^~~~~

Immagine
Immagine

Anonymous user

3 years ago

Any one help me with keypad programing. I need to run a program based on the input entered using keypad. For example. If i press 1000 in key pad and press a push button the led to be glow one second. If i press the start button again it should run a program again for one second. * button to clear the input # button to confirm the input. Any one can help me with coding

Immagine
Immagine

roneliosevilla26

3 years ago

Thank you so much for sharing your ideas with us! It will be a big help for us whose an amateur of this

Immagine
Immagine

kaivalya19

4 years ago

In my same code it is showing that Arduino: 1.8.13 (Windows 10), Board: "Arduino Uno" Multiple libraries were found for "Servo.h" lock:2:10: fatal error: Keypad.h: No such file or directory Used: C:\\Users\\Admin\\Documents\\Arduino\\libraries\\Servo #include <Keypad.h> Not used: C:\\Program Files (x86)\\Arduino\\libraries\\Servo ^~~~~~~~~~ compilation terminated. exit status 1 Keypad.h: No such file or directory This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences. Can you help me out.Please

Immagine
Immagine

UrekMazino

2 years ago

You should download the respective library Sketch >> Include Library >> Manage Libraries.. >> It sill show a new window, look for the library "Keypad" by Mark Stanley and Install it It sill show a new window, look for the library "Servo" by Michael Margolis and Install it Those are the one that should solve this.

Immagine
Immagine

zackkennedy42

4 years ago

The code isn't working for me and I am a beginner, any code that I can try would be much appreciated.

Immagine
Immagine

manchas08

4 years ago

I really like the project but in the code the "#include<Keypad.h>" is giving me error. It tells ,e that doesn't exist. Could you please help me. I really like the project.

Immagine
Immagine

Anonymous user

2 years ago

you need to download the library from the sketch. if you go to Sketch>Include Library>Manage Library and from there download the library

Immagine
Immagine

Anonymous user

2 years ago

I have the exact same problem, please tell me if you solved it.

Immagine
Immagine

Anonymous user

2 years ago

do you still need help? i got the solution

Immagine
Immagine

macbrlink

2 years ago

I am having the same problem

Immagine
Immagine

Anonymous user

4 years ago

i havent touched an arduino in years and im out of practice, but i remember trying to write a program similar to this years ago. if im not mistaken, this code has teh same issue, correct me if im wrong.... basically, if i remember correctly, the code says the pw position is 0, and if the key entered is a correct pw char, then the position advances one, and when it advances 3 positions, the lock opens. so, again, correct me if im wrong here, but this means that if someone comes up and randomly hits, say "66987676898678686876-4-4567896568587698765986576-2-98324058923583420580834058509-7" the lock will open because the 4, 2, and 7 advanced it 3 steps, but there is no instance for incorrect inputs. really, if someone wanted to hack it intelligently, they would just enter 0-9 until it opens, max of 3x assuming a 3 digit code (less than 2x in this instance).

Immagine
Immagine

charlielidstone

4 years ago

Very neat. I'm trying to create a lock system with much of the same parts you are using, but I'm wondering how your code knows the value of the user input when all the keys are represented using chars. I'm pretty new to the keypad library as well as using arrays so forgive me if I don't make sense. -charlie

Immagine
Immagine

zimo_96

4 years ago

Hello, I see you guys understand how a keypad works, can you help me in my project plz ?

Immagine
Immagine

Anonymous user

5 years ago

Where is the proper schematic for this project? Still love the Idea though !!

Immagine
Immagine

nijlvaraan

5 years ago

to me it gives the error: C:\\Users\\XXXX\\Documents\\Arduino\\code_keypad\\code_keypad.ino:6:18: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] char* password = "XXX"; ^~~~~ can anyone help me please?

Immagine
Immagine

Anonymous user

2 years ago

Did you figure it out? I am having the same problem.

Immagine
Immagine

Anonymous user

5 years ago

i cant find the circuit diagram!

Immagine
Immagine

adeebjbmcmi

5 years ago

where is diagram

Immagine
Immagine

Anonymous user

5 years ago

Ive never attempted any of these projects. Is there a more clear wiring schematic that I can follow. Or step by step instructions?

Immagine
Immagine

Anonymous user

2 years ago

https://drive.google.com/file/d/1cDwoOGePrVwzq2nr6Vq05JQnBwQedhgd/view

Immagine
Immagine

JohanSanju06

5 years ago

Really a great project..... My first ever arduino project....... Can you share the schematic clearly as i cannot understand where the pin is located. Thank you and once again great project

Immagine
Immagine

geek25

2 years ago

gregarduino posted a schematic

Immagine
Immagine

Anonymous user

6 years ago

Simple but very cool code. It works perfectly. Congratulations. Jorge

Immagine
Immagine

hockey1alex

2 years ago

thanks so much

Immagine
Immagine

geek25

2 years ago

thanks

Immagine
Immagine

Anonymous user

2 years ago

where is the circuit diagram

Immagine
Immagine

gregarduino

4 years ago

Hi. I see that there is no shematic for the wiring of this project. I created one based on the code. You can go check it out with the link below. https://drive.google.com/file/d/1cDwoOGePrVwzq2nr6Vq05JQnBwQedhgd/view?usp=sharing