Here’s how I’d like to communicate between modules in the AUV:
This is how it works:
For the transmitter I’m using a TSAL6100 infrared emitter. The LED is rated to operate at 100 mA, which the 15 Ω resistor generates (I actually calculated a 22 Ω resistance and bought 22 Ω resistors; two of those in series, in parallel with another one results in around 15 Ω). I will actually use a 10 Ω resistor to get a bit more power out of the LED. This is safe because the LED will only be turned on for brief periods.
The transmitter uses a PNP transistor. When the Tx-o pin is low, current will flow from the emitter (the side with the arrow) into the base (the Tx-o pin) and the transistor will open, sending current to the LED. When the Tx-o pin is high current will not flow from the emitter and the transistor will be closed. This effectively inverts the UART signal, which is good because the Tx-o line spends its idle time high and only goes low when sending data. The LED only turns on when the Tx-o pin is sending a 0.
The receiver circuit is based around a TEFT4300 phototransistor. The current generated by the phototransistor is amplified by another NPN transistor (i.e. a Darlington pair configuration). The resistor is a pull-up resistor, keeping the Rx-i line high while idle. When the phototransistor is activated by the transmitter LED (a 0 bit is transmitted), the signal is amplified by the NPN transistor and the Rx-i line is pulled to slightly above ground.
I found that the pull-up resistor in the receiver circuit is a little sensitive. With a 10 kΩ resistor the receiver is not responsive enough to generate a square wave matching the transmitted signal. With a 10 Ω resistor the NPN transistor saturates and never reaches the low threshold. I tried the 1 kΩ resistor and a 390 Ω resistor, and qualitatively decided that the 1 kΩ gave a little more range.
The transistor switching frequencies determine the maximum speed of the UART link. The NPN and PNP transistors both have bandwidths exceeding 1 MHz under the conditions presented above. The phototransistor is limited to 180 kHz, which is plenty for this application. It is sufficient to program an Arduino (57600 bps) or Netduino (115200 bps) wirelessly. More bandwidth could be obtained using photodiodes, which are very fast but a little more expensive than phototransistors.
I haven’t measured the range of this system yet, but eyeballing it it’s around 15 cm with the 10 Ω resistor on the transmitter. I could improve this by amplifying the signal at the receiver (e.g. with a Schmitt trigger), but 15 cm is probably enough for my application, as long as it works underwater.