Raspberry Pi IR remote

I wanted to use the Raspberry Pi as a remote control for my TV, so I searched the internet and found a pretty good guide by Alex Bain.
So all credits goes to him!

I then created a TV-guide webapp, where I could click on a channel to switch to that channel on the TV.
It’s webbased but I haven’t exposed it to the internet, so it only works when I’m home 🙂

Images of the final assembly

(Ignore the circuit connected with the green and red wire, its a RF tranmitter, which I will post about later)

Video demo

Installing the distro

I had a old spare 1GB SD card laying around, so first thing I did was install Moebius which is a very small Raspberry Pi distro, that fits the 1GB nicely 🙂
I don’t know what class the card is, but I don’t think it really matter, as performance is not a issue here.

To install the image to a SD-card, I followed the guide from RPi Easy SD Card Setup. (I used the program Pi-Writer.)

Creating IR transmitter

I made the electronic from Alex’ schematic, and soldered the components on a stripboard.
I bought my parts from my local electronics store:
2 x IR-LED
2 x LED holder
1 x IR receiver
1 x NPN transistor
1 x 10 kΩ resistor
1 x 2×13 pin connector
1 x stripboard

Installing LIRC

Follow the guide here.

Installing a web server

Just for good measure reboot the Raspberry Pi

sudo reboot

When it’s back up and running, we now install the webserver and PHP

sudo apt-get -y install lighttpd
sudo apt-get -y install php5-common php5-cgi php5

#enable fastcgi module included with lighttpd
sudo lighttpd-enable-mod fastcgi fastcgi-php

#The following restarts the webserver
sudo service lighttpd force-reload

Now we need to setup some permissions for the webserver.

#change the owner of /var/www to www-data (user and group)
sudo chown www-data:www-data /var/www

#gives user and group read/write/execute rights to /var/www
sudo chmod 775 /var/www

#adds the user pi to the group www-data
sudo usermod -a -G www-data pi