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
RPi-and-restroom
Search
fukayatsu
January 15, 2014
Technology
1
290
RPi-and-restroom
Check restroom is occupied/vacant using Raspberry Pi
fukayatsu
January 15, 2014
Tweet
Share
More Decks by fukayatsu
See All by fukayatsu
esaを支える技術と気持ち
fukayatsu
7
2.9k
esa.ioの育て方
fukayatsu
28
9k
[WIP] esa.io、その後の話
fukayatsu
20
6.6k
esaを支える睡眠を支える技術
fukayatsu
18
6.5k
esa.io - 趣味から育てたWebサービスで生きていく
fukayatsu
62
61k
esa-kai
fukayatsu
1
360
あなたの知らないesa
fukayatsu
0
310
楽しいesaの作り方
fukayatsu
0
270
tqrk07-fukayatsu.pdf
fukayatsu
3
440
Other Decks in Technology
See All in Technology
データモデリング通り #2オンライン勉強会 ~方法論の話をしよう~
datayokocho
0
110
o11yツールを乗り換えた話
tak0x00
1
370
マルチモーダル基盤モデルに基づく動画と音の解析技術
lycorptech_jp
PRO
4
540
隙間時間で爆速開発! Claude Code × Vibe Coding で作るマニュアル自動生成サービス
akitomonam
3
250
生成AI導入の効果を最大化する データ活用戦略
ham0215
0
110
Oracle Cloud Infrastructure:2025年7月度サービス・アップデート
oracle4engineer
PRO
1
120
AI時代の経営、Bet AI Vision #BetAIDay
layerx
PRO
1
1.8k
みんなのSRE 〜チーム全員でのSRE活動にするための4つの取り組み〜
kakehashi
PRO
2
140
人に寄り添うAIエージェントとアーキテクチャ #BetAIDay
layerx
PRO
8
2k
Google Cloud で学ぶデータエンジニアリング入門 2025年版 #GoogleCloudNext / 20250805
kazaneya
PRO
17
3.2k
LLMをツールからプラットフォームへ〜Ai Workforceの戦略〜 #BetAIDay
layerx
PRO
1
880
Lambda management with ecspresso and Terraform
ijin
2
150
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
A designer walks into a library…
pauljervisheath
207
24k
Building Applications with DynamoDB
mza
95
6.5k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.9k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
1k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
139
34k
Facilitating Awesome Meetings
lara
54
6.5k
Faster Mobile Websites
deanohume
308
31k
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.4k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.4k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
GitHub's CSS Performance
jonrohan
1031
460k
Transcript
PRi on Toilet @fukayatsu
ઌिʹΑ͏͘ RPiΛ࢝Ί·ͨ͠ RPi = Raspberry Pi
ͱ͜ΖͰɺ
ฐࣾΦϑΟεͷ
τΠϨ͕ࠞΜͰΔ • ϑϩΞͷஉੑ10ਓʹରͯ͠τΠϨ1͚ͭͩɻ • ͦΕҎ֎ͩͱ֎ͷίϯϏχͷτΠϨΛआΓΔ͙ Β͍͔͠ͳ͍ɻ • ԿճτΠϨΛ֬ೝ͠ʹߦ͘ͷ͕໘͍͘͞ɻ
ͦ͜Ͱɺ
None
None
͜ΕԿʁ • RPi + ֎ઢηϯα + Wifiυϯάϧ • τΠϨ͕༻த͔Ͳ͏͔Λఆظతʹαʔόૹ৴
None
ࡢ͔ΒՔಇத http://ucchusma.herokuapp.com/api/v1/rooms/1
γεςϜશମ૾
RPi্ͷεΫϦϓτ • cat /sys/class/gpio/gpio4/value • => 1 (͍Δ) or 0
(͍ͳ͍) • ্هͷ݁ՌΛఆظతʹAPIαʔόʹૹ৴(Ruby) • ࣮ࡍʹۙ30ඵؒͰ5ඵҎ্Ԡͨ͠߹ ʹ”༻த”ͱஅ
APIαʔό • on Heroku • Sinatra + Grape + Redis
• /api/v1/rooms/1ʹରͯ͠GETɾPUTΛڐՄ • PUT࣌token͕ඞཁ
Chrome ֦ு • ఆظతʹAPIΛνΣοΫͯ͠ΞΠίϯΛม͑Δ
before & after • ಋೖલ • ʮ͏ʔτΠϨτΠϨʯ=>ʮ͋ɺ༻த͔…ʯ => ʮ·ͨޙͰདྷΑ͏ʯ=> ޙ࠷ॳʹΔ
• ಋೖޙ • ʮ͓ɺτΠϨۭ͍ͨͳɻʯ=> ʮ;͎…ʯ
RPiΛ͍͡Δ࣌ͷTips • δϟϯύϫΠϠ(Φε-ϝε)͕͋Δͱศར • GPIOͷinput5VͰͳ͘3.3V • ৄ͘͠blogͰʂ • blog.fukayatsu.com/2014/01/12/rest-room-api/
࣍ճ࡞ • ΦϑΟεͷΠϯλʔϗϯతͳͭ • ϘλϯΛԡͨ͠Βࣸਅ͖Ͱhipchatʹ௨ • ͍ͭͰʹTweet͢ΔϘλϯ͕͍͍͋ͬͯ • ిݯͷऔΓճ͕͠ωοΫ
ײ • ϋϯμָ͚͍͠ • Rubyָ͍͠ • ࣗͷੜ׆Λศརʹ͢ΔͷΛ࡞Δͷ࠷ߴʹ ָ͍͠ = RPi͓͢͢Ί
ؔ࿈ϓϩδΣΫτ • ϔϒϯζŋυΞɹʙࢲ͕ߦͬͨΒۭ͍ͯΔτΠϨʢ by νʔ ϜϥϘMAKE෦ ʣ • http://heavens-door.info/ •
ͪ͜Βmbedɻηϯαʔಉͬ͡Ά͍ • Peeping Tom in the toilet with Raspberry Pi • http://www.raspberrypi.org/archives/4509 • RPi + webcamɻτΠϨʹwebcamͬͯ…