Skip to content

Infrared Remote Control RC-5

February 15, 2009

Overview:

RC5 is most popular protocol used for IR remote control. It was developed by philips. Now it has become universal protocol and used in almost each and every remote control. Also care is taken that IR code is unique for electronics equipments and manufacturers. This article explains how you can crack RC-5 codes from any IR remote control and design your own receiver.

Detail Description:

IR transmitter transmits 14bit code and it is decoded at receiver side. This IR code is repeated after certain interval. This 14 bit code can be divided into 4 parts.

1. Two start bits.

2. One Toggle bit.

3. Five address bits.

4. Six Command bits.

Start bits: Initial two start bits are always ‘1’.

Toggle bit: Toggle bit changes every time when new button is pressed. Now this is useful for volume control. For example if you long press mute or any number key button then this 14 bit code is transmitted multiple time but command is executed first time only. But this is not the case with volume/channel change button. For volume change long press is important feature. So receiver controller uses this toggle bit and decodes command.

Address and command bits: Five Address bits are used for system address. There is unique address for each equipments. Similarly there are 64 commands.


system-address

But wait a minute… This is a communication signal and this must be modulated to higher frequency for reliable communication. Remote control transmitter modulates digital signal to frequency 30KHz-40KHz. At receiver side it is demodulated using TSOP17xxIR remote control receiver. For example TSOP1738 demodulated 38KHz IR signal. Below picture shows how original signal and demodulated signal looks like.

By this time you must have realized this is one wire serial data line signal. When I say one-wire protocol it means there is no clock so 1. digital signals are decoded based on wither width of signal (i.e. Logic1 and logic 0 will have different width) OR 2. bit is transmitted for uniform time interval. So receiver must know bit period and according it will generate clock. Ideal way is to use timer/counter to generate clock (or an interrupt at regular interval ) and then sample signal- This is true for all one-wire protocol because there is no clock !!!  RC5 uses second method, RC5 has a uniform duration of each bit. It uses biphase code method.


In RC5, a transition in the middle of the time interval assigned to each bit encodes the logical value.If there is transition from low to high then it is encoded as ‘1’ and If there is transition from high to low then it is encoded as ‘0’. Width of each bit is 1.778 msec. For logic 0 signal remains 1 for first half bit period (889uSec) and goes to 0 for next half bit period. Similarly for logic 1 signal remains 0 for first half bit period (889uSec) and goes to 1 for next half bit period.

As shown in picture each bit has 1.78 ms duration, so it takes 24-25 ms for each code.

Here:

Start bits: S1=1 S2=1

Toggle bit = 0

Address = 0b11000

Command = 0b100111

You really don’t have to write complicated code to decode RC-5 commands. There are RC-5 decoder ASIC available in market which decodes TC5 code and gives Address and command bits on parallel bus as shown in following diagram.You can refer to following RC-5 decoder.

ir_rx

You can refer to following RC-5 decoder.

Philips Infrared Remote Controller Decoder

ST3049 – Infrared Remote Controller Decoder

IR Receiver:

IR receiver sensor is another important part in this circuit. As explained earlier it demodulates and converts IR signals to TTL digital logic. You can any TSOPxxxx sensor. Refer following datasheet.

TSOP.pdf

Usecases:

1. You can interface IR receiver and decoder IC to any microcontroller and decode system address and command bits. Use LCD display as output device to display decoded RC5 code.

2. Design your own IR receiver to switch on/off tube, fan TV etc. Use relay as electrical switch. You can use any existing RC5 remote control as transmitter.

In above both application you can connect CA (command acknowledge) to external interrupt of microcontroller and built complete code as interrupt based instead of polling based. You can force microcontroller to enter into sleep state when it is idle. This will save microcontroller power.

Advertisements
10 Comments
  1. that is good information for me, thanks

  2. Anurag permalink

    Hi,
    Good information,.. could you please let me know if its available in mumbai (i am assuming you are from India) .. 😉

    • ashishd permalink

      Yes you can get it from Lamington road, Mumbai

  3. Akshay permalink

    Is ST3049 available in Delhi???

  4. Dear All, I need RC 5 remote, Addresss 13. in bulk quantity. pl. lead me a address of any manufacturer or whole seller. on info@addcraftmania.com

  5. hi,
    nice work yar….
    i was going for the complete code for RC 5 but your blog saved me from the hectic work..
    can you let me know where can i find the IC in chandigarh or delhi ??

  6. manoj permalink

    can u plz tell cost of st3049 in mumbai actually i want to get an approximate for my project

  7. Greetings from New Farm. Thanks for the useful content. I’m doing a project at college and your stuff was quite useful. Thanks for sharing 🙂

  8. anurag permalink

    This is a helpful information,
    Thanks for it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: