Venues such as computer labs typically include a fixed desktop PC along with a fixed projector - but no projector remote, as it has gone missing.
For a conventional infrared-remote-controlled projector (no serial/USB control, no network control) the simplest and cheapest way to add "wired in" control is to drive an infrared LED directly from a the PC's serial port.
Such an arrangement could obviously be used to control other infrared-controlled devices besides projectors.
), and 38kHz is almost exactly one third of a standard RS-232 serial baud rate (115,200 baud).
Using com port parameters of 115200 baud, 7 data bits, no parity and 1 stop bit (totaling 9 bits per word transmitted, nicely divisible by 3) and transmitting a stream of data value of 91 (decimal) yields a 1/3 duty cycle, 38.4kHz square wave:
Under the tested operating system (Windows XP) this works surprisingly well; a block of data is transmitted without noticeable timing variation or gaps.
Note that the value 91 was not picked out of a hat; it is 1011011
(binary) which when reversed (as com ports transmit LSB first) and
start/stop bits added yields 011011011, which when inverted (as rs-232 hardware considers 0 = positive) yields 100100100 - the waveform you see above.
The silence
In order to modulate the signal, periods of silence must be interspersed with the carrier. This could be achieved in software with delays or timers, but it's highly unlikely that the required accuracy will be achieved with a user-mode application running under a multitasking operating system. Instead, a different data value (chosen to be as close to "off" as possible) can be transmitted during the periods of silence - thus using the serial port hardware/driver to manage the timing. This trick can't produce a perfect "off" as the start bit will always contribute.
The obvious choice of data value is 127 (decimal), with a resulting waveform of 100000000:
While this delivers the least possible average power, the resulting harmonics mean a fair proportion of that is at 38kHz, which is not ideal. The optimal value turns out to be 96 (decimal), or a waveform of 111111000:
The above 12.8kHz waveform has no 38.4kHz component due to everyone's favourite rule of thumb, the "1/n duty cycle pulse waves have no (N*n)-order harmonics" rule. Any
reference on the Fourier series should explain further.
Note that in all cases above, there was more than one suitable data value to choose from - for instance, in the last case, a waveform of 111000000 (instead of 111111000) would fit the criteria just as well. In practice, the chosen value of 96 proved to work slightly better; this may be related to the receiving device's
AGC circuit.
Software
Armed with carrier and silence values of 91 and 96 decimal respectively - each lasting 78µs - it becomes a relatively trivial matter to string together an appropriate sequence and write it to the serial port. The attached "iRemote" Windows application is a ready-to-use example; the comments in the ini file should be sufficiently explanatory.
Hardware
A suitable circuit can be built into a a DE-9 backshell, with a cable running to an IR LED positioned near the projector or other device.
This example includes a potentiometer to adjust the output to a level where the silence signal is detected as such.
A considered enhancement was to add a filter to suppress frequencies above/below 38kHz, bringing the silence signal closer to the ideal "off" state. However, the feeble high-impedance nature of the PC serial port meant this wasn't viable with all-passive components, and active components (along with external power source) didn't mesh with the simple/cheap goal of the project. Moreover, it would then become simpler/cheaper to use a low-end microcontroller to generate the waveform (in that case, the PC serial port could still govern the timing of the overall IR signal).