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:
- 1 x EZ-B Bluetooth Robot Controller: http://www.ez-robot.com
- 1 x GWS Standard Servo for head: http://www.hvwtech.com/products_view.asp?ProductID=878
- 2 x GWS Standard Servo for arms: http://www.hvwtech.com/products_view.asp?ProductID=878
- 1 x USB Webcam
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.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Get the Hardware
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!
Step 2: Take Apart Your Webcam
The webcam will need to be taken apart and inserted into the head.
Step 3: Take Apart Your Robot Shell
The robot shell will need to be disassembled to fit the parts.
Step 4: Attach Camera Into Head
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.
Step 5: Fit Arms (optional)
I attached servo peices to the arms.
The servos will need to be fitted for the arms also
Step 6: Assemble the Robot
Put the robot back together and plug the servos into your robot board
Step 7: Setup the Source Code
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.
- Download and install EZ-Builder
- Select Add Control
- Add a Camera Control
- Select Config
- Select the Servo Port that your Neck servo (The one that moves the camera) is connected
- Select Servo Tracking
- Press the Save button
- Select the camera choice from the dropdown
- 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.
Finalist in the
National Robotics Week Robot Contest