June
2006, Issue 191
Measurement
System for Weight and Dimensions
Renesas
M16C Platform Design Contest 2005
SIZE
MEASUREMENTS
When
I started this project, I first considered using a computer
vision system for measuring the sizes of packages. I
figured a box could be placed against a white background
with a calibrated grid, and then a camera could process
the image and determine the size from the remaining
visible grid space. Such a system is feasible, but it
isn’t cost-effective. Cameras and their associated interface
electronics aren’t cheap, and I’d need a fair amount
of processor and memory capability to process images.
What’s worse, I’d have to devote a lot of space to the
measuring device so the camera would be far enough away
to capture an entire scene.
After
considering all of the disadvantages associated with
a camera-based measurement system, I set out to create
a simpler, less expensive measurement scheme. Because
I wanted to be able to measure cardboard boxes to the
nearest inch, it seemed reasonable to use a sensor for
each measurement point. I placed a row of inexpensive
photocell light sensors 1²
apart along the Weasure’s axis (see Photo 1b). This
setup enables the system to measure a box’s height,
width, and depth. When a box is placed on the platform,
its size is determined by the photocells that aren’t
illuminated. This scheme works particularly well with
the M16C/62P microcontroller’s generous helping of parallel
I/O. Even when using only leftover I/O ports that aren’t
used by the Renesas SKP16C62P evaluation board or the
other Weasure functions, there are 62 I/O lines left.
This is enough to measure boxes up to 24²
× 20² × 19²
in size.
The
photocells have a resistance of approximately 2 kW
or less when well illuminated, and at least 20 kW
or more when they aren’t. By connecting a photocell
in series with a 10-kW pull-up,
the photocell pulls the signal line to ground when it’s
illuminated (generating a zero) and lets it go to one
when the box covers it up. These signals are connected
directly to the M16C/62P microcontroller’s input lines.