This week’s assignment was that we should build a smart system on Arduino-controlled locked doors using a keypad, switch, LCD, servo motor, with buzzer. In the event the correct code is entered, the door unlocks without a sound, but an incorrect code keeps the door locked, and it makes an alert for preventing the outsiders. The LCD provides with clear instructions and with feedback, so that the system has some smart features and it is secure. This guarantees access control that is safe.
Software Materials: Electronic Tools
Tinkercad
Arduino IDE
Switch ON/OFF
Servo motor : Open/Close
Buzzer
Resistor 220 ohms 5V adapter
Jumper wires
Cable for Arduino Uno
Keypad Password
Breadboard
Arduino Uno
Materials: Crafting Tools
TinkerCad Project: Arduino, switch, keypad, LCD, servo motor, and buzzer
I did build such a simple door lock system with just an Arduino Uno, along with a switch, along with a servo motor, along with a keypad, an LCD screen, and a buzzer was then used. To guide the user, the switch is used to activate and desactvate the circuit, the keypad is used to enter a passcode, also the LCDs messages like “Enter password”, “Access Granted,” or “Access Denied.” The servo rotates to unlock the door at the time when the correct code is entered. By the buzzer a short confirmation beep is then given. When the wrong code is entered, the servo stays locked, and an alert sounds from the buzzer. All components are neatly wired to the breadboard’s 5V and GND rails for easy organization and testing because the Arduino powers the entire system.
Here:
Switch and Keypad are the inputs.
LCD is the display, shows the messages
Servo motor and Buzzer are the outputs.
I started connecting the Arduino’s ground (GND) to the negative rail of the breadboard and did the same for the 5V pin by connecting it to the positive rail.
And Then, I connected the servo’s ground and power to the Arduino’s rails and plugged its signal wire into digital pin 10. Setting it up myself really helped me see how the Arduino powers and controls each part of the project.
And finally, I connected the Buzzer's ground to the Arduino’s ground and plugged its positive wire into pin 11. I also added a push button to activate/deactivate the circuit.
Next, I connected the keypad's lign to digital pin 2 to 9. Setting it up myself helped me understand how the Arduino reads data from lign to control the project.
Thirdly, I added LCD, Connected the power and ground in the breadboard, Data (SDA) to analog pin A4 and Clock (SCl) to analog pin A5.
The circuit Process
Step 1: Preparing the components needed, Here is the list of all the electronic components I will need.
Step 2: Connect the positive and negative wires from the Arduino to the breadboard to set up the power rails.
Step 3: Connect the keypad's lign to digital pin 3 to 9. Setting it up myself helped me understand how the Arduino reads data from lign to control the project.
Step 4: Connect the servo motor’s positive and negative wires to the breadboard power rails, and attach its output pin to digital pin D8 on the Arduino
Step 5: Connect the LCD's positive and negative wires to the breadboard power rails, and attach its Data and Clock pin to analog pin A4 and A5 on the Arduino
Step 6: Uploading the code into Arduino Uno
Final look
First I started by defining the libraries that I would need in the code, which are a library for the LCD, keypad and servo. I defined a variable and put the values of the keypad in it, then I wrote some defined strings to use some codes from the keypad library, then I defined a variable to store the password and defined another to verify that the password was entered by the user, I defined another variable called angle that I would use for the servo motor, and defined another variable for time (I got some help from Google of course) :) for this particular variable
As for the set-up, I defined the servo pin, and the button and the buzzer , and I made the servo at an angle of 0.
Inside the void loop(), the program keeps checking if someone presses a key on the keypad. If nothing is pressed, it waits. In normal mode, pressing # makes the program check the entered password, while pressing * switches to password change mode. If a number is pressed, it gets added to the input, and the LCD shows stars to hide the real digits. After each key press, the loop repeats, always ready for the next input. This setup lets the system run smoothly and respond right away to what the user does. If the input is correct, matches the password, the servo motor rotate 90 degree or Otherwise it doesn't rotate, satyed in 0 degree until it enters the correct password.
I spent three hours programming my LCD with Arduino while developing my own game. My friend Ali send me a link website to lean about coding LCD. This task challenged my problem-solving skills and tested my patience. I learned a lot about coding, debugging, and working with hardware. Overall, it was a valuable experience that improved my confidence and understanding of Arduino projects.
I watched in a video where mine only had 3, but the keypad had 4 columns. That variation created programming my keypad hard. I struggled a lot. I eventually had to adjust my code for the keypad, costing extra time and effort. I better understood just how different keypad layouts may change the program at the end.
Learning how to program components with Arduino gave me a stronger understanding of how each part works together, which I can use in my final project.
Writing code for the sensors(servo motor, LCD, Keypad) project showed me how programming can bring movement and life to a design.
This week felt really special compared to the others. I worked on something I never imagined I could do. It reminded me of the smart planter populars and motion sensors I’ve only seen in malls or on TV
Discovering new components useful as LCD, photoresitor, servo motor