Good Morning All,
I have been working for a few days on trying to interface my arduino to my portable AC unit in my home office. The air conditioner in question is
The AC has an existing remote and I have already use the IR library to steal the codes from existing remote. I have built a circuit using IR leds from remotes I salvaged as well as 2 brand new IR leds. I tried with and without a transistor. I even went as far as to use 2 arduinos and had one as a receiver and the other sending to ensure I am sending the same code as the remote was.
So far to no avail. So I am curious. Has anyone else done any work with building IR transmitters? Is there something I am missing in the circuit. Should I be using specific transistors? Maybe I need to add a cap like some of the TV B Gone projects I have seen.
Here is the latest code I am using to send.
int IRledPin = 3; // IR emitter LED connected to digital pin 3
int orangeLedPin = 7; // Orange LED connected to digital pin 7
int buttonPin1 = 4; // "Send" push-button connected to digital pin 4
int buttonState1 = 0;
void setup() {
// Initialize the Orange LED pin as an output
pinMode(orangeLedPin, OUTPUT);
// Initialize the "Send" push-button pin as an input
pinMode(buttonPin1, INPUT);
// Initialize the IR digital pin as an output
pinMode(IRledPin, OUTPUT);
// Set uart baudrate
Serial.begin(9600);
}
void loop() {
// Read the state of the "Send" push-button value
Serial.println("send code");
SendIRCode();
//delay(15); // wait 15 milliseconds before sending it again
//SendIRCode(); // repeat IR code if it is neccesary
delay(10000); // wait 5 seconds to resend the code
}
// This procedure sends a 38KHz pulse to the IRledPin for a certain # of microseconds.
void pulseIR(long microsecs) {
cli(); // Turn off any background interrupts
while (microsecs > 0) {
// 38 kHz is about 13 microseconds high and 13 microseconds low
digitalWrite(IRledPin, HIGH); // 3 microseconds
delayMicroseconds(10); /* hang out for 10 microseconds,
you can also change this to 9 if its not working */
digitalWrite(IRledPin, LOW); // 3 microseconds
delayMicroseconds(10); /* hang out for 10 microseconds,
you can also change this to 9 if its not working */
// So 26 microseconds altogether
microsecs -= 26;
}
sei(); // Turn them back on
}
void SendIRCode() {
cli();
pulseIR(3440);
delayMicroseconds(1620);
pulseIR(480);
delayMicroseconds(1240);
pulseIR(480);
delayMicroseconds(1280);
pulseIR(440);
delayMicroseconds(440);
pulseIR(460);
delayMicroseconds(420);
pulseIR(480);
delayMicroseconds(420);
pulseIR(460);
delayMicroseconds(1280);
pulseIR(440);
delayMicroseconds(420);
pulseIR(480);
delayMicroseconds(420);
pulseIR(480);
delayMicroseconds(1240);
pulseIR(500);
delayMicroseconds(1240);
pulseIR(460);
delayMicroseconds(440);
pulseIR(460);
delayMicroseconds(1240);
pulseIR(480);
delayMicroseconds(420);
pulseIR(480);
delayMicroseconds(420);
pulseIR(480);
delayMicroseconds(1240);
pulseIR(480);
delayMicroseconds(1240);
pulseIR(480);
delayMicroseconds(420);
pulseIR(460);
delayMicroseconds(1280);
pulseIR(440);
delayMicroseconds(1240);
pulseIR(500);
delayMicroseconds(420);
pulseIR(460);
delayMicroseconds(420);
pulseIR(460);
delayMicroseconds(440);
pulseIR(440);
delayMicroseconds(440);
pulseIR(460);
delayMicroseconds(420);
pulseIR(460);
delayMicroseconds(460);
pulseIR(440);
delayMicroseconds(440);
pulseIR(460);
delayMicroseconds(1260);
pulseIR(460);
delayMicroseconds(1260);
pulseIR(460);
delayMicroseconds(1280);
pulseIR(440);
delayMicroseconds(1280);
pulseIR(460);
delayMicroseconds(1260);
pulseIR(440);
delayMicroseconds(440);
pulseIR(460);
delayMicroseconds(440);
pulseIR(460);
delayMicroseconds(440);
pulseIR(460);
sei();
}
I am considering getting http://www.cooking-hacks.com/documentation/tutorials/control-hvac-infrared-devices-from-the-internet-with-ir-remote/ since it claims to be for HVAC already but i am not sure if its really any different than what I have already built.
Thanks