vilaswkhade
Published © LGPL

Monitor temp/humidity and control LED from anywhere!!

Attractive 'Remote control panel' with gauges to monitor data and buttons for LED control.

IntermediateFull instructions provided6,417
Monitor temp/humidity and control LED from anywhere!!

Things used in this project

Hardware components

NodeMCU ESP8266 Breakout Board
NodeMCU ESP8266 Breakout Board
×1
LED (generic)
LED (generic)
×4
DHT11 Temperature & Humidity Sensor (3 pins)
DHT11 Temperature & Humidity Sensor (3 pins)
×1
Arduino UNO
Arduino UNO
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

LED-IoT

Connections

Code

LED-IoT.ino

C/C++
Monitor Temperature, Humidity and control LED over internet.
#include <DHT.h> // library of DHT11 temperature and humidity sensor
#include <CavyIoTdevelopmentBoard.h>

//----------------------DHT11 connection------------------------------------
DHT dht(8, DHT11);
//--------------------------------------------------------------------------

//---------------For communication with DevBoard ----------------------------
#define rx 10
#define tx 11
#define rst 13
//---------------------------------------------------------------------------
CavyIoT myIoTdevice;       //Create instance of CavyIoT Object.
//---------------------------------------------------------------------------
//--------------------- Sensor Variables ------------------------------------
float temp;
float hum;

//--------------------------------------------------------------------------
void setup()
  {
   Serial.begin(9600);
   myIoTdevice.SetPort(rx,tx,rst);
   dht.begin();
  
//--------------------- Button Labels----------------------------------------   
 
  Serial.println("Wait for a while to connect!");
  /*------To start Device replace your own credentials here-----------------------------*/ 
  myIoTdevice.StartDevice
  /*Your Wi-Fi router->*/("WiFi-SSID","WiFi-password",
   /* CavyIoT------>*/"Username","password","Device");//
 //--------------------------------------------------------------------------
   }

void loop()
  {
                                   
    myIoTdevice.loop();  //Updates the Status variable.                           
  
   Serial.println("Device Status:-"+myIoTdevice.Status);
   
   //---------Read values from sensor ---------------------
  
   temp=dht.readTemperature();
   hum=dht.readHumidity(); 
  
   //----------------Sending data to server----------------------------------
   myIoTdevice.UpdateSensorData
      ( "Temperature",String(temp),  "C",
         "humidity",  String(hum),   "Rh"
      );

}//End of loop

Credits

vilaswkhade

vilaswkhade

3 projects • 15 followers

Comments