10/13/05
I am going to make a barcode reader. This is the chronicle of
that journey. Step 1. Create a simple test circuit to read
barcodes. The basic Idea I am going to use is an LED will be shined
onto a small spot, and the reflected light will be sent back to a photo
transistor. The output of the phototransistor will be fed into an
amplifier (probably a Schmitt trigger) and viewed on a logic
analyzer. This initial test will help me to develop a feel for how
the barcode reader will function, and what ideas work and don't work.
10/23/05
So I built a simple "wand" barcode reader.
Here is the basic idea: A LED provides a bright source of
"focused" light. The light is then bounced off a small
portion of the barcode into a phototransistor which registers the small
changes in light and dark by the amount of reflected light received.
One of the challenges was how to get the light to focus on a tiny area and
to get the reflected light back to the photo-transistor without having the
source swamp the receiver. This was my simple solution:

So
I grabbed one my children's wooden blocks (sheepish grin) and set to work
on fabricating a prototype out of wood to see if the idea was even
"half baked" so to speak. After about 10 minutes, I had
this:

That's
1 infrared LED and a phototransistor. The alligator clips give it
(and the test barcode) some scale. The cube is approx. 1 inch on
each side. To test the theory, I rigged up this super simple test
circuit:

I
then ran the barcode reader over the barcode and watched the scope
trace. JOY OF ALL JOYS IT WORKS!!! Here is a picture of the
scope trace superimposed over the barcode it read. You can clearly
see the difference between the thick and thin bars.

But
I was not happy with the result, this barcode above was HUGE and a regular
barcode will be much finer. Therefore I decided to redo the barcode
reader (because a small mistake had made the reader aperture much larger
than I had wanted). I made a new reader with another wooden block
(another sheepish grin, "What! they have a whole bucket and I
am short on building supplies") and went online to find a real
barcode. I printed one off (about 3 1/2 inches long and 2 inches
tall, still not perfect, but compared to my homemade barcode, it was a
major difference) and ran the old barcode reader over the barcode.
This was the result:

The
scope trace is backwards from the barcode because I swiped the reader from
right to left, but if you look closely, there is no distinction in the
first two humps which are a scan of 2 thick lines, 4 thin lines, a thick
line and one more thin line, with varying spaces between. This
simply will not do. I then modified the new readers aperture to an
opening of approx. 1 mm. using electrical tape (very high tech)

After
the modification, I was surprised to see that the reader still worked
(wow) but more importantly, it worked well! below is a superimposed
composite scope trace on top of the horizontally flipped barcode (because
I again read it from right to left)

Its
not perfect, but it could work. The Volts / Div setting on my scope
was 1 V/Div so that's actually a pretty significant wiggle. With
some better circuitry, It could probably provide a TTL output for Light /
Dark.