Configure a Smart Temperature control for Air Conditioner

Published April 10, 2020  ( 5 min read )
automation

Today in the headway of Automation innovation, life is getting simpler and less demanding in all spheres. Home automation is a modern technology that modifies your home to perform different sets of task automatically. Today Automatic frameworks are being favored over manual frameworks. No wonder, home automation in the world is already the buzz word, especially as the wave of second generation home owners grows, they want more than shelter, water, and electricity.

In this blog, we will learn how we can use WiFiSecureAccess to put a window or split system airconditioner ON/OFF automatically depending on the temperature sensed at a farther corner of the room. This can help reduce average electricity bill per month. Lets get started :

Things we need


  1. Two units of WifiSecureAccess Smart device
  2. One unit of DHT11 Temperature/Humidity sensor
  3. One unit of 240/110Volt, 30A external relay
WiFiSecureAccess smart device can be purchased from Amazon.

Fig 1: WiFi Secure Access Smart Device



DHT11 Temperature/Humidity sensor is a low cost sensor that can read temperature and humidity.

Fig 2: DHT11 Temperature/Humidity Sensor

DHT11 Temperature/Humidity sensor can be purchased from anywhere. Given below is a link from amazon. If this link is not available, search for DHT11 Temperature/Humidity in ebay, Amazon or Google


As the Airconditioner may take more than 10A current, the internal relay onboard the smart device cannot be used, as its current rating is only 10A. So, you need to get an external relay with a current and voltage rating that matches with the airconditioner that you are using. Given below is a picture of a relay and its link from Amazon for a relay rated at 240V 30A. If this link is not available, search for 240V 30A relay in ebay, amazon or google. Given below is just a suggestion. You can use any available relay which matches the current requiremt of your airconditioner.

Fig 3: 240V 30A Relay

Note: If this link is broken, search for '30A High Current Relay' in Amazon.com



Step 1

Connect DHT11 sensor to one of the smart devices as shown in Fig 4 and Fig 5 below.

Fig 4: Cabling DHT11 Temperature sensor to Smart Device

Fig 5: Cabling DHT11 Temperature sensor to smart device

Connect GND, DATA, and VCC of DHT11 to GND, D7 and 3V3 on the connector PJ4 of one of the smart devices. You can also use connector J6 of the smart device, if you prefer that way. We suggest that you use a 3-line flat cable to connect to PJ4. Then you can either install DHT11 within the smart device as shown in Fig 6 or you can install DHT11 outside the box of the smart device.
Fig 6: Installing DHT11 Tempe4rature sensor

Then install this smart device along with the DHT11 sensor at a location in the room where you want it to sense the temperature. Then, either connect 12V or 240VAC power to this smartdevice depending on what is convenient at that location of the room. Make sure to select the power supply correctly by putting the jumper on PJ1 depending on what power source you have cabled to this smart device.

Step 2

Cable the 30A relay to the second smart device and the airconditioner and the 240V/110V power line as per Fig 7 and Fig 8 below.

Fig 7: Cabling 30A Relay to smart Device and AirConditioner

Fig 8: Cabling External Relay to Smart device

Fig 8A: Cabling 30A Relay to smart Device and AirConditioner

Connect the red wire (+) of the relay to VDD, and the black wire (-) to P0 on the J9 connector of the smart device. Connect a jumper wire from 12V og connector J2 to VDD on connector J9 of the smart device. Refer Fig 9.
Fig 9: Cabling 30A Relay to smart Device

Then, install this smart device at a location closer to the airconditioner's power supply point. Keep in mind that the casing of the smart device is not water-proof and, therefore, you cannot install it outside unless you use a water resistant casing to enclose everything.

Step 3

Put on the power to both the smart devices. If these devices are brand new and you have not yet assigned their ownership to yourself and not yet set their WiFi, go through the steps given in 'Installation' section 2.0 of the documentation. If you had done those steps earlier for these two devices, you will hear a beep sound when the power is put on and the LED will turn red. When doing the initial configuration of these devices in that section of installation, set the name of these two devices something meaningful. Also, the 'Use Type' of both these sensors must be set to 'CONTROL/SENSOR'.

Before configuring automatic controls, check if you can actvate the airconditioner from your smartphone. Open the app and click on 'Activate a device' in the scanning page of the app, and then click on the device connected to the airconditioner. Then, click on the red cross mark on RELAY. If all cabing is correct and if you have completed the steps in the 'Installation' section of the documentation correctly, you should see the aircondition is put ON. Click on it once more to put it off manually. You should be seeing the airconditioner is put off.

Next, configure the device connected to the DHT11 sensor. Click on 'Configure Device' under 'Device Admin' in the dashboard. This can be done either from a smartphone of a computer. If using smartphone, open the app and press 'Admin Dashboard'. Then, expand the menu at the top right and click on 'Configure Device' under 'Device admin'. If you are using a computer, do the same on a dashboard. You will see a page similar to Fig 10 when you click 'Configure Device'. Select Use Type as 'CONTROL/SENSOR' and select 'DHT11 Temperature Humidity' for D7. Then press Submit button.

Fig 10: Initial Configuration of Devices

Next, check if this smart device is reading the temperature correctly. Click on Dashboad and click on 'Hme/Industrial Automation' and then on 'Devices in Automation' and then click in theat device's name. Alternatively, click on 'Show Device Details' under 'Device Admin' in Dashoard. you will be taken to the details of this device. On that page click on Sensor Values. You should be seeing the temperature read by the DHT11 sensor. You will see the display in degree celcius as well as Fareinheiht similar to Fig 11.
Fig 11: Display DHT11 Temperature/Humidity Sensor

On this page make sure that it is reading the temperature and humidity correctly.

Step 4

Once we have completed all the previous steps successfully, we are ready to configure automatic control. Click on 'Configure Auto Controls' under 'Device Admin' in Dashboard. Then select the device with DHT11 sensor. You will see a page similar to Fig 12.


Fig 12: Configure Auto control

On this page, click on 'ADD INPUT BASED PORT CONTROL'. That will take you to a page similar to Fig 13.
Fig 13: Configure Auto control (ON)

On this page, select the Out port as P0 and Out device as the name of the other device to which you have connected the 30A relay and the airconditioner. Then, for 'Mode', select 'PUT ON THE PORT AND/OR SEND EMAIL WHEN'. Select 'GREATER THAN OR EQUAL TO' for the logical operator field. Then for 'Value' field, set whatever temperature at which the airconditioner must be put ON. Then press Submit button. If all fields are correct and if it finds no conflict of this port control with any other settings of both these devices, it will successfully configure this prtcontrol.

As explained in section 5.3 of the documentation, the above port control will put on the airconditioner when the temperature is 75 degree (or, whatever temperature you have set) or higher, and it will put off the airconditioner when the temperature is belor 75 degree. This sharp cut-off is not ideal as it may switch on/off the airconditioner too frequently. To avoid this, we will add another port control specifying when the airconditioner should be put off once it is on. To do this click on 'AADD INPUT BASED PORT CONTROL' once more. And, in the new page select the values as shown in Fig 14.
Fig 14: Configure Auto control (OFF)

On this page, select Out Port' as P0. This is the port to which the 30A relay on the other device is cabled to. Select the name of the other device for 'Out device'. For 'Mode' for this control, select 'PUT OFF THE PORT AND/OR SEND EMAIL WHEN'. Select 'DH7 DHT TEM FAHRENHT' for Input port. For logical operation, select 'LESS THAN'. Then set a Value at which you want the airconditioner OFF. Then press Submit. If every entry is correct, it will configure this portcontrol for putting the airconditione OFF. It will then display all the port controls set for this device (similar to Fig 15).
Fig 15: Configure Auto control (OFF)

You can make further modifications on this page, if you want to. If you make any further modifications on this page, do not forget to press Submit. If you have no further modifications to make, therre is nothing more to do.

The system is all set to go. Check and monitor if everything is working as configured. You can make any further modifications of the port controls any time by clicking 'Configure Auto Controls' under 'Device Admin' in Dashboard.