Professional Documents
Culture Documents
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)
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.
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 TESTING
Serial.print(final[0]);Serial.print(final[1]);Serial.print(final[2]);Serial.p
rint(final[3]);
Serial.print(" | ");
Serial.print(correct[0]);Serial.print(correct[1]);Serial.print(correct[2])
;Serial.print(correct[3]);
Serial.print(" ");
Serial.print(pass_correct);
Serial.println("");
*/
delay(500);
}
Step 7: Implementing Your 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. Mine is called Bluetooth SPP just like 4
or 5 other apps that are similar and can be found by going to the link
below. 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 beable to send ABCD and the door strike will unlock for
around 5 and 1/2 seconds, and then lock itself again. This concludes my
tutorial on making a Bluetooth enabled door lock. If you have any
questions or corrections for my project let me know!