2015年1月24日 星期六

[Arduino] Make a IR translator to translate IR code of Panasonic TV to Kbro TV box

[Arduino] 製作紅外線遙控轉換器 IR translate Panasonic 電漿電視轉 Kbro 凱擘 (Chinese)

Base on last article [Arduino] Use IRrepeator to capture IR raw code of kbro TV box's remote control, the real purpose is make a device to transfer/translate Tivo IR code to be the code of Kbro TV box. Then I just need setup Lotactionfree client to control Tivo, IR translator will transfer Tivo IR code and emit Kbro IR code for controlling Kbro TV box. The same approach is useful to let Sony Locatoinfree remote control any non-supported machines. (Please look at the video record in the end of this article if you want.)

The same situation, I make this device to transfer the IR code of Panasonic remote control to be the Kbro code. Due to my Panasonic TV provides the features of Skype, Youtube and screen size changing, so using the original Panasonic remote control is more convenient to me:


Looks the type of Panasonic remote control is N20AYB:

The IR codes of Panasonic remote control captured by IRrecvDump as following. Due to Arduino IR library could not recognize type of the code, so it prints Unknow type. The length of following raw data are 100, the hash codes are useful to put into program for comparing the received signatures, so I put all raw data in the note of this article:

Channel UP: Unknown encoding: 4DE74847 (32 bits)
Channel DOWN: Unknown encoding: B8781EF (32 bits)
ONE 1: Unknown encoding: F7283C77 (32 bits)
TWO 2: Unknown encoding: 757FB4DF (32 bits)
THREE 3: Unknown encoding: B33B4597 (32 bits)
FOUR 4: Unknown encoding: 3C03E507 (32 bits)
FIVE 5: Unknown encoding: E705551F (32 bits)
SIX 6: Unknown encoding: A4A58EC7 (32 bits)
SEVEN 7: Unknown encoding: E2E45F7F (32 bits)
EIGHT 8: Unknown encoding: 6BACFEEF (32 bits)
NINE 9: Unknown encoding: E88E91F (32 bits)
ZERO 0: Unknown encoding: 7D168BCF (32 bits)
OK: Unknown encoding: BB0ED9E1 (32 bits)
RETURN: Unknown encoding: D28EF217 (32 bits)
POWER: Unknown encoding: F61E2A57 (32 bits)

After Kbro TV box setup by cable company, I need use this specific remote control to watch TV. I really don't like that because I already have 2 remote control, Panasonic TV and Tivo. So my plan is do not use it, put it to drawer.

Due to Arduino IRremote library also could not recognize the code type of the above Kbro remote control, so I need raw data to be the source of emitting IR signature. The same, I list the raw data of Kbro IR codes in the end of this article, the length is 18.

Then is the hardware part, it's fully the same with IR repeater in my laster article:

The architecture is really simple, connect IR LED power pin to D3 of Arduino Pro mini. And, IR receiver data pin connect to D11 pin of Arduino Pro mini.

The components list:

Arduino mini pro, IR LED, IR receiver (PL-IRM0101-3, datasheet), USB male plugUSB. The total cost of components almost $130 NTD (around $4.5 USD):


IR receiver, I bought PL-IRM0101-3, please note different model has different define of 3 pins. Please check appropriate datasheet. There have 3 pins: Vcc, Vout and GND. Connect Vout to D11 of Arduino pro mini:

USB male plug used to connect 5V DC input to Arduino mini pro, connect the power pin on USB male to Vcc pin:

The leading role, Arduino mini pro, 70 NTD (around $2.2 USD). The cost is OK for DIY but still expensive for production:

Arduino pro mini need a USB program upload, take a picture of it:

Connect with upload:

The connection hint of DuPont lines
upload  connect Arduino mini pro
       DTR connect DTR
       RXI  connect TXO
       TXO connect RXI
       VCC connect VCC
       GND connect GND  


After connected by DuPont lines, then using Arduino IDE to complier and upload.

As description in last article, I already tested circuit by breadboard. So I start create use single side matrix board to layout. My design is put IR receiver behind of Arduino, the IR LED put on the side near the IR receive window of Kbro TV box:

The relative position between the USB port of Kbro box and IR window:

Paste a picture of the final position to see the IR LED status:

The layout of welding as following picture:

The left side, welded IR LED, the LED turn toards to IR receive window of Kbro box:

The right side, I welded female pin slot. It give the option to us for removing Arudino mini pro to other purpose:

The end of board, IR receiver is behind Arduino:

The front of Arduino has USB male, it used to get the 5V DC power:

Ya! Done! It's easier than my another project of reform the x61 IR UltraBase dock. Next is testing:

Of course not just hardware, we need upload program:
https://github.com/smallbeetw/arduinosketch/blob/master/Panasonic2KbroIRtrans/Panasonic2KbroIRtrans.ino

The program is easy, we make a mapping table that's used to map Panasonic IR hash code with kbro raw codes. The program compares the IR code that's received by  IR receiver with the Panasonic hash code in mapping table,   then it emits appropriate kbro raw code when found that match.

After a couple of testing, I modified the part of program is delay time, using 30 got the best result.

This is the video record of result:

The same device can used to transfer the Tivo IR code emitted by Locationfree to be Kbro IR code, so don't need worry for any IR codes didn't support by Locationfree. The approach can applied on SlingBox to solve the problem of non-supported IR code because those kind of devices almost supported Tivo IR code. Just need base on Tivo IR code to transfer to the codes that's we want. Then we can continue to use our expensive Locationfree or SlingBox.


2014-12-12 add:
The original program doesn't binding the power button of Kbro remote control with the power button of Panasonic TV. So I need set my Kbro box always power ON, otherwise I will need use Kbro remote control to power on TV box:

The default setting is auto-shutdown after 24 hours didn't control by human:

So I updated the program to binding power button. Due to my TV box put in TV cabinet, there have a distance between IR receive window of TV. It not always synchronous when power on. So I bind the power button of TV box to DTV/TV button on Panasonic remote control. Please check my code.

After power power binding, then I set the auto-shutdown time to 12 hours:

2014-12-20 add:
Today I used simple USB power meter to measure:

The USB slot on Kbro box looks fine to provide 5V output:

The ampere value smaller than the minimum resolution:


2015-01-10 add:
Add some pictures of USB male pin fore reference how to get 5V input to Arduino:




more: [Arduino] 以 nRF24L01+ 和 RF24 library 製作無線電端點



Notes:
Raw data of Panasonic remote control:

Channel UP:
Unknown encoding: 4DE74847 (32 bits)
3450,1750,450,400,450,1300,450,400,450,400,450,450,400,450,450,400,450,450,400,450,450,400,450,450,400,450,450,400,450,1300,450,400,450,400,450,450,450,400,450,400,450,450,400,450,450,400,450,450,400,1300,450,450,400,450,450,400,450,450,400,450,450,400,450,400,450,450,450,400,450,400,450,1300,450,400,450,1300,450,1300,400,450,450,400,450,450,400,450,450,1300,400,450,450,1250,450,1300,450,400,450,1300,450,

Channel DOWN:
Unknown encoding: B8781EF (32 bits)
3400,1750,450,400,450,1300,450,400,450,400,450,450,450,400,450,400,450,450,450,400,450,400,450,450,400,450,450,400,450,1300,450,400,450,450,400,450,450,400,450,400,450,450,450,400,450,400,450,450,450,1250,450,450,450,400,450,400,450,450,400,450,450,400,450,450,400,450,450,1300,400,450,450,1250,450,450,450,1250,450,1300,450,400,450,450,450,1250,450,450,400,1300,450,450,400,1300,450,1300,450,400,450,1300,450,

ONE 1:
Unknown encoding: F7283C77 (32 bits)
3400,1750,450,450,450,1250,450,450,400,450,450,400,450,450,400,450,450,400,450,400,450,450,450,400,450,400,450,450,450,1250,450,450,450,400,450,400,450,450,450,400,450,400,450,450,400,450,450,400,450,1300,450,400,450,400,450,450,450,400,450,400,450,450,450,400,450,400,450,450,450,400,450,400,450,450,450,1250,450,450,400,450,450,400,450,450,400,450,450,400,450,400,450,1300,450,400,450,450,450,1250,450,

TWO 2:
Unknown encoding: 757FB4DF (32 bits)
3450,1750,400,450,450,1300,400,450,450,400,450,400,450,450,450,400,450,400,450,450,450,400,450,400,450,450,450,400,450,1300,400,450,450,400,450,450,400,450,450,400,450,450,400,450,450,400,450,400,450,1300,450,400,450,450,450,400,450,400,450,450,450,400,450,400,450,450,400,1300,450,450,400,450,450,400,450,1300,450,400,450,400,450,450,450,1250,450,450,450,400,450,400,450,1300,450,400,450,450,400,1300,450,

THREE 3:
Unknown encoding: B33B4597 (32 bits)
3400,1750,450,450,400,1300,450,450,400,450,450,400,450,400,450,450,450,400,450,400,450,450,450,400,450,400,450,450,450,1250,450,450,400,450,450,400,450,450,400,450,450,400,450,450,400,450,450,400,450,1300,450,400,450,400,450,450,450,400,450,400,450,450,450,400,450,400,450,450,400,1300,450,450,400,450,450,1300,400,450,450,400,450,400,450,450,450,1250,450,450,450,400,450,1300,450,400,450,400,450,1300,450,

FOUR 4:
Unknown encoding: 3C03E507 (32 bits)
3400,1750,450,400,450,1300,450,400,450,450,400,450,450,400,450,400,450,450,450,400,450,400,450,450,450,400,450,400,450,1300,450,400,450,450,400,450,450,400,450,450,400,450,450,400,450,400,450,450,450,1250,450,450,450,400,450,400,450,450,450,400,450,400,450,450,400,450,450,1300,400,1300,450,450,400,450,450,1250,450,450,450,400,450,400,450,1300,450,1300,450,400,450,400,450,1300,450,400,450,450,400,1300,450,

FIVE 5:
Unknown encoding: E705551F (32 bits)
3400,1750,450,400,450,1300,450,400,450,450,450,400,450,400,450,450,450,400,450,400,450,450,400,450,450,400,450,450,400,1300,450,450,400,450,450,400,450,400,450,450,450,400,450,400,450,450,450,400,450,1300,450,400,450,400,450,450,400,450,450,400,450,450,400,450,450,400,450,450,400,450,450,1250,450,450,450,1250,450,450,450,400,450,400,450,450,450,400,450,1300,400,450,450,1300,400,450,450,400,450,1300,450,

SIX 6:
Unknown encoding: A4A58EC7 (32 bits)
3400,1750,450,400,450,1300,450,400,450,450,450,400,450,400,450,450,450,400,450,400,450,450,400,450,450,400,450,450,400,1300,450,450,400,450,450,400,450,400,450,450,450,400,450,400,450,450,450,400,450,1300,450,400,450,400,450,450,400,450,450,400,450,450,400,450,450,400,450,1300,450,400,450,1300,450,400,450,1300,450,400,450,400,450,450,450,1250,450,450,400,1300,450,450,400,1300,450,450,400,450,450,1250,450,

SEVEN 7:
Unknown encoding: E2E45F7F (32 bits)
3400,1750,450,400,450,1300,450,400,450,400,450,450,450,400,450,400,450,450,450,400,450,400,450,450,450,400,450,400,450,1300,450,400,450,450,400,450,450,400,450,450,400,450,450,400,450,450,400,450,450,1250,450,450,450,400,450,400,450,450,450,400,450,400,450,450,450,400,450,400,450,1300,450,1300,400,450,450,1250,450,450,450,400,450,400,450,450,450,1250,450,1300,450,400,450,1300,450,400,450,450,400,1300,450,

EIGHT 8:
Unknown encoding: 6BACFEEF (32 bits)
3450,1750,400,450,450,1300,400,450,450,400,450,400,450,450,450,400,450,400,450,450,450,400,450,400,450,450,450,400,450,1300,400,450,450,400,450,450,400,450,450,400,450,450,400,450,450,400,450,400,450,1300,450,400,450,450,450,400,450,400,450,450,450,400,450,400,450,450,450,1250,450,1300,450,1300,400,450,450,1250,450,450,450,400,450,400,450,1300,450,1300,450,1250,450,450,450,1250,450,450,400,450,450,1300,400,

NINE 9:
Unknown encoding: E88E91F (32 bits)
3400,1750,450,400,450,1300,450,400,450,450,400,450,450,400,450,450,400,450,450,400,450,450,400,450,450,400,450,400,450,1300,450,400,450,450,450,400,450,400,450,450,450,400,450,400,450,450,450,400,450,1300,400,450,450,400,450,450,400,450,450,400,450,400,450,450,450,400,450,400,450,450,450,400,450,1300,450,1250,450,450,450,400,450,400,450,450,400,450,450,400,450,1300,450,1300,400,450,450,400,450,1300,450,

ZERO 0:
Unknown encoding: 7D168BCF (32 bits)
3400,1750,450,400,450,1300,450,400,450,400,450,450,450,400,450,400,450,450,450,400,450,400,450,450,450,400,450,400,450,1300,450,400,450,450,400,450,450,400,450,450,400,450,450,400,450,400,450,450,450,1250,450,450,450,400,450,400,450,450,450,400,450,400,450,450,400,450,450,1300,400,450,450,400,450,1300,450,1300,400,450,450,400,450,400,450,1300,450,400,450,450,450,1250,450,1300,450,400,450,450,400,1300,450,

OK:
Unknown encoding: BB0ED9E1 (32 bits)
Raw (100): -27668 3450 -1750 450 -400 450 -1300 450 -400 450 -400 450 -450 450 -400 450 -400 450 -450 400 -450 450 -400 450 -450 400 -450 450 -400 450 -1300 450 -400 450 -400 450 -450 450 -400 450 -400 450 -450 450 -400 450 -400 450 -450 400 -1300 450 -450 400 -450 450 -400 450 -400 450 -450 450 -400 450 -400 450 -450 450 -1250 450 -450 450 -400 450 -1300 400 -450 450 -400 450 -1300 450 -400 450 -1300 450 -400 450 -400 450 -1300 450 -400 450 -450 450 -1250 450 -1300 450

RETURN:
Unknown encoding: D28EF217 (32 bits)
Raw (100): -20988 3450 -1700 450 -450 400 -1300 450 -450 400 -450 450 -400 450 -400 450 -450 450 -400 450 -400 450 -450 450 -400 450 -400 450 -450 400 -1300 450 -450 400 -450 450 -400 450 -450 400 -450 450 -400 450 -450 400 -450 450 -400 450 -1300 450 -400 450 -400 450 -450 450 -400 450 -400 450 -450 400 -450 450 -400 450 -1300 450 -1300 400 -1300 450 -400 450 -1300 450 -1300 450 -400 450 -400 450 -1300 450 -1300 400 -1300 450 -450 400 -1300 450 -1300 450 -400 450 -1300 450

POWER:
Unknown encoding: F61E2A57 (32 bits)
Raw (100): -15610 3400 -1750 450 -450 450 -1250 450 -450 400 -450 450 -400 450 -450 400 -450 450 -400 450 -450 400 -450 450 -400 450 -450 400 -450 450 -1250 450 -450 450 -400 450 -400 450 -450 400 -450 450 -400 450 -450 400 -450 450 -400 450 -1300 450 -400 450 -450 400 -450 450 -400 450 -400 450 -450 450 -400 450 -400 450 -1300 450 -400 450 -1300 450 -1300 400 -1300 450 -1300 450 -400 450 -400 450 -1300 450 -400 450 -1300 450 -1300 400 -1300 450 -1300 450 -400 450 -1300 450


The Raw data of Kbro remote control (already removed the first number of serial, length is 18-1=17):

Channel up:
250,850,250,1000,250,700,250,750,200,750,250,2450,250,750,200,750,250

Channel Down
250,850,250,850,250,750,200,750,250,700,250,2600,250,750,200,750,250

POWER:
250,850,250,700,250,750,200,750,250,750,200,2750,250,750,200,750,200

ONE 1:
250,850,250,2650,200,750,200,750,250,750,200,900,200,750,200,750,250,

TWO 2:
250,850,250,2450,250,750,200,750,250,700,250,1000,250,750,200,750,200,

THREE 3:
200,900,200,2400,200,750,200,750,250,750,200,1150,200,750,250,750,200,

FOUR 4:
200,900,200,2250,200,750,200,750,250,750,200,1300,200,750,250,700,250,

FIVE 5:
250,850,250,2100,200,750,250,700,250,750,200,1400,250,750,200,750,250,

SIX 6:
250,850,250,1950,200,750,250,750,200,750,200,1600,200,750,200,750,250

SEVEN 7:
200,900,200,1850,200,750,250,750,200,750,200,1700,250,700,250,750,200,

EIGHT 8:
250,850,250,1650,250,750,200,750,250,750,200,1800,250,750,200,750,250,

NINE 9:
200,900,250,1550,200,750,200,750,250,750,200,1950,250,750,200,750,200

ZERO 0:
200,900,200,2800,200,750,200,750,250,750,200,750,200,750,250,750,200

OK:
250,850,250,1800,250,750,200,750,200,1050,200,1450,200,750,200,750,250

RETURN:
250,850,250,1300,200,750,200,750,250,1000,200,2000,200,750,200,750,250