arduino keypad library
I want to build myself an electronic keypad or lock using a micro controller I’m sure that you will like this tutorial, because it’s a pretty interesting one. What I want to do is insert a password using one of these chip, keypads that I bought from eBay for less than 70 cents. If the password is correct, the door will open using a servo motor that will move a slight lock like this one. But if the password is wrong, an error will show on the LCD screen and I will have to try it once again. I will also add a small buzzer to this project. In order to have some sound signals using two push buttons, I will be able to open and close the door from inside of the room in case of an emergency. So let’s start with a tutorial. Remember all the part list. Examples schematics and codes are in the description down below. We will use Arduino Uno to make the tests, but, finally I recommend you to switch it for an Arduino Nano, because it is a lot smaller. I bought this 4×4 keypad from eBay for under 102 slide the door lock I’ll use this sg9 micro servo. It will be strong enough to slide the lock, but you could use a bigger one if needed, to reduce the pin amount. I use this. I square see LCD screen it’s a very cheap module and I also bought it from eBay. We will also need one active buzzer to push buttons to 1 kilo, ohm resistor for the pull downs, and maybe some LEDs to make this door lock.
Loop, cooler let’s. First, take a look at this example. I have set the password to three zero zero. Seven. I type in that code and press a to confirm, as you can see it says, accepted and the server spins you will have to set the minimum and maximum angle of the servo, depending on your slide lock size. If I’ll try a wrong password, the error will show up let’s try again this time. The password is correct once the door is open to close it just press the beach character. Now we are back in the main password screen. Pressing the open push button. The door will directly open without password. Put these two push buttons inside of the locked room. We’Ll use a nine volt battery to supply the system may be. A permanent transformer will be a better idea, because if the battery’s low, the door would never open and we don’t want that, let’s take a look at the schematic connect the I square C module of the LCD screen to analog pins, a 4 and a 5 which Are data and clock supply 5 volts to the LCD screen and also to the servo motor connect ground as well? Connect digital pin 10 to the signal wire of the servo motor now connect the 8 pin from the keypad from digital pin 2 to digital pin 9 of the Arduino make sure that the connections are in the correct order. If you look close enough, you will see a dot or a 1 on the keypad connector.
This number marks the first thing. We can also see that the columns are marked with white and the rows with black connect them in the same order. If not, you will have to change the code later now: connect the buzzer to ground and digital pin 11. It has to be opposed with modulated, pin if not the buzzer won’t be able to make sounds connect to pulled our resistor from the push buttons to ground connect. The wire from the same pin of the push buttons to digital pin 12 and 13 of the Arduino connect 5 volts to the other side of the push button. In this way, the digital input will be always in the low state, except when the button is pressed, because then we will have 5 volts at the input. The schematic is ready. Let’S now take a look at the code. As always, we import the libraries. Remember that this I square see LCD modules needs a special library in order to work download the liquid crystal I square C library, from a link below open arduino ide, go to sketch, include library, add zip library and open the downloaded zip file in order to install It now we are ready to make our code. These two variables define the maximum rotation of the servo motor. I have set mine from 90 to 180 degrees. We create some extra variables that we will need along the code. Here we configure the keypad. We have to include the keypad library as well download it from a link below and stall it define the rows and columns amount.
This is the layout of my keypad. If you press one key, but a different chapter is printed on the screen. That means that you’ve wired wrong the columns and rows. You can change that or change this layout to match your pressed buttons. These are the pins used for the keypad. You can also change these values. If the keypad doesn’t work properly in the setup loop, we select our servo P. In this case, digital pin, 10 start the screen and print the main text. We also put the servo in the closed position using the server write function now in the infinite loop. We first open or close the door depending on the to emergency push buttons. After that we make the chair turn read. This is all the code that makes the for chapter password right once we arrive at the for character and press the a key we check. If the password is correct in order to open or not the door, if the password is wrong, display the error and start again, if is correct, set the server to the open position and print door open now compile and upload and let’s give it a test. Works. Nice doesn’t, it I’ll mount this system to my door. I will also print a 3d case for the keypad and LCD to give it a nice look. I’Ll leave it functioning with a 9 volt battery for now I’ll install a transformer later. We could always add a Bluetooth connection to this Arduino, connecting a module to pins 1 amp 2 and open the door using our smartphone.
In a previous video, I shown you how to create a Bluetooth app and how to control Arduino pins with it check that video. If you want to make your own app now in the same way, I’ve created this simple app that will send the letter open, open and the letter C when closed download the app and install it to your Android smartphone connect the Bluetooth module to your Arduino pins. Tx and rx I shown in this 2nd schematic now download the second code for the Arduino, Bluetooth, control and upload it to your Arduino. Now you can open the door using the app as well. In this case, the app will be the key to the door, and anyone who has it could open it if you don’t want to use the blue just upload the previous code and you are ready to go well. I hope you liked this video stay tuned for more.
arduino keypad library Video
arduino keypad library news
Posted on Tuesday April 23, 2019Need A Small Keyboard? Build Your Own! Hackaday … Continue Reading »
Posted on Sunday January 25, 2015Making Membrane Keypads From Scratch Hackaday … Continue Reading »
Posted on Wednesday January 30, 2019Infrared Brute Force Attack Unlocks TiVo Hackaday … Continue Reading »
arduino keypad library Social
🔬 Now that you’ve gotten your feet wet, dive into the kit and enjoy all nine experiments. Order yours today: http://bit.ly/2MnQ7fr