Home > Projects > Very Simple Arduino Electric Lock

Very Simple Arduino Electric Lock

Summary of Very Simple Arduino Electric Lock


This article outlines a proof-of-concept Arduino-controlled electric lock project. The system uses an Arduino to act as a switch, receiving serial data from a computer or other devices to trigger a transistor that powers an electromagnet inside a specific electronic lock, thereby unlocking the door. The author utilized this build to learn about Arduino programming, Bluetooth integration, barcode scanning, and serial communication.

Parts used in the Arduino Electric Lock:

  • Arduino (specifically a Diecimila)
  • La Gard ENV 1300 type electronic lock
  • Basic Transistor (2N2222)
  • Bluetooth phone (Touch Pro with Windows Mobile)
  • Bar code scanner (Symbol CS1504)
  • Door knob with a glued wooden square knob

This is a instructable for a very simple Arduino controlled electric lock.

The key idea here is to be very simple as this was more of a proof of concept prototype type of thing.

The Arduino is used as a switch to control the lock itself, and is set to interface with a Computer.

The Computer sends serial data to the Arduino in which allows the electronic lock to be opened.
Arduino Electric Lock
The Computer itself allows many different ways of opening this lock such as just pushing a button, reading a bar code scanner, and even over Bluetooth with a Windows Mobile device.

I used this simple project as a fun way of learning the basics of a few different things,
such as Arduino programming, Bluetooth integration, Bar code scanners and Serial communication

Step 1: Parts

Well first you need a Arduino, i used a Diecimila but any type would work.

The lock i am using is La Gard ENV 1300 type lock, i bought like 6 of them for 10 bucks on EBay.
You can not use just any type of lock, like a regular door lock, it must be electronic based.

It needs to work in the following manner: Inside this lock is a deadbolt, now what keeps this deadbolt closed is a very simple electromagnet. When you put power through this electromagnet it allows the lock to be open. If it does not have this simple electromagnet inside then it will not work . A simple door lock that uses a key and pins and tumbler will not work.

I included a picture of the inside of the lock where you can see how it works: Power goes to the electromagnet which pulls back a pin that releases and frees a wedge. This wedge then allows the door to be unlocked.

Theoretically you could create your own electromagnetic lock, or use a simple motor or something but that is for a different instructable.

You will also need a basic transistor: I used a 2N2222 from radio shack

Now if you want to open it through other means than just the computer your need:

A Bluetooth phone, i am using a Touch Pro with Windows Mobile

A bar code scanner, i am using a Symbol CS1504

In the last picture you see a door knob, this door knob has a wooden square knob glued to the bottom to fit in the square peg on the lock, its used to open the lock.

Step 2: Arduino

The wiring of the Arduino is very simple.

Its just a very simple set up with a transistor. 2N2222 from radio shack
Now i tried it with a few resistors and was having some problems so i just went without them.
Feel free to correct me on that.
Arduino Electric Lock circuit
The transistor is connected as so:
The signal from the Digital port is connected to the transistors base.
The power from the Arduino is going through the lock back out and to the collector on the transistor
Then it is going out the emitter to the Ground on the Arduino

The code is very simple it takes any data from the serial port and sends signal to the port, delays then ends the signal.

Once again, very simple:

/*
Test to use serial port to open/close lock
*/
int inByte = 0;

void setup()
{
//Start serial
Serial.begin(9600);
pinMode(3,OUTPUT);
}

void loop()
{
//check for connection
if (Serial.available() > 0)
{
inByte = Serial.read();
digitalWrite(3,HIGH);
delay(1000);
digitalWrite(3,LOW);
}
}

Its just like it looks, any serial data it picks up on that port it opens the lock for 1000 milliseconds.

Very Simple

Major Components in Project
Arduino

La Gard ENV 1300 type lock

Basic Transistor

For more detail: Very Simple Arduino Electric Lock

Quick Solutions to Questions related to Arduino Electric Lock:

  • How does the Arduino control the lock?
    The Arduino acts as a switch that sends a signal to a transistor, which powers the lock's internal electromagnet to open it.
  • Can any regular door lock be used for this project?
    No, you cannot use a regular key-operated lock; it must be an electronic lock containing an electromagnet mechanism.
  • What types of input methods can open this lock?
    The lock can be opened via a computer button push, a bar code scanner, or over Bluetooth using a mobile device.
  • Which specific transistor model is recommended in the article?
    The article recommends using a basic 2N2222 transistor from Radio Shack.
  • Does the Arduino code require resistors for this setup?
    The author states they went without resistors after trying them and having problems, though they invite corrections on this point.
  • How long does the lock stay open when triggered?
    The lock opens for 1000 milliseconds whenever serial data is detected by the Arduino.
  • What is the wiring connection for the transistor base?
    The signal from the Digital port on the Arduino is connected directly to the transistor's base.
  • What baud rate is used for the serial communication?
    The serial port is initialized at a baud rate of 9600 in the Arduino code.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top