Close Menu
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
Facebook X (Twitter) Instagram
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
How To Electronics
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
How To Electronics
Home » Password Based Door Lock Security System Using Arduino & Keypad
Arduino Projects

Password Based Door Lock Security System Using Arduino & Keypad

Mamtaz AlamBy Mamtaz AlamUpdated:February 2, 202524 Comments7 Mins Read
Share Facebook Twitter LinkedIn Telegram Reddit WhatsApp
Password Based Door Lock Security System Using Arduino & Keypad
Share
Facebook Twitter LinkedIn Pinterest Email Reddit Telegram WhatsApp

Overview

In this project, we will make a Password-Based Door Lock Security System using Arduino, a keypad, a servo motor, an LCD, and a buzzer. With rising concerns about security, this digital password-based lock can be an effective way to safeguard homes or lockers.

This system will unlock the door only when the correct password is entered. It’s a simple and effective way to keep your home or valuables safe. Earlier we built, RFID Security System and also Biometric Security Lock using Arduino.

In Password Based Door Lock Security System, the Arduino controls the whole system. The keypad is used to enter the password, and the LCD shows messages like “Enter Password” or “Access Granted.” The buzzer makes sounds to give feedback, like when a button is pressed or the password is wrong. If the correct password is entered, the servo motor unlocks the door and locks it again after a few seconds. This project is easy to build and very useful for security.


Bill of Materials

Follows are the list of components that you need for this project. You can purchase all these components from Amazon at affordable price.

S.N.Components QuantityPurchase Links
1Arduino Nano Board1Amazon | AliExpress
24x4 Keypad Matrix1Amazon | AliExpress
316x2 LCD Display1Amazon | AliExpress
4Potentiometer 10K1Amazon | AliExpress
5SG90 Servo Motor1Amazon | AliExpress
6Buzzer 5V 1Amazon | AliExpress
7LED Red1Amazon | AliExpress
8LED Green1Amazon | AliExpress
9Resistor 330 ohms2Amazon | AliExpress
10Connecting Wires20Amazon | AliExpress
11Breadboard1Amazon | AliExpress




Circuit: Password Based Door Lock Security System using Arduino

The Password-Based Door Lock Security System uses an Arduino Nano, a 4×4 keypad, a servo motor, an LCD, LEDs, and a buzzer.

Circuit of Password Based Door Lock Security System using Arduino
Fig: Circuit of Password Based Door Lock Security System using Arduino

Below is an explanation of the connections:

  1. Arduino Nano: The Nano acts as the brain of the system. It processes inputs from the keypad, compares passwords, and controls the servo motor, LCD, LEDs, and buzzer.
  2. Keypad: The 4×4 keypad is used for entering passwords. It is connected to:
    • Row Pins (A0, A1, A2, A3) of the Nano.
    • Column Pins (A4, A5, 9, 10) of the Nano.
  3. Servo Motor: The servo motor is responsible for locking and unlocking the door. It is connected to pin 8  of the Nano. It receives commands from the Nano to rotate and unlock/lock the door.
  4. LCD (16×2): The LCD is used to display instructions and feedback messages like “Enter Password” or “Access Granted”. Its pins 1, 5, and 16 are connected to GND. The LCD pins 2 and 15 are connected to 5V of Arduino. A 10K potentiometer is connected to pin 3 of the LCD to control the LCD contrast. The data pins of the LCD are connected as follows:
    • RS → pin 2
    • E → pin 3
    • D4 → pin 4
    • D5 → pin 5
    • D6 → pin 6
    • D7 → pin 7



  5. Buzzer: The buzzer provides sound feedback for various actions like button presses, correct password, or incorrect password alerts. It is connected to pin 11 of the Nano.
  6. Red LED: The red LED indicates incorrect password attempts. It is connected to pin 12 with a 330-ohms current-limiting resistor.
  7. Green LED: The green LED indicates a successful password entry and access granted. It is connected to pin 13 with a 330-ohms current-limiting resistor.

The Arduino Nano is powered via USB or an external 5V supply. The components (servo, buzzer, LEDs) share a common ground with the Arduino Nano.

Fig: Breadboard Assembly of Password Security System Project

You can connect all the components on breadboard using jumper wires as per the circuit diagram above.


Source Code/Program

Here is the C++ Arduino code for our project. This code implements a Password-Based Door Lock System using an Arduino Nano, a 4×4 keypad, an LCD, a servo motor, a buzzer, and two LEDs.

The system allows users to set a password during the first boot, enter the password to unlock the door, and change the password by entering a master password. The keypad handles user input, while the LCD provides feedback such as “Enter Password” or “Access Granted.” The servo motor unlocks the door on a correct password, and the system relocks the door after a 10-second countdown.

The buzzer provides sound feedback for button presses, incorrect passwords, and access granted. The red LED indicates incorrect password attempts, while the green LED lights up on a successful password entry.

In the current code, the master password is set as “1234”. You may set your own Master password. The code also has a very well written comments which makes it very easy to understand each line of the code. Before uploading the code, please add the Keypad Library to the Arduino IDE to avoid compilation error.



Copy the following code and paste it on your Arduino IDE editor window.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
#include <Keypad.h>
#include <LiquidCrystal.h>
#include <Servo.h>
 
// Define pins for various components
#define SERVO_PIN 8           // Servo motor pin
#define RED_LED_PIN 12        // Red LED pin (for incorrect password indication)
#define GREEN_LED_PIN 13      // Green LED pin (for access granted indication)
#define BUZZER_PIN 11         // Buzzer pin (for sound feedback)
 
Servo myservo;                // Servo object
LiquidCrystal lcd(2, 3, 4, 5, 6, 7); // LCD object with defined pins
 
// Keypad configuration
const byte rows = 4, cols = 4; // Keypad dimensions (4x4)
char keys[rows][cols] = {      // Keypad layout
  {'1', '2', '3', 'A'},
  {'4', '5', '6', 'B'},
  {'7', '8', '9', 'C'},
  {'*', '0', '#', 'D'}
};
byte rowPins[rows] = {A0, A1, A2, A3}; // Row pins connected to Arduino
byte colPins[cols] = {A4, A5, 9, 10};  // Column pins connected to Arduino
 
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, rows, cols); // Keypad object
 
// Passwords
char masterPassword[] = "1234";  // Master password for password change
char savedPassword[5] = "";      // User-set password
char enteredPassword[5];         // Buffer for entering a password
int currentPosition = 0;         // Tracks the number of entered digits
int invalidCount = 0;            // Counts incorrect password attempts
 
// Flags for different modes
bool isFirstBoot = true;         // Indicates if it's the first time setting the password
bool isSettingPassword = false; // Indicates if the system is in password setup mode
bool isCheckingMaster = false;  // Indicates if the system is verifying the master password
 
void setup() {
  lcd.begin(16, 2);            // Initialize LCD
  pinMode(RED_LED_PIN, OUTPUT); // Set LED pins as outputs
  pinMode(GREEN_LED_PIN, OUTPUT);
  pinMode(BUZZER_PIN, OUTPUT);  // Set buzzer pin as output
  myservo.attach(SERVO_PIN);    // Attach servo to the defined pin
  myservo.write(0);             // Initial servo position (locked)
  Serial.begin(9600);           // Begin serial communication (for debugging)
 
  // First boot behavior: prompt user to set the password
  if (isFirstBoot) {
    lcd.print("Set Password:"); // Show setup message on LCD
    isSettingPassword = true;  // Enable password setup mode
    currentPosition = 0;       // Reset the current position
  } else {
    lcd.print("*ENTER THE CODE*"); // Prompt user to enter the code
  }
}
 
void loop() {
  char key = keypad.getKey(); // Read key pressed on the keypad
  if (key) {
    playKeyPressSound();      // Play sound feedback for any key press
 
    if (isSettingPassword) {
      handlePasswordSetup(key); // Handle password setup mode
    } else if (isCheckingMaster) {
      handleMasterPasswordCheck(key); // Handle master password verification
    } else {
      handlePasswordEntry(key); // Handle normal password entry
    }
  }
}
 
// Function to play sound feedback for a key press
void playKeyPressSound() {
  tone(BUZZER_PIN, 1000, 100); // Play 1kHz tone for 100ms
  delay(100);                  // Ensure sound is distinct
}
 
// Function to handle password setup
void handlePasswordSetup(char key) {
  lcd.clear();                 // Clear LCD for updated display
 
  if (key == 'B') {            // Delete the last character
    if (currentPosition > 0) {
      currentPosition--;       // Move back one position
      enteredPassword[currentPosition] = '\0'; // Clear the character
    }
  } else if (key >= '0' && key <= '9' && currentPosition < 4) {
    // Add digit to entered password if less than 4 digits
    enteredPassword[currentPosition] = key;
    currentPosition++;
  } else if (key == 'C') {     // Confirm the entered password
    if (currentPosition == 4) { // Check if 4 digits are entered
      enteredPassword[4] = '\0'; // Null-terminate the string
      strncpy(savedPassword, enteredPassword, 5); // Save new password
      lcd.print("Password Set!"); // Display success message
      delay(2000);
      isSettingPassword = false; // Exit password setup mode
      isFirstBoot = false;       // First boot completed
      lcd.clear();
      lcd.print("*ENTER THE CODE*"); // Go back to normal mode
      currentPosition = 0;       // Reset position for new entries
    } else {
      lcd.print("Incomplete Pass"); // Warn user of incomplete entry
      delay(2000);
    }
    return;
  }
 
  // Display entered digits during password setup
  lcd.setCursor(0, 0);
  lcd.print("Set New Pass:");
  lcd.setCursor(0, 1);
  for (int i = 0; i < currentPosition; i++) {
    lcd.print(enteredPassword[i]); // Show the actual digits
  }
}
 
// Function to handle master password verification for password change
void handleMasterPasswordCheck(char key) {
  lcd.clear();                 // Clear LCD for updated display
 
  if (key == 'B') {            // Delete the last character
    if (currentPosition > 0) {
      currentPosition--;       // Move back one position
      enteredPassword[currentPosition] = '\0'; // Clear the character
    }
  } else if (key >= '0' && key <= '9' && currentPosition < 4) {
    // Add digit to entered password if less than 4 digits
    enteredPassword[currentPosition] = key;
    currentPosition++;
  } else if (key == 'C') {     // Confirm the entered password
    if (currentPosition == 4) { // Check if 4 digits are entered
      enteredPassword[4] = '\0'; // Null-terminate the string
      if (strcmp(enteredPassword, masterPassword) == 0) {
        lcd.print("Master Verified"); // Display success message
        delay(2000);
        isCheckingMaster = false; // Exit master password check
        isSettingPassword = true; // Enter password setup mode
        currentPosition = 0;      // Reset position for new entries
        lcd.clear();
        lcd.print("Set Password:"); // Prompt to set new password
      } else {
        lcd.print("Incorrect Master"); // Display error message
        delay(2000);
        isCheckingMaster = false; // Exit master password check
        currentPosition = 0;      // Reset position
        lcd.clear();
        lcd.print("*ENTER THE CODE*"); // Go back to normal mode
      }
    } else {
      lcd.print("Incomplete Pass"); // Warn user of incomplete entry
      delay(2000);
    }
    return;
  }
 
  // Display asterisks during master password entry
  lcd.setCursor(0, 0);
  lcd.print("Master Pass:");
  lcd.setCursor(0, 1);
  for (int i = 0; i < currentPosition; i++) {
    lcd.print("*");            // Show asterisks for entered digits
  }
}
 
// Function to handle normal password entry
void handlePasswordEntry(char key) {
  if (key == 'A') {            // Initiate password change
    lcd.clear();
    lcd.print("Master Pass:");
    currentPosition = 0;       // Reset position
    isCheckingMaster = true;   // Enter master password check mode
    return;
  } else if (key == 'B') {     // Delete the last character
    if (currentPosition > 0) {
      currentPosition--;       // Move back one position
      enteredPassword[currentPosition] = '\0'; // Clear the character
    }
  } else if (key >= '0' && key <= '9' && currentPosition < 4) {
    // Add digit to entered password if less than 4 digits
    enteredPassword[currentPosition] = key;
    currentPosition++;
  } else if (key == 'C') {     // Confirm the entered password
    if (currentPosition == 4) { // Check if 4 digits are entered
      enteredPassword[4] = '\0'; // Null-terminate the string
      if (strcmp(enteredPassword, savedPassword) == 0) {
        unlockDoor();          // Unlock the door if password is correct
      } else {
        incorrectPassword();   // Indicate incorrect password
      }
      currentPosition = 0;     // Reset position for new entries
    } else {
      lcd.clear();
      lcd.print("Incomplete Pass"); // Warn user of incomplete entry
      delay(2000);
      lcd.clear();
      lcd.print("*ENTER THE CODE*"); // Go back to normal mode
    }
    return;
  }
 
  // Display asterisks during normal password entry
  lcd.clear();
  lcd.print("PASSWORD:");
  lcd.setCursor(0, 1);
  for (int i = 0; i < currentPosition; i++) {
    lcd.print("*");            // Show asterisks for entered digits
  }
}
 
// Function to unlock the door
void unlockDoor() {
  lcd.clear();
  lcd.print("Access Granted");
  digitalWrite(GREEN_LED_PIN, HIGH); // Turn on the green LED
 
  // Play success melody
  for (int i = 0; i < 4; i++) {
    tone(BUZZER_PIN, 400 + (i * 200), 200);
    delay(250);
  }
  noTone(BUZZER_PIN);
  digitalWrite(GREEN_LED_PIN, LOW); // Turn off the green LED
 
  delay(2500); // Display "Access Granted" for 2.5 seconds
 
  // Unlock the door and show countdown timer
  myservo.write(90); // Unlock position
  for (int secondsLeft = 10; secondsLeft > 0; secondsLeft--) {
    lcd.clear();
    lcd.print("Door locks in:");
    lcd.setCursor(6, 1);
    lcd.print(secondsLeft);   // Show countdown timer
    lcd.print(" sec");
    delay(1000);
  }
 
  // Lock the door
  lcd.clear();
  lcd.print("Locking Door...");
  myservo.write(0);          // Lock position
  delay(1000);
  lcd.clear();
  lcd.print("*ENTER THE CODE*"); // Go back to normal mode
}
 
// Function to handle incorrect password entry
void incorrectPassword() {
  lcd.clear();
  lcd.print("CODE INCORRECT");
  digitalWrite(RED_LED_PIN, HIGH); // Turn on the red LED
 
  // Play alert melody
  for (int i = 0; i < 3; i++) {
    tone(BUZZER_PIN, 300, 150);
    delay(200);
    tone(BUZZER_PIN, 100, 150);
    delay(200);
  }
  noTone(BUZZER_PIN);
  digitalWrite(RED_LED_PIN, LOW); // Turn off the red LED
 
  delay(2500); // Display "CODE INCORRECT" for 2.5 seconds
 
  lcd.clear();
  lcd.print("*ENTER THE CODE*"); // Go back to normal mode
}

From the tools Menu, select the Arduino Nano Board. Then Select the COM port and hit the upload button to upload the code. The code will be uploaded.



Testing: Password Based Security System Using Arduino & Keypad

After uploading is done, now the device is ready for the test. Go through the following instructions to set the password or lock/unlock the door or to change the password.

The keys A, B, and C on the keypad have the following functions:

  1. Key A:
    • Used to initiate the password change process.
    • When pressed, it prompts the user to enter the master password. If the master password is correct, the user is allowed to set a new password. If incorrect, it displays “Incorrect Master” and returns to normal mode.
  2. Key B:
    • Functions as a backspace/delete key.
    • If pressed during password entry or setup, it deletes the last entered digit, allowing the user to correct typing errors.
  3. Key C:
    • Used to confirm the entered password.
    • During normal operation, it checks the entered password against the saved password. If the passwords match, the door unlocks. During password setup, it confirms the newly entered password and saves it.

Setting the Password

Initially, when the device boots up, it will ask you to set up the password.

Use the keypad to enter the 4 digit code. The code can be anything from “0000” to “9999”.

Press button C to enter or to set password. The password will be set successfully.

Password Based Security System Using Arduino & Keypad


Unlocking/Locking the Door

Once the password is set, you can start unlocking the door by entering the right password.

Use the keypad to enter the 4-digit password. Press the C key to enter.

If the password entered is wrong, the LCD will show “CODE INCORRECT”. The Red LED will turn ON and Buzzer will melody.

If the password entered is correct, the LCD will show “Access Granted”. The green LED will turn ON and Buzzer will play a melody.

Password Based Security System Using Arduino & Keypad

At the same time, Servo Motor will rotate and open the door. It will display a 10-second timer as well before it closes the door again.

Once the 10-second timer is gone, the door will close again.

Password Based Door Lock Security System Using Arduino & Keypad



Changing the Password

If you want to change the password, press the button A. Then it will ask you to enter the master password.

The default Master Password is “1234”, which is set in the code. You may modify your code to change the default master password. Enter the password using the keypad and press button C.

If the master password is correct, it will show “Master Verified” message on LCD screen.

Now you can set the New password here. The LCD will ask you to Set the new password.

Enter 4 digit New password and press C button again.

Now you are ready to test it again. You can enter the code to unlock the door again.


Video Tutorial & Guide

DIY Digital Lock | Password-Based Security System with Arduino, Keypad & Display
Watch this video on YouTube.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
Previous ArticleEarthquake Detector Alarm with Accelerometer & Arduino
Next Article Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Related Posts

DC Energy Meter using Arduino

Build a DC Energy Meter using Arduino – 32V/5A

Updated:August 26, 20252K
Interfacing ADXL375 Accelerometer with Arduino

Interfacing ADXL375 Accelerometer with Arduino (±200g)

Updated:June 28, 2025
PZEM-004T Arduino Energy Meter

DIY AC Energy Meter using PZEM-004T & Arduino

Updated:March 6, 20258K
Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Updated:February 2, 20259K
Earthquake Detector Alarm with with Accelerometer & Arduino

Earthquake Detector Alarm with Accelerometer & Arduino

Updated:February 2, 2025661K
74HC595 Shift Register with Arduino

Shift Register 74HC595 with Arduino – Examples & Code

Updated:February 2, 202516K
View 24 Comments

24 Comments

  1. Sanjana on June 25, 2019 6:07 PM

    What happens if the key pad fails or if someone forgets password

    Reply
    • Alex Newton on June 25, 2019 6:11 PM

      The door won’t open simply.

      Reply
  2. Sanjana on June 26, 2019 7:31 AM

    What if after locking battery gets dead?

    Reply
    • Alex Newton on June 26, 2019 8:39 AM

      You dc power supply from adapter

      Reply
  3. Sanjana on June 26, 2019 7:32 AM

    Is their any solution for above mentioned problems

    Reply
  4. devansh on July 21, 2019 3:02 PM

    i want to detect coin, when i put the coin in loadcell…after i put 1 more coin, the system detect total nominal of all coins…for example coin 100(2 grams)+ 200(3 grams)= 300(5 grams)…can you help me with my project??
    thank you very much,,,

    Reply
  5. Devansh on July 27, 2019 10:38 PM

    can i use 4×4 keypad instead of 3×4??

    Reply
    • Alex Newton on July 27, 2019 11:11 PM

      yes, you can. modification in code is required too

      Reply
  6. rohan sadeque on September 23, 2019 8:48 PM

    WHAT IS TORTURE 1 & 2 ??

    Reply
  7. Darshan on November 7, 2019 8:52 AM

    Can’t find the library file keypad.h for downlaod

    Reply
  8. Faizal Abdul Kadir on November 28, 2019 10:44 PM

    can’t find the library file keypad.h for download

    Reply
  9. Nasir on January 25, 2020 7:56 PM

    sir
    I need simple Eletronice cabinet doors lock keypad password control circuits digram or P. C.B perches give me ida’s
    Thanks

    Reply
  10. Chetan A thakur on March 3, 2020 11:34 PM

    Sir LCD not work.. plzs help me?

    Reply
  11. Yavor Kamberov on April 16, 2020 9:30 PM

    Hey dude. The Keypad.h library is not available anymore on that link. Can you share some other link where it can be downloaded? Thanks!

    Reply
  12. Sheena Ford on April 29, 2020 2:39 AM

    the servo is moving before the password is entered

    Reply
  13. suhail khan on July 12, 2020 1:06 PM

    YES PLEASE TELL ME WHAT IS PROBLEM I AM USING 4*4 KEYPAD THARE 1,2,3,A,B,C,D button will not work please resolve my problem as soon as possible

    Reply
  14. Yadatt Raiker on October 29, 2020 6:45 PM

    Why keypress and unlock door function are not coming on my IDE

    Reply
  15. husen on March 24, 2021 3:45 PM

    Any body can need this project plese call me 8401016135
    thank you

    Reply
  16. vigneshwaran s on March 27, 2021 1:33 PM

    it is not a build in function we have to define

    Reply
  17. rohan salvi on April 7, 2021 10:24 PM

    f (code==password[currentposition])
    {
    ++currentposition;
    if(currentposition==4)
    {

    unlockdoor();
    currentposition=0;

    }

    }

    else
    {
    ++invalidcount;
    incorrect();
    currentposition=0;///////////////////////////////////////////

    }
    if(invalidcount==5)
    {

    ++invalidcount;
    torture1();

    }
    if(invalidcount==8)
    {
    torture2();
    }

    }

    anyone explain what happing here exactly

    Reply
  18. Piyush Bajaj on May 18, 2021 2:43 PM

    SIR I WANT TO INTERFACE IT WITH LM35 SENSOR….MEANS THAT IF A CERTAIN TEMPERATURE IS SET THEN ONLY THE PASSWORD IS ENTERED OTHERWISE NOT….
    SIR PLEASE HELP ME WITH THIS….ITS VERY IMPORTANT……

    Reply
  19. Victor on December 8, 2021 1:58 PM

    How can i add a pushbutton code to open the servo in this program

    Reply
  20. Ahmad on January 16, 2023 6:26 AM

    can you use a ESP32 too?

    Reply
  21. Aaron on February 9, 2025 10:53 PM

    I believe the code order is incorrect. She put the loop function before declaring the code within the loop. the loop should be at the end.

    void loop() {
    char key = keypad.getKey(); // Read key pressed on the keypad
    if (key) {
    playKeyPressSound(); // Play sound feedback for any key press

    if (isSettingPassword) {
    handlePasswordSetup(key); // Handle password setup mode
    } else if (isCheckingMaster) {
    handleMasterPasswordCheck(key); // Handle master password verification
    } else {
    handlePasswordEntry(key); // Handle normal password entry
    }

    }
    }

    Reply

CommentsCancel reply

Latest Posts
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

May 31, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

May 10, 2026
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

May 2, 2026
A Guide to Sourcing Obsolete ICs for Vintage Projects

Beyond AliExpress: A Guide to Sourcing Obsolete ICs for Vintage Projects

April 21, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

April 27, 2026
Building a Smart Sensor Node with a BLE Microcontroller

Building a Smart Sensor Node with a BLE Microcontroller

February 26, 2026
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

April 27, 2026
DIY Colorimeter using AS7265x Spectroscopy Sensor & ESP32

DIY Colorimeter using AS7265x Spectroscopy Sensor & ESP32

February 1, 2026
Top Posts & Pages
  • 12V DC to 220V AC Inverter Circuit & PCB
    12V DC to 220V AC Inverter Circuit & PCB
  • ECG Graph Monitoring with AD8232 ECG Sensor & Arduino
    ECG Graph Monitoring with AD8232 ECG Sensor & Arduino
  • Buck Converter: Basics, Working, Design & Application
    Buck Converter: Basics, Working, Design & Application
  • IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
    IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
  • How to use INA226 DC Current Sensor with Arduino
    How to use INA226 DC Current Sensor with Arduino
  • ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
    ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
  • How to use Modbus RTU with ESP32 to read Sensor Data
    How to use Modbus RTU with ESP32 to read Sensor Data
  • IoT Based ECG Monitoring with AD8232 ECG Sensor & ESP32
    IoT Based ECG Monitoring with AD8232 ECG Sensor & ESP32
Categories
  • Arduino Projects (197)
  • Articles (60)
    • Learn Electronics (19)
    • Product Review (15)
    • Tech Articles (28)
  • Electronics Circuits (46)
    • 555 Timer Projects (21)
    • Op-Amp Circuits (7)
    • Power Electronics (13)
  • IoT Projects (204)
    • ESP32 MicroPython (7)
    • ESP32 Projects (81)
    • ESP32-CAM Projects (15)
    • ESP8266 Projects (76)
    • LoRa/LoRaWAN Projects (22)
  • Microcontrollers (38)
    • AMB82-Mini IoT AI Camera (4)
    • BLE Projects (18)
    • STM32 Projects (19)
  • Raspberry Pi (93)
    • Raspberry Pi Pico Projects (57)
    • Raspberry Pi Pico W Projects (12)
    • Raspberry Pi Projects (24)
Follow Us
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
About Us

“‘How to Electronics’ is a vibrant community for electronics enthusiasts and professionals. We deliver latest insights in areas such as Embedded Systems, Power Electronics, AI, IoT, and Robotics. Our goal is to stimulate innovation and provide practical solutions for students, organizations, and industries. Join us to transform learning into a joyful journey of discovery and innovation.

Copyright © How To Electronics. All rights reserved.
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us

Type above and press Enter to search. Press Esc to cancel.

Ad Blocker Enabled!
Ad Blocker Enabled!
Looks like you're using an ad blocker. Please allow ads on our site. We rely on advertising to help fund our site.