Summary of Infrared Dedicated Decoder
This article details a project using an ATtiny85 microcontroller as a dedicated IR decoder for the Sony protocol. It offloads signal processing from a main host controller by decoding pulses from an MIM 5383H4 sensor and transmitting results via serial communication at 9600 baud. The system uses internal RC oscillators and specific timing thresholds to distinguish binary data, enabling efficient integration with various microcontrollers or PCs.
Parts used in the ATtiny85 IR Decoder Project:
- Atmel ATTiny85
- MIM 5383H4 IR detector
- 33 Ohm resistor
| Hardware components: | |||||
![]() |
|
× | 1 | ||

Attiny85 IR code for Sony protocol
Schematics

Notes
Attiny85 core files used:
http://code.google.com/p/arduino-tiny/
You must select the correct “board” type… ATtiny85@16MHz (internal PLL)>9600 BAUD serial output comes out the ATtiny on physical pin# 7
Why?
Using a dedicated Attiny85 microcontroller to monitor and decode the IR detector (MIM5383H4) frees the main uC from having to do this nasty and inefficient job. This makes for nimble IR operation on the host microcontroller where only a serial port needs to be monitored for traffic which originates from the tiny85.
My implementation uses the Sony IR protocol which is available on almost every inexpensive Universal Remote Control. The algorithm for this decode was developed and put in the public domain by Arduino Forum member pmalmsten. Full links to his work is provided in my source code. This is an Open Source implementation, so you can easily change the tiny85 to decode NEC or other remote protocols by changing the decode algorithm – but you are on your own for this effort; however there are many IR decode algorithms freely available for the searching on Google.
The main program is more efficient and requires less resources because the IR polling and decoding is eliminated and the host simply receives the decoded digits and commands on the serial port at 9600 BAUD in my example. This solution is also microcontroller agnostic: I have used it for AVR and for PIC. You can even feed the serial output of the ATtiny85 to your PC over a USB/serial converter and host software on the PC to do magic stuff.
On the Arduino, all that is necessary is a single statement in the loop():
if (Serial1.available() > 0) >If nothing is in queue, then the host Arduino microcontroller does not need to be concerned about IR messages. It cannot get much simpler!
Resources
I have a full write-up of this technique on the main Arduino.cc Forum:
http://forum.arduino.cc/index.php?topic=139907.0
Read More: Infrared Dedicated Decoder
- How does the ATtiny85 improve system efficiency?
It frees the main microcontroller from inefficient IR polling by handling decoding independently. - What IR protocol is supported by this implementation?
The code supports the Sony IR protocol available on almost every inexpensive Universal Remote Control. - Can I use a different microcontroller as the host?
Yes, the solution is microcontroller agnostic and works with AVR, PIC, or even a PC via USB/serial. - How are the IR detector pins connected to the ATtiny85?
Pin 1 connects to D4, Pin 2 to GND, and Pin 3 to 5V through a 33 Ohm resistor. - What baud rate is used for serial output?
The serial output comes out at 9600 BAUD. - Which library was used for the Tiny85 setup?
The Google Tiny library was used with the internal RC 16MHz configuration. - Does the code toggle an LED when power is pressed?
Yes, the status LED toggles every time the Power button is hit. - How can I change the protocol to NEC?
You can change the decode algorithm in the source code since it is Open Source. - What happens if invalid data is received?
The function returns -1 to flag the data as invalid. - Why is the start bit threshold set to 2200 microseconds?
This threshold waits for the start bit before measuring subsequent bits.

