Introduction: Push Button Combination Lock Arduino

About: I am an electronic engineer and i have been working on embedded system , Iot and Artificial intelligence.

Combination locks have been there for decades and many products such as briefcase, doors are protected by them. There is keypad module for arduino that can help us to set combination password for various things, you may also use RFID cards to provide access and in this tutorial, i am going to explain how you can make push button combination lock.

Step 1: Working

The project will help us to set combination password and you can set a password by using 1-6 digits, When you will push the buttons, and the combination is matched the green LED will be turned on and if the combination is not matched the Red LED will indicate that the password is wrong.

You will need,

  1. Arduino
  2. 6x Push Buttons
  3. 7x Red LEDs
  4. 1x Green LED
  5. BreadBoard
  6. Jumper Wires


The push buttons can be interfaced by arduino using pull down configuration i.e. button will give 5V when pressed and 0V when released and pull up configuration i.e. when button is pressed it will give 0V and when released it will give 5V. We are using pull up configuration and we are not using any external resistor instead we are using arduino internal pull up resistor.


You can change combination password from Arduino code, open the code and find the following line,

int code[] = {6,5,5,4,3,2};

and change the sequence, for now you will have to press 6th button followed by 5 , again 5 , 4 ,3 and then 2 and your Green LED should be on.

Step 4: Make Circuit and Upload Code

The Circuit diagram and code can be find below, make circuit open arduino IDE and don't forget to select port and board and upload the code.


Step 5: Video Tuotriol

Step 6: Conclusion

So, that way you can use arduino and push buttons as combination lock you can use that to secure your door or any other thing. If you are interested in such projects please subscribe us and that would be benificial for you.