Home     Contact     Forum     Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Time for Science     RSS     Terms of services     Privacy policy  
 Home     Forum     Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Time for Science   

Author Topic: IR Transmitter  (Read 10412 times)

0 Members and 1 Guest are viewing this topic.


  • Cadet
  • Posts: 1
IR Transmitter
« on: October 17, 2012, 22:34:36 PM »
First of all, I'd like to spend a minute complimenting you on your PIC Tutorial series.  I'm a hardware guy trying to learn how to do my own assembly programming with PIC processors.  I've been looking at various published books and online sites looking for a "course" that would start at the beginning and walk me through the processes and procedures.  I hadn't found anything that I really liked until I found your series - this is the best tutorial I've seen.  I'm still working my way through the actual circuit tutorials, but have completed several successfully.  I'm anxious to see the intermediate and advanced sections completed and hope you are still planning on their completion.  A few topics I'd really love to see would deal with interrupts, the UART, and PWMs.  I'm really hoping that more topics are underway and we'll see more added to the PIC tutorials.

Similar to another post, I want to build an IR transmitter that is controlled through a serial port.  I don't want to attempt to send the IR commands through on the TX data line, but rather want to send the necessary parameters to the PIC over a serial port and have the PIC take those commands and generate the desired IR output. For example, I want to feed it the frequency, then the various codes, and let the PIM generate the actual IR commands.

I'm taking this one step at a time.  The first step is that I want to understand how to create the necessary signal driving the IR LED.  For example, how would I best implement the attached graphic (I don't want to do it in hardware, but in firmware).  I found  your document describing the use of pulse width modulation to generate a carrier frequency, but in your code for the RC5 Decoder / Transmitter, it looks like you use another method.

Can you walk me through how you would implement this IR transmitter output?  Or, is there another document I've not found that gives a good example of this?

Thanks so much and again, keep those tutorials coming - they're great!


  • Administrator
  • Hero Member
  • *****
  • Posts: 1849
Re: IR Transmitter
« Reply #1 on: October 17, 2012, 22:46:47 PM »
Thank you for your kind words Rocky

First, check this out:
Philips RC5 single LED Decoder and Transmitter circuit

I suppose that you've read the RC5 theory. I encourage you to go with a protocol that already exists, unless you want to make something very special. Yet again, it is very simple to design your own IR protocol (if it is a simple one). Go with the typical guidelines:

1. Your protocol must have one or 2 start bits for the receiver to be able to reconstruct the clock pulses
2. Your protocol must be based on a carrier frequency between 37 and 40KHz so that the receiver can use simple and cheap integrated receivers/filters
3. An address number of bits should also be used for 2 reasons: to be able to control multiple devices, and to have a primitive error reception control (by comparing the bits)
4. The command bit set is of course a must in your protocol
5. Optionally, you can have a sort of error correction, go again through the already-walked road: Odd-Even bit is one method. For IR protocols it is also common to find error corrections by re-sending the very same set of bits twice (and the receiver compares them)

As for the hardware - make sure that you have a transistor driver (LED driving and controlling methods) to drive the IR LED(s). They are able to consume high amounts of pulsing current, dramatically increasing their reception distance. PIC outputs can provide up to 20mA.