16-04-2012, 04:49 PM
Infrared Data Transmission with the PIC Microcontroller
infrared micro project.pdf (Size: 150.35 KB / Downloads: 141)
Introduction
There are two main sections to this experiment, the transmitter and receiver.
The transmitter uses the pulse width modulation (PWM) module in combination
with an IR diode to produce a 38KHz carrier wave. This wave is then
modulated at a slower frequency to send data. This is both similar and dissimilar
to the standard RS-232 transmission protocol, in that we will be using
a start bit, 8 data bits, and a stop bit. The IR scheme is dierent in that to
send a pulse, you cannot merely sent a solid IR signal. You must instead send
a 38KHz square wave, with a duty cycle of approximately 40-50%. The signal
will be transmitted with the least-signicant bits sent rst.
Data
For the transmitter, two functions have been crafted to handle timings. The
wait600us and wait1000us functions provide a waiting time for the respective
bits. The processor rst initializes the serial communications registers, along
with timer 2 set-up for PWM operation. Each time through the main loop, the
processor waits for a character to be sent from the computer. The processor
then enters into an 8-execution loop.
Conclusion
This laboratory experiment is very similar to the procedure a computer's modem
uses to connect to a computer network using a dial-up connection over
the voice telephone network. The modem, much like the IR transmitter processor,
modulates a higher frequency signal to transfer the data. The receiving
modem would demodulate the signal, but in our experiment, the IR receiver
automatically demodulates and inverts the signal, which makes it much easier
to decode.