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

Remote Control Basics - Understanding Protocol and ModulationAuthor
Giorgos Lazaridis
July 30, 2012

I am beginning a (long) series of IR remote control theory and circuit series for an upcoming project that i prepare. Actually, the first reference for this matter was precisely one year ago, when i wrote the Manchester and Differential Manchester Code and the Pulse Position Modulation and Differential PPM theory pages. I planned to use some LEDs that i was provided by Alan Parekh's store. Alan offered me these 5mm IR LEDs as a replacement for the Long Range IR Beam Break Detector circuit, but i sincerely did not have enough time to work on an interesting project with IR LEDs. hopefully, the one that i prepare will pay off all this waiting.

But first of all, some theoretical matters. I will explain some essential and widely used IR protocols including the Phillips RC5/6 and the Sony SIRC protocol. But first of all, there is something very important to explain. Many people tend to confuse the protocol and the modulation. I first wrote this article as part of the RC5 protocol, but since it became that long i decided to make a separate page.

The difference between Protocol and Modulation
It is important to understand the difference between modulation and protocol. In words, modulation is the method that the signal is being transmitted by the transmitter so that the receiver will recognize it as a valid signal. On the other hand, the protocol is the method that the data to be transmitted are arranged and sent to the receiver - Both the receiver and transmitter must have the same modulation-demodulation method and also they must have the same protocol encoding and decoding method.

Here is an everyday example. The different languages that people speak, is one of the most complex protocols that you will find. People speaking the same language have a common method to encode sounds and make words, and also a common method to decode these sounds and understand these words. People can learn different protocols (Greek, English, Chinese...) and communicate with other people. For a successful communication, both the transmitter (the one that talks) and the receiver (the one that hears) must know the same protocol (language).

As for the modulation: Suppose that two people own the same protocol (language). One of them is about to speak, so he thinks of the phrase "Hello"... He knows the protocol, he knows what must be transmitted, but there has to be a way to modulate this thinking into something that can be transmitted through air. This is accomplished with his vocal strings. His brain will send electrical signals to his vocal strings which will modulate his thought into air vibrations, able to travel through air. When these modulated vibrations arrive inside the ear of the other person (receiver), they will be demodulated into electrical signals and his brain will decode it into the word "Hello"...

Let's water the plants - A simple IR remote control system
Defining the transmission protocol
Lets see now a typical example. Suppose that we have a device which control 4 irrigation valves, and this device is controlled by an IR remote control. The transmission protocol (which we can call VESTRAPROFOE - VEry Simple TRAnsition PROtocol For Our Example) has 4 bits. The first bit is the start bit to wake up the receiver microcontroller. The next bit is the command. Here are the possible commands:

0 - Turn valve OFF
1 - Turn valve ON

And the next 2 bits is the valve address:

00 - Valve #1
01 - Valve #2
10 - Valve #3
11 - Valve #4

If the operator wants to turn the second valve ON (#2), then by pressing the proper key, the transmitter will send this signal:

1 - 1 - 0 - 1

Reading from left to right, the first bit is the start bit, the second bit tells the receiver that a valve must be turned on, and the last 2 bits indicate that this valve is the valve #2

This protocol is extremely simple. Usually, consumer products with remote controls have more sophisticated and complex protocols, but this does not mean that such a simple protocol would not work.

Defining the transmission modulation
Now that we know what has to be transmitted, we need to find a way to transmit it thorough air from the transmitter to the receiver. We need therefore to make a modulation method. This will be more trickier than defining the protocol. The modulation has two parts. The first part is how to transmit the four data bits so that the receiver will be able to understand what bit is being transmitted. Since we use infrared light, the bits will be transmitted with light pulses. Let's define a simple transition modulation:

  • Each bit will be transmitted with a 10mSec modulated pulse
  • To transmit an ACE, the IR LED will be ON for 8 mSec and OFF for 2 mSec (total 10mSec)
  • To transmit a ZERO, the IR LED will be ON for 2 mSec and OFF for 8 mSec (total 10mSec)
  • Each data transmission (4-bits) lasts 40 mSec (4 x 10 mSec)

  • So, this was the first part of the modulation. This ensures that the receiver will be able to understand if a 0 or an 1 was transmitted. The receiver only needs to check the duration of the pulse that was transmitted: If the duration is less than 5mSec (2mSec), then a zero was transmitted, otherwise (8mSec) an ace was transmitted.
    Actually, this method of modulation is not new neither mine. It is so called "Pulse Width Modulation" or PWM and it is a very common modulation method for transmitting digital signals.

    The second part of the modulation is how to transmit the four bits so that the receiver will distinguish the signal from ambient interference. If there were absolutely no ambient IR radiation other than the one being transmitted by our transmitter, then turning on and off the LED according to the PWM would be enough but this is not the case. Actually, there are countless sources of IR light around us, with most common being the sun and the light bulbs. So, the transmitter must emit the IR light in a way that the receiver can distinguish it from the ambient IR light.

    The most simple way to do this is to use a "carrier frequency" to transmit the pulses. Here is how this works: First of all we select a frequency for the carrier frequency such that it cannot be mistaken with other ambient IR frequencies. A very common range for IR transmitters is 36 to 46 KHz. Suppose that we choose a carrier frequency of 38 KHz.

    Suppose now that we want to transmit a pulse with 8 mSec ON duration and 2 mSec OFF duration (digital ACE). Instead of simply turning ON the LED for 8 mSec, we will set the LED to oscillate at the carrier frequency for 8 mSec. This way, instead of transmitting a continuous light beam, we transmit a series of very fast light pulses (38 KHz) for a duration of 8 mSec. The receiver has a narrow band filter that discards all other IR light sources that do not have a 38 KHz frequency. If the transmitted signal reaches the receiver, it will go through the narrow-band filter. Then, with a set of low-pass filters or other filtering devices, it will be translated into a pulse back again.

    Understanding the difference with images




      Email (shall not be published)


    Notify me of new posts via email

    Write your comments below:
    BEFORE you post a comment:You are welcome to comment for corrections and suggestions on this page. But if you have questions please use the forum instead to post it. Thank you.


  • At 24 June 2015, 1:36:29 user Jorge Olivares wrote:   [reply @ Jorge Olivares]
    • best explanation ever!!

  • At 1 May 2015, 10:22:07 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @Anugrah Vijay Well, actually 10mSec is only good for this example. Pulses are much faster than this.

  • At 8 April 2015, 2:19:42 user Anugrah Vijay wrote:   [reply @ Anugrah Vijay]
    • This has been the best post I've read so far. No joke, You should consider teaching. The question I had was is there a specific reason why you chose 10ms modulated pulses? Or was it just for the sake of the example?

      Also, do you know of any good resource to learn about Radio communication protocols and modulations? For example the ones used in remote control quadcopters?

      Thank you!

  • At 25 March 2015, 7:51:04 user Robin Singh Sidhu wrote:   [reply @ Robin Singh Sidhu]
    • Very helpful. Keep up the good work.

  • At 2 December 2013, 15:42:30 user Barbich wrote:   [reply @ Barbich]
    • Hello,

      Excellent !

  • At 17 September 2013, 14:27:53 user Victor wrote:   [reply @ Victor]
    • Thank you!!! It's awesome! You explained so well!!

  • At 29 May 2013, 13:26:33 user bassam esa wrote:   [reply @ bassam esa]
    • great explanation ! put simple to understand.

  • At 22 March 2013, 7:56:05 user VENU GOPAL wrote:   [reply @ VENU GOPAL]
    • you explained awesome.i like this type of explaining, means comparing with real life examples.This method is easy to understand the complex concepts.

  • At 23 February 2013, 18:41:36 user Manjinder wrote:   [reply @ Manjinder]
    • Excellent work! Thanks a lot :)

  • At 10 January 2013, 11:55:40 user Dharma Teja Reddy K wrote:   [reply @ Dharma Teja Reddy K]
    • Excellent......!
      It's very easy to understand

  • At 7 November 2012, 16:54:01 user bruce gee wrote:   [reply @ bruce gee]
    • Gosssshhh!
      You're the best ever engineer when it comes to breaking it down for the not-so-technical man. Keep it up here. I need more of these in my mail, PLEASE :-)

  • At 23 October 2012, 18:19:55 user HASSAN wrote:   [reply @ HASSAN]

  • At 2 September 2012, 17:01:41 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @NOAK that cannot work actually. stay tuned. within the next week i will start uploading IR transceiver circuits with different protocols based on my previous theories.

  • At 31 August 2012, 12:37:20 user NOAK wrote:   [reply @ NOAK]
    • I want to use PIC micro-controllers to build IR Transmitter/receiver but using UART for sending and receiving data.

      Can it be done?
      Does this means that UART takes care of the headache of protocol/Modulation and carrier frequency?
      How reliable is it?

  • At 27 August 2012, 7:48:37 user NOAK wrote:   [reply @ NOAK]
    • Dude!, you're the best ever! I read your tutorial about pid tutorial the other day
      and I understood it right the way, and this one too God I love you.

  • At 7 August 2012, 22:32:40 user Grubi wrote:   [reply @ Grubi]
    • Excellent examples and easy to understand. Thanks!

  • At 1 August 2012, 20:35:04 user Filipe YaBa Polido wrote:   [reply @ Filipe YaBa Polido]
    • Excelent work! I've been reading about IR to play around with IRToy from DP, but this, is by far the best description of how IR works.
      Thanks! Keep up the good work.

    reddit this Reddit this

     HOT in heaven!

    NEW in heaven!

    New Theory: AC electric motor working principle

     Contact     Forum     Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Time for Science     RSS   

    Site design: Giorgos Lazaridis
    © Copyright 2008
    Please read the Terms of services and the Privacy policy