Today’s network backbones don’t use copper wires any more — they use lasers to transmit information. The laser light usually propagates in a fiber, but while convenient, this isn’t strictly necessary; you can also send the laser light through the air in a collimated beam, like an ordinary laser pointer.
Because this sounds cool, I thought I could build something like that. Here’s the prototype:
For simplicity, I decided to limit the scope to 10 MBit/s ethernet. This old standard is both conceptually as well as electrically (lower frequencies) simpler than the more modern 100 MBit/s or 1000 MBit/s standards. After a bit of research, I noticed that it’s not necessary for the transceiver to understand anything about ethernet; it’s sufficient to simply provide optical send and receive channels, and convert the electrical signal to optical intensity and back one-to-one.
The idea is now simply to build two identical boards with an ethernet RJ45 connector on the one side, and a send/receive optical transceiver on the other side. When pointed at each other, the boards mediate the ethernet signal from one RJ45 connector to the other.
Theory of operation
Each board consists of a transmit channel, a receive channel, and some meta components (power supply, fuse …).
The task of the transmit channel is to take the electrical ethernet signal transmitted by computer A and convert it into an optical signal by varying the brightness of a laser diode. The schematic is shown below. The part with the operational amplifier is simpy a constant current source, which sets an “offset brightness” for the laser diode. The actual TX signal is then added to this offset brightness through AC-coupling (C23, C7 perform the coupling, R24, R6 set the optical amplitude, and L1 and L3 isolate the high-frequency signal from the DC offset current).
The bias current is selected such that in LOW state, the laser diode is still in laser mode (“glowing brightly”). With a modulation amplitude of about 4 mA and a laser threshold of about 12 mA for this type of diode, I set the bias current to 19 mA by tuning potentiometer RV1.
With this, we now have a laser diode changing its brightness in sync with the electrical signal of the ethernet twisted pair cable.
The receive channel is slightly more complex. Its purpose is to detect the optical signal generated by its sister board, convert it back into an electrical signal, and drive that electrical signal into the receive (RX) cable pair of the conntected ethernet cable.
It starts with a transimpedance amplifier, which converts the photocurrent of a reverse-biased photodiode (SFH203P) into a power signal, with a gain of 1 kOhm.
The high bias voltage of the photodiode, about 35 V in practice, lowers the intrinsic photodiode capacitance and through that enables it to respond more quickly. This bias voltage is generated by an on-board DC booster (MIC2605).
After this stage, the signal is still quite weak and noisy, as can be seen below:
To convert this into something which can be driven into the ethernet cable, a comparator (LT1713) is used. Conveniently, it already provides an inverted- and a non-inverted output, which makes it easy to drive a differential cable pair. Unfortunately, it does not support the high output current we need (5 V into 100 Ohms differential), which is why an additional dual operational amplifier is used as a buffer (MAX4392).
After the comparator, the signal looks much nicer:
The full schematic is available here.
Armed with this schematic, I layouted a printed circuit board with SMD components in kicad, and sent it off for manufacturing. In addition to the transmit and receive channels and the DC booster, it contains a 5 V linear regulator, a fuse, and a 9 V DC input jack.
These are the manufactured boards (front and back):
With soldering iron and a bit of help of the trusty chinese 858D+ hot air gun I assembled the first board step by step, testing the parts individually. Apart from one 200µm misplaced drill hole and confusing one “output latch” pin with “output enable” on U3 (both errors were easily worked around) everything went smoothly and this is the final board:
The laser diode is fixed with a simple cable tie. The screws have springs below them to allow for some tuning.
Insider question: if you look at the schematic, with C3 = 3.3 pF, U1 oscillates at something like 500 MHz. Why? C3 was supposed to highpass-filter the feedback loop and stabilize U1, not the opposite … with C3 not connected it works fine. Any insights welcome. Note that U1 is a current-feedback opamp, i.e. the inverting input is low-impedance. (Update: explanation here: http://www.analog.com/en/analog-dialogue/articles/compensating-current-feedback-amplifiers.html)
The next simple step after assemby of one board is to put a mirror in front of it and look if the transmitted signal is the same as the received one. And indeed, after some tuning, this worked and my notebook got confused by seeing itself in a mirror:
e1000e: eno1 NIC Link is Up 10 Mbps Full Duplex, Flow Control: Rx/Tx IPv6: eno1: IPv6 duplicate address fe80::d6be:d9ff:fe85:330a detected!
This looks great! Thus I went on and built a second board.
I mounted the two boards on a piece of wood and aligned the laser beams (not simple even for this small distance, unfortunately):
I booted up my Raspberry Pi as second computer and connected it with an Ethernet cable to one of the boards, and my notebook to the other one. And surely enough, they established a connection immediately:
e1000e: eno1 NIC Link is Up 10 Mbps Full Duplex, Flow Control: Rx/Tx
Fortunately this works even with auto-negotiation enabled (where the two computers decide on the data rate by themselves). This is not trivial, because both sides in this case think they support 100 MBit/s, but in practice only 10 MBit/s works. But for those two devices, after a few failed connection attempts with 100 Mbit/s, they switch to 10 MBit/s automatically (if this were not the case, it would be easy to force both devices to 10 Mbit/s mode manually).
I can also ping the Pi from my notebook:
» ping -i 0.025 192.168.1.52 PING 192.168.1.52 (192.168.1.52) 56(84) bytes of data. 64 bytes from 192.168.1.52: icmp_seq=1 ttl=64 time=0.843 ms
Transferring files over ssh works as well, with the expected data rate of about 1.1 MByte/s. If the lasers are aligned properly, there does not seem to be any packet loss, as tested by ping -f:
1799339 packets transmitted, 1799338 received, 0% packet loss, time 1465837ms rtt min/avg/max/mdev = 0.597/0.753/11.748/0.049 ms, ipg/ewma 0.814/0.735 ms
Next step is to test this with a bit bigger distances between the boards.
Below are a few more pictures (click for proper quality and size).