obniz developer team
Published © GPL3+

Remote Air Conditioner Controller with Smartphone

DIY AC remote controller with obniz. You can measure room temperature and control your AC from outside with smartphone.

BeginnerFull instructions provided4 hours1,721

Things used in this project

Hardware components

IR module
obniz IoT Home Kit
×1
LM32DZ
obniz IoT Home Kit
×1
iPhone
Apple iPhone
any smartphone
×1
Android device
Android device
any smartphone
×1
obniz
Cambrian Robotics obniz
×1

Story

Read more

Code

Program

HTML
<!-- 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>

Credits

obniz developer team

obniz developer team

80 projects • 32 followers
Development board "obniz" is controlled via the internet.

Comments