DIY Smart Home – Control AC from anywhere with Smartphone

By on August 2, 2018

Web site:

https://obniz.io/explore/30

Project Summary:

You can measure room temperature and control your AC from outside with your smartphone. Let's create DIY Air conditioner remote controller with obniz.

Full Project:

Remote air conditioner controller

By connecting obniz through wifi, you can measure room temperature and control air conditioner from outside using smartphone via the internet.

Step 1

Connect IR module and LM32DZ to obniz as below and place it in your house.

obniz ac controller

Step 2

Write the program in the code section. Do need to change  obniz ID in the program to your obniz ID.  By clicking “save & open,” you can see the room temperature.

obniz ac controller 2

Step 3

Record your air conditioner’s signal for ON/OFF.

The example program contains comment outed code for IR receiver. Remove the comment out and record your air conditioner’s ON/OFF signal. Your signal will be shown in the log.

Put the recorded data array into your program.

Use it!

Just open the HTML with your smartphone. You can control your air conditioner from everywhere in the world!

What is Obniz?

Obniz is a cloud-connected IoT development board. You can program on the web browser of any smartphone or computer and the command is sent to obniz through the internet. By connecting the Obniz to the cloud through wifi, users can remotely control devices that are physically connected to obniz.

obniz how it works

Obniz has 12 IO and WiFi-BLE module. It can be controlled through the APIs – REST or WebSocket API – on obniz cloud. Not only simple IO on/off but also UART, I2C, BLE etc can be used by remotely controlling obniz via internet. All you need to do to connect obniz is to input unique ID by scanning QR code. Complicated processes are done by obniz and its cloud. You can just start programming in HTML, browser and circuit have already been integrated. If you write a program to collect sensor values , you can make a chart of the values easily.

obniz program

 

In terms of hardware, every IO can drive up to 1A with overcorrect protection, therefore high current demanding devices such as motors can be directly connected to Obniz IO. GPIO and AD can be used on every IO. UART, SPI etc peripherals can be assigned to every IO. Even output voltage 3v/5v can be changed by software. Most electrical parts can be connected directly. Embedded parts such as switch, OLED display, and BLE are ready for use on
program.

obniz info

More information on obniz is available on its website

Bill of Materials:

  • Obniz
  • IR module
  • LM32DZ
  • Smartphone

Software & Code Snippets:

<!-- HTML Example -->
<html>
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css">
  <script src="https://obniz.io/js/jquery-3.2.1.min.js"></script>
  <script src="https://unpkg.com/obniz@1.6.1/obniz.js"></script>
  
</head>
<body>

<div id="obniz-debug"></div>

<h1 id="temp">Measuring...</h1>
  
<p>
  <button id="on" class="btn btn-primary btn-block">Turn ON</button>
</p>
<p>
  <button id="off" class="btn btn-primary btn-block">Turn OFF</button>
</p>

<script>
  
var obniz = new Obniz("OBNIZ_ID_HERE");

obniz.onconnect = async function () {
  
  //var sensor = obniz.wired('IRSensor', {vcc:0, gnd:3, output: 2});
  //sensor.start(function (arr) {
  //  console.log('detected!!')
  //  console.log(JSON.stringify(arr));
  //})

  // Javascript Example
  var tempsens = obniz.wired("LM35DZ",   { gnd:7 , output:8, vcc:9});
  tempsens.onchange = function(temp){
    $("#temp").text('' + parseInt(temp)+ ' degree')
    obniz.display.clear();
    obniz.display.font('Avenir', 60)
    obniz.display.print('' + parseInt(temp) + '℃')
  };
  
  var infraredLed = obniz.wired('InfraredLED', {anode: 1, cathode: 3});
  
  $("#on").click(function(){
    // your value for ON here.
    infraredLed.send([])
  })
  
  $("#off").click(function(){
   // your value for OFF here
    infraredLed.send([])
  })
}


</script>
</body>
</html>

 

About obniz

Cloud-connected IoT development board. https://obniz.io. You can create your DIY projects which can be controlled through Wifi from anywhere.

Leave a Reply

Your email address will not be published. Required fields are marked *

Connect with Facebook

*