Arduino Projects

Arduino Camera Tracking System using Image processing vb.net EmguCv

Arduino Camera Tracking Project 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.


allpcb circuit

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 the video tutorial given at the end of this Article.

Amazon Links:

Arduino Nano USB-C Type (Recommended)

12v Adaptor:

Car Wiper 12V gear Motor

WebCam:

Arduino Uno

*Disclosure: These are affiliate links. As an Amazon Associate I earn from qualifying purchases.


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.



Related Arduino Image Processing Projects:

OCR Optical Character recognition using VB.net and Arduino

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...

Related Articles

Leave a Reply

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

Back to top button