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!|
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.