Introduction: Netflix Button! Arduino IR Controlling Xbox 360
This is a Arduino that sends IR signals to turn on Netflix with the push of a button. It is a good example of using IR to control a TV, stereo, Xbox 360, or anything! This also goes into depth about using RAW IR codes, which is used to to allow any device to be recognized by an Arduino, even when it does not follow normal IR protocols... like an Xbox 360. There aren't many examples of using RAW IR or using IR signals in a multi-step process on Instructables, so this instructable will shed light on both of those areas.
Step 1: Build IR Receiving Circuit
The circuit is easy to build. The list of materials is as follows:
- Arduino
- IR emitter and reciever
- Button
The first circuit to build is the circuit to receive IR signals. Use the wiring diagram to help.
Step 2: Receive IR Signals
Use the code provided to receive raw and hex IR signals. The code for receiving hex is great for just about everything other than the Xbox. For some reason the Xbox is not a fan of using a known protocol and the raw code has to be used.
Go to this page to download the library that will allow you to send and receive IR codes. If you do not know how to add Arduino libraries, there are a lot of other instructables to help you out with that.
Once you start receiving codes on the serial monitor, copy and paste the codes you are receiving onto a word document. You will see why in the next step.
Attachments
Step 3: Collecting All of the IR Codes
Input all of the IR codes into a word document. For signals that are encoded into "NEC" or another known format, there is no more work to be done. For all codes with an "Unknown format", proceed with the rest of this step.
Delete the first number of the raw code. It is not used.
Then erase all of the negatives and separate each number with a comma. This is easily done by using "Find and Replace" and replacing "-" with "(space)" and then replacing "(space)(space)" with ",(space)".
Below is an example of the Xbox Power button.
Serial Monitor:
800FF40C
Decoded RC6: 800FF40C (36 bits) Raw (68): 14152 2650 -800 500 -400 450 -400 450 -850 450 -850 1350 -800 450 -400 500 -400 450 -400 450 -400 450 -400 450 -400 500 -400 450 -400 450 -400 450 -400 900 -450 450 -400 450 -400 450 -400 450 -400 500 -400 450 -400 450 -850 850 -850 450 -400 500 -400 450 -400 450 -400 450 -400 900 -400 500 -800 500 -400 450
Corrected Signal:
2650, 800, 500, 400, 450, 400, 450, 850, 450, 850, 1350, 800, 450, 400, 500, 400, 450, 400, 450, 400, 450, 400, 450, 400, 500, 400, 450, 400, 450, 400, 450, 400, 900, 450, 450, 400, 450, 400, 450, 400, 450, 400, 500, 400, 450, 400, 450, 850, 850, 850, 450, 400, 500, 400, 450, 400, 450, 400, 450, 400, 900, 400, 500, 800, 500, 400, 450
Fun Fact: The numbers shown here are the amount of time in nanoseconds that the LED is on and off. The amount of time on and off is translated into 1's and 0's
Step 4: Build Circuit to Send IR Signals
The circuit to send IR signals is very simple also. The diagram I have is using an IR led and a resistor. You can also use an IR led module like I did here.
Step 5: Code for Sending IR Signals
The entire Netflix automation code is attached. The code uses raw IR signals for the Xbox and uses hex protocol for the TV and stereo so you can see the differences between the two. I put comments throughout so that way you can easily change the code to match your TV, stereo, etc.
Note: I had a nasty time turning on the Xbox. I found out that for whatever reason, to turn on the Xbox, it alternates between the home button and the power button. This is easily fixed by just sending both codes.
Note: To turn off the Xbox, simply using the power button works. I just had it scroll though the menu just because it looks cool.
Attachments
Step 6: Enjoy Watching Netflix With the Push of a Button!
Once the code is uploaded onto your Arduino, you will be all set to automate your Xbox, TV, and ANY IR device! Thank you.