Easy Bluetooth Enabled Door Lock With Arduino + Android

 by Collin Amedee
FeaturedContest Winner

Step 3: 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.
 
Remove these adsRemove these ads by Signing Up
danica17 says: Feb 8, 2013. 4:30 AM
what are those grounds? ground of power supply?
stormdead says: Oct 12, 2012. 1:53 PM
I want to make this device but... i want a button activate the lock....

I'm using a 9v battery instead of a power supply


Is this ok?....:

int buttonPin = 2;
int ledPin = 13;
int lock = 9; //pin 9 on Arduino
int buttonState = 0;


void setup() {
pinMode(lock, OUTPUT);
pinMode(buttonPin, INPUT);
digitalWrite(lock, HIGH);
pinMode(ledPin, OUTPUT);
}

void loop(){
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH) {
digitalWrite(ledPin, HIGH);
digitalWrite(lock, LOW);
delay(5000);
}
else {
digitalWrite(ledPin, LOW);
digitalWrite(lock, HIGH);
}
delay(500);
}
stormdead says: Oct 12, 2012. 1:48 PM
Hi!... Where is connected the GND of the Power SUpply?
Geniusdude says: Apr 17, 2012. 2:15 PM
How many mA is the power supply used here?
Collin Amedee (author) in reply to GeniusdudeApr 17, 2012. 2:35 PM
Well I am using my universal power supply from my first tutorial so it's doing somewhere around 20 Amps. These electric door locks only require about 125-200 mA
Geniusdude in reply to Collin AmedeeApr 17, 2012. 2:44 PM
Awesome. Glad to see another teen enthusiast btw.
Collin Amedee (author) in reply to GeniusdudeApr 17, 2012. 5:48 PM
Definitely! Don't forget to note for this in the Arduino contest!
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!