Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
失くしたリモコンを作る
Search
Kenta
January 14, 2022
Technology
57
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
失くしたリモコンを作る
Raspberry Pi でエアコンのリモコンを作った話
Kenta
January 14, 2022
More Decks by Kenta
See All by Kenta
『Verylで作るCPU』を読んでいる
kenta11
0
220
マイクロプログラム制御方式のCPUを自作した話
kenta11
0
500
Elixirで作る将棋ソフト
kenta11
0
170
失くしたリモコンを作る2
kenta11
0
110
Other Decks in Technology
See All in Technology
全員がプロダクトへ向き合う組織を持続成長させるために——組織づくりのフライホイールと4象限 / The Flywheel Model and Four Quadrants for Organizational Design
hiro_torii
4
910
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
2
320
こんなアーキテクチャ図は嫌だ BEYOND THE TIME: 半年後の自分へ贈る15のメッセージ / 15 of Anti-pattern in AWS Architecture Diagrams
naospon
3
270
ブラウザアプリの継続的パフォーマンスモニタリング (序) / Continuous Browser Application Performance Monitoring; Act 1
moznion
0
110
Sigmaユーザーのための有用リソース一挙公開 & Sigmaで使えるMCP #sigma_ucj /useful-resources-for-sigma-computing-users-and-mcps-with-sigma
shinyaa31
0
160
Deploying a Full-Stack Bun-Native Framework on Cloudflare Workers
7nohe
0
110
データエンジニアの困りごとをDevinと一緒に解消する
10xinc
2
860
Claude Code本って、 読む必要あるの?
oikon48
1
120
多層防御と最⼩権限で実現する、安全なAIエージェント設計パターン
lycorptech_jp
PRO
1
220
AIに丸投げしないトイル削減 / Eliminating Toil Without Leaving It All to AI
kohbis
4
1k
Multica × 長期記憶:40個のミニプロジェクト管理
eiei114
1
210
AIとペアプロを始める。人とのペアプロをやめる。ペアプロの良さを改めて知る。もっと好きになった。 / Rediscovering Pair Programming
honyanya
1
290
Featured
See All Featured
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.1k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
190
The Curse of the Amulet
leimatthew05
2
14k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
310
Making Projects Easy
brettharned
120
6.7k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
230
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
260
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Scaling GitHub
holman
464
140k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Transcript
失くしたリモコンを作る Kenta Arai 2022/01/14 某イベント 1
はじめに • エアコンのリモコンを失くしました • と言っても、かれこれ5年以上は見ていません • 今は二つの部屋で1つのリモコンを使いまわしています →「今のリモコンを失くしたら終わり」な状況が続いている • 不要なリモコンを見つけました
• 以前テレビを処分したのだが、そのリモコンはほったらかしだった • 不要なリモコンを再利用して、エアコンのリモコンを作れないだろう か? • 実用性を兼ねた趣味 • ジャンクの再利用なのでエコかも 2022/01/14 某イベント 2
リモコン製作までの道 • 方針:手軽に作る • リモコンの完成像:Raspberry PiにLEDやボタンを付けてリモコン化する リモコンの信号を計測 信号を解析 意図した信号を出力する リモコンを構築
2022/01/14 某イベント 3
信号を計測する~ハードウェア編~ • 信号を読み取るのもラズパイで • 赤外線受信モジュールをGPIOと接続し、信号を読めるようにする 2022/01/14 某イベント 4
信号を計測する~ソフトウェア編~ • irrp.py(IR Record and Playback)を利用して信号を読む • 信号がオンの時間とオフの時間が交互に表示される • 波形としてプロットするとこんなかんじ
2022/01/14 某イベント 5
信号を解析する(1/3) • インターバル(真ん中の長いオフの時間帯)を挟んで、同じ信号が2回 出ている • 暖房 • 冷房 • ドライ
00001110 11110001 11000011 00111100 00001111 10100101 00001111 00001111 00001111 00001110 11110001 11000011 00111100 00001111 10100101 00001111 00001111 00001111 00001110 11110001 01001011 00111100 00001111 10100101 00001111 00001111 00001111 00001110 11110001 01001011 00111100 00001111 10100101 00001111 00001111 00001111 00001110 11110001 10000111 00111100 00001111 10100101 00001111 00001111 00001111 00001110 11110001 10000111 00111100 00001111 10100101 00001111 00001111 00001111 2022/01/14 某イベント 6
信号を解析する(2/3) • 黒枠のビット列が違う値になっている • 暖房 • 冷房 • ドライ 00001110
11110001 11000011 00111100 00001111 10100101 00001111 00001111 00001111 00001110 11110001 01001011 00111100 00001111 10100101 00001111 00001111 00001111 00001110 11110001 10000111 00111100 00001111 10100101 00001111 00001111 00001111 2022/01/14 某イベント 7
信号を解析する(3/3) • バイト列はそれぞれ下記の通り • 暖房:0xC3 • 冷房:0x4B • ドライ:0x87 •
暖房→ドライ→冷房の順に、 • 下位4ビットは4ずつ増えている • 上位4ビットは4ずつ減っている • また上位4ビットをビット反転すると、下位4ビットになる 2022/01/14 某イベント 8
我が家のリモコンの信号フォーマット • Parity: Data0のビット反転 • Data0: 運転状態(暖房→0x3、ドライ→0x7、冷房→0xB、停止→0xF) • Data1: 風量(自動→0x0F、弱→0x1E、中→0x2D、強→0x3C)
• Data3: 気温((t-15)*0x0F。ただし16≦t[℃]≦30) • その他は使いたい機能とは関係が無さそうなので深追いしない Customer code Parity (4bits) Data0 (4bits) Data1 Data3 Data2 Data5 Data4 Data6 byte offset 0 2 4 6 8 8bit 8bit 2022/01/14 某イベント 9
リモコンを構築 • 機能 • 暖房、冷房、電源オフができる • LEDでエアコンの運転状態 (暖房、冷房、電源オフ)が分かる 2022/01/14 某イベント
10
完成したリモコン 2022/01/14 某イベント 11 ボタンを押すと… エアコンが起動した!
まとめと反省 • 不要なリモコンを再利用し、エアコンのリモコンを作ることができた • ジャンクを再利用したが、本当にエコなのか? • リモコンは単四電池2つでX年もつが、ラズパイはコンセントから常に電源を とっている • スマートリモコンを目指すとラズパイを使った甲斐があるかもしれな
い • 足したら面白そうな機能:部屋の状態(気温、湿度、CO2量)のモニタ、Alexa と連動など 2022/01/14 某イベント 12