同樣的東西我先做了一個來將 Panasonic 電漿電視遙控器發射的紅外線訊號轉發為 Kbro 機上盒用的紅外線訊號. 由於我的 Panasonic 電視有 Skype, Youtube, 螢幕縮放等功能, 所以使用原本的電漿電視遙控器比較方便:
遙控器後面的型號, 好像是 N20AYB:
用 IRrecvDump 抓出來的 Panasonic 電漿電視遙控器碼如下. 由於 Arduino IR library 抓不出 type, 所以是 Unknow type, 以下所有按鈕抓出的 raw data 長度都是 100, 由於有抓出 hash code 可以在程式中用於收訊號比對, 所以 raw data 列在文末備註:
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)
安裝凱擘數位機上盒之後, 多了一支白色遙控器, 由於不想用兩支遙控器(加我的Tivo就三支了), 這支遙控器就是準備封存的:
上面這支白色 kbro 的遙控器用 Arduino 也是無法抓出 type, 所以需要 raw data 作為發射訊號用. 一樣列在文末, kbro raw data 長度都是 18.
接下來是硬體部份, 和上一篇 IRreperter 的架構一模一樣:
架構很簡單, IR LED 接到 D3, IR receiver 接 D11.
材料盤點:
Arduino mini pro, IR LED, IR receiver (PL-IRM0101-3, datasheet), USB焊接公頭. 材料成本大約130元上下.
IR LED, 長腳接 D3, 短腳 GND:
IR receiver, 我用 PL-IRM0101-3, 不同型號三支腳順序不同, 請查看 datasheet, 有Vcc, Vout, GND 三支腳, Vout 接 D11:
USB焊接公頭拿來接5V電進 Arduino mini pro, 接 Vcc pin:
另一個主角, Arduino mini pro, 70元, DIY自用還可以, 但量產來說還是貴,
由於 Arduino pro mini 需要 USB上載器, 這裡拍個照:
連起來後:
杜邦接頭順序:
上載器 接 Arduino mini pro
DTR 接 DTR
RXI 接 TXO
TXO 接 RXI
VCC 接 VCC
GND 接 GND
杜邦線接接好之後一樣用 Arduino IDE compiler/upload 就可以了.
在上一篇已經用麵包板基本測過了, 所以開始用洞洞板佈局, 我的設計是將IR receiver放在尾端, IR LED 放在靠近 kbro 機上盒 IR 收訊窗的那一邊:
下圖是 kbro 機上盒的 USB 接口 和 IR 窗相對位置:
先貼個完成圖, 可以看到 LED 方向:
照佈局焊接, 下面的焊路:
左邊, 焊 IR LED, 盡量LED頂端向著收訊窗:
右邊, 我銲了母pin座, 讓 Arduino mini pro 可以有機會拔下來移作他用:
尾端有 IR receiver:
前端 USB 公頭, 從機上盒的 USB接口取 5V 電:
鐺鐺! 完成! 比起之前的 x61 底座 IR 改造工程簡單多了, 接下來測試:
當然不是只有硬體, 程式要upload進去, 程式在此:
https://github.com/smallbeetw/arduinosketch/blob/master/Panasonic2KbroIRtrans/Panasonic2KbroIRtrans.ino
程式很簡單, 就是將 Panasonic IR hash code 和 kbro raw code 作成一個 mapping table. 後續從 IR receiver 收進來的 IR code 和 mapping table 中的的 panasonic hash code 逐一比對, 如果有 match 就發出相對應的 kbro raw code.
反覆測試的過程中, 有修改程式的部份主要是 deley time, 測過之後用 30 效果最好.
以下為完成後的成果影片:
同樣的設備可以用來轉換 Locationfree 發射出來的 Tivo IR code 成為 Kbro IR code, 而不用擔心 IR code 沒有內建的問題. SlingBox 也可以用相同的方式解決找不到 IR code 的問題, 因為這些機器幾乎都有 Tivo IR code. 只要用 Tivo IR code 作為基礎來轉換成需要的機器, 可以延續 Locationfree 或 SlingBox 的壽命.
2014-12-12 補充:
一開始的設計並沒有把 kbro 機上盒的 power鍵和 Panasonic 電視的遙控器 power 鍵綁在一起, 但是這樣一來就需要設定 kbro 機上盒永遠開機狀態, 否則還是需要原本的遙控器來開機:
預設是24小時沒人操作就會自動關機:
後來改了程式將 power 鍵 binding 起來, 由於我的機上盒放在電視櫃內, 距離電視的收訊窗有一段距離, 有時候沒辦法完全同步, 所以另外再找一個遙控器上的DTV/TV鍵特別binding到 kbro 的power鍵. 詳細請看程式.
當power鍵binding之後, 就可以把自動待機時間調整短一點, 到12小時自動關機, 這樣就算沒有同步關到機上盒, 機上盒12小時後也會自動關機. 倒是那個3小時的選項有點太短了, 比較長的片子是有可能超過三小時, 應該弄個4或5小時的選項會比較有用:
2014-12-20 補充:
心血來潮用簡易USB電表量一下耗電:
kbro的機上盒耗電5V供電還算穩定:
我有兩台kbro機上盒, 另一台的前端USB就容易斷電, 機上盒品質還要加強.
另外量安培流量, 量不出來, 顯示0.00A已經小於簡易電表的最低解析度: 還算省電:
現在市面上有可以使用3A充電電池的USB充電盒, 所以可以嘗試用這樣的充電盒來供電. 缺點是這種USB充電盒不便宜, 也要三百元台幣左右.
2015-01-10 補充:
補充洞洞板的俯視圖和USB公頭的pin腳, 方便了解如何把電從USB頭接進Arduino:
2016-01-11 補充:
在一年的快樂使用後, 這兩天又做了另一個轉換器用來轉換 LF-BOX1的 Panasonic CATV1 code 給 kbro 機上盒用, 發現本篇抓的 raw code 無法用在比較舊的 kbro 機上盒. 無論 Arduino 用 IRremote 怎麼發都無反應. 可能 code 有不同. 如果想使用我抓的 raw code 的同好, 請先看一下您的機上盒是不是長這樣:
確切的完整 kbro 凱擘遙控碼在新的文章中:
[Arduino] 完整抓取 凱擘 kbro 遙控器紅外線原碼並發出重新發出以控制機上盒
more: [Arduino] 以 nRF24L01+ 和 RF24 library 製作無線電端點
more: [Locationfree] 製作紅外線遙控轉換器 IR translator LF-BOX1 Panasonic CATV/DVD 轉 Tivo
備註:
Panasonic 遙控器 Raw data:
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
kbro 遙控器 Raw data (已拿掉第一個 code, 長度為 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