Author Options:

Do you have the Arduino code for keypad, PIN (password), change/customize the PIN via the keypad and LCD? Answered

Hello All,

I've been researching this for a while but I still can't find anything to meet my requirements:
- the setup is based on Arduino UNO
- enter a PIN of 4 digits via keypad
- have multiple PINs such as master, user 1, user 2
- show the digits (or *) entered on an LCD
- give the user the option to change the PIN via the keypad by following a certain sequence such as entering 9999 or hold # pressed for 5 sec then entering current PIN  followed by the new PIN.

Optional but it will make my life easier given that I am very new at Arduino coding:
- turn on green LED for a set time when PIN is correct
- turn on red LED for a set time when PIN is incorrect
- buzz tone 1 for a set time for correct PIN
- buzz tone 2 for a set time for correct PIN
- make an I/O go high for a set time when PIN is correct (used to energize a relay via a transistor, etc.).

I can probably figure out the basic things (mostly the optional stuff) but I would appreciate it if somebody shared with me some sample code that covers the requirements above.

As you can imagine, I need this to build a PIN based security lock.

Thanks for your help and I am looking forward to your answers.



Take a look on the right of the page>>>>>>>>>>
First project at the top

Thanks Steve, that was one of the instructables I looked at but it is for the Mega and it does not have the PIN change option.

It is close to what I need though.

I'm too much of a newbie to start dissecting his code. I'm hoping somebody will have something that is more "turn key".


The first step to learning from example is to take something you know works, change things around and see how it works (or doesn't) afterwards. Follow the code and see what each line does (helps if there are comments on the lines).
Build your own routine that changes the password and you're set.

I hear you, but life gets in the way and I am not at an age to start learning how to code. I do know the basics and did some C programming 20+ years ago but that's about it.

I do agree with you though, that's the way to learn.

It's like riding a bike; if you've done it before, it's the same C language with a few minor tweaks here and there.