Arduino combination lock

January 31, 2021

Arduino combination lock

January 31, 2021

Created By

About This Project

So For my class my teacher gave me a task to make an arduino combination lock on tinkercad.This Project is arduino based project.

Roshan Baig

My name is Roshan, I am 13 years old and I am in 7th standard. My hobbies are horse riding, robotics, and computer programming.

Components Required

  • Arduino UNO
  • Alphanumeric LCD 16 X 2
  • Dip / Sip Switch, 6 Circuits
  • SG90 Micro-servo Motor
  • Through Hole Resistor 220 kohm
  • Through Hole Resistor 1 kohm
  • Trimmer Potentiometer, 10 Kohm

Schematics

In this image all the components with the connections are given

Code Of Project

  // include the library code: 
  # 
 include 
 <LiquidCrystal.h> 
 
  # 
 include 
 <Servo.h> 
 
 // initialize the library by associating any needed LCD interface pin 
 // with the arduino pin number it is connected to 
 const 
 int 
rs = 
 12 
 , 
en = 
 11 
 , 
d4 = 
A0 , 
d5 = 
A1 , 
d6 = 
A4 , 
d7 = 
A2 ; 
LiquidCrystal lcd 
 ( 
rs , 
en , 
d4 , 
d5 , 
d6 , 
d7 ) 
 ; 
 int 
switch1 = 
 2 
 ; 
 int 
switch2 = 
 3 
 ; 
 int 
switch3 = 
 4 
 ; 
 int 
switch4 = 
 5 
 ; 
 int 
switch5 = 
 1 
 ; 
 int 
switch6 = 
 0 
 ; 
Servo door ; 
 void 
 setup 
 ( 
 ) 
 { 
 // set up the LCD's number of columns and rows: 
lcd . 
 begin 
 ( 
 16 
 , 
 2 
 ) 
 ; 
 //declare inputs 
 pinMode 
 ( 
switch1 , 
INPUT ) 
 ; 
 pinMode 
 ( 
switch2 , 
INPUT ) 
 ; 
 pinMode 
 ( 
switch3 , 
INPUT ) 
 ; 
 pinMode 
 ( 
switch4 , 
INPUT ) 
 ; 
 pinMode 
 ( 
switch5 , 
INPUT ) 
 ; 
 pinMode 
 ( 
switch6 , 
INPUT ) 
 ; 
 // set servo motor 
door . 
 attach 
 ( 
 13 
 ) 
 ; 
door . 
 write 
 ( 
 90 
 ) 
 ; 
 } 
 void 
 loop 
 ( 
 ) 
 { 
switch1 = 
 digitalRead 
 ( 
 2 
 ) 
 ; 
switch2 = 
 digitalRead 
 ( 
 3 
 ) 
 ; 
switch3 = 
 digitalRead 
 ( 
 4 
 ) 
 ; 
switch4 = 
 digitalRead 
 ( 
 5 
 ) 
 ; 
switch6 = 
 digitalRead 
 ( 
 1 
 ) 
 ; 
 if 
 ( 
switch1 && 
switch4 && 
switch6 == 
HIGH ) 
 { 
lcd . 
 clear 
 ( 
 ) 
 ; 
lcd . 
 setCursor 
 ( 
 0 
 , 
 1 
 ) 
 ; 
lcd . 
 write 
 ( 
 "Door not lock" 
 ) 
 ; 
door . 
 write 
 ( 
 180 
 ) 
 ; 
 delay 
 ( 
 5000 
 ) 
 ; 
door . 
 write 
 ( 
 90 
 ) 
 ; 
 } 
 else 
 { 
lcd . 
 clear 
 ( 
 ) 
 ; 
door . 
 write 
 ( 
 90 
 ) 
 ; 
lcd . 
 write 
 ( 
 "Door locked" 
 ) 
 ; 
 } 
 for 
 ( 
 int 
i = 
 0 
 ; 
i <= 
 3 
 ; 
i ++ 
 ) 
 { 
 delay 
 ( 
 5000 
 ) 
 ; 
 if 
 ( 
switch1 != 
HIGH && 
switch4 != 
HIGH && 
switch6 != 
HIGH ) 
 { 
lcd . 
 clear 
 ( 
 ) 
 ; 
lcd . 
 write 
 ( 
 "Wait for 5 minutes" 
 ) 
 ; 
 delay 
 ( 
 300000 
 ) 
 ; 
 } 
 } 
 } 
  
 
A person is using a laptop computer next to a robot.
By Siddhartha Kumar January 5, 2022
Robotics: Blessing and Curse? Robots have improved healthcare , surveillance, delivery of goods (drones), spacecraft, travel, logistics, etc.
A man is wearing a virtual reality headset and touching a screen.
By Tahreem Jamadar December 28, 2021
Is it time for 3D Printing to Adopt Blockchain Technology? Research has already shown 3D printing has a growing need for cybersecurity.
A group of children are sitting at a table making a robot.
By Dr. Heath Kirby-Miller December 25, 2021
Why STEM Education in Australia The Australian industries to be benefited from STEM include advanced information and communication technology
A red rc truck is sitting on top of a remote control.
December 12, 2021
Arduino IR remote controlled Car The project is arduino based project. the Links pf the projects are given below
A laptop computer is on a tripod on a table.
November 30, 2021
Animation Studios Mechatron Robotics project uses an Arduino uno R3 a LCD and push buttons. It is based on the concept of arduino and LCD
A young boy wearing headphones is using a laptop computer.
By Kiran Gupta November 30, 2021
Machine Learning for Disables can help those disabled people to improve their lives. With the marvel of machine learning doctors
A man wearing a virtual reality headset is working on a robotic arm.
By Kiran Gupta November 7, 2021
What are the Consequences of Not Embracing Robotics & AI? We won’t be able to go ahead as these are the next big things.
A person is holding a remote control in a living room.
November 4, 2021
Home Automation System is made because today's light bulbs tend to heat and this can cause blast in the house.
A close up of a bottle of vaccine with a virus in the background.
By Rajesh Sharma November 1, 2021
Robotics and the Pandemic 2020. This is where Robotics can come in, robots can help reduce the human contact.
A person is playing with a robotic head on a table.
By Siddhartha Kumar November 1, 2021
Key Elements Most of the Schools are Missing. Everyone has different criteria but one key element remains the same:” The quality of teaching
Show More
A person is using a laptop computer next to a robot.
By Siddhartha Kumar January 5, 2022
Robotics: Blessing and Curse? Robots have improved healthcare , surveillance, delivery of goods (drones), spacecraft, travel, logistics, etc.
A man is wearing a virtual reality headset and touching a screen.
By Tahreem Jamadar December 28, 2021
Is it time for 3D Printing to Adopt Blockchain Technology? Research has already shown 3D printing has a growing need for cybersecurity.
A group of children are sitting at a table making a robot.
By Dr. Heath Kirby-Miller December 25, 2021
Why STEM Education in Australia The Australian industries to be benefited from STEM include advanced information and communication technology
A red rc truck is sitting on top of a remote control.
December 12, 2021
Arduino IR remote controlled Car The project is arduino based project. the Links pf the projects are given below
A laptop computer is on a tripod on a table.
November 30, 2021
Animation Studios Mechatron Robotics project uses an Arduino uno R3 a LCD and push buttons. It is based on the concept of arduino and LCD
A young boy wearing headphones is using a laptop computer.
By Kiran Gupta November 30, 2021
Machine Learning for Disables can help those disabled people to improve their lives. With the marvel of machine learning doctors
A man wearing a virtual reality headset is working on a robotic arm.
By Kiran Gupta November 7, 2021
What are the Consequences of Not Embracing Robotics & AI? We won’t be able to go ahead as these are the next big things.
A person is holding a remote control in a living room.
November 4, 2021
Home Automation System is made because today's light bulbs tend to heat and this can cause blast in the house.
A close up of a bottle of vaccine with a virus in the background.
By Rajesh Sharma November 1, 2021
Robotics and the Pandemic 2020. This is where Robotics can come in, robots can help reduce the human contact.
Show More