Air Conditioning Web Controlled by Arduino

71,457

540

1

Posted in TechnologyArduino

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 noip.com or dyndns.org. With static IP, just open ports on router and use it.

Example:

internal IP: 192.168.1.100

external IP: 2.230.yyy.xxx 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: http://2.230.yyy.xxx:7000

If you use a dynamic IP service: http://user.noip.com:7000

_________________________________________________

Hope you enjoy this instructable.

Cristian

2 People Made This Project!

Recommendations

  • Spotless Contest

    Spotless Contest
  • Microcontroller Contest

    Microcontroller Contest
  • Space Challenge

    Space Challenge
user

We have a be nice policy.
Please be positive and constructive.

Tips

2 Questions

i am trying to use my arduino to switch on the aircon when is cold and switch it off when is warm without using the remote.i don't know how to go about it.please help

I tried to read the codes of my ARH465 remote control of AC Samsung but every time I read defferent code. Why? Can you help me? I used TSOP4838 IR receiver connetted to Arduino UNO. I show you two defferent codes:

Command: ON - Only Fan

Raw: (231) 3028, -9024, 540, -508, 564, -1556, 540, -508, 540, -540, 532, -536, 532, -516, 540, -560, 540, -504, 544, -508, 484, -1584, 540, -512, 536, -532, 508, -1536, 540, -512, 536, -532, 540, -1504, 540, -1532, 536, -1508, 588, -1504, 540, -1528, 544, -504, 540, -512, 508, -560, 540, -508, 544, -504, 544, -508, 540, -528, 568, -504, 544, -504, 544, -508, 536, -536, 536, -540, 540, -508, 540, -532, 536, -564, 540, -508, 540, -508, 540, -512, 532, -536, 536, -512, 540, -508, 540, -508, 540, -512, 564, -504, 540, -508, 544, -504, 544, -508, 540, -552, 544, -504, 544, -508, 540, -532, 484, -564, 540, -1508, 480, -1584, 540, -1556, 540, -1504, 512, -1908, 3004, -9044, 536, -1560, 536, -508, 540, -536, 460, -588, 540, -504, 544, -508, 540, -532, 460, -584, 540, -512, 540, -1528, 540, -508, 540, -536, 540, -1576, 548, -1500, 484, -1580, 544, -1528, 532, -516, 540, -1556, 540, -1504, 536, -1528, 544, -1524, 540, -1504, 544, -1528, 540, -1504, 564, -1500, 592, -512, 456, -592, 536, -512, 540, -504, 544, -556, 536, -512, 544, -504, 544, -564, 532, -516, 532, -536, 536, -512, 536, -512, 536, -516, 480, -588, 536, -1508, 536, -1532, 540, -536, 536, -1528, 540, -512, 536, -1528, 544, -1504, 540, -528, 540, -508, 544, -536, 536, -512, 480, -592, 540, -508, 536, -1528, 540, -1504, 544, -1528, 540, -1508, 508,

Raw: (231) 3000, -9076, 536, -508, 540, -1528, 544, -504, 540, -512, 536, -516, 476, -592, 540, -508, 540, -508, 536, -516, 584, -1508, 592, -504, 540, -536, 532, -1536, 540, -532, 536, -512, 540, -1504, 532, -1536, 544, -1524, 544, -1500, 484, -1584, 540, -508, 540, -536, 512, -532, 544, -504, 568, -508, 540, -532, 460, -588, 540, -508, 540, -536, 540, -532, 540, -508, 544, -556, 540, -512, 536, -532, 516, -532, 540, -508, 540, -508, 540, -508, 540, -532, 508, -540, 540, -508, 540, -512, 536, -536, 512, -536, 536, -536, 540, -512, 536, -532, 536, -564, 540, -508, 544, -504, 540, -532, 488, -560, 544, -1500, 544, -1528, 536, -1556, 540, -1504, 516, -1904, 3004, -9020, 560, -1556, 544, -508, 540, -512, 536, -536, 536, -508, 540, -508, 540, -508, 540, -532, 508, -544, 536, -1528, 592, -508, 540, -512, 556, -1536, 540, -1584, 536, -1508, 536, -1528, 544, -504, 544, -1524, 544, -1552, 540, -1556, 540, -1532, 536, -1508, 536, -1528, 544, -1528, 536, -1508, 536, -512, 536, -536, 536, -512, 540, -508, 540, -512, 532, -536, 564, -508, 540, -508, 540, -512, 484, -588, 536, -540, 540, -508, 536, -532, 536, -512, 544, -1504, 484, -1584, 536, -512, 536, -1556, 540, -508, 536, -1532, 540, -1528, 544, -508, 540, -504, 540, -512, 544, -528, 540, -508, 540, -532, 540, -1584, 536, -1508, 536, -1528, 544, -1524, 488,

Thanks in advance

Massimo Dani

Comments

I tried to read the codes of my ARH465 remote control of AC Samsung but every time I read defferent code. Why? Can you help me? I used TSOP4838 IR receiver connetted to Arduino UNO. I show you two defferent codes:

Command: ON - Only Fan

Raw: (231) 3028, -9024, 540, -508, 564, -1556, 540, -508, 540, -540, 532, -536, 532, -516, 540, -560, 540, -504, 544, -508, 484, -1584, 540, -512, 536, -532, 508, -1536, 540, -512, 536, -532, 540, -1504, 540, -1532, 536, -1508, 588, -1504, 540, -1528, 544, -504, 540, -512, 508, -560, 540, -508, 544, -504, 544, -508, 540, -528, 568, -504, 544, -504, 544, -508, 536, -536, 536, -540, 540, -508, 540, -532, 536, -564, 540, -508, 540, -508, 540, -512, 532, -536, 536, -512, 540, -508, 540, -508, 540, -512, 564, -504, 540, -508, 544, -504, 544, -508, 540, -552, 544, -504, 544, -508, 540, -532, 484, -564, 540, -1508, 480, -1584, 540, -1556, 540, -1504, 512, -1908, 3004, -9044, 536, -1560, 536, -508, 540, -536, 460, -588, 540, -504, 544, -508, 540, -532, 460, -584, 540, -512, 540, -1528, 540, -508, 540, -536, 540, -1576, 548, -1500, 484, -1580, 544, -1528, 532, -516, 540, -1556, 540, -1504, 536, -1528, 544, -1524, 540, -1504, 544, -1528, 540, -1504, 564, -1500, 592, -512, 456, -592, 536, -512, 540, -504, 544, -556, 536, -512, 544, -504, 544, -564, 532, -516, 532, -536, 536, -512, 536, -512, 536, -516, 480, -588, 536, -1508, 536, -1532, 540, -536, 536, -1528, 540, -512, 536, -1528, 544, -1504, 540, -528, 540, -508, 544, -536, 536, -512, 480, -592, 540, -508, 536, -1528, 540, -1504, 544, -1528, 540, -1508, 508,

Raw: (231) 3000, -9076, 536, -508, 540, -1528, 544, -504, 540, -512, 536, -516, 476, -592, 540, -508, 540, -508, 536, -516, 584, -1508, 592, -504, 540, -536, 532, -1536, 540, -532, 536, -512, 540, -1504, 532, -1536, 544, -1524, 544, -1500, 484, -1584, 540, -508, 540, -536, 512, -532, 544, -504, 568, -508, 540, -532, 460, -588, 540, -508, 540, -536, 540, -532, 540, -508, 544, -556, 540, -512, 536, -532, 516, -532, 540, -508, 540, -508, 540, -508, 540, -532, 508, -540, 540, -508, 540, -512, 536, -536, 512, -536, 536, -536, 540, -512, 536, -532, 536, -564, 540, -508, 544, -504, 540, -532, 488, -560, 544, -1500, 544, -1528, 536, -1556, 540, -1504, 516, -1904, 3004, -9020, 560, -1556, 544, -508, 540, -512, 536, -536, 536, -508, 540, -508, 540, -508, 540, -532, 508, -544, 536, -1528, 592, -508, 540, -512, 556, -1536, 540, -1584, 536, -1508, 536, -1528, 544, -504, 544, -1524, 544, -1552, 540, -1556, 540, -1532, 536, -1508, 536, -1528, 544, -1528, 536, -1508, 536, -512, 536, -536, 536, -512, 540, -508, 540, -512, 532, -536, 564, -508, 540, -508, 540, -512, 484, -588, 536, -540, 540, -508, 536, -532, 536, -512, 544, -1504, 484, -1584, 536, -512, 536, -1556, 540, -508, 536, -1532, 540, -1528, 544, -508, 540, -504, 540, -512, 544, -528, 540, -508, 540, -532, 540, -1584, 536, -1508, 536, -1528, 544, -1524, 488,

Thanks in advance

Massimo Dani