Easy Bluetooth Enabled Door Lock With Arduino + Android

FeaturedContest Winner
Picture of Easy Bluetooth Enabled Door Lock With Arduino + Android
Thanks to everyone who supported this project and voted for it in the Arduino Challenge! I was awarded second prize and hope to participate in more Arduino contests in the near future.

This tutorial will explain a simple way to make a password protected bluetooth door lock using your Arduino, which can be unlocked by sending a four digit pin from your Android phone!  The hardware setup is quite simple,  and the programming side of it is a bit tricky, but should be no problem for any Arduino ameuture.

Remove these adsRemove these ads by Signing Up

Step 1: Parts Needed

Picture of Parts Needed
1. Arduino (I am using the Duemilanove)

2. Electric Door Strike

3. Bluetooth Module ($9.99)

4. Power Supply (Required voltage and amperage differs among different door strikes/locks)

5. TIP120 Transistor

6. 1N4001 Diode

7. Hookup Wire

8. Solderless Breadboard

9. An Android phone (optional, considering that there are lots of devices you could use to send serial data to our bluetooth modem including Iphones, computers, and other Bluetooth devices)

Step 2: About The Transistor

Picture of About The Transistor
We'll start by focusing on one of the main components of the circuit, the transistor. Our transistor will allow us to control a device that requires more current than our Arduino can supply, by sending the transistor different values. The type of transistor we are using (the TIP120) has a base, collector, and an emitter which are labeled here. We will send the signal from pin 9 on the Arduino to the base of the transistor, and depending on the value sent, current will increase or decrease.

Step 3: Assemble The Circuit

Picture of Assemble The Circuit
The diagram shows how the transistor is wired up in our circuit. As you can see, we have a diode pointed away from ground that is connected to the collector of the transistor as well as the ground of the lock itself. This diode will protect our electronics from any back voltage that might be created when our lock is turned off. At this point you could set pin 9 to high or low to control the lock.
1-40 of 126Next »
mjgable10 days ago

I had success creating the project by following the steps. I was wondering though... Is there anyway to state the wrong password was entered to let the user know they need to try again?

JayveeA111 days ago

how to insert the code what software is to be use??

JayveeA111 days ago

what software please?

SabriM made it!7 months ago

Hello guys. I made it as a part of my graduation project. I am building android application too.The logic of the circuit in pics is %98 same with this one. My android application is ready too. I will upload it in few weeks.Images are HD. You can see the circuit clearly. Thanks Collin Amedee. But I changed Arduino code to this one in the link : http://english.cxem.net/arduino/arduino5.php

Collin Amedee (author)  SabriM2 months ago
Hello SabriM,

I very much appreciate you building onto this project, and especially answering questions whilst I have been inactive over the past several months! I do hope that you received a good grade on your project!

Thanks, and good luck!
bigworld21 SabriM2 months ago
hi sir sabri, hmm i m interested with this project,may i see ur full circuit,n ur android apk for control the lock .. pls mail me wellsinclair@gmail.com
nobodykid SabriM4 months ago

hi i'd like to ask about the bluetooth modules. if i'm using different modules, will the codes changes too? if so, which one is likely to be changed, the Arduino or the one in phone? thanks

SabriM nobodykid4 months ago

No I don't think that will change anything. I used HC 06 but you can use HC 05 too.

nobodykid SabriM4 months ago
SabriM nobodykid4 months ago

The code is not about Bluetooth module. It doesn't effect it. You can use it. Differences between Bluetooth modules is about their security.

hi . i want to add this project to my graduation project "advanced easy home security systems"
so can u please send me all the details of this project to this email seda4unit@gmail.com

This is the link of my Term project : Language is Turkish but you can get some details from video. I will try to add English subtitle.

hi,i have to do mini project and its about fire detrector.

The fire will be detected by the sensor then a bluetooth transmiiter will tell my pc which will send sms message via ip to my phone.

please i need your help in connecting the circuit,i dont know the circuit that i should use.

Dhivagar.V4 months ago

how will u change the password using mobile app instead of the password being static as "ABCD"??

hafiizhadis4 months ago
mohit98904 months ago

i want the project details for my seminar can u mail me at mbhanushali5@gmail.com

saeedbayat6 months ago

hi .who help me to make this project?

saeedbayat6 months ago

hi .who help me to make this project?

saeedbayat6 months ago

hi .who help me to make this project?

pelegren6 months ago

it won't work with arduino nano v3 and HC-06. help please.....

Skaedryn6 months ago

Might want to add a failsafe?

oh_mali made it!10 months ago

Hi, here are some pictures and personal notes from my finished version of this project!

1) Make sure that you buy the CZ-HC-05 Bluetooth module as well. Some people will advertise the carrier board & the Bluetooth and sell only the carrier board (part label JY-MCU) without the actual Bluetooth module (CZ-HC-05) soldered onto it.

2) I also found a helpful link (HERE: http://www.instructables.com/id/Modify-The-HC-05-Bluetooth-Module-Defaults-Using-A/?ALLSTEPS) on how to reset mostly anything you need via AT Commands through the KEY pin on the Bluetooth.

3) Instead of an electric door strike, I used a door lock made active/inactive by a solenoid that works on 12V (because it was much cheaper at $20 rather than $100+!!)

4) I used the Arduino Uno board instead and it works just the same.

5) If the Bluetooth SPP app you're using counts the /r as another byte, you'll have to change the first for condition in the void looping section from 4 to 5. ( for(int i=0, i<5, i++) )


SabriM oh_mali7 months ago

Hi I have bought HC06 bluetooth module. Is it not going to work for this project? Why make sure HC05? Thanks.

oh_mali SabriM7 months ago


Your module will work for this application.

In my original post I was saying to make sure that you order the actual chip in addition to the carrier board, rather than just the carrier board.

Both modules have the same hardware, but different firmware. The HC-06 is a slave device, i.e. it can't start the communication (this process is know as pairing in bluetooth jargon) with another device, it needs a master (PC/Smartphone) that pairs with it. On the other hand, the HC-05 is a master/slave device, i.e. it's capable of peer to peer communication with other HC-05 modules, it can be the master of an HC-06 module, it can be a slave of a PC/Smartphone, etc.

If need be, more can be read HERE:http://embeddedprogrammer.blogspot.com/2012/06/ubuntu-hacking-hc-06-bluetooth-module.html

SabriM oh_mali7 months ago

Thanks. oh_mali . I made it :) . I am building android application too. Application is ready too. I ll upload it to store in few weeks.

tiongson1 year ago

where is the connections of the electric door strike ???????

SabriM tiongson7 months ago

Its step 3. Lock - and +

ekeesee8 months ago

Could you draw up some wiring instructions or take a couple other pictures of the setup?

SabriM8 months ago

Does it send feedback if someone else already opened or locked the door? For instance I locked it from android device and then someone else unlocked it by his hands. Will I be able to see feedback on android device that lock has been unlocked?

skalra29 months ago
instead of using direct power supply for lock, can i take it via Vin pin of arduino uno, my solenoid lock requires 12v dc and 0.6A for its operation.
oh_mali111 months ago

Can you post a parts list detailing your vendors and part #s?


randersen61 year ago
How do you open the door during a power outage ?

The lock he used in this example is unlocked without power. For a house door I would choose one that is locked without power and add a 12-volt battery backup system to operate the lock during power outages. A 12-volt car battery, or even a lawn mower battery, would provide a lot of backup and could power both the Arduino and lock for extended periods. An automatic battery charger would keep the battery ready to go.

maangas.ako11 months ago

is there any tutorial on how to use the Bluetooth SPP application

GuoxuanN11 months ago

hello. May I know the code of the electric door strike?

ManuelL1 year ago

hey hello can i replace the electric door strike with a solenoid?

will it work as the same?

Collin Amedee (author)  ManuelL1 year ago
If it works off of 12 volts and a ground then yes, a solenoid would be interchangeable with the strike in this circuit!
Yes my solenoid works with 12v and gnd , thanks for the reply!
anyone has the idea on how to modify this project so that the door lock/ relay should be activated once the bluetooth connection is paired between the phone and the module. and when unpaired(out of range), the relay should deactivated.

the system should work without any commands need to be send(in the project above we must send 'ABCD' to activate the relay) from the phone.

hope you can help me by giving some solution. much appreciated your help..
1-40 of 126Next »