Automatic AC Temperature Controller using Arduino, DHT11 and IR Blaster
An AC (Air Conditioner) which was once considered to be a luxury item and was only to be found in big hotels, movie halls, restaurants etc… But, now almost everyone has a AC in our home to beat out the summer/winter and those who have it, worry about one common thing. That is their high electricity consumption and chargers due to it. In this project we are going to make a small Automatic Temperature Control Circuit that could minimize the electricity chargers by varying the AC temperature automatically based on the Rooms temperature. By varying the set temperature periodically we can avoid making the AC to work for lower temperature values for a long time and thus making it consume less power.
Most of us would have experienced a situation where we have to change the Air Conditioner’s set temperature to different values during different times of the day, so as to keep us comfy throughout. To automate this process this project uses a Temperature sensor (DHT11) which reads the present temperature of the room and based on that value it will send commands to the AC through an IR blaster similar to the AC’s Remote. The AC will react to these commands as if it is reacting to its Remote and thus adjust the temperature. As your room’s temperature changes, the Arduino will also adjust your AC’s set temperature to maintain your temperature in just the way you want it to be. Sounds cool right?… Let’s see how to build one.
- Arduino Mega 2560
- TSOP1738 (HS0038)
- IR Led
- DHT11 Temperature/Humidity Sensor
- Any Colour LED and 1K Resistor(optional)
- Connecting Wires
All the Remote Controls in our home that we use to control TV, Home Theatre, AC etc work with the help of IR Blasters. An IR blaster is nothing but an IR LED which could blaster a signal by repetitive pulsing; this signal will be read by the receiver in the electronics appliance. For each different button on the remote a unique signal will be blasted which after read by the receiver is used to perform a particular pre-defined task. If we are able to read this signal coming out from the Remote, we can then mimic the same signal using an IR LED when ever required to perform that particular task. We have previously made a IR Blaster circuit for Universal IR Remote.
A TSOP is an IR Receiver that could be used to decode the signal coming from the Remotes. This Receiver will be interfaced with Arduino to signal for each button and then an IR Led will be used with Arduino to mimic the signal when ever required. This way we can gain control over our AC using Arduino.
Now, all that is left is to read the Temperature value using DHT11 and instruct the AC accordingly using the IR signals. To make the project look more attractive and user friendly I have also added an OLED display that display the current Temperature, Humidity and AC set temperature. Learn more about using OLED with Arduino.
This Automatic AC Temperature Controller project is slightly advanced for beginner’s level, however with help of few other tutorials anyone can build this with matter of time. So if you are a absolute newbie to OLED, DHT11 or TSOP then kindly fall back to these tutorials below where you can learn the basics and how to get started with these. The list might seem to be bit long, but trust me it’s easy and worth learning, also it will open doors to many new projects.
- Basic circuit using TSOP and IR LED to under their working
- Basic interfacing guide for DHT11 with Arduino
- Basic interfacing guide for OLED with Arduino
- Interfacing TSOP with Arduino to Read IR remote values
Make sure you have an Arduino Mega and any other version of Arduino, since the code size is heavy. Also check if you have already installed the following Arduino libraries if not install them form the link below
- IR Remote Library for TSOP and IR Blaster
- Adafruit Library for OLED
- GFX Graphics Library for OLED
- DHT11 Sensor Library for Temperature sensor
Working of an AC Remote:
Before we proceed into the project take some time and notice how your AC remote works. AC remotes work in a bit different way compared to TV, DVD IR remotes. There might be only 10-12 buttons on your Remote, but they will be able to send a lot of different types of signals. Meaning the Remote does not send the same code every time for the same button. For example, when you decrease the temperature using the down button to make it 24°C (degree Celsius) you will get a signal with a set of data, but when you press it again to set 25°C you will not get the same data since the temperature is now 25 and not 24. Similarly the code for 25 will also vary for different fan speed, sleep settings etc. So let’s not fiddle around with all options and just concentrate only the temperature values with a constant value for other settings.
Another problem is the amount of data that is being sent for each button press, normal remotes with send either 24 bits or 48 bits but an AC remote might sends up to 228 bits since each signal contains a lot of information like Temp, Fan Speed, Sleep timing, Swing style etc. This is the reason why we need an Arduino Mega for better storage options.
Circuit Diagram and Explanation:
Luckily the hardware setup of this Automatic AC Temperature Control Project is very easy. You can simply use a breadboard and make the connections as shown below.
JLCPCB – Prototype 10 PCBs for $2 + 2 days Lead Time
China’s Largest PCB Prototype Enterprise, 300,000+ Customers & 10,000+ Online Orders Per Day
Inside a huge PCB factory: https://www.youtube.com/watch?v=_XCznQFV-Mw
This Post / Project can also be found using search terms:
- Project on use of sound for measurment of temperature