IoT Arduino Ball Tracking © LGPL

Tracks circular objects of certain color and calculates the position of objects.

  • 3,074 views
  • 4 comments
  • 8 respects

Components and supplies

Apps and online services

About this project

Overview

The advancement and development of high resolution per frame cameras in recent years motivate both engineers and students in the research and creation of applications based on "automated" computer vision algorithms, a frequent task and used for the tracking of object movements and position of the object, as well as its own characteristics, such as object shape, object color, etc.

In this case, the project is based on the tracking of moving objects and specific characteristics of these, such as circular or spherical shapes and color, besides positioning and movement of these.

The colors that can be detected with this application are:

  • Red
  • Orange
  • Yellow
  • Green
  • Blue
  • Violet

But tracking is not limited just to this type of tracking, also you can track recognition of the face, eyes, body parts such as hands, arms, legs, head, etc.

Some areas in which object tracking can be applied are:

  • Bodies in motion
  • Vigilance
  • Recognition of facial gestures
  • Body movements
  • Automated navigation
  • Trajectories performed by objects.

As I mentioned above the tracking is made on circular colored objects. With regard to the hardware, I do not have enough elements to make a robotic arm of at least two servos. I only have one and a smartphone camera a little outdated with Android operating system.

How does it work:

Run the application. Select WiFi in the menu to register the target host and port by which the information will be sent to the WiFi module. And your Arduino can receive the information and can make the necessary calculations.

Then you can select the color to be tracked or from the menu select Ball, and begin to track. When it detects the object of the selected color, the application will begin sending the necessary data.

Arduino Micro receives information about the object through a WiFi module, in this case the SparkFun Breakout Board CC3000 from IT. The communication is done through UDP sockets client server, the application in the mobile sends the necessary data (frame size position for horizontal and vertical servo) to the microcontroller, so that this can perform the calculations with the information sent and perform the updates in the servos, in this case only the horizontal.

I hope it is to your pleasure and serves you for a better project or investigative study or as you wish.

Code

ATmega32u4_ServoObjectTrackingC/C++
/*
*	Author		: Zavala Ortiz Vicente Arturo.
*	language	: .ino
*	Date		: Friday April 18 2014.
*	Update		: Friday June  06 2014.
*	Name		: ATmega32u4_ServoObjectTracking.ino
*	Description : Tracks circle coloresd objects
*/
#include <avr/delay.h>

/*		servo libs			*/
#include "_Servo.h"

/*		WiFi libs			*/
#include "CC3000.h"
#include "CC3000_Client.h"
#include "common.h"

Servo servo_x;
Servo servo_y;

void setup()
{
	/* add setup code here */
	ConnectionInfo connection_info;
	
	// Initialize CC3000 (configure SPI communications)
	#ifdef CC3000_DEBUG
		Serial.begin(115200);
	#endif
	
	// Initialize CC3000 (configure SPI communications)
	if(!wifi.init(9)) {
		#ifdef CC3000_DEBUG
		DEBUGPRINTLN(PSTR("Initialize CC3000 FAIL!"));
		#endif
		return;
	}

	else {
		//FreeRam();
		#ifdef CC3000_DEBUG
			DEBUGPRINTLN(PSTR("Initialize CC3000 OK"));
		#endif
	}

	if(!wifi.connect(ap_ssid, ap_security, ap_password, timeout)) 
	{
		#ifdef CC3000_DEBUG
			DEBUGPRINTLN(PSTR("Error: Could not connect to AP!"));
		#endif
	}
	
	
	// Gather connection details and print IP address
	if(!wifi.getConnectionInfo(connection_info) )
	{
		#ifdef CC3000_DEBUG
		DEBUGPRINTLN(PSTR("Error: Could not obtain connection details"));
		#endif
		return;
	}
	
	else
	{
		#ifdef CC3000_DEBUG
		DEBUGPRINT(PSTR("IP Address: "));
		printIPAddr(connection_info.ip_address);
		#endif
	}

	pin_mode(SERVO_PIN_X, OUTPUT);    // declare the LED's pin as output
	pin_mode(SERVO_PIN_Y, OUTPUT);    // declare the LED's pin as output

	servo_x.attach(SERVO_PIN_X);
	servo_y.attach(SERVO_PIN_Y);

	// center servos
	servo_x.write(SERVO_CENTER_X);
	servo_y.write(SERVO_CENTER_Y);

	_delay_ms(200);
}

void loop()
{
	
}

Schematics

basic schematic
Obt schem ux1ji8eg6j

Comments

Similar projects you might like

IoT Face Tracking and Recognition

by vicente zavala

  • 7,252 views
  • 1 comment
  • 21 respects

IoT Arduino Ball Tracking

Project tutorial by vicente zavala

  • 749 views
  • 0 comments
  • 4 respects

IoT Face Tracking and Recognition

Project tutorial by vicente zavala

  • 2,882 views
  • 1 comment
  • 18 respects

IoT Dimmer

Project showcase by vicente zavala

  • 2,425 views
  • 0 comments
  • 6 respects

IoT Stepper Motor

by vicente zavala

  • 4,037 views
  • 0 comments
  • 12 respects

IoT Speech Recognition

by vicente zavala

  • 5,931 views
  • 0 comments
  • 14 respects
Add projectSign up / Login