Summary of RC5 IR Remote Control Decoder with PIC12F1822 Microcontroller
This article explains how to decode IR remote signals using the Philips RC-5 protocol with a PIC12F1822 microcontroller. It details the 14-bit structure of the RC-5 signal, including start, toggle, address, and command bits, along with Manchester coding. The project uses a state machine to interpret pulse and space durations from an IR receiver, processing the data via the microcontroller to display results on an LCD screen.
Parts used in the RC5 IR Remote Control Decoder:
- PIC12F1822 Microcontroller
- 1602 LCD
- 74HC595 Shift Register
- IR Receiver
- 47µF Capacitor
- 10K Resistor
- 10K Variable Resistor
- +5V Power Supply
- Protoboard
- Jumper Wires
This topic shows an easy and effective way for decoding IR (Infra-Red) remote controls that use Philips RC-5 communication protocol, but first we’ve to understand how the RC5 protocol works.
This Wikipedia links has good infos about the RC5 protocol.
The RC-5 protocol was developed by Philips in the late 1980s as a semi-proprietary consumer IR (infrared) remote control communication protocol for consumer electronics.
The RC5 has 14 bits per 1 code transmission, the 14 bits can be divided into 4 parts:
The first 2 bits are start bits and they are always logic 1.
The third bit called toggle bit, it can be logic 1 or logic 0.
The next 5 bits are address bits, each device type has its address number for example TV address number is 0, CD player address = 20 …………
And the last 6 bits are command bits, each button has its command number.
For the same device for example TV all the remote control buttons has the same address but each button has its command.
The toggle bit changes whenever a button is pressed.
The RC5 protocol uses Manchester coding, logic 1 and logic 0 are coded as shown in the following drawing where toggle bit is 1, address = 0 and command is 2:
RC5 Protocol state machine:
I used the state machine shown below for decoding the RC5 protocol. The RC5 state machine checks the length of pulses and spaces transmitted from the remote control to go from state to another.
Where:
SP : Short Pulse (About 889µs)
LP : Long Pulse (About 1778µs)
SS: Short Space (About 889µs)
LS : Long Space (About 1778µs)
Basically there are 4 states: Mid1, Mid0, Start1 and Start0.
RC5 IR Remote Control Decoder with PIC12F1822 Microcontroller Circuit:
Components List:
- PIC12F1822 Microcontroller
- 1602 LCD
- 74HC595 Shift Register (74HC164, CD4094 ….)
- IR Receiver
- 47µF Capacitor
- 10K Resistor
- 10K Variable Resistor
- +5V Power Supply
- Protoboard
- Jumper Wires
To interface 1602 LCD with PIC12F1822 microcontroller we need 74HC595 shift register as what was done in this post:
Interfacing PIC12F1822 microcontroller with LCD display
The IR receiver is used to receive the IR signals transmitted from the remote control and convert this signals to a digital data (logic 0 and logic 1). The microcontroller reads digital data from the IR receiver, this data is decoded and the results displayed on the 1602 LCD.
Read more: RC5 IR Remote Control Decoder with PIC12F1822 Microcontroller
- How many bits are in each RC-5 code transmission?
The RC-5 protocol has 14 bits per code transmission. - What is the function of the first two bits in the RC-5 protocol?
The first 2 bits are start bits and they are always logic 1. - Which bit changes whenever a button is pressed in the RC-5 protocol?
The toggle bit changes whenever a button is pressed. - How does the RC-5 protocol encode logic 1 and logic 0?
The RC-5 protocol uses Manchester coding for encoding logic levels. - What components are needed to interface the LCD with the microcontroller?
A 74HC595 shift register is needed to interface the 1602 LCD with the PIC12F1822. - What is the role of the IR receiver in this project?
The IR receiver converts transmitted IR signals into digital data (logic 0 and logic 1). - What determines the transitions between states in the RC5 state machine?
The state machine checks the length of pulses and spaces transmitted from the remote control. - What are the approximate durations for Short Pulse and Long Pulse?
Short Pulse is about 889µs and Long Pulse is about 1778µs.

