Arduino Controlled AirCon

Hi all, having some trouble sending codes to my AC from my arduino, or doing it incorrectly..
I have an IR transmitter module V2 (https://core-electronics.com.au/digital-ir-transmitter-module-arduino-compatible.html) and and a receiver. I received the following when turning my AC on at 19deg, using the IRremote.h library:

rawData[358]:
-3276750
+3000,-3050
+3000,-4350 + 500,-1700 + 550,- 550 + 550,-1650

  • 550,- 550 + 550,- 550 + 500,-1700 + 550,-1650
  • 500,- 600 + 550,- 550 + 550,- 550 + 550,-1650
  • 550,-1650 + 550,- 550 + 550,-1650 + 500,-1700
  • 550,- 550 + 500,-1700 + 550,-1650 + 500,-1700
  • 550,- 550 + 500,- 600 + 500,- 600 + 550,- 550
  • 550,- 550 + 550,- 550 + 550,- 550 + 550,- 550
  • 550,- 600 + 500,- 600 + 500,- 550 + 550,- 600
  • 500,- 600 + 500,- 550 + 550,-1650 + 550,- 600
  • 500,- 600 + 500,- 600 + 500,- 600 + 500,- 600
  • 500,- 600 + 500,- 600 + 500,- 600 + 500,-1650
  • 550,- 600 + 500,- 600 + 550,- 500 + 550,- 600
  • 500,- 600 + 550,- 550 + 500,- 600 + 550,- 550
  • 550,- 550 + 550,- 550 + 550,- 550 + 550,- 550
  • 550,- 550 + 550,- 600 + 500,- 600 + 500,-1650
  • 550,- 600 + 500,- 550 + 550,- 600 + 500,- 600
  • 500,- 600 + 500,- 600 + 500,- 600 + 500,- 600
  • 500,- 600 + 500,- 600 + 500,- 600 + 500,- 600
  • 500,- 600 + 550,- 550 + 500,- 600 + 550,- 600
  • 500,- 550 + 500,- 600 + 550,- 600 + 500,- 550
  • 550,- 550 + 550,- 600 + 500,- 600 + 500,- 600
  • 500,- 600 + 500,- 600 + 500,- 600 + 500,- 600
  • 500,- 600 + 500,- 600 + 500,- 600 + 550,- 550
  • 500,- 600 + 500,- 600 + 500,- 600 + 500,- 600
  • 500,- 600 + 550,- 550 + 550,- 550 + 550,- 550
  • 550,- 550 + 550,- 550 + 550,-1650 + 550,- 550
  • 550,-1650 + 550,- 550 + 550,-1650 + 550,- 600
  • 500,- 550 + 550,- 600 + 500,- 600 + 500,- 550
  • 550,-1650 + 550,-1650 + 550,- 600 + 500,-1650
  • 550,-1650 + 550,- 550 + 550,-1650 + 550,-1650
  • 550,-1650 + 550,- 550 + 550,- 550 + 550,- 600
  • 500,- 600 + 500,- 550 + 550,- 600 + 500,- 600
  • 500,- 550 + 550,- 600 + 500,-1650 + 550,- 600
  • 500,- 600 + 500,- 600 + 500,- 600 + 500,- 600
  • 500,- 600 + 500,- 600 + 500,- 600 + 500,- 600
  • 500,- 600 + 550,- 550 + 550,- 550 + 500,- 600
  • 550,- 600 + 500,- 550 + 500,- 600 + 550,- 600
  • 500,- 550 + 550,- 550 + 550,- 600 + 500,- 600
  • 500,- 600 + 500,- 600 + 500,- 600 + 500,- 600
  • 500,- 600 + 500,- 600 + 500,- 600 + 500,- 600
  • 500,- 600 + 500,- 600 + 500,- 600 + 550,- 550
  • 500,- 600 + 550,- 550 + 550,- 550 + 500,- 600
  • 550,- 600 + 500,-1650 + 550,-1650 + 550,-1650
  • 500,-1650 + 600,- 550 + 500,-1700 + 550,-1650
  • 500,-1650 + 550
    Sum: 242950

I am unable to decode this and send it o my Haier AC to turn it on.. or do anything. Can anyone offer some help?

Thanks!!

Printing the values as HEX would likely be more useful.
Posting a link to the AC technical manual/datasheet would help all helpers that haven' done this on exactly the same AC as the one You have.

HI, @bennos
Welcome to the forum.

Can you please post your code that drives the IR transmitter?
Can you please post a schematic of your project.

What receives the IR transmission?

Thanks.. Tom.... :smiley: :+1: :coffee: :australia:

What transmitted the numbers you received?

What arduino board you use?
Do you need to decode it or could you just send it raw?

Anyway, few things to be aware of. That IR "module" is just a LED with resistor, the transmitting range can be very low, well under 1meter.
Also your raw code is 132bits, which is not whole bytes and this, while possible, make me wonder if you received the whole signal. Did you set raw_buffer_length on your receiver code?

Hi! Thanks for the response. I'm using a mega 2560 board. I don't need to decode it, though that would be useful eventually; for now sending the raw data is fine.
I have tried the IR module very close to the AC and still no response. Should I connect the receiver I bought to the AC instead of the factory one?
Hmm, I didn't set raw_buffer_length- that may be the problem? I will keep trying getting better data with the receiver and sending differing data from the transmitter.

^ This transmitter on my arduino mega 2560 board

Hi, I was assuming the AC unit inside would be able to receive the data sent? But perhaps not? I can wire in the receiver I bought and see if that makes a difference I suppose!
Below is the code I am using to send it, I've tried writing several differing programs to send the data, but have resorted to some chatGPT code while trying differing data to be sent.. Here it is:
#include <IRremote.h>

IRsend irsend;

void setup() {

irsend.enableIROut(38);
}

void loop() {

uint16_t rawData[] = {

// Include the rest of the raw data here...

};

irsend.sendRaw(rawData, sizeof(rawData) / sizeof(rawData[0]), 38);
delay(2000);
}

How do you know what codes to send?

Have you looked at the Examples that come with the IR Library?

Tom.... :smiley: :+1: :coffee: :australia:

Thanks Tom! I've been trying to send the raw codes I used the receiver and AC remote to get. I've tried the examples that come with the IRremote library.

You are using very old library/code.
Update your library to new version 4.41 and use the example code from that with buffer length set:
define RAW_BUFFER_LENGTH 730;