Arduino Camera Tracking System using Image processing vb.net EmguCv

(Last Updated On: July 20, 2019)

Arduino Camera Tracking

Description:

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


While version1 of the Arduino and vb.net  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 vb.net 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 video tutorial given at the end of this Article.

The components and tools used in this project can be purchased from Amazon, the components Purchase links are given below:

Arduino Uno: https://amzn.to/2tVz1vu
Mega 2560: https://amzn.to/2ze1kdu
12v DC Gear Motor for machine control: https://amzn.to/2V3Caoq
12v dc Gear motor for Trigger: https://amzn.to/2Uki4ZS
USB Camera: https://amzn.to/2Wy6GY2
330-ohm resistors pack: https://amzn.to/2NtlAeh
5v 2A adaptor: https://amzn.to/2GsNfcw
2n2222 npn transistors: https://amzn.to/2EmXsIb
10k Resistor: https://amzn.to/2KTd6OW
lm7805 Voltage Regulator: https://amzn.to/2IZEl5x
330-ohm resistors pack: https://amzn.to/2NtlAeh
female DC power jack socket: https://amzn.to/2KEo1gt
470 UF capacitors: https://amzn.to/2xDCOzf
5×7 cm Vero board: https://amzn.to/2OHGbvn
female headers: https://amzn.to/2zqmtiJ
connection wires: https://amzn.to/2DpBuW7
Super Starter kit for Beginners: https://amzn.to/2KJvmKG
Jumper Wires: https://amzn.to/2KMoVXs
Bread Board: https://amzn.to/2MS4q8X
12v Adaptor: https://amzn.to/2Ntr6h1
PCB plate: https://amzn.to/2IUwpCt
Variable Supply: https://amzn.to/2MT4Qfj
Digital Multimeter: https://amzn.to/2Nvft9i
Vero Board / stripboard: https://amzn.to/2MTf9jD
Soldering iron kit: “best” You guys should definitely purchase this: https://amzn.to/2zfoNuJ
Solder wire: https://amzn.to/2ufUMWf
Wire Stripper: https://amzn.to/2KOqxfU
wirecutter: https://amzn.to/2ucIq14
PCB small portable drill machine: https://amzn.to/2Nu62XF

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 VB.net and Arduino

 

Arduino Image processing CCTV camera system using VB.net

 

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

Close