Remote Air Conditioner Controller

Control an air conditioner from your smartphone with obniz! Put obniz + IR + temperature sensor to your home. You can control it from a browser on your Smartphone.


(*) These are included in IoT Home Kit.


First, connect parts to an obniz like the table and the image below.

obniz parts
0 [IR Module] Vcc
1 [IR Module] send(IR LED anode)
2 [IR Module] recv(IR Receiver output)
3 [IR Module] GND(IR LED cathode)
7 [LM35DZ] GND
8 [LM35DZ] output
9 [LM35DZ] Vcc

Supply power to the obniz and run the program. The temperature measured by temperature sensor will be displayed.

Second, record your air conditioner’s signal for ON/OFF.

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

Put recorded data into the array of the infraredLed.send([]) at the “Program”(line 46).

    // your value for ON here.
   // your value for OFF here

At last, run the program again and push tap the “ON/OFF” button.

Use it !

Just open the HTML, and you can control your air conditioner from everywhere in the world!


<!-- HTML Example -->
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="">
  <script src=""></script>
  <script src=""></script>

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

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

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.font('Avenir', 60)
    obniz.display.print('' + parseInt(temp) + '℃')
  var infraredLed = obniz.wired('InfraredLED', {anode: 1, cathode: 3});
    // your value for ON here.
   // your value for OFF here