How to make a electronic lock using an Arduino UNO

Picture of How to make a electronic lock using an Arduino UNO

This is a fairly easy project. You don't need to solder. Other than the Arduino UNO, all of the materials are easy to find and are not that costly. This project it is a fun way to lock your bedroom door, and is completely customizable. I have included the code, but to run it you need to have the Arduino software. Have fun!

Remove these adsRemove these ads by Signing Up

Step 1: Gather the materials

Picture of Gather the materials
This picture shows the materials you will need.

The resistors are as follows
9 270 ohms(5% resistance)
3 10k ohms(5% resistance)

You will also need a power source. I hooked up my Arduino to my computer.
You will need a chord to connect the Arduino to the computer
Make sure everything works and then continue

Step 2: Make a diagram

Picture of make a diagram
This is how it will look. You can print out my diagram or make you're own. ( I used a program called Fritzing)

Step 3: Start building

Now you are ready to assemble the lock. 
I will show each new step in red wiring, and the old ones in blue.

Step 4: The basic wires

Picture of The basic wires
The first thing you need to do is connect the Arduino to the bread board. To do that, connect the ground(GND) of the Arduino to to the negative(blue) strip on the breadboard with a wire. Plug another wire into the 5 volt (5v) hole on the Arduino and to the positive (red) strip on you're breadboard. The first wire is typically brown or black, and the second red. Then run a wire from one side of the breadboard to the other side, both on positive. Do the same for the negative strip.
ycindrella16 months ago

excuse me! what was the combination for these switches to run the servo........!

Liamthe1st1 year ago

I would like to make a nice comment so if I Ask will the sketch be updated or edited to read the correct version is that OK?

I Really need to lock my Garage door with something not pick lockable. copying and pasting correct code would make life a lot quicker and more secure, Thanks

Shadow513 (author)  Liamthe1st1 year ago

Im sorry, I don't really understand your question. I don't know if using this lock for your garage door is the best idea.

Shadow513 (author)  Shadow5131 year ago

i have updated the code and double checked it and changed it.

Shadow513 (author) 1 year ago

Hello Ehab volt. I am so sorry, in the line above [Servo myservo;], I made a mistake. instead of [ #include ] it should be [ #include <Servo.h>

hope that works!

-MS. shadow513

Ehab volt1 year ago

excuse me MR. ... that line didnt work (Servo myservo; ) ... what a good idea ! so plz help me to apply it .. thank you :)