Make a Robot With Camera Color Recognition

by djsures in Circuits > Robots

23800 Views, 30 Favorites, 0 Comments

Make a Robot With Camera Color Recognition

Resized_PB271613.JPG
Hello! This is for group 18+.

This instructable will walk you through building a robot with color recognition using a camera and a servo. The robot i will build has servos for arms also, but they aren't necessary. Use your imagination on how you want to build your robot.

You may not be able to find the same shell. So I suggest visiting a thrift store and find a robot to use as a shell. Pick one that will suit your needs.

Here are the parts used in this robot:

The software is EZ-Builder, available here: http://www.ez-robot.com/EZ-Builder

I suggest watching the video before attempting to build your robot. That will give you an idea of what to expect in the next steps.

 

Get the Hardware

Resized_PB261614.JPG
Resized_PB271614.JPG
Resized_PB271615.JPG

I always hook up the hardware to the circuit board to verify it works before i build a robot. In this step, i connect the servos to the board, and simply make them move.

Yay it works!

 

Take Apart Your Webcam

Resized_PB261617.JPG
Resized_PB261618.JPG
The webcam will need to be taken apart and inserted into the head.



Take Apart Your Robot Shell

Resized_PB261621.JPG
The robot shell will need to be disassembled to fit the parts.

Attach Camera Into Head

Resized_PB261623.JPG
Resized_PB271633.JPG
Resized_PB271636.JPG

Use a hot glue gun and secure the camera inside the head of the robot. Be sure to cut a hole in the plastic for the camera to see through.

The head servo can also be fitted. This servo will allow the head to turn side to side.
 

Fit Arms (optional)

Resized_PB261632.JPG
Resized_PB261631.JPG
Resized_PB261630.JPG
I attached servo peices to the arms.

The servos will need to be fitted for the arms also 

Assemble the Robot

Resized_PB271641.JPG
Resized_PB271614.JPG
Resized_PB271613.JPG
Put the robot back together and plug the servos into your robot board

Setup the Source Code

1.jpg
2.jpg
3.jpg
4.jpg

In this robot, I am using the EZ-B Robot Controller with the EZ-Builder software. The software is available for free at http://www.ez-robot.com/EZ-Builder

Optionally, if you are an advanced user, you can download the EZ-SDK: http://www.ez-robot.com/SDK

If you are not using an EZ-B, then check out its documentation to see how to control the hardware.

The EZ-Builder has built in color recognition, which makes it easy to use for this application.

 

  1.  Download and install EZ-Builder
  2. Select Add Control
  3. Add a  Camera Control
  4. Select Config
  5. Select the Servo Port that your Neck servo (The one that moves the camera) is connected
  6. Select Servo Tracking
  7. Press the Save button
  8. Select the camera choice from the dropdown
  9. Select the Color that you would like to recognize

You should now see a vision of your camera's view. 

When you move your colored object, the servo will move the camera (head) to follow the object.