Sending AC on signal to AlpicAir

Everything related to protocols and IR codes
Post Reply
onic
Posts: 5
Joined: Wed Jan 12, 2022 4:24 pm

Sending AC on signal to AlpicAir

Post by onic »

Hello everyone,
I am trying to turn on air conditioner from Arduino yun board.
the bord is running fine I tested it by turning on my TV.
I recorded IR code from remote control and skipped first value also deleted (-) signs. But nothing happened then send the signal.
Any suggestions where I am wrong.....

test code without any other stuff-->
#include <Arduino.h>
#define IR_SEND_PIN 13
#define WARNING_PIN 2
#include <IRremote.hpp>
#include "PinDefinitionsAndMore.h"

void setup(){
pinMode(WARNING_PIN,OUTPUT);
Serial.begin(9600);
digitalWrite(WARNING_PIN, 0);
#if defined(IR_SEND_PIN)
IrSender.begin();
#else
IrSender.begin(IR_SEND_PIN, ENABLE_LED_FEEDBACK);
#endif
IrSender.enableIROut(38);

}
uint16_t sAddress = 0x0102;
uint8_t sCommand = 0x34;
uint8_t sRepeats = 1;

const uint16_t irSignal[] = {4460, 676, 1632, 672, 532, 676, 560, 648, 1632, 672, 560, 648, 560, 652, 552, 656, 552, 644, 1636, 680, 1628, 672, 1636, 680, 524, 672, 564, 648, 1632, 680, 556, 652, 1628, 676, 1632, 680, 1628, 676, 1632, 680, 552, 648, 560, 648, 1632, 680, 1628, 676, 556, 652, 556, 652, 556, 652, 552, 652, 556, 648, 1632, 680, 552, 648, 1632, 680, 552, 648, 560, 648, 1632, 680, 556, 656, 19956, 684, 1624, 676, 532, 680, 1628, 672, 560, 648, 560, 652, 1628, 672, 1636, 680, 552, 656, 552, 644, 560, 652, 556, 652, 552, 656, 552, 644, 564, 648, 1632, 680, 1628, 676, 556, 652, 552, 656, 552, 648, 560, 648, 560, 648, 556, 652, 556, 652, 552, 648, 560, 648, 556, 652, 556, 652, 556, 644, 1636, 676, 1632, 672, 536, 672, 532, 676, 39976, 9016, 4464, 676, 1628, 684, 524, 672, 560, 652, 1628, 672, 536, 676, 532, 676, 532, 676, 556, 652, 1628, 676, 1632, 680, 1628, 676, 532, 676, 528, 680, 1628, 676, 532, 676, 1632, 680, 1628, 676, 1632, 680, 1628, 676, 528, 680, 552, 648, 1632, 680, 1628, 676, 532, 676, 560, 648, 528, 680, 528, 672, 560, 648, 560, 648, 1632, 672, 1636, 676, 532, 680, 524, 684, 1624, 676, 532, 680, 19960, 680, 528, 680, 1624, 680, 528, 680, 1628, 676, 532, 676, 556, 652, 528, 680, 552, 656, 1624, 680, 528, 680, 556, 652, 1628, 676, 1628, 676, 532, 676, 532, 676, 1632, 680, 524, 676, 1632, 680, 1628, 676, 1632, 680, 1628, 676, 1632, 680, 528, 680, 528, 672, 1636, 676, 1632, 672, 532, 676, 532, 680, 1628, 672, 532, 676, 1632, 684, 1624, 676, 39972, 9020, 4460, 676, 1632, 684, 524, 672, 532, 676, 1632, 684, 524, 672, 560, 648, 532, 680, 528, 680, 1624, 676, 1632, 684, 1624, 676, 532, 680, 552, 656, 1624, 680, 528, 680, 1628, 672, 1636, 680, 1628, 672, 1636, 680, 528, 680, 552, 644, 1636, 680, 1628, 672, 532, 680, 556, 652, 552, 656, 528, 672, 532, 676, 1632, 680, 1628, 676, 1632, 680, 528, 680, 552, 648, 1632, 680, 528, 680, 19960, 680, 528, 672, 560, 648, 556, 652, 556, 652, 556, 644, 560, 648, 560, 648, 556, 656, 552, 656, 552, 644, 560, 652, 556, 652, 556, 652, 552, 656, 524, 676, 556, 652, 556, 652, 552, 656, 552, 648, 532, 676, 556, 652, 556, 652, 552, 648, 560, 648, 532, 676, 556, 656, 552, 656, 548, 648, 1632, 684, 524, 684, 548, 648, 560, 652, 39972, 9016, 4464, 672, 536, 676, 532, 676, 556, 652, 556, 652, 552, 648, 560, 648, 556, 652, 556, 652, 552, 648, 560, 648, 560, 648, 556, 652, 556, 656, 552, 648, 556, 648, 560, 652, 552, 656, 552, 644, 560, 652, 556, 652, 556, 652, 552, 644, 564, 648, 556, 652, 556, 652, 552, 648, 560, 648, 556, 652, 556, 652, 1628, 676, 532, 676, 1632, 680, 552, 648, 1632, 680, 528, 680, 19960, 680, 524, 676, 560, 648, 556, 652, 556, 652, 556, 644, 560, 648, 556, 652, 556, 652, 552, 648, 560, 648, 560, 648, 560, 652, 552, 656, 552, 644, 560, 652, 556, 652, 556, 652, 528, 672, 560, 648, 532, 676, 556, 652, 552, 656, 552, 648, 560, 648, 556, 652, 556, 652, 552, 648, 560, 648, 560, 648, 1632, 684, 548, 648, 1632, 680};

void loop() {
if (Serial.read() != -1) {
for (int i = 0; i < 3; i++) {
IrSender.sendRaw(irSignal, sizeof(irSignal) / sizeof(irSignal[0]), NEC_KHZ); // Note the approach used to automatically calculate the size of the array.
digitalWrite(WARNING_PIN,1);
delay(40);
}
}
digitalWrite(WARNING_PIN,0);
}

the several signals I received are below-->
Raw: (559) 9020, -4460, 676, -1632, 672, -532, 676, -560, 648, -1632, 672, -560, 648, -560, 652, -552, 656, -552, 644, -1636, 680, -1628, 672, -1636, 680, -524, 672, -564, 648, -1632, 680, -556, 652, -1628, 676, -1632, 680, -1628, 676, -1632, 680, -552, 648, -560, 648, -1632, 680, -1628, 676, -556, 652, -556, 652, -556, 652, -552, 652, -556, 648, -1632, 680, -552, 648, -1632, 680, -552, 648, -560, 648, -1632, 680, -556, 656, -19956, 684, -1624, 676, -532, 680, -1628, 672, -560, 648, -560, 652, -1628, 672, -1636, 680, -552, 656, -552, 644, -560, 652, -556, 652, -552, 656, -552, 644, -564, 648, -1632, 680, -1628, 676, -556, 652, -552, 656, -552, 648, -560, 648, -560, 648, -556, 652, -556, 652, -552, 648, -560, 648, -556, 652, -556, 652, -556, 644, -1636, 676, -1632, 672, -536, 672, -532, 676, -39976, 9016, -4464, 676, -1628, 684, -524, 672, -560, 652, -1628, 672, -536, 676, -532, 676, -532, 676, -556, 652, -1628, 676, -1632, 680, -1628, 676, -532, 676, -528, 680, -1628, 676, -532, 676, -1632, 680, -1628, 676, -1632, 680, -1628, 676, -528, 680, -552, 648, -1632, 680, -1628, 676, -532, 676, -560, 648, -528, 680, -528, 672, -560, 648, -560, 648, -1632, 672, -1636, 676, -532, 680, -524, 684, -1624, 676, -532, 680, -19960, 680, -528, 680, -1624, 680, -528, 680, -1628, 676, -532, 676, -556, 652, -528, 680, -552, 656, -1624, 680, -528, 680, -556, 652, -1628, 676, -1628, 676, -532, 676, -532, 676, -1632, 680, -524, 676, -1632, 680, -1628, 676, -1632, 680, -1628, 676, -1632, 680, -528, 680, -528, 672, -1636, 676, -1632, 672, -532, 676, -532, 680, -1628, 672, -532, 676, -1632, 684, -1624, 676, -39972, 9020, -4460, 676, -1632, 684, -524, 672, -532, 676, -1632, 684, -524, 672, -560, 648, -532, 680, -528, 680, -1624, 676, -1632, 684, -1624, 676, -532, 680, -552, 656, -1624, 680, -528, 680, -1628, 672, -1636, 680, -1628, 672, -1636, 680, -528, 680, -552, 644, -1636, 680, -1628, 672, -532, 680, -556, 652, -552, 656, -528, 672, -532, 676, -1632, 680, -1628, 676, -1632, 680, -528, 680, -552, 648, -1632, 680, -528, 680, -19960, 680, -528, 672, -560, 648, -556, 652, -556, 652, -556, 644, -560, 648, -560, 648, -556, 656, -552, 656, -552, 644, -560, 652, -556, 652, -556, 652, -552, 656, -524, 676, -556, 652, -556, 652, -552, 656, -552, 648, -532, 676, -556, 652, -556, 652, -552, 648, -560, 648, -532, 676, -556, 656, -552, 656, -548, 648, -1632, 684, -524, 684, -548, 648, -560, 652, -39972, 9016, -4464, 672, -536, 676, -532, 676, -556, 652, -556, 652, -552, 648, -560, 648, -556, 652, -556, 652, -552, 648, -560, 648, -560, 648, -556, 652, -556, 656, -552, 648, -556, 648, -560, 652, -552, 656, -552, 644, -560, 652, -556, 652, -556, 652, -552, 644, -564, 648, -556, 652, -556, 652, -552, 648, -560, 648, -556, 652, -556, 652, -1628, 676, -532, 676, -1632, 680, -552, 648, -1632, 680, -528, 680, -19960, 680, -524, 676, -560, 648, -556, 652, -556, 652, -556, 644, -560, 648, -556, 652, -556, 652, -552, 648, -560, 648, -560, 648, -560, 652, -552, 656, -552, 644, -560, 652, -556, 652, -556, 652, -528, 672, -560, 648, -532, 676, -556, 652, -552, 656, -552, 648, -560, 648, -556, 652, -556, 652, -552, 648, -560, 648, -560, 648, -1632, 684, -548, 648, -1632, 680,



Raw: (559) 9012, -4468, 680, -1656, 648, -556, 652, -556, 652, -1628, 676, -560, 648, -556, 652, -556, 656, -552, 644, -1664, 652, -1628, 672, -1636, 680, -556, 652, -552, 644, -1636, 680, -556, 652, -1656, 648, -1632, 680, -1628, 676, -1636, 676, -556, 652, -556, 644, -1636, 676, -1632, 672, -560, 648, -560, 652, -552, 656, -552, 644, -564, 648, -1632, 680, -552, 648, -1636, 676, -556, 652, -552, 648, -1632, 680, -556, 652, -19960, 684, -1624, 676, -556, 656, -1628, 672, -560, 652, -556, 652, -1652, 652, -1632, 680, -552, 656, -552, 648, -556, 652, -556, 652, -556, 644, -560, 648, -560, 648, -1660, 656, -1624, 676, -560, 648, -556, 656, -552, 644, -560, 648, -560, 652, -556, 652, -552, 656, -552, 648, -560, 648, -556, 652, -556, 656, -548, 648, -1632, 684, -1624, 676, -556, 652, -556, 652, -39972, 9016, -4464, 672, -1632, 680, -556, 652, -556, 644, -1636, 676, -556, 656, -552, 644, -560, 648, -560, 652, -1652, 648, -1636, 680, -1628, 684, -552, 648, -556, 652, -1632, 672, -560, 648, -1632, 680, -1632, 672, -1632, 680, -1628, 676, -556, 652, -552, 648, -1632, 680, -1628, 676, -556, 652, -556, 652, -556, 652, -552, 648, -560, 648, -560, 648, -1656, 648, -1632, 684, -552, 644, -560, 648, -1636, 680, -552, 656, -19956, 676, -556, 652, -1628, 676, -1632, 680, -556, 652, -556, 644, -560, 648, -556, 652, -556, 652, -1628, 676, -556, 652, -556, 644, -1636, 676, -1632, 684, -548, 652, -1632, 680, -552, 656, -552, 644, -1636, 680, -1632, 680, -1628, 676, -1632, 680, -1628, 676, -556, 652, -552, 648, -1636, 676, -1632, 680, -552, 648, -556, 652, -1632, 672, -560, 648, -560, 652, -1628, 672, -39980, 9048, -4440, 676, -1628, 672, -564, 680, -524, 684, -1600, 700, -532, 680, -524, 684, -524, 684, -524, 676, -1604, 708, -1600, 704, -1604, 708, -524, 676, -532, 676, -1604, 708, -528, 680, -1600, 704, -1604, 700, -1608, 704, -1604, 712, -520, 676, -532, 676, -1604, 712, -1596, 708, -524, 684, -524, 672, -532, 676, -532, 680, -528, 680, -1600, 704, -1600, 700, -1608, 708, -524, 684, -524, 684, -1600, 704, -528, 680, -19936, 708, -524, 684, -524, 672, -532, 680, -528, 680, -528, 680, -524, 676, -532, 676, -528, 680, -528, 680, -528, 680, -524, 676, -532, 676, -528, 680, -528, 684, -524, 672, -532, 676, -532, 680, -524, 684, -524, 676, -532, 676, -528, 680, -528, 680, -528, 672, -532, 676, -528, 680, -528, 680, -524, 676, -532, 676, -1608, 704, -528, 684, -524, 672, -532, 676, -39952, 9044, -4436, 700, -532, 680, -528, 680, -528, 680, -524, 676, -532, 676, -532, 676, -528, 680, -528, 684, -524, 672, -536, 672, -532, 676, -528, 684, -524, 672, -536, 676, -528, 680, -528, 680, -524, 676, -532, 676, -532, 676, -528, 680, -528, 680, -528, 672, -532, 676, -532, 676, -528, 684, -524, 672, -536, 672, -532, 680, -528, 680, -1600, 704, -528, 680, -1604, 700, -532, 676, -1604, 708, -524, 676, -19940, 700, -532, 676, -528, 680, -528, 684, -524, 672, -532, 676, -532, 680, -528, 680, -524, 672, -536, 676, -528, 680, -528, 680, -524, 676, -532, 676, -528, 680, -528, 680, -528, 680, -524, 676, -532, 676, -532, 676, -532, 680, -524, 672, -536, 672, -532, 676, -532, 680, -528, 680, -524, 672, -540, 672, -532, 676, -528, 680, -1600, 704, -532, 676, -1604, 708,
User avatar
AnalysIR
Site Admin
Posts: 793
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: Sending AC on signal to AlpicAir

Post by AnalysIR »

I checked your signals and they decode OK for me using AnalysIR. (as Electrolux 134 bit AC signals. Note the naming is arbitrary)

The first thing I noticed is that your signal begins with the 4nnn value. It should begin with the 9nnn value, which it appears you have removed.

The ones starting with 9nnn decoded for me.
onic
Posts: 5
Joined: Wed Jan 12, 2022 4:24 pm

Re: Sending AC on signal to AlpicAir

Post by onic »

Thanks,
will put the first value back and try again.
onic
Posts: 5
Joined: Wed Jan 12, 2022 4:24 pm

Re: Sending AC on signal to AlpicAir

Post by onic »

Hello,
today I finally got to the AC, and nothing happened.
I put the 9nnn value back before test.
What else could be wrong?
The board works, tested with the samsung tv on/off signal.
User avatar
AnalysIR
Site Admin
Posts: 793
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: Sending AC on signal to AlpicAir

Post by AnalysIR »

Describe your IR emitter circuit (post a schematic & photo).
onic
Posts: 5
Joined: Wed Jan 12, 2022 4:24 pm

Re: Sending AC on signal to AlpicAir

Post by onic »

Hello,
I have YUN board.
The IR LED is connected to the arduino PIN13 but not directly.
pin13 connects to the NPN transistor which trigers and enable the IR LED.
I looked at IR led form phone camera and I can see the light flashes.
I will try to put the code to another arduino which controls mitsubishi AC, to skip possibility of wrong board config.
You do not have the required permissions to view the files attached to this post.
User avatar
AnalysIR
Site Admin
Posts: 793
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: Sending AC on signal to AlpicAir

Post by AnalysIR »

It seems from the photo that you have the transistor wired incorrectly (from what I can see)


Double check the pin-out of the 2N2222 (you may have the emitter & collector swapped???) (make sure it is a 2N2222...without a P...see below)

Also, put a 10R resistor in line with the IR LED to limit the current.

If I am right, simply rotating the NPN such that the flat end faces the Arduino would do. (Plus add in the resistor)

Also double-check the polarity of the IR LED.

NOTE: If it is a P2N2222 the wiring is correct
onic
Posts: 5
Joined: Wed Jan 12, 2022 4:24 pm

Re: Sending AC on signal to AlpicAir

Post by onic »

]Hi all,
the transistor is correctly joint. (from datasheet).
I experimented for a while and got it to work :)
I have no ideas why but the AC works with this sending solution see below code.
the part off code was taken from here->https://www.analysir.com/blog/2016/04/1 ... -irremote/
so:
AlpicAir nordic series A/C turn on signal with 23Degree; health function; cooling mode; and some directions of blowers have this signal to be sent-->
const unsigned int irSignal[] PROGMEM = {9020,4460,676,1632,672,532,676,560,648,1632,672,560,648,560,652,552,656,552,644,1636,680,1628,672,1636,680,524,672,564,648,1632,680,556,652,1628,676,1632,680,1628,676,1632,680,552,648,560,648,1632,680,1628,676,556,652,556,652,556,652,552,652,556,648,1632,680,552,648,1632,680,552,648,560,648,1632,680,556,656,19956,684,1624,676,532,680,1628,672,560,648,560,652,1628,672,1636,680,552,656,552,644,560,652,556,652,552,656,552,644,564,648,1632,680,1628,676,556,652,552,656,552,648,560,648,560,648,556,652,556,652,552,648,560,648,556,652,556,652,556,644,1636,676,1632,672,536,672,532,676,39976,9016,4464,676,1628,684,524,672,560,652,1628,672,536,676,532,676,532,676,556,652,1628,676,1632,680,1628,676,532,676,528,680,1628,676,532,676,1632,680,1628,676,1632,680,1628,676,528,680,552,648,1632,680,1628,676,532,676,560,648,528,680,528,672,560,648,560,648,1632,672,1636,676,532,680,524,684,1624,676,532,680,19960,680,528,680,1624,680,528,680,1628,676,532,676,556,652,528,680,552,656,1624,680,528,680,556,652,1628,676,1628,676,532,676,532,676,1632,680,524,676,1632,680,1628,676,1632,680,1628,676,1632,680,528,680,528,672,1636,676,1632,672,532,676,532,680,1628,672,532,676,1632,684,1624,676,39972,9020,4460,676,1632,684,524,672,532,676,1632,684,524,672,560,648,532,680,528,680,1624,676,1632,684,1624,676,532,680,552,656,1624,680,528,680,1628,672,1636,680,1628,672,1636,680,528,680,552,644,1636,680,1628,672,532,680,556,652,552,656,528,672,532,676,1632,680,1628,676,1632,680,528,680,552,648,1632,680,528,680,19960,680,528,672,560,648,556,652,556,652,556,644,560,648,560,648,556,656,552,656,552,644,560,652,556,652,556,652,552,656,524,676,556,652,556,652,552,656,552,648,532,676,556,652,556,652,552,648,560,648,532,676,556,656,552,656,548,648,1632,684,524,684,548,648,560,652,39972,9016,4464,672,536,676,532,676,556,652,556,652,552,648,560,648,556,652,556,652,552,648,560,648,560,648,556,652,556,656,552,648,556,648,560,652,552,656,552,644,560,652,556,652,556,652,552,644,564,648,556,652,556,652,552,648,560,648,556,652,556,652,1628,676,532,676,1632,680,552,648,1632,680,528,680,19960,680,524,676,560,648,556,652,556,652,556,644,560,648,556,652,556,652,552,648,560,648,560,648,560,652,552,656,552,644,560,652,556,652,556,652,528,672,560,648,532,676,556,652,552,656,552,648,560,648,556,652,556,652,552,648,560,648,560,648,1632,684,548,648,1632,680};


if (Serial.read() != -1) {
for (int i = 0; i < 3; i++) {

sendRAW_Flash(irSignal, sizeof(irSignal) / sizeof(irSignal[0]), NEC_KHZ);
digitalWrite(WARNING_PIN,1);

}
}
digitalWrite(WARNING_PIN,0);


}

void sendRAW_Flash(const unsigned int * signalArray, unsigned int signalLength, unsigned char carrierFreq) {

irsend.enableIROut(carrierFreq); //initialise the carrier frequency for each signal to be sent

for (unsigned int i=0;i<signalLength;i++){
//tmp=pgm_read_word_near(&signalArray);
// tmp=cleanPanasonic(tmp); //not needed
if (i & 1) irsend.space(pgm_read_word_near(&signalArray));
else irsend.mark(pgm_read_word_near(&signalArray));
}
irsend.space(1);//make sure IR is turned off at end of signal

}


Thank you for help @AnalysIR
User avatar
AnalysIR
Site Admin
Posts: 793
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: Sending AC on signal to AlpicAir

Post by AnalysIR »

Thanks for the update.

The only thing I can think of is the accuracy of the capture/timings.

FYI: Our AnalysIR app can clean these signal so that you are sending a good signal every time.
Also, our LearnIR module has our unique Fuzzy Clean technology, which can capture signals to within a few uSecs accuracy vs standard IR receivers (+/- 200uSecs)
Post Reply