Arduino Controlled Air Conditioner

Arduino Controlled AC

Now that summer is coming, it’s time to break out the Air Conditioners! There are some old AC units out there that still work just fine, but nowadays we are used to everything being remotely controlled and automatic. [Phil] had an old window-mounted AC unit that still worked but was installed in a not-so-convenient place. To access the AC’s controls, one would have to climb over a large desk. This is a perfect opportunity to use the plethora of widely available hobby electronics to make an automatic AC controller retrofit.

First things first, there needs to be a way to turn the current control knob on the AC. [Phil] modeled up a 3D bracket to hold an RC car servo to the AC control panel. Attached to the servo horn is a slotted cylinder sized appropriately to fit the shape of the control knob. An Arduino measures the temperature of the room via a DS18B20 temperature sensor which then has the servo turn the control knob to the appropriate position, on or off. The Arduino sends temperature data back to a PC via MegunoLink Pro which graphs past data and also displays current temperature data. Using MegunoLink Pro, the min/max temperature points can also be set without uploading a new sketch to the Arduino.

Arduino Controlled AC

From the temp vs time graph, it looks like the room temperature stays a consistent 23 +/- 1 °C. [Phil] did us summer-swelterers a favor and made all his design files available. This is a great idea but wonder if leaving the air conditioner unit switch in the ‘on’ position and turning the unit on/off via a relay connected to the 120vac line would work just as well.

31 thoughts on “Arduino Controlled Air Conditioner

  1. Looks awfully like MegunoLink ad, they used to be free you know?

    In that case I’ll advertise as well Inspired by them I made an opensource alternative (as a student couldn’t afford megunolink at the time), haven’t finished but maybe someone will find it useful:

    Supports multiple plots, also time based plots and xy type of plots and you can save your dashboard for later use. I haven’t made a release version for linux but if you know your way around and you know how to compile a qwt library it can be run on linux without any modification.

    Also I have no idea how stable it is, since I wrote the FlexiPlot in couple days.

    1. I’m a bit biased in this situation because I picked up my copy for $5. With that said, what’s wrong with a developer showing off what their product can do? Do you mean to scold the Hackaday staff for posting this? You mention that your code is not finished, and yet here is a complete, reasonably priced software that gives someone an extensive set of tools that isn’t available out of the box(or available in your plugged project). Quality development deserves a return and any product that ends up on this site could be seen from that angle. This site provides interesting solutions for just about anything, and part of that is knowing what is available to help you along the way. For the record, I found out about this program through reddit and don’t recall ever seeing it on this site.

  2. I use a Frigidaire Window unit that came with an infrared sensor and remote control.
    I use an IR Blaster with a software that exposes the abillity to blast commands via a COM interface (it was LM Getision’s Remote Key Map)
    I have written both a C# desktop app and ASP web page to control the unit (basically anything the remote could do, that apps can do)

    1. I’m with you on this one. with newer AC Units, only the cheapest are dial controlled, and they tent to not have enough onboard sensors to keep from freezing up.

      Older, dial units may still work, but are often extremely power hungry. You are likely going to come out ahead going to a newer unit with the IR remote, then using IRBlaster or even an IR Arduino setup.

      Then again, our newest unit is pretty intelligent on it’s own, includes the regular and power saving modes, An automatic fan setting and even a setting to progressively warm up for use at night when the room will naturally cool off) (still gets too warm for me, but I like sleeping in an ice cave).

      Very cool idea, but in reality, I would suggest a newer unit for most folks. If the old once is still working, sell it on Cragislist and recoup some cast. Between that and power savings, you can likely pay for most of a new unit in a couple years of use.

        1. I don’t know about efficency….but r22 has been outlawed (at least int he USA) and you can no longer legally buy it.
          So eventually, you will have to upgrade anyways (or have it retro-fitted, at cost)

          1. what I mean is if someone already has an old r22 unit that still works, wouldn’t it be more efficient than a new computer controlled r410 unit and even more so with arduino control?

          2. @takato
            the following website suggests the following: ‘R22 has been the standard refrigerant used in air conditioners for many years now. The problem with this refrigerant is that it is both less efficient and less environmentally friendly than R410a refrigerant.’

            — I would say no…it is not more efficent and r22 is being phased out…as of 2020 no new r22 will be made.
            So, in 5 years….it will near impossible to get r22 except from recycled or reclaimed quantities and will, probably, end up costing your more then buying a new unit.


  3. That is a terrible way to drive an AC: you’ll be constantly overshooting. 1°C is a hell of a fluctuation for such short times! There’s very simple control approaches that would solve this issue.

    I’m also not very convinced that turning the thing on and off is either energy-efficient or not damaging to the device.

    1. If it is anything like mine, the thermostat is mostly worthless. It is incredibly inconsistent. One day I have to turn it down a quarter turn to keep it from cooling to 60 deg F, and then the next day I have to turn it back up to get it to turn on below 80 deg F. It acts as if the outside air is leaking in and influencing the thermostat. If it is really hot outdoors it will run until it’s way too cold, and if it’s not so hot outside then it won’t come on even if it warm inside.

        1. Rob, these older/cheaper in-unit thermostats like the one shown are typically hydraulic, not electric, so you can’t “wire in a more stable one”, nor have much flexibility on relocating it. Sheesh.

          You can, however, hack the ducting or otherwise redirect the airflow around it so it’s more sensitive to room air and not to outdoor or internal equipment temperature.

          1. Hydraulic thermostat?

            Citation needed.

            I’ve had my share of window air conditioners (both with electronic, and electromechanical controls). One thing they all have in common is that they’re all too sensitive to the cooling cycle: The front of the unit gets cold, the thermostat gets arbitrarily cold, and it turns off — irrespective of the temperature of the room being cooled. (The opposite happens with plug-in space heaters.)

            The only and most obvious answer here is to remotely-locate the thermostat, which is actually easy to hack together safely with off-the-shelf parts. For a heater, you buy a thermostat made to switch baseboard heaters directly. For an air conditioner, you buy any DC thermostat which can control an air conditioner and add a solid-state relay.

            Put the adjustable thermostat near the people trying to be comfortable, instead of near the interminably too-hot/too-cold area at the front of the unit, and bask in the win.

            (My own citation: Proper split-system small AC systems from Mitsubishi et al. include things like auto-positioning IR sensors to detect the thermal status of the room, and temperature sensors in the remote control. They do not rely on the temperature at the unit itself, because nobody cares about that temperature except for the beancounters who refuse to make a functional system.)

          2. flodadolf says: June 14, 2015 at 4:42 pm
            Hydraulic thermostat?
            Citation needed.

            Seriously? Clearly you’ve never looked inside one, or didn’t understand what you were looking at when you did.
            See the blob at the end of the copper pipe? Hint: it’s not electronic. Not even electrical.

            Lots more:

            More specifically, at the ehow IQ level:


  4. That graph shows the AC restarting about a minute after turning off — a good recipe for premature compressor death. It also shows the room cooling at the rate of 2 degrees per minute. This must be a very, very small room, or perhaps the temperature sensor is in the air blast and not sensing the room temperature directly.

  5. I have a dumb (no thermostat) in my apt as well. My setup is a relay on the 240V line, a programmed temp swing of 5deg, and cool down period of 5 minutes after ac shutdown before it can turn on again to avoid damaging the compressor. Lack of any cool down and that short of a swing is a recipe for compressor damage.

    Maybe that thermostat know in the picture is broken?

  6. If you start running the A/C directly you’ll eventually restart too quickly and wreck the compressor as well – there’s a reason that there’s a restart time-delay built in.

  7. i would have built a thermostatically controlled relay inside of an electrical box to witch the ac unit would be plugged into.

    the downsides of this is

    1. the fan will stop working with the unit by controlling the power.

    2. and it does not apply here but modern ac units with remotes often does not have a watchdog feature that will turn it back on after power outages and that would only apply to electronic controls if the remote is missing

  8. The comments about preventing short cycling are 100% awesome. You have to avoid that if you want to keep from killing the compressor. I do like the hack of turning the knob though.

    Rather than make a homebrew solution years ago when I wanted to control my 18000 BTU unit, I bought a Lux WIN100 ( which you plug in between the wall and the A/C unit. It gives you 4 set times/temps for weekdays and 4 for weekends. It works swell.

      1. The WIN100 described above is actually listed for use with 120V, as found in the USA (and obviously has the NEMA 5 connectors).

        There are several 240V options listed available in the USA from Where do you live that uses 220V?

      2. If you live in the US/Mexico/Canada (or a few other 110V places) and have a 220V AC (not as uncommon as some folks here think), you’ll mostly find 110V control systems. If you need 220V, look overseas at any 220V country that has hackers: Australia is full of hackers and is 220v, same as Germany, the UK, etc.

        Seriously: Just have a look at, find who makes what, and do your homework. Order the part from wherever it is that is convenient, and/or add an AC-driven AC SSR (or a DC supply and a more common DC-driven AC SSR) in an appropriate metal grounded box to match your available control systems up with whatever you have for an AC unit.

        If I had to solve this problem today, I’d go to Ebay with a $10 bill and buy a DC-triggered AC SSR, and to Wal-Mart with a $20 bill for a battery-powered Honeywell digital thermostat, and to the hardware store with a $5 bill for the enclosure, cabling, and connectors.

        $35, a few days for an ePacket delivery from China, and done.

  9. I doubt the front-panel switch is built to survive being turned so frequently. But I wouldn’t control it by switching the AC to the entire unit either. The fan should run for at least a while after the compressor shuts off, to distribute the cool from the still-cold coils to the room, and to distribute air around the room; both of which help avoid excessively short cycles. This hack is capable of turning the switch to the fan position, though I don’t see anything saying the software actually does this during normal cycling. If it doesn’t, it should.

    Also, if this really is an old AC it’s probably out of warranty, so there’s no reason to use a Rube Goldberg non-intrusive control method. Open that sucker up and do it right! If you’re careful it could still be done in a way that’s removable without a trace, if needed for warranty purposes.

  10. I am heading to west Africa to work on a few projects through two NGOs. One of them is research on food loss. In general Africa have high food loss due to lack of proper storage (silo, cold storage). Many fruits and vegetables need to be cleaned, cooled (40F-50F) then stored within 4 hours to preserve quality (retain liquids and slow bacteria growth). Is it possible to use an Arduino to make an AC go below manufactures temp of (60F, 15C)? Please advise where to find open-source program and build instructions.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.