COMPUTER LINK USING
BY ED RINGEL
Readers of this magazine know that broken stuff can sometimes be an
inspiration, not necessarily a disappointment. So it was with a giveaway
laser pointer from a drug company. The plastic housing broke, leaving the
laser module and a primitive switch mechanism. Hmmm…
It turns out that it is extraordinarily easy to establish serial communication between computers (or microcontrollers)
over the low power red laser modules used for pointers,
carpenter’s levels, and the like. It is also very inexpensive.
Easily sacrificed, the modules from these pointers can be
readily extracted and used for this purpose.
Aside from the laser module, each half of the
communication module requires only three bipolar
transistors, a phototransistor, a few resistors, one
pushbutton switch, and a cheap mainstream IC.
This is a fun project, but be safe!
As with all laser projects, a word of caution is in order.
The modules used are classified as Class IIIa lasers, with
output fixed at < 5 m W. These are pretty safe as lasers go.
Nonetheless, misuse can cause injury to the eye and can
be illegal. Staring at the beam can cause retinal injury.
Never, ever further focus the beam using optics unless
you really know what you are doing. Shining a laser at an
airplane is illegal and aiming a laser at a car is stupid.
Safety goggles are appropriate. Enough said.
What do we need to know
before we start?
Laser modules consist of the laser diode, power
regulating circuitry, optics, and the casing. Laser diodes
are operated at the extremes of the thermal and power
curves for the semiconductor. There is usually a
photodiode in the unit that monitors the output of the
laser and provides feedback to the power regulation
circuitry to prevent runaway. Optics collimate the beam
(usually just a cheap plastic lens), and the metal casing
dissipates heat. My initial concern in this experiment was
that the on/off time for the laser unit would be too long,
but it is possible to achieve 4800 baud communication.
All that internal output regulation occurs very, very rapidly.
34 November 2009
The unit stays cool, and the waveforms are sharp enough
to meet serial port encoding standards.
The other piece of background has to do with phototransistors. This class of semiconductor develops current
with illumination. Illumination of a phototransistor with a
red laser produces a very robust response which under
my experimental conditions dropped effective resistance
by at least a factor of 10 (and sometimes more) in room
light. This is more than enough of a change to be easily
detected by a comparator. The rise time and fall time
of current across the semiconductor junction with
application of light is fast and can meet serial port
encoding standards with the correct choice of parts.
The Basic Layout
I chose to implement communication using the
conventional serial port/RS-232 encoding protocol. There
were several reasons for this. First, both computers and
microcontrollers have extensive hardware and software for
this protocol and I would not need to reinvent the wheel.
Second, speed of transmission was easily varied; if there
were difficulties with maintenance of communication I could
simply slow down the speed of transmission. Third, it was
binary. The protocol requires no analog modulation of the
signal (amateur radio types — no frequency modulation or
phase modulation a la PSK- 31, and much, much faster),
improving reliability and ability to detect a low level signal.
I also chose to route the communication through
microcontrollers. There were three major reasons for this.
The first was protection of the computer. If I bungled this,
I’d trash the Arduino, not the Dell. The second was extensibility. If I could establish communication between the
microcontrollers, there would be a general solution that
could be applied to both microcontrollers and computers.
Third, use of the microcontroller permits addition of some
extra functions that would require significant additional
programming on a computer. These extra functions