Вы находитесь на странице: 1из 21

EASY BLUETOOTH ENABLED

DOOR LOCK SYSTEM USING


ARDUINO AND ANDROID
INTRODUCTION
Easy Bluetooth enabled door lock with
arduino and android is 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 armature.
PARTS OF DOOR LOCK SYSTEM

1. Arduino 
Arduino is an open-source electronics
prototyping platform based on
flexible, easy-to-use hardware and
software. It’s intended for artists,
designers, hobbyists, and anyone
interested in creating interactive
objects or environments.
2. Electric Door Strike
An electric door strike
allows doors to remain locked
to public access (usually on
the exterior side of the door).
However, the door may still
be opened quickly and easily
from the inside without the
use of a key.
3. BLUETOOTH MODULE

Serial port Bluetooth module is fully qualified


Bluetooth V2.0+EDR (Enhanced Data Rate)
3Mbps Modulation with complete 2.4GHz radio
transceiver and baseband. It uses CSR Blue
core 04-External single chip Bluetooth system
with CMOS technology and with AFH(Adaptive
Frequency Hopping Feature). It has the
footprint as small as 12.7mmx27mm. Hope it
will simplify your overall design/development
cycle.
4.POWER SUPPLY
A power supply unit (PSU) converts 
mains AC to low-voltage regulated 
DC power for the internal components of
a computer. Modern personal computers
universally use a 
switched-mode power supply. Some 
power supplies have a manual selector
for input voltage, while others
automatically adapt to the supply
voltage.
5.TRANSISTOR TIP120
Transistors are powerful little electronic switches, and
when our little NPN transistors aren't power enough
for your project, we have been known to use these
beefy TIP120 Darlington transistors. Great for
whenever you need to control medium to high-power
electronics such as motors, solenoids, or 1W+ LEDs. We
find them so handy, they come in a pack of 3!
Each transistor is a general purpose amplifier, model
TIP120 and has a BCE pin out. They can switch up to
60V at peak currents of 8A (not continuously, just
peak!) and continuous current of 5A, with a DC gain of
about 1000.
6.1N4001
The 1N4001 DIODE
series (or 1N4000 series
) is a family of popular 1.0 A (ampere)
[2]

general purpose silicon rectifier diodes
 commonly used inAC adapters for
common household appliances. 
Blocking voltage varies from 50 to 1000
volts. This diode is made in an axial-
lead DO-41plastic package.[3]
7.HOOKUP WIRES
Stranded and solid copper conductors,
bare or tinned, with other plating
available for special application needs
Colour-coded insulation for easy
circuit identification
UL, CSA, and Mil-spec compliance
Convenient put-ups as short as 100
feet
Excellent uniformity and low-fray
design for easy handling, stripping,
and termination
8.SOLDERLESS BREADBOARD

A Breadboard Is A Construction Base For 


Prototyping Of Electronics. Originally It
Was Literally A Bread Board, A Polished
Piece Of Wood Used For Slicing Bread. In
The 1970s The Solder less
Breadboard (AKA Plug board, A Terminal
Array Board) Became Available And
Nowadays The Term "Breadboard" Is
Commonly Used To Refer To These.
"Breadboard" Is Also A Synonym For "
Prototype".
9.ANDROID PHONE
 ON the app market, you can
search for Bluetooth SPP
(serial port profile). There are
many apps that have been
made to send serial data
through Bluetooth on your
phone. 
working
 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 labelled 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.
1. 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.

2. Adding a Bluetooth module to our project is very easy. Simply connect


RX on the Bluetooth module to TX on our Arduino board, TX on the
module is then connected to RX on the Arduino, GND is obviously
connected to ground, and lastly VCC is connected to 3.3 volts or 5 volts
depending on your Bluetooth module.
Here is a look at what everything should look like. Its a bit
difficult to see everything, but this is just the completed circuit
on the breadboard.
The code
int lock = 9;          //pin 9 on Arduino
char final[4];         //Characters the Arduino will receive
char correct[4] = {'A','B','C','D'};    //User-Defined Password
int pass_correct = 0;          //Does Password match, 0=false 1=true
void setup()
{
pinMode(lock, OUTPUT);
Serial.begin(9600);
digitalWrite(lock, HIGH);  //By default, lock is active(locked)
}
void loop()
{
while(Serial.available()) 
{
  for(int i=0; i<4; i++)   //While data is available read 4 bytes
 {
   final[i] = Serial.read();  //Read 4 bytes into the array labled "final"
 }
for(int i=0; i<4; i++)
 {
   if(final[i]==correct[i]) //Compare each char received to each car
in our password in order
   {
    pass_correct = 1;   //If we compare two chars and they match,
set the pass_correct variable to true(1)
   }
   else
   {
    pass_correct = 0;  //if the two compared chars do NOT match,
set pass_correct variable to false(0)
    break;   //End loop and stop comparing chars
   }
 }
}
if(pass_correct==1)  //If all chars compared match,
deactivate(unlock) the lock for 5 seconds
{
  Serial.println("Unlocked");
  digitalWrite(lock, LOW);
  delay(5000);
 
Serial.println("Locked");
  pass_correct = 0;
}
else
{
digitalWrite(lock, HIGH); //Else if there was not a
complete match, keep the lock high(locked)
}
/* FOR TESTING
Serial.print(final[0]);Serial.print(final[1]);Serial.pri
nt(final[2]);Serial.print(final[3]);
Serial.print(" | ");
Serial.print(correct[0]);Serial.print(correct[1]);Seri
al.print(correct[2]);Serial.print(correct[3]);
Serial.print(" ");
Serial.print(pass_correct);
Serial.println("");
*/
delay(500);
}
On the app market, you can search for Bluetooth SPP (Serial Port Profile).
There are many apps that have been made to send serial data through
Bluetooth on your phone
After you install one of these Bluetooth SPP apps, you can pair with your
Bluetooth modem connected to the Arduino. If it asks for a key, it will
usually be by default "1234" (without quotes of course). After that, you
should be able to send ABCD and the door strike will unlock for around 5
and 1/2 seconds, and then lock itself again.
Thank
You
Project Submitted By:-
1. Sakshi Pimplapure
2. Tarni Verma
3. Sona Dargad
4. Sneha Malhotra
5. Rituparna Das
REFERNCES

http://www.instructables.com/id/E
asy-Bluetooth-Enabled-Door-Lock-
With-Arduino-An/?
ALLSTEPS
https://www.arduino.cc/en/Guide/I
ntroduction

Вам также может понравиться