The Junk Box RS232 Laser Transceiver

By Joseph Sullivan

    This cute little guy is made from a laser pointer and a handful of junkbox components. I've only done rudimentary testing, but it seemed to work at 115 kbps over a distance of 40 feet. I bet that tuning could make it work over longer distances; I only had one unit to test, so I had to reflect the laser beam back at the transceiver with a mirror in order to get an input signal. And the beam was pretty messy when it came back.

    I was able to find everything I needed for this project by rummaging around my "junk boxes", with the exception of the phototransistor. That cost me $0.89 at a local electronics store. I already had the laser pointer, but if you need to buy some you can get them for about $3 on eBay.

    Here we are. That's the phototransistor to the lower right. I'm pulling DTR, DSR, and CD (from the serial port) together; that way when the CPU asserts DTR, DSR and CD are automatically brought high and the computer thinks it's really talking to something. Same goes for RTS and CTS. If your computer says "couldn't open port" or something like that, you may not have tied these together correctly. The pin numbers I've given are for a 9-pin connector; chop the plug off a dead mouse if you need one.
    As an added plus, we are also pulling power from these two pin groups. This is eventually used as the high (RS-232 "space") signal for data reception. Unfortunately, the voltages we get from these pins may vary from computer to computer, so the 4.5K resistor might have to be varied accordingly. If you have a small 10K pot handy, just use it instead. More on calibrating this later.

    The components shouldn't be too critical; I used 1N914 diodes (from Radio Shack) and a 2N2222 transistor. The battery is an AA pack with three cells in series. Laser pointers, I ought to mention, use laser diodes that are rather sensitive to overvoltage and what not. It is possible that you will need something slightly different from what I have here; it may be a good idea to hook a 20K pot and a 4.5V power source up to your laser and figure out exactly what voltage source you need. The circuit I built actually used a 10K resistor for R1, and after a bit it stopped working right; I think I may have burned out the transistor. That's why I put down 100K for the transistor input. It may need tweaking.

    One of the quirks of serial signaling is that it requires both negative and positive voltages, with "space" being +3 to +25 volts, and "mark" at -3 to -25 volts. Something like that. At any rate, that is why the positive lead from the battery is connected to serial ground. That way the serial port itself supplies a positive voltage, as we mentioned earlier; and the battery pack supplies negative voltage (in addition to powering the laser). The phototransistor approximates a short circuit when light is applied, so the RX line that is otherwise pulled low from the battery pack is forcefully brought high when illuminated by the laser.

    To start off, you're going to need to modify the laser pointer. I used a dremel to cut a rectangular hole in the top of mine, over where the power button used to be. This allowed me to solder a wire to the spring (negative lead!) and to the case. I also took a pair of dikes and cut the switch open; I then made a small solder bridge between the contacts. After you do all this it would be a good idea to test the laser again and make sure everything is still functioning!

Troubleshooting and Calibration

    You're going to need to follow the logical progression of the signal from the computer to the transistor to the laser, and then check the progression back from the phototransistor in. Of course, if you don't feel the need to calibrate and everything works perfectly to begin with, you can skip this part. ;)
    The first thing to do is to plug the unit into a computer and try to open the port. I used Windows' HyperTerminal, and opened COM1 at N-8-1 300bps with no flow control (for starters.) If you have trouble connecting, make sure the DTR/DSR/CD and RTS/CTS are tied together as shown on the schematic.
    At this point you should be able to hook a scope up to TxD and ground and watch the signal as you type on the keyboard. My computer gives me about +6 to -6 volts on the scope. If you touch RxD to TxD, whatever you type gets echoed back to the screen.     Now make sure that the transistor is working right and the laser is getting it's proper +4.5 volts or so. Remember, the laser NEVER sees any reverse voltage. As you type on the keyboard, the laser should get little spurts of power and blink on and off. The laser should be nice and bright; a dim laser may mean low voltage.

    If you're OK this far, we can check the input. Make sure the laser is pointing right at the phototransistor and that the phototransistor is shielded from other light. For testing, the laser should be within inches of the phototransistor. When the light is off, the RxD line should be at -3 volts or lower, and when it's on it should be at +3 volts or higher. Now is when you might need to adjust the pot (or replace the resistor) that is listed as 4.5K on the schematic. You might also need to throw in an extra resistor between the phototransistor and the power coming from the serial port; do this only if your port is putting out a lot of voltage and messing things up. Somewhere from 1-10 K might do the job.
    If all is functioning as it should, a scope connected from RxD to ground will show a signal similar to the one on TxD, when keys are pressed. If it does and everything is shipshape, you will see your text echoed back at you. At this point everything is working.

Further Ideas