DIY HID IR Keyboard (FLIRC Clone)





Introduction: DIY HID IR Keyboard (FLIRC Clone)

About: Hi! My name is Suraj. I'm a DIY electronics enthusiast who loves to make circuits and stuff.

Hello everyone. This is my first Instructable.

A while ago I got to know about the FLIRC IR receiver which I thought of buying. But I thought, Hey! Why buy something I can make at home.

So basically what FLIRC do is convert IR signals received from any remote to HID signals. From what I gathered, it recognizes as an HID keyboard to the computer.

Now, to the project, we can do this using two ways.

-Easy way.

-Fun way.

Easy way would be to use and arduino Leonardo compatible board which can easily made to be recognized as an HID keyboard or mouse to the computer. There is even an IR library to easily decode IR signals from the remote. But let’s be real here, you cannot use a development oriented board to create something to be used on a daily basis. Plus there are similar projects already available. Also it will be WAY too bulky. Even if you use the tiniest Leonardo compatible board. So, we move on to the fun way.

For this project, I used a PIC18F25J50 microcontroller with a TSOP IR decoder. I used this microcontroller because of three reasons. First, this mcu is available in tiny QFN package which helps reducing the overall board size. Second, this mcu supports usb communication without using an external crystal/resonator which again helps reducing the board size. And third, is that I have several of these laying around in my stock. The list of components required to make this project is very tiny. Hence it’s not very hard to build this circuit. But, if you want to build the circuit I built, you’ll need very steady hands and expert soldering skills.

Step 1: Components Required

-PIC18F25J50 (You can also use other PIC18F MCUs with USB transceiver built-in but you may have to make appropriate changes to the code and the schematics. You can comment below if you need my help doing so.)

-TSOP IR receiver.

-LM1117 3.3v regulator

-2x220nf capacitors.

-470 ohm resistance.

-10k ohm resistance.

As I said, the list of components is tiny.

Step 2: Schematics and PCB Layout

To make the PCB i used the simple Toner transfer method using a simple iron. As you can see, the quality is decent except sometimes the 0.01 inch traces gets scraped off by using steel wool no matter how careful i get with it.

To cut the PCB to size, I mainly used a box cutter to carve out the shape. (I also got my right thumb severely cut in the process.)

After carving the shape, i drilled necessary holes using a 0.5 mm drill bit. Then there was just a matter of soldering the components on the board. which requires a lot of patience since it's a QFN chip and i don't have a hot air soldering station. But anyways, I got it to work in the first try..

For later, I've designed a double layer PCB which is more than 40% smaller.

You can also refer to the project folder to these images... I've also included Eagle-CAD files

Step 3: PIC Firmware and the Final Product.

I used MikroC pro for PIC to build the firmware. Source code is attached in the project zip file. There is precompiled Hex file that you can burn to the chip using PICKIT2 or any other pic programmer.

Note that you’ll need the registered version of the MikroC pro for pic IDE to compile the project as you cannot compile a code larger than 2000 words in the demo version. But I’m sure you guys can figure that out on your own.

Alternatively, you can convert the code to MPlabX (please send me the project folder if you do).

I’ve used IR remote decoder example code from this link. HERE

I’ve slightly modified the code to trigger the decoding process using an external Interrupt pin so the program don’t need to constantly check whether any data is received from the IR decoder. It also reduces the lag.

In this project, I’ve used a NEC remote. Because it’s easiest to decode. You can refer to the project code for more info on that.

To decode the ir code sent by your remote, You can use UART to send the integer value inside ir_result[2] variable(in case of NEC remote). I used UART_remappable module mapped Tx and Rx pins to RB6 and RB7 respectively (ie. PGD and PGC pins used to program the chip) so I can use the PICKIT2’s UART feature to receive serial data without connecting any other usb to serial converter to the board. (Do I need to elaborate this?)

You can also refer to the IR remote decoder example code I’ve linked above. To get help decoding your remote.


1. As of now you can’t remap the keys. However I’m planning to do this sometime later.

2. Current Code cannot decode RAW ir data. Hence only known IR remotes are supported like sony, NEC, RC5 etc.

Feel free to ask any questions. And do share your experience if you decide to do this project.




    • Oil Contest

      Oil Contest
    • Creative Misuse Contest

      Creative Misuse Contest
    • Clocks Contest

      Clocks Contest

    26 Discussions


    1 year ago

    Congrats :) You cracked me.

    As the father sth like that was Igor Cesko AVR309 (2003).

    Here you got a hardware USB service. Hi did own software implemented USB 1.1 LS protocol by cycle exact assembler routine on 12MHZ clock.

    Also hi wrote own WDM driver in DDK.

    Ergh... times goes by so fast. Today any cheap chip can have OTG.

    Nice job mate.

    Wow, really impressive (especially as a first project!), also very useful!
    I just wanted to add, for those of you who use Linux, that you can also buy a cheap (<8€) DVBT stick, most of which also come with a remote and IR receiver. You can also assign commands to those remote keys.

    2 replies

    thanks! But this is my first project on instructables.. not THE first project I've done..

    why I don't usually upload projects is that I don't record the progress of the project because I'm not certain that I'll finish it... even now I have about 5-6 projects waiting to be finished. also, I'm a lazy potato.

    also dvb-t receivers are TV receivers.. they cannot control your computer. I have one for my laptop....

    thanks again!

    Oh, okay, I see.
    Actually there are loads of DVBT sticks around with IR remotes [eg. ] for most of them, you can reconfigure the commands send to the computer (at least under Linux).


    1 year ago

    Thumbs up for using a PIC (vs shitduino) and thumbs up for using Eagle. Love this project. Thanks.

    1 reply

    thanks :)

    but why so such hate for arduino?

    Good one....keep it up...

    Very nice design.

    I already have a few of these for my Raspberry Pi farm.


    u should sell these the cheapest one i can find is 20 bucks

    6 replies

    I would love to sell these. but the problem is the international courier from my country would exceed 15+ dollars.. I board however took no more than 5$ for me.

    I will vote it to have one, too. If not able to find any party to do it, I might be able to arrange to do it here in Taiwan.

    If you can find enough people that want them, it's possible to ship these in bulk, being so small, to someone local to leverage as a distributor. As long as you aren't breaking any trade laws....


    Reply 1 year ago

    man... no one is calling you names... quit the drama. Lots of projects here are made for educational purposes. You can not put a price on the skills the author learn

    However, you can make a very good profit from it (since it's a great project).

    BTW I suggest offloading the manufacturing to China and shipping from there. (Ebay stuff is Overpriced so it's a good place to sell it)

    thanks a lot! you guys gave me a lot of inspiration.

    I'll think about manufacturing once i implement the option to use any remote... not just NEC one..and the key remapping option.

    Nice almost-single-layer design!

    I try to avoid the LM1117 in new desings as the datasheet specifys
    using at least 2x 10uF tantalum capacitors which are rather bulky. Lucky you for getting it working without them :). My personal favorite LDO for low voltage (<5.5V), low power, digital designs is the XC6206 series by torrex. They are in SOT23 packages, draw less then 10uA quiescent current, require only 2x 1uF X5R capacitors for operation and cost only a few cents on aliexpress.

    Apart from that this is pretty close to a perfect design, I curious what you come up next with!

    1 reply

    I'm aware that lm1117 requires 2 tantalum caps...I mainly skipped them because there was lack of space on the board.. also I used lm1117 because I had a few of these laying around...

    I'll look into the regulator you mentioned. thank .. :)

    PS. if I start manufacturing these boards I'll definitely use smaller regulator.... and since I can use double PCBs ...the overall board size will also decrease.


    1 year ago