So I have this IR transmitter
and I found interesting to control my TV with this transmitter. I got the hex codes from my remote TV control using an ir receiver and I put the volume up code in this sketch:
#include <IRremote.h>
IRsend irsend;
void setup() {
Serial.begin(9600);
}
void loop() {
for (int i = 0; i < 50; i++) {
irsend.sendNEC(0xFD02FB04, 32);
delay(300);
}
}
I connected the transmitter's negative leg with my Arduino's GND and the positive leg to the Arduino's pin 3 (that's what I saw from the tutorial I was watching). Also between the positive leg and pin 3 I placed two 220 Ohm resistors in parallel so the total resistance is 110 ohms. That's what the circuit looks like:
After uploading my code I placed the IR transmitter next to my TV's IR receiver but nothing happened. I also tried to check the transmitter with my phone's camera but I didn't see any light, like when I do it with my TV remote.
I'm sure the IR transmitter works because I did a project where I could find the distance of an object using the same transmitter and an IR receiver.
That's what I was thinking but that's what the guy on the tutorial did. Also, there were no comments saying how does the arduino know in what pin the led is connected. All the comments were saying thank you, you solved my problem etc.
@thanasisk09
Many IR transmitters needs a current that exceeds the maximum of arduino pin, so is probably that you need a transistor driver to power the transmitter.
Also I recommend to see the library examples, because your code is not looks complete.
* Pin mapping table for different platforms
*
* Platform IR input IR output Tone Core/Pin schema
* --------------------------------------------------------------
* DEFAULT/AVR 2 3 4 Arduino
Yes. I think the problem is in the code. I will find another one online because the example is too complex. Do you know what resistance I should use for the IR receiver? I don't want to damage anything because the first site I saw didn't use any resistors in it's circuit diagram.