ArduinoArduino Projects

Arduino Image Processing based Entrance lock Control System

image processing


This tutorial is focused on Image Processing using Visual Basic 2010 Express Version, Arduino UNO or Mega and 12 Volt Electronic Key. The aim of this tutorial is to use Human Detection to automatically control the Entrance Lock. Using the frontal Face XML folder, humans are monitored in RealTime, once the human face is identified, then we find the human face’s x and y coordinates and then send a command to open the Entrance Lock to the Arduino Uno or Mega Board. Such commands are sent from the Visual Basic software in serial form.

Depending on the type of XML file they use, the same program can be used to record ears, nose, human body, hands and so on. All you need is to replace the XML file of Frontal Face with the one you want. You can use this project to track virtually anything you want.

You can also create custom XML file for specific object tracking that will cover in another Tutorial. 

The EmguCV is playing key role in this venture.

Software used in this project:

  1. Visual Basic 2010 Express Edition
  2. Arduino IDE

The Amazon Purchase links are given below:

WebCam night vision supported: best deal on Amazon:
electronic lock:
Arduino Uno:
Mega 2560:
lm7805 Voltage Regulator:
330-ohm resistors pack:
female DC power jack socket:
470uf capacitors:
5×7 cm Vero board:
female headers:
connection wires:
Super Starter kit for Beginners:
Jumper Wires:
Bread Board:
12v Adaptor:
PCB plate:
Variable Supply:
Digital Multimeter:
Vero Board / stripboard:
Soldering iron kit: “best” You guys should definitely purchase this:
Solder wire:
Wire Stripper:
PCB small portable drill machine:


Please Note: these are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!

About the Electronic Lock:

image processing

Electronic locks are available in various shapes and sizes. But the working theory is exactly the same for all the Digital Locks. The difference can only be in the voltage and current that the electronic lock coil requires to be energized. The coil that creates the magnetic field when the desired voltage is applied is inside the electronic lock.

There are two wires in the electronic switch, one is the voltage and the other is the GND cable. The digital lock used in this tutorial has two cables. You can test the electronic lock by applying the voltage across the electronic lock’s two wires.

Since this tutorial is based on the Image Processing Automatic Entry Control System, we will need driver circuit for this Electronic Lock to control this Electronic Lock automatically. Using relay, NPN transistor, or MOSFET, this lock can be operated automatically. As we only aim to open and close the electronic lock in this project and as we do not use any PWM or fast switching, Relay is the best choice in this project. Isolation will also be provided by the use of a relay.

image-processing Circuit Diagram:

image processing

As you can see, the circuit diagram is very simple. The electronic lock is controlled by means of a relay type SPDT “Single Pole Double Throw,” which is a 12v relay. As you can see in the circuit diagram, the electronic lock attaches the 12v wire from the power supply, it really doesn’t matter to which wire you connect it.The relay’s normally open connection is connected to the other electronic lock wire While the power supply ground is connected to the relay’s specific contact.

Using the relay motor, this relay is operated. A 2n2222 NPN transistor and 10k resistor are used in the relay driver. Please check the coil current of the electronic lock before choosing the transistor. To find the current, you must first find the resistance of the electronic lock coil, the voltage is already known to be 12v, then use the Ohm rule.

V = IR

You can measure the current. Use the NPN transistor whose measured value is the current of the collector. Pick transistor whose collector current is times higher than the calculated value for the best performance.

The Arduino electronic pin 13 controls the relay as shown in the above circuit diagram and ensures that the Arduino ground is connected to the 2n2222 NPN transistor emitter.

image processing Arduino Programming: Image Processing Application Programming:

You will need to install the following two software to design the image processing application. Edition and EmguCv are expressed by Microsoft Visual Basic 2010. That’s how it looks like the final form.

image processing

Watch Video Tutorial

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button