Ultimately, I was able to achieve a remarkably stable system transmitting data at a whopping 15 kilobits per second, beating the 14,400 modems of the mid 90's. Timer frequency, number of samples per bit, and re-synchronisation period became tuning parameters for the system. Thus, the actual time to read a single bit is better expressed as 13.5+(4.5 n) μsec for n samples. This was addressed by periodically re-synchronising the receiver, and by taking multiple samples from the phototransistor each cycle.
#FREESPACE OPTICAL COMMUNICATION CODE#
StabilityĮarly iterations of the code were not stable, and suffered from bit slip as the clocks on the transmitter and receiver drifted apart. Test results varied enormously depending on the position and intensity of the laser. Phototransistors are sensitive to saturation, and a pulse of light that is too bright can actually lengthen the response time.
I tried to nail down exactly what the response time of my phototransistor was, but was never able to achieve convincing results.
The table reports typical response time I gleaned from a bit of reading. The phototransistor and laser introduce a lot of uncertainty. As it didn't make any sense to drive the timer faster than the rest of the system could send and receive a signal, I instrumented the code to measure how long it took to send or receive a single bit. Many other inventions marked Bells later life, including groundbreaking work in optical telecommunications, hydrofoils, and aeronautics. Both the receiving and transmitting rates are governed by the 16-bit Arduino timer1, with a single bit being transmitted each timer cycle. Free-space optical communication has been deployed in space, while terrestrial forms are naturally limited by geography, weather and the availability of light. The code is small and fast, not much more that 4 kilobytes. Let's face it: there's no need for layer 3, there are only two nodes in our setup.
#FREESPACE OPTICAL COMMUNICATION SOFTWARE#
The software implements -in a very rudimentary and incomplete way- layers 1, 2 and 4 of the OSI network communications protocol stack. For most of the development and testing, a bright LED replaced the laser, and allowed the two development boards to be conveniently placed within a few inches of each other. I used two Arduino Uno's for this project, with very simple circuits to drive a 36¢ laser as the transmitter and the phototransistor as a receiver. If NASA can do it, why can't I? The Hardware They simply sent the laser light through free space. In a sense, all that NASA did was to deploy a fibre optic network between the Earth and the Moon, but without the fibre. Today, laser light transmits data through glass fibres that form the vast fibre-optic networks that underpin our modern telecommunication world. Light has been used to transmit information for centuries. During the fall of 2013, NASA's LADEE robotic spacecraft demonstrated the use of lasers for high-speed, 2-way communication between the Earth and the Moon.