Introduction: Air Conditioning Web Controlled by Arduino

Hello there

The high temperature of this summer, make me think to this project. May be there are similar on the internet, but I didn't find.

This project is based on arduino, and runs well on boards bigger than UNO, which has not so much memory. With this you can switch ON or OFF, your home's air conditioning system, checking the ambient temperature and humidity, and all this, through your phone's browser away from home. ... of course, if you have a internet connection at home and on your cell phone (not just smartphones).

Step 1: Hardware

  1. Arduino Mega
  2. Ethernet shield
  3. 5v(USB), 6v or 9v power plug for arduino
  4. LAN ethernet cable
  5. DHT22(or DHT11) sensor for temperature/humidity
  6. Infra Red (IR) LED from a remote control or less than 1€ in electronics shop
  7. temporary: an IR receiver
  8. temporary: a breadboard with three wires

Step 2: Getting the Codes

The remote control of the air conditioning systems have always an lcd screen with settings. When you press any button, the IR led sends ALL the configurations which are shown on the remote's lcd, plus the modification by pressing that button.

All the other remotes (TV, DVD, HiFi...) are different -> every time you press the same button, you get the same short code. But that's another nice story.

To make the receiver, we can use our arduino (UNO is good enough) and the IR receiver. Please see the photo above with few models and pinout. Just look at the housing and the pins. In my case, is the first on the list.
Put the receiver on the breadboard and connect + to 5V, - to GND and S to arduino's Digital 2. Connect the arduino to the computer and download the arduino sketch "Long_IR" down here and load it on the arduino.

To get the codes for OFF, DRY, COOL or even HEATING, we need to set the lcd on the remote with the configuration that we need, for example DRY/25°C/no Swing/Fan auto . Then open the terminal, arduino will wait for data from the remote. Now put the remote in the front of the arduino receiver and press "ON/OFF". After you see on the terminal the code coming, press again "ON/OFF".

In this way, the first code you get on the terminal is OFF and the second one is DRY/25°C/no Swing/Fan auto .

You can copy this codes to a text file.

Now, you can do the same for COOL, and you can copy only the code for COOL.

In the text file with the codes cancel all the "-" (minus) sign and put it in the sketch

Step 3: First Test in the Home Network

First I tried with arduino UNO, but I get out of memory (only 2kb) for the variables. Uno is ok if you want to just activate the air conditioning (one code). If you need buttons to switch OFF!, switch ON cooling, switch ON drying, switch ON heating, you definitely need an arduino Mega.
DHT22 is an option. But is nice to see the temperature and humidity in your house, one hour before your arrival.

Mount the ethernet shield on the arduino. Connect DHT22 to +, GND and digital pin 2. Please refer to DHT22 connection: here Connect the IRtransmitter led to GND and digital pin 9. Note that I did not use a resistor. I see that with the resistor, the IR light is werry weak (AC did not receive), and without the resistor is better. How did I "see"? take a look at: this instructable . Then connect arduino to network.

Libraries used for this are most of them located by default il the arduino IDE. Libraries which you may need are DHT and IRremote, witch you can also, get it here. Download the sketch down here and load it on your arduino.

Change the network configuration with yours > mac, IP ... < .

Codes may be different because we're using a different AC manufacturer. Just change my codes, with your codes, keeping the same meaning of the codes: my OFF with your OFF, my DRY with your DRY and so on...

Load the new sketch and from the pc conected to your home network, just tipe in the browser the arduino's IP.

Keep the IR led straight to the AC not more than 5 meters away. Then check if you can see in the browser the temp/humidity values, and looking at the AC press the commands OFF, DRY, COOL.

In this case, you can use this to control the AC from inside your home network.

Step 4: Setting Up Router

For this you need to refer to your router manufacturer and open the ports that arduino can be seen from outside.
If you have a dynamic IP, you must use a free service like or With static IP, just open ports on router and use it.


internal IP:

external IP: find your's here

You need to open a port on external IP to go on port 80 of the internal IP. We chose port 7000.
The address you will need to call in the browser from outside, look's like this:

If you use a dynamic IP service:


Hope you enjoy this instructable.