Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
213 lines (151 sloc) 7.71 KB
MinnowBoard Fish Picker-Upper
This is the MinnowBoard Fish Picker-Upper, documentation and code for a
demo that has been used at conferences and user group events to
introduce people to the MinnowBoard (
This demo makes use of the OpenCV computer vision library to detect an
object (a foam "fish") and control a cheap robotic arm to pick up the
fish and move it. It is powered by the MinnowBoard embedded computer and
the Yocto Project.
A video of how the demo works can be viewed here:
The goals of the demo were to come up with an affordable and
replicatable project that leverages a technology (autonomous robot
control using computer vision) that most people perceive as complex,
and try make it as easy as possible to get started with it.
This demo is a work in progress, and I encourage people to take it and
modify it as desired for greater capabilities, improved simplicity, etc.
This software comes without any warranty, and neither I nor Intel Corp.
takes any responsibility for possible damage to computers, robot arms, or
your sanity for attempting to run this code or replicate this project.
Scott Garman - <>
Technical Evangelist for MinnowBoard and the Yocto Project
Intel Open Source Technology Center
Equipment List
Here's a list of the components used to create this demo:
OWI-535 Robotic Arm Edge Kit:
OWI USB Interface for Robotic Arm:
Logitech C310 USB Webcam:
Two 3V DC, 1 Amp power supplies. These multi-voltage Enercell ones from
Radio Shack were used when set to 3V, but I'm sure you can save some
money if you look around for something cheaper:
The blue placemat I used was just background wallpaper used to line the
back of fish aquariums. It's mainly useful for marking a 6-inch radius
from the robot arm for fish placement.
The foam fish was cut from a soda can "cozy" used to insulate soda or
beer cans. I found these in several colors from a local craft store.
Cut out the bottom from the cozy and then cut a 1" strip from the foam.
Then curl one of the ends back and superglue it to itself. Here's a
close-up photo:
Robot Arm Modifications
The OWI robot arm is powered by batteries by default. Since some of the
arm movements are software routines based on timing values, they are
too sensitive to fluctuations in battery power as the batteries drain
over time. So the first modification I made was to power the arm with a
pair of 3V power supplies:
Take a look at the circuit diagram at the end of the OWI assembly
instruction manual for specific wiring guidance.
Install the USB control board in place of the default one, following the
instructions included with the USB kit.
The webcam was attached to the base of the robot arm using a set of 3M
double-sided adhesive strips:
I used a dremel tool to shave off just a bit of the plastic on each side
of the webcam's base to ensure there was no friction with the robot
arm's "shoulder" motion.
Software Dependencies
The Linux OS image was generated using the 1.3 "Danny" release of the
Yocto Project and the following custom layer that was developed for
this demo:
See the Yocto Project web site ( to get
started - you will find plenty of documentation and new user tutorials
to can get started with.
Alternately, should you wish to use another Linux OS (e.g, try it out
using a Linux distro running on your laptop), the software dependencies
you'll need for this code are:
* Python
* OpenCV
* pyusb 1.0
* numpy
* v4l
Training OpenCV
Unless you manage to re-create the exact setup and use the same foam
"fish" objects that I did, you will need to create an OpenCV Haar
database to detect the object you're trying to pick up. I found the
following tutorials helpful in learning how to train Haar object
Haar training is unfortuantely a fairly tedious process, as you need to
create and define the Region of Interest (ROI) using hundreds of photos.
I'll share the Haar databases I used for this demo. I found that the
amount of ambient light in the room could significantly impact the
detection reliabilty, so I have two sets of Haar data I'll choose from
depending on how bright the room is.
This set of data was developed using only 143 positive samples and 18
Haar stages, and works well in lower light situations:
This set of data was developed using 403 positive samples and 18 Haar
stages, and works well in bright light situations:
You'll need to extract these tarballs someplace on your system and then
point the haar_dbfile variable in to
the path of the haarclassifier.xml file.
Running the Software
Troubleshooting Object Detection Reliability:
Before running the script, take note of the following variables in
min_size = (60, 60)
image_scale = 2
haar_scale = 1.2
min_neighbors = 8
These values can all be tweaked to further improve object detection
reliability. A debug utility,, has
been included to allow you to easily change these values and test
them without operating the robot arm.
Let's Pick Up Some Fish!
TODO: Expanation of GPIO pushbutton switch wiring.
To start the demo, run:
You will see the video output from the webcam, and to set the robotic
arm in motion, looking for fish, press the pushbutton switch.
Robot Arm Calibration Position:
The script expects the OWI Robotic Arm Edge to be in the following
position before it is run:
* Base: Rotated clockwise as far as it will go
* Shoulder: Pointed straight up
* Elbow: Align the longer "notch" in the yellow motor housing with the
middle channel in the black outer plastic arm support
* Wrist: All the way down
* Grippers: Closed
Here are photos of the calibrated starting position, and a close-up of
the elbow position:
You're free to use a different starting position for the robot arm if
desired, but you'll need to significantly modify the arm control
functions in the script.
Now you should be ready to run the demo! Run, and the robot arm should begin
rotating counterclockwise, looking for an object. If the rotation
reaches the limit of its counterclockwise rotation without having found
an object, be prepared to hit the Off switch on the arm to stop the
rotation - it's on my TODO list to add support for resetting itself if
it never finds an object. In fact, there's plenty left to do - see the
TODO file for more tasks you can help out with if you'd like! :)
I welcome questions and comments at