I'm using Rapsberry Pi 3 based Kodi mediacenter to watch movies, TV series, pictures and listen music. I like to keep it switched off if it is not in use – it is not a problem to switch it off but to switch it on again I have to physically go to its AC/DC adaptor (5 steps! – a real exercise!), unplug it and plug it again to start my Kodi. I know it should be possible to wake up Rapsberry using Wake on LAN, nevertheless I was never succesfull to configure and use this functionality.
Rapsberry Pi 3 is powered using the standard micro USB connector (5, 5 V), so I decided to build an Arduino Nano based IR controlled power switch. I wanted to use the IR controler I use for operating my TV and Kodi, so I found two buttons (AD
and SUBT.
) on it I never used and decided to learn Arduino to understand these two command for switching the power for Rapsberry on and off.
I took the inspiration from this project – http://www.instructables.com/id/Arduino-Infrared-Remote-tutorial/ – and I built based on it a simple IR receiver which copies the IR signals received by IR receiver attached to PIN 11 to serial monitor. This was needed to find out which codes are emited when my two buttons are pressed. I found out that each button is randomly (?) sending two different codes (HEX - DEC):
AD E0E0E41B - 3772834843 or 37A03AA2 - 933247650
SUBT. E0E0A45B - 3772818523 or A51FEC3E - 2770332734
Not a big deal to react adequately on both of them.
So I extended the original project with relay attached to PIN 12. This relay switches on and off the power for Rapsberry Pi 3. Whole electronics is powered by the same adaptor (it is located before the relay so it is always powered when the adaptor is plugged in.
Laziness won and I do not need to stand up from my sofa to switch of my mediacenter. Next challenge is to build a robot which would bring me cold beer from a fridge ;-)
Finally I added one red LED (PIN 10) which copies the statuses of relay and works as a visual controll. (I think to reverse its logic not to disturb when Kodi is on and I'm watching TV). Whole the used electronic fits in a box from Xiaomi Band I had on my table for ages. (Yes – I definitely need to buy a 3D printer to be able to print nice boxes – I have to explain this to my wife ;-))
Comments