Arduino Camera Tracking System using Image processing EmguCv

(Last Updated On: February 5, 2022)

Arduino Camera Tracking Project Description:

Arduino Camera Tracking

Arduino Camera Tracking– In this Tutorial, you will learn how to make an image processing based human face tracking system using Arduino and which is also known as visual basic. This project is based on the image processing application designed in This is the 4th  version of the Arduino and based image processing system.

While version1 of the Arduino and  based image processing system was based on the human face recognition and entrance control system using the Electronic Lock.



While in version2 of the Arduino based image processing system, I designed a CCTV camera system.This image processing application is able to capture pictures whenever a human face is detected, in this project the PIR sensor is also used for the feedback.


While in version 3 of the Arduino and based image processing system, I demonstrated how to make your own xml file to track a specific eye.

Arduino Camera Tracking Tutorial is entirely based on the version1 which is the human face recognition and entrance control system,  which is a pretty long tutorial covering the EmguCv installation, EmguCv settings which is the most important step, relay circuit making and application designing. So for the best understanding I recommend you should first watch my previous tutorials and then you can resume from here. Because in this tutorial, I will not explain the things which I have already explained in Version1. I did a very little change in the code which I used in version1. So in this tutorial, I will only  discuss the changes. This tutorial covers

  1. Circuit Diagram
  2. Motor H-Bridge explanation
  3. Arduino programming
  4. Application programming
  5. Testing

For the step-by-step explanation watch the video tutorial given at the end of this Article.

Amazon Links:

12v Adaptor:

Arduino Uno

Arduino Nano

Mega 2560:

Car Wiper 12V gear Motor


Other Tools and Components:

Top Arduino Sensors:

Super Starter kit for Beginners

Digital Oscilloscopes

Variable Supply

Digital Multimeter

Soldering iron kits

PCB small portable drill machines


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!

Circuit Diagram of the Arduino Camera Tracking System:

Arduino Camera Tracking

This is the complete circuit diagram designed in Cadsoft eagle 9.1.0 version. If you want to learn how to make a schematic and PCB then watch my tutorial.



Let’s start with the toy machine trigger. The machine trigger is controlled using a 12v gear motor. This gear motor is controlled using a 12v Relay. This relay is of the type SPDT which stands for the single pole and double throw. This relay has total of 5 pins, two coil pins, common pin, normally open and normally closed. To control this relay we need a driver. The driver simply consists of the 2n2222 NPN transistor and a 10k resistor. The selection of the transistor depends on the relay coil current needed to energize the relay coil. The relay coil resistance can be found using the digital multi-meter and then using the ohm’s law

V = IR

We can find the coil current. You can use any NPN transistor; so far its collector current is greater than the relay coil current. I selected 2n2222 NPN transistor because it has a low price, easily available in electronics shops, you can think of the 2n2222 NPN transistor as the cockroach of the electronics world.

Now let’s have a look at the H-bridge. As you know in the circuit diagram above, an h-bridge is used to control the direction of the dc motor. The relays normally open, normally closed and common contacts are connected with the dc gear motor in such a way that by turning on and turn off the relays the motor direction can be controlled. I have also used the same h-bridge in the tongue controlled wheelchair. Then I tested this circuit using Proteus simulation software. This H-bridge Module will be used to rotate the platform on which the machine is fixed. For the practical demonstration watch Video tutorial given at the end.

Proteus simulation of the H-bridge:

Arduino Camera Tracking

Download Proteus H-Bridge Simulation: h bridge

Arduino Camera Tracking Controller Programming:

Program Explanation:

I started off by defining pins for controlling the h-bridge. As the h-bridge has two relays, so one relay will be controlled using the Arduino’s pin number 7 and the other relay will be controlled using the Arduino’s pin number 8. While the trigger motor will be controlled using the Arduino’s pin number 13.

As the image processing application will send the control commands serially to the Arduino so we will need to activate the serial communication.

Serial.begin(9600); // activates the serial communication while 9600 is the baud rate. All the motors are set to OUTPUT using the pinMode function and keep all the motor off by default…then starts the void loop function.

  while(Serial.available() > 0) // if we have received data or a command from the image processing application, then simply read the serial port and store the received character in variable received.  Then using if conditions we control the motors accordingly.

Computer Application Designed for Arduino Camera tracking system:

Arduino Camera Tracking

This is the same exact application used in Version1 of the Arduino image processing based entrance control system. This time I did a very little change, that is I find the X and Y co-ordinates which you can clearly see in the program. For the best Understanding watch Version1.

Watch Video Tutorial and don’t forget to Subscribe:


Related Arduino Image Processing Projects:

Arduino image processing Eye Pupil Tracking, how to make Haarcascade XML file


OCR Optical Character recognition using and Arduino


Arduino Image processing CCTV camera system using


Arduino Image Processing based Entrance lock Control System



Recommended For You

About the Author: Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Leave a Reply

%d bloggers like this: