This prototype shows an example of reliable communication of two micro controllers using Morse Code. An IR LED pair is used to transmit information wirelessly between two microcontrollers.
Although invisible to the human eye, it is no secret that infrared can be used to send wireless signals. Remote controls and most wireless mice and keypads use infrared to control a device. These signals are typically carried on a carrier wave with a frequency near 40kHz. When received by an IR detector, all infrared noise outside the carrier frequency is filtered out, then the signal itself is extracted from the carrier frequency. This ensures a more robust transmission of data and limits the data rate possible.
Since the data signal is simply transmitted by an ON or OFF state of the carrier frequency (an extreme form of amplitude modulation), an IR detector's output is a pseudo-digital one, where the timing of the on's and off's determine the signal transmitted, via a known protocol. Each remote controller's language is set up by its manufacturer, with device codes to further distinguish only a single emitter and transmitter pair. Libraries of IR codes from various manufacturers and devices can be found online.
In our experiment, we did not use an IR detector, which would automatically demodulate the signal on the carrier wave. Instead, we used the simpler IR emitter and receiver pair, where the receiver is a phototransister only. When light at the right wavelength (IR wavelength at 940 nm) hits it, it turns on. The IR light transmitted by the emitter can be fully turned ON and OFF, or pulsed at a frequency of one's choosing. In our case, the Arduino Pro Mini has PWM pins capable of 490 Hz, which is what we used to transmit the IR signal. Pulsing the light, at any frequency, helps conserve energy and system components.
Without any filtering, our IR receiver (phototransistor) responds to IR light at all frequencies, which means that ambient light has a huge effect on its output. Directed and very close IR light from our emitter showed up only as a small change in voltage at the receiver. When the emitter/receiver pair was separated over 10cm, the receiver could no longer differentiate the emitter's signal from the ambient noise. Setting up our own filter or using an IR detector instead would theoretically increase our usable distance to those of commercial remote controllers.
Choosing morse code as the language, and a simple (almost human-scale) designation of ON, OFF times as the protocol, the receiver was able to discern all letters of the alphabet and display them on screen.The prototype allows other uses to be imagined. For example, a person could have a key code using a small IR LED flashlight.
Morse Code was officially retired by the world's Naval organizations in 1999 in favor of more modern telecommunication methods, however its usefulness still remains intact.
Two breadboards were setup each with a microcontroller; one as a transmitting unit, the other as a receiving unit. The IR transmit-receive pair sent reliable communication to each other in real time. The receiving unit was hooked up to the computer's serial monitor, allowing a realtime view of the information it was receiving.