Trying to replace an IR remote for a mini-split (heating and air). Ardunio?

I've got a wall mounted AC unit (kind of a mini-split setup) that uses an IR remote control for all operations. Here's what I don't like about it:

  • There is no real on/off "thermostat" function. You can choose a temperature, but the unit will just run forever (cycle between AC or heat and fan/vent) until you turn it off.
  • The remote is crappy, and you have to aim it very precisely to get a response.
  • Interesting modes like dehumidify, different fan speeds, air flow direction, away/low power mode, etc (all things that could be very helpful), are useless since you have to manually change them all the time with the remote to get any effect, and nothing is automatic.

My idea is to make some kind of device I can program that will accept input (initially via usb or ethernet, but eventually via a small LCD with buttons), read temperature and humidity in the room, work all sorts of software magic (I'm a software developer by trade; I'll bring the magic) and send IR codes to the AC unit to manage it. I know I'll need the following:

  • Some sort of programmable logic board (thinking the Arduino could be right for this)
  • IR transmitter/blaster (preferably one with a cord so I can mount it directly to the front of the AC unit where the reciever is)
  • IR receiver (temporarily only? Need to read in and make a database of every possible code the current IR remote can transmit)
  • Temperature sensor
  • Humidity sensor
  • Small LCD with input buttons (eventually, not needed for initial config)

Challenges:

  • This is a one way data flow; there is be no way to immediately tell if the device actually is doing what it should be. There are some wires that I can potentially tap into for extremely basic info, but the unit is under warranty and costs several thousand dollars.
  • I don't know what type of IR signal the remote uses (what frequency, string length, etc), so I don't know what breed of receiver/transmitters I will need.
  • I have never tinkered with an Arduino before; so no experience on my part (though my coding skills are strong)

I'd love to get some feedback on this plan, and maybe a point in the right direction on potential parts. I've been looking at the hardware options, and frankly I'm really confused.

Potential parts I've found so far:

Temprature and humidity sensors: DHT11 or DHT22 ($2.50 or $11; not sure if I really need the upgraded one)

Having done something similar, I can tell you that this is tough for one reason: communication between the remote and the split unit is one way. This means that unlike a simple TV remote (which generally sends a different IR code for each button pressed), all the state info (fan speed, temp, etc) is stored on the remote itself. When you press a button on the split unit's remote, it will USUALLY send a whole stream of information containing all the state information.

So the signal for two different button presses, say on/off and fan speed, will look largely the same, except that for on/off the on/off bit(s) will change, and for fan speed the fan speed bit(s) will change. All the other information (temperature, cooling function, etc) will be transmitted according to what they are set to on the remote.

What this means for you is that to replace the remote with some hardware of your creation, you would need little more than an IR led and an Arduino. However you will have to reverse engineer the remote protocol which would require an oscilloscope (well, maybe not required but it would make your job easier) and a good chunk of free time.

I can offer you a suggestion though, with enough I/O, you could simply rig the button contacts on the remote to I/O pins on your Arduino and control it from there. Keep in mind that since you will have to store the states in variables in your Arduino sketch, and there is no "syncing" between the A/C and the "remote" you have built, it is very important to make sure your code is written such that the risk of "desynchronization" (i.e. your Arduino thinking that it has set the temperature to 65, when actually it's at 68) is minimal.

EDIT: IR frequency for these units is typically 38 kHz, string length can vary but it is typically longer than your average TV/DVD player remote. There are many libraries available online as well as tutorials to help you decode IR signals with a simple IR receiver hooked up to an Arduino.

I had a suspicion that the remote worked in that fashion based on some trivial testing I did (change multiple states covering the LED then change one setting uncovered and all updated states are changed at once). Do I really need to reverse engineer anything with the codes? I did an analysis and I really only need 11 total states, with a single code for each:

  1. Off
  2. Fan speed 1 @ 65f
  3. Fan speed 2 @ 65f
  4. Fan speed 3 @ 65f
  5. Low power cooling @ 65f
  6. Fan speed 1 heating @ 90f
  7. Fan speed 2 heating @ 90f
  8. Fan speed 3 heating @ 90f
  9. Low power heating @ 90f
  10. Dehumidify
  11. Recirculate/fan only

Can't I just capture the raw code coming from the remote for each state and make a small database/table of them, re-transmitting the raw codes as needed?

As far as sync and one way communication; consider that the unit currently has that problem as well. Sometimes if I don't point it just right, the remote will reflect updated settings when the unit doesn't. I plan to send the IR command multiple times right away to ensure it takes, and send a "keep alive" command every couple minutes with the current code. Frankly this is just as good as what I currently have in terms of reliability. It will require disconnecting an audible "beep" from the unit so I don't go crazy (every received command causes a beep), but it's easy to unplug the speaker on the front panel without voiding any warranty.

Can't I just capture the raw code coming from the remote for each state and make a small database/table of them, re-transmitting the raw codes as needed?

Maybe, but probably not. From your experiments and comments from boredat20, it seems likely that the remote always sends the whole stream. If so, it also seems plausible that the receiver expects the full monty every time. The only way to be sure is to get decoding and see if you can control the system with partial sends. I suspect though that it would be easier to send the full command set every time and just keep track of the current state of every variable in software.

Paul,

As wildbill said, if you can identify the relevant bits for a particular function (say by keeping everything constant, toggling the relevant function and comparing the streams), you could try to send a partial code and see if that works. It is possible that the AC unit expects some kind of confirmation code at the end of the stream, or at the end of each function set in the stream. That is where you will have to do a bit of reverse engineering. Take a look at this link for more information: http://petavolt.com/propel-helicopter/

What you have suggested will also work. Since each button press sends out a stream, it follows that each configuration will have a unique stream. Between fan speeds, temperature, cooling/heating function, swing direction, timers, economy modes etc, the number of combinations is prohibitively large for you to replicate all functions of the remote (and the code would get seriously messy) using this approach. However if you really only need those 11 exact configurations, you can simply capture those codes and repeat them with a simple IR LED, no fancy equipment needed.

Check out ladyada’s tutorial here to see how to read in and transmit IR signals with your Arduino: http://learn.adafruit.com/ir-sensor

EDIT: In fact, you can probably use this approach using only 4 I/O pins configured as inputs and heres how. Assuming you have 11 buttons for those 11 configurations, you can configure those buttons (in hardware!) to drive each of those 4 pins to a certain state such that each button press results in a different configuration of those 4 pins e.g. split unit configuration 1 = D1-0, D2-1, D3-0, D4-0, split unit configuration 2 = D1-1, D2-1, D2-0, D4-0, … . Then you would have your Arduino code respond to the states of those 4 I/O pins. Of course this would require a bit of extra work (i.e.hardware debouncing of the buttons, driving the I/O pins) but it would be a novel way to get 16 buttons triggering 16 different functions using only 4 pins on your Arduino. You could also use a few analog inputs and a resistive ladder (http://en.wikipedia.org/wiki/Resistor_ladder) to do the same thing…or you could just go with the tried and tested method, a shift register :wink: