Air Conditioner Automation with Arduino UNO

Imagine walking into your house and finding someone watching a program on TV that you do not like. Would it not be great if you could change the channel or better still, switch off the TV without using the TV remote?

Or, have an automated AC system, which you can switch on / off using your mobile? Set on and off times, on durations, temp settings, well make it all automatic?

All this is possible now.  One option is to use an Arduino UNO along with an IR receiver and IR transmitter module. The UNO can be programmed to Switch on / off, or whatever rules you have in mind.

The process can be classified into two stages,

Stage-1

In this stage we decode the IR signals from the remote using the IR receiver module connected to the Arduino UNO.

Stage – 2

In this stage we transmit the decoded commands through an IR transmitter connected to the Arduino UNO.

In this write up, we will show you how to decode IR signals and then transmit these signals back to the concerned IR receivers.

Required Components:

IR Receiver Module 38 kHz TSOP4838

Library Used:

Arduino IRremote library

Connecting IR Receiver and Transmitter to Arduino:

AC Arduino

 Arduino Code to decode incoming IR signals:

/***
IR Receiver.ino
***/

#include <IRremote.h>
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup()
{
Serial.begin(9600);   // begin serial communication with baud rate 9600
irrecv.enableIRIn();                // Start the receiver
}
void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
irrecv.resume();                 // Receive the next value
}
}

———————————-

The Serial output looks like,

Example:

1324 3500 4400 4400 -550 1700 500 550 -550 600 -500 -600 550 -550 550 -550 -550 550 550 550 -550 600 500 -1700 550 550 550 -550 -550 1650 -550 1700 -550 1650 -550 1650 -550 1700 500 1700 -500 -600 550 -550 -550

Arduino Code to retransmit the captured IR signals:

/***
IR Transmitter.ino
***/
#include<IRremote.h>
IRsend irsend;
unsigned int data[43]={4400,4400,550,1700,500,550,550,600,500,600,550,550,550,550,550,550,550,550,550,600,500,1700,550,550,550,550,550,1650,550,1700,550,1650,550,1650,550,1700,500,1700,500,600,550,550,550};        // Samsung air conditioner ON/OFF received HEX data

int KHz = 38;                    // default frequency
void setup() 
{
Serial.begin(9600);   // begin serial communication with baud rate 9600 
}
void loop()
{
irsend.sendRaw (data, 43, KHz);  // Samsung air conditioner ON/OFF
}

———————————-

Authors: Gunaseelan and Niranjan

4 thoughts on “Air Conditioner Automation with Arduino UNO

  1. i have problem whith code… not working…

    Arduino: 1.6.7 (Windows 7), Πλακέτα:”Arduino/Genuino Uno”

    C:\Program Files (x86)\Arduino\libraries\RobotIRremote\src\IRremoteTools.cpp:5:16: error: ‘TKD2’ was not declared in this scope

    int RECV_PIN = TKD2; // the pin the IR receiver is connected to

    ^

    exit status 1

    Compile error .

    This report will have more information
    “Show verbose output when compiling ”
    enabled File> Options.

    ent the secont program:

    Arduino: 1.6.7 (Windows 7), Πλακέτα:”Arduino/Genuino Uno”

    klima_2:5: error: ‘IRsend’ does not name a type

    IRsend irsend;

    ^

    C:\Users\user\Documents\Arduino\klima_2\klima_2.ino: In function ‘void loop()’:

    klima_2:15: error: ‘irsend’ was not declared in this scope

    irsend.sendRaw (data, 43, KHz); // Samsung air conditioner ON/OFF

    ^

    exit status 1
    ‘IRsend’ does not name a type

    Compile error .

    This report will have more information
    “Show verbose output when compiling ”
    enabled File> Options.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s