This includes cameras, TV's, DVD players, VCR's, you get the point.
I will be showing you how to receive the codes, and then how to transmit them.
Objects required for this project:
1x Arduino (any kind as long as it has whats called "PWM" which I will explain)
1x IR LED (you can get these from any TV remote)
1x IR reciever (see picture)
1x USB A to B wire for programming the Arduino
1x Computer to program the Arduino with
1x Arduino software
and the .PDE files I will include
This website really helped me out a lot with this. http://www.ladyada.net/learn/sensors/ir.html
THIS IS NOT MY CODE, I DO NOT CLAIM OWNERSHIP. I merely copied and pasted the code and rewrote the instructions to make this easy to understand.
IF YOU DO ANYTHING ILLEGAL WITH THIS CODE I WILL NOT BE HELD RESPONSIBLE (which I think is probably not a problem).
Remove these ads by
Signing UpStep 1: Preparing to Receive Signals
You can get one here: http://www.adafruit.com/products/157
They cost $2 not including shipping and handling.
So you want to hook up the receiver according to the first picture.
I highly suggest putting both the IR Receiver and the remote in a shoe box or something that is dark (the same shoe box of course). This will insure there will be the least amount of interference and to have clearer code so you don't have to program your Arduino 12 times for one simple task. Also, make sure you are out of the way of people watching TV.
And you want to download the file named IR_RECORD.PDE and open it into the Arduino program.
Plug your Arduino in with the USB cable I hope you have and proceed to step 2!








































Visit Our Store »
Go Pro Today »




so that means u giving 280us to void pulseIR(). which means there would be 10 pulse send to receiver. so does it means it goes 10 channels up??? If yes what about ur 20 sec delay??
I'm not trying to be offensive; it's just the way you worded it is a little weird.
And Thank you very much for your time, Great that there are nice people like you! :)
Thanks for this great tutorial! working really well, but i have a question how can you make this work with a manual switch?.
All you have to do is in "void loop" is to make it check if the button is being pushed, and if it is, send out the IR code once. Make sure to debounce the button either through software, or a resistor hooked up to ground. (Check the "button" example in the Arduino IDE)
To make life even easier, you could define each remote send command as a class, and call each class when you push different buttons. It'll work just like a regular remote that way, and make your life a bit easier.
If you need help with either of the above, feel free to contact me and I will definitely help you out.
i modified the serial output in the RECEIVE sketch so that it can be directly copied and pasted into the SEND sketch already formatted:
------
Serial.print("delayMicroseconds(");
Serial.print(pulses[i][0] * RESOLUTION, DEC);
Serial.print("); ");
Serial.print("pulseIR(");
Serial.print(pulses[i][1] * RESOLUTION, DEC);
Serial.println(");");
------
Why use delayMicrosecond and don't simply delay? The value of delay is in ms, is not?
us=microseconds
Thanks, I work with us many times and in this case didn't see it...
typedef struct irCode {
int off;
int on;
} codes[34];
codes[0] = {36328, 280};
.
.
.
codes[33] = {700, 240};
then use this code to send it
for (cx=0; cx<34; cx++) {
delayMicroseconds(codes[cx].off);
pulseID(codes[cx].on);
}