Summary of Universal Serial Infrared Receiver. using pic microcontoller
This project enables PC control via any TV or device remote using a Universal Infrared Receiver (UIR). A PIC microcontroller captures demodulated IR signals, converts them to serial data at 57600 baud, and sends them to the PC. PC software learns unique key codes to trigger programs, adjust volume, or move the mouse. The system works with multiple remotes and standard 3-pin IR detector modules, requiring a USB-to-Serial adapter for modern computers.
Parts used in the Universal Infrared Receiver:
- PIC microcontroller (16F88)
- Standard 3-pin Infrared detector module
- USB Digital Serial Interface or USB RS232 adaptor
- Mikroelectronika MikroC compiler
- PC running learning software
You can use this Universal Infrared Receiver (UIR) project to control your PC:
- Starting Windows programs,
- setting the Windows volume control,
- even moving the mouse around the screen!
All at the touch of a button – with your TV remote control in fact!
It uses a PIC microcontroller to characterize the demodulated infrared signal and then transmit it as a serial data stream to the PC.

It’s even good with multiple remotes so you could use any one of a set of remotes to control the PC
Specification for Serial Infrared receiver project.
| Baud Rate | 57600 Baud |
| Clock | Internal 8Mhz |
| Remove Control type | Any (Point any control at it and let the PC software learn its codes). |
Note: Some remote controls need two key presses (if you press the same key) as they output an inverted key sequence for a repeated key. If you press a different key then it works as a normal remote.
Serial Infrared receiver : Project Details
| Compiler | Mikrolectronika MikroC Free! |
| Target | 16F88 (retargetable to other PICs that have a built in USART). |
| Software level | Easy. |
| Software notes | No special notes. |
| Hardware level | Easy. |
| Hardware notes | No special notes. |
| Project version | 1.01 |
| Project files | Enter your details to get the Download Link and get the microcontroller newsletter: (Note: Your email is safe it will never be sold or rented). Note: Check your email for the project code download link. |
How the Serial Infrared receiver works
This project uses a standard Infrared detector module (one of those 3 pin devices) as the main input.
It’s not worth making your own circuit up as it will not match the performance of a three pin demodulator module.
I had a go using some circuits I found on the web and but these use a PIN diode and a high impedance amplifier e.g. LM3140 – but the circuits are actually light meters and saturate when a light shines on them (even desk lamp) – so they become insensitive to the IR light – the PIN diode reacts to any light source. You can get some use out of them up to about six feet but a lot of engineering has gone into the three pin modules so it really is worth using them and they are very cheap.
Inside the module is a PIN diode, AGC circuit, band pass filter, control logic and output detector. The datasheet specifies use from 15m (45ft) up to possibly 30m (90ft) max!. These are very good detectors that are also insensitive to sunlight (has a physical filter over the PIN diode and the electronic bandpass filter).
What to do if you only have a USB port
Todays PCs only have USB ports so you need some adaptor hardware to allow serial RS232 operation. There are two options:
- A USB Digital Serial Interface
- A USB RS232 adaptor
Both of these are very cheap and useful. You can learn more about usb adaptors in the link.
Serial Infrared receiver
How the Serial Infrared receiver works.
This project took longer than it should have and I have ended up with a far smaller source code than my initial attempts! First off I used the capture facility in the CCP and the Timer1 timer to accurately measure each period of high and low decoded IR. This turned out to be too accurate!
For more detail: Universal Serial Infrared Receiver.
- What functions can the UIR perform on a PC?
It can start Windows programs, set volume control, and move the mouse. - How does the system identify different remote controls?
The PC software learns the specific data stream for each key press from any remote type. - Can this project work with multiple remotes?
Yes, it supports multiple remotes so you can use any one of a set to control the PC. - Why should I use a three pin demodulator module instead of building my own circuit?
Custom circuits using PIN diodes often saturate with light and are insensitive, whereas three pin modules are cheap and highly effective. - What is the recommended baud rate for this project?
The specification requires a Baud Rate of 57600. - Which microcontroller is targeted for this design?
The project targets the 16F88 chip, which is retargetable to other PICs with built-in USART. - What hardware is needed if the PC only has USB ports?
You need a USB Digital Serial Interface or a USB RS232 adaptor to enable serial operation. - Does the system handle repeated key presses correctly?
Some remotes output an inverted sequence for repeated keys, requiring two presses to register correctly.
