On Sat, 18 Oct 1997 15:17:59 -0700 Bruce Cannon writes: >I would like to design my projects/products so the ubiquitous ON >indicator >LED is serving the secondary purpose of sending debug info serially, >to a >phototransistor or some such which I have placed over it. >I've found that spacing out the bytes, and sending at reasonably high >data >rates results in a visibly steady LED glow (comm feature transparent). > My >problem is that I can't find phototransistors fast enough to switch >fully >on and off with so little illumination (a few mA through a standard >brightness LED). Phototransistors are slightly faster working into a low impedance (small collector resistor). This of course reduces the output voltage for a given amount of light. An amplifer stage (usually a single transistor) may be necessary. For more than about 1200 baud, use a photodiode, not a phototransistor. Some phototransistors have a base lead (total of 3 leads) which allows use of the collector-base junction as a photodiode. The photodiode will need an external amplifier. The amplifier should have a low input impedance for best speed. If you can place the photodiode right next to the LED and exclude light from other sources, DC coupling will work. If you have to reject background light, AC couple the amplifier. In that case, the data must be infrequent so it doesn't charge up the amplifier. I assume you are using the LED constant on when idle and turning it off to send data. Using Manchester or other modulation to remove DC would work better with constant data. The LED will appear at a constant brightness regardless of the data content. And an AC-coupled amplifier would pose no problem. But the data would need to be converted (by another PIC, of course) to asynchronous, and the PIC sending would need to send constantly. Hooking the LED send to a timer interrupt could do that. The interrupts would need to be at twice the bit rate. If you use 40 KHz on-off modulation, one of the prepackaged remote-control receivers could be used for reception at a range of up to a couple of feet with a red LED, and across the room with an IR one. These receivers are built for about 1000 baud (10 ms per bit). The photodiode must of course be one with a clear lens. Many have a "black" plastic lens which passes only IR. Photodiodes and transistors are both more sensitive to red and IR, but have decent sensitivity through the yellow and green range if you'd rather use a different color LED. As for the LED, use a high-efficiency red. Superbright reds are even better but considerably more expensive. Other colors can work, but not as well. Test with a good red one at first.