Introduction: Raspberry Pi Universal Remote
In this tutorial I hope to convince you that this is the ultimate universal remote built using a raspberry pi.
LIRC is the perfect for this job. It simplifies many of the more difficult tasks that we need to accomplish.
Step 1: Parts
1 x Raspberry Pi (https://www.sparkfun.com/products/11546)
1 x IR Emmitter (http://www.amazon.com/gp/product/B005BJFDL6/ref=oh...
1 x Audio Breakout Board (https://www.sparkfun.com/products/11570
1 x IR sensor (https://www.sparkfun.com/products/10266)
1 x 2N3906 (https://www.sparkfun.com/products/522)
1 x Female Headers (https://www.sparkfun.com/products/115)
1 x Make Headers (https://www.sparkfun.com/products/116)
1 x Perf Board
Step 2: Setting Up the Software
(Most of this step is from: http://alexba.in/blog/2013/01/06/setting-up-lirc-on-the-raspberrypi/ )
For the sake of this tutorial i'm assuming this is on a clean Raspbian image.
Set up the GPIO pins (remember this for later if you want to use other pins)
Add these 2 lines to the bottom of the file
(CONTROL + C will save and exit)
Configure the hardware file.
Erase the contents and paste this file
# Arguments which will be used when launching lircd
# Don't start lircmd even if there seems to be a good config file
# Don't start irexec, even if a good config file seems to exist.
# Try to load appropriate kernel modules
# Run "lircd --driver=help" for a list of supported drivers.
# usually /dev/lirc0 is the correct setting for systems using udev
# Default configuration files for your hardware if any
Reboot the Pi
Step 3: Making LIRC Files
Run the command and press remote buttons at the sensor and you should get some feedback
(CONTROL + C to stop)
Next we run the fallowing command wile in the pi directory to record the remote commands
Fallow the instructions provided
When it asks for key names you must use the predefined names. To get the names I like to open a new window and run the command.
Once you have finished recording, open out.conf
copy from "begin remote" all the way to "end remote" and open /etc/lirc/lircd.conf
Erase the content and paste the code and save.
Assign a name to the remote by replacing the line in the .conf that has a file path after NAME:
Repeat this for all the remotes you want to use
Reboot the Pi
Step 4: Building the Board
The idea here is to build the circuit form the schematic above (the nice one) and replace the LEDs with an IR emitter instead. As you can see in the circuit above (the bad one) the tip of the headphone board is +5v and one of the rings must be connected to the transistor. The Pi does not go fast enough to run the LED itself It must have the transistor to work.
I started by soldering 2 female headers side by side on a perf board.
Then I added the circuit and trimmed the excess perf board off.
Step 5: Now What?
execute remote command to devices with lines like
(device being the name you assigned to it)
Having a raspberry pi so close to you entertainment center with the ability to turn itself on is a great place to start.
I have set up a MySQL DB and written a PHP file to execute these. Then made a simple HTML page to call these PHP files.
You could write a batch file run a sequence of commands.
I plan to write an App on my phone that will control everything.
The possibilities are endless
As requested here are my html and php files. The SQL is a simple table with 3 fields.
The second field is the command I give the PHP file.
The third is the key that is executed (KEY_POWER).
If you enjoyed this tutorial please vote for it!
KalaiyarasanE made it!
We have a be nice policy.
Please be positive and constructive.