|
Clan Sullivan
|
|
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff |
The Junk Box RS232 Laser TransceiverBy 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.
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.
Troubleshooting and CalibrationYou'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. Further Ideas
|