Project showcase
Comptroller Box: IoT Based Smart Switchboard

Comptroller Box: IoT Based Smart Switchboard © CC0

Primarily a possible approach of a smart switchboard to control/operate any traditional electrical gadgets remotely using a web application.

  • 1,248 views
  • 0 comments
  • 9 respects

Components and supplies

Apps and online services

About this project

Concept

The project is on the application of SCADA property of Internet of Things. The project is about the development of a smart electric multipin plug box which can be used to power various electrical appliances this box can be remotely controlled/operated using a web application. The project proposes an efficient implementation for Internet of Things used for monitoring and controlling the home appliances via Internet. The project basically has three divisions a User Interface, Switch Board (wiz-wiki board) and Communication interface between the both. The Board is controlled using a Wizwiki-W7500 board which in turn is creates a webserver that can be accessed using a web browser.

Introspection

The project is about the development of a home/industrial automation which will be able to remotely control and monitor environment using a web application. Home automation develops automation for a home, called a smart home which includes the control and automation of AC (air conditioning), lighting, and security and additional home apparatuses; like washer/dryers, ovens or fridges. Wi-Fi is frequently utilized for remote checking and control. The project is based on Supervisory control and data acquisition (SCADA) which comprises of software and hardware elements that allows users to

  • Control processes locally or at remote locations
  • Gather, Monitor and process real-time data
  • Switching traditional electrical appliances to Smart devices is very difficult task, the switchboard provides a feature to control any old electrical gadgets remotely

Comptroller Box: A review

Why This Project?

We, as a team wanted to do a project that would satisfy these three constraints:

* easily implementable

* practically possible

* cost efficient

We majorly focus on the problem domain i.e. "Energy Conservation".

Why to conserve energy?

Ø Protection can spare you cash. Thisis one of the most compelling motivations numerous start to develop a cultureof preservation, be that as it may, as an ever increasing number of individualslearn, it is positively not by any means the only reason.

Ø Less power utilized means lessnon-renewable energy sources consumed. It's valid that we can acquire powerfrom cleaner wellsprings of vitality, for example, wind and sun oriented power,however a great part of the power that we utilize is still from sources, forexample, oil and coal. Petroleum products are not inexhaustible sources and thegreater power we devour, the quicker these assets will be drained.

Ø Non-renewable energy sources are nota spotless wellspring of vitality either. Preservation of electrical vitalitycan decrease contamination and lessen ozone harming substance discharges.

Ø As a component of the comprehensiveview, preservation can likewise help decrease the danger of oil slicks and thedangers that coal and oil acquirement stance to our biological communitiesaround the globe.

Ø With an end goal to decreasepetroleum derivative utilization, researchers have centered cash and endeavorsinto creating atomic reactors. Despite the fact that these reactors can yieldmuch power, it likewise delivers radioactive waste items. Diminishing ourinterest for power can diminish the requirement for atomic reactors and alongthese lines decrease the danger of radioactive contamination

Related Work/Background

Implementing Home Automation systems is one of the most popular Internet of Things projects with huge possibilities to expand. Home Automation projects done by beginners are mostly using Arduino controllerand Bluetooth devices which are easy to implement. With experience in Arduino, webdesigning and the interest in both led me to choose this project. Instead of using Arduino or Raspberry pi whichare easy in implementation, I choose Wizwiki-W7500 board because of itspotential in networking. A user interface was developed using HTML, CSS and JavaScriptto gain more experience in the same.

WIZ750SR: The game changer

WIZ750SR is the condensed sized serial toEthernet unit utilizing W7500P, WIZnet iMCU, cortex-M0. WIZ750SR is theconvention converter that transmits the information sent by serial gear asTCP/IP information compose, and changes over back the TCP/IP information gotthrough the system into serial information to transmit back to a serialhardware. It supports the serial interface of TTL, RS-232, RS-422/485. Learning about the “Wiz750SR” and making a project using it was the major responsibility. The project technically has three divisions: a User Interface, Switch Board (Comptroller board) and Communication interface between both. Wiz750SR plays a major role as the communication module concerning to device and the database.

Actual Work/ Implementation

Here are the screenshots pictures of the actual work and output

UI/UX

Evidence:

Backend Establishment:

Code

Connecting the database with Arduino:PHP
<?php
   
    $dbusername = "arduino"; 
    
    $dbpassword = "arduinotest";
    
    $server = "localhost"; 

    $dbconnect = mysql_pconnect($server, $dbusername, $dbpassword);
    $dbselect = mysql_select_db("test",$dbconnect);

    $sql = "INSERT INTO test.sensor (value) VALUES ('".$_GET["value"]."')";    

    mysql_query($sql);

?>

#include <SPI.h>
#include <Ethernet.h>

byte mac[] = {
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
 
// Enter the IP address for Arduino, as mentioned we will use 192.168.0.16
// Be careful to use , insetead of . when you enter the address here
IPAddress ip(192,168,0,16);

int photocellPin = 0;  // Analog input pin on Arduino we connected the SIG pin from sensor
int photocellReading;  // Here we will place our reading

char server[] = "192.168.0.11"; // IMPORTANT: As we are using XAMPP we had to find out the IP address of the computer and put it here.

// Initialize the Ethernet server library
EthernetClient client;

void setup() {
 
  // Serial.begin starts the serial connection between computer and Arduino
  Serial.begin(9600);
 
  // start the Ethernet connection
  Ethernet.begin(mac, ip);
    
}

void loop() {
 
  photocellReading = analogRead(photocellPin); // Fill the sensorReading with the information from sensor
 
  // Connect to the server (your computer or web page)  
  if (client.connect(server, 80)) {
    client.print("GET /write_data.php?"); // This
    client.print("value="); // This
    client.print(photocellReading); // And this is what we did in the testing section above. We are making a GET request just like we would from our browser but now with live data from the sensor
    client.println(" HTTP/1.1"); // Part of the GET request
    client.println("Host: 192.168.0.11"); // IMPORTANT: As we are using XAMPP we had to find out the IP address of the computer and put it here.
    client.println("Connection: close"); // Part of the GET request telling the server that we are over transmitting the message
    client.println(); // Empty line
    client.println(); // Empty line
    client.stop();    // Closing connection to server

  }

  else {
    // If Arduino can't connect to the server (your computer or web page)
    Serial.println("--> connection failed\n");
  }
 
  // the server is given some time to receive the data and store it say 10 seconds. Be advised when delaying. Using a short delay might lead the server unable to capture data because of Arduino transmitting new data too soon.
  delay(10000);
}
LED operationsPHP
<?php
$onoroff = $_GET["state"];
$textfile = "LEDstate.txt"; 
 
$fileLocation = "$textfile";
$fh = fopen($fileLocation, 'w   ') or die("Something went wrong!"); 

$stringToWrite = "$onoroff"; 
fwrite($fh, $stringToWrite); 
fclose($fh); 
 
header("Location: index.html");
?>
Wiz750SR Connectivity Source CodeC/C++
#include "mbed.h"
#include "EthernetInterface.h"
#include "Adafruit_SSD1306.h"
#include "HTTPClient.h"


#if defined(TARGET_WIZWIKI_W7500)||defined(TARGET_WIZWIKI_W7500P)
    uint8_t mac_addr[6] = {0x00, 0x08, 0xDC, 0x53, 0xAE, 0x90};
#endif
Serial pc(USBTX, USBRX);
Serial device(D1,D0);
EthernetInterface eth;

// Declare TCP Connection Class
TCPSocketConnection sock;

int main() {
   int val;
   int i=0;
   char c;
   
char D[1000];
   
   int phy_link;
    printf("Wait a second...\r\n");

   eth.init(mac_addr);     //Use DHCP

printf("Check Ethernet Link\r\n");
    /*while(1) //Wait link up
    {
        if(eth.link() == true) 
            break;
    }*/
    printf("Link up\r\n");

    eth.connect();
    
      printf("IP Address is %s\r\n\r\n", eth.getIPAddress());
        printf("MASK Address is %s\r\n\r\n", eth.getNetworkMask());
        printf("GATEWAY Address is %s\r\n\r\n", eth.getGateway());
        printf("MAC Address is %s\r\n\r\n", eth.getMACAddress());
        while(1){
             while(device.readable())
        {   
        
            D[i]=device.getc();
           // char c= device.getc();
            pc.printf("%c",D[i]);
            c = D[i];
            i++;
            
            
        }
        val = int(c - 48);
        //printf("%d",val);
        // TCP socket connect to openweather server 
        //TCPSocketConnection sock;
        char send_data[1024];
        int CDS_data=val;
        sock.connect("api.thingspeak.com", 80);
        
         sprintf(send_data, "GET https://api.thingspeak.com/update?api_key=WO0QPMWOHQ7HTZMM&field1=%d HTTP/1.0\n\n",CDS_data);
        // GET method, to request weather forecast  
       // char http_cmd[] = "GET /update?api_key=0Q8S3KCULT7GUDVR&field1=2000 HTTP/1.0\n\n";
        
           
        sock.send_all(send_data, sizeof(send_data)-1);
        
        // get data into buffer
        char buffer[2048];
        int ret;
        while (true) {
            ret = sock.receive(buffer, sizeof(buffer)-1);
            if (ret <= 0)
                break;
            buffer[ret] = '\0';
            printf("Received %d chars from server: %s\n", ret, buffer);     
        }
        printf("\r\n\r\n");
      }
}
WIZwiki-W7500 Source CodeC/C++
#include "mbed.h"
#include "EthernetInterface.h"
#include "FsHandler.h"
#include "HTTPServer.h"
#include "SDFileSystem.h"
#include "SoftwareSerial.h"


SoftwareSerial mySerial(10,11);//RX, TX

#if defined(TARGET_WIZWIKI_W7500)||defined(TARGET_WIZWIKI_W7500P)
    //Choose one of file system.
    SDFileSystem local(SD_MOSI, SD_MISO, SD_CLK, SD_SEL, "local");//PB_3, PB_2, PB_1, PB_0
    //LocalFileSystem local("local");
#endif

#if defined(TARGET_WIZWIKI_W7500)||defined(TARGET_WIZWIKI_W7500P)
    uint8_t mac_addr[6] = {0x00, 0x08, 0xDC, 0xFF, 0xFF, 0x02};
#endif

// Declare Ethernet Class
EthernetInterface eth;

// Declare HTTP Server Class
HTTPServer  svr;

// Set Server Network
char ip_addr[] = "169.254.80.156";
char subnet_mask[] = "255.255.255.0";
char gateway_addr[] = "192.168.240.1";


int main()
{
    HTTPFsRequestHandler::mount_eth(&eth);
    HTTPFsRequestHandler::mount("/local/", "/");
    svr.addHandler<HTTPFsRequestHandler>("/");

#if defined(TARGET_WIZWIKI_W7500)||defined(TARGET_WIZWIKI_W7500P)
    
    #ifdef DHCP
        eth.init(mac_addr); //Use DHCP
    #else
        eth.init(mac_addr, ip_addr, subnet_mask, gateway_addr); //Not Use DHCP
    #endif

#else

    #ifdef DHCP
        eth.init(); //Use DHCP
    #else
        eth.init(ip_addr, subnet_mask, gateway_addr); //Not Use DHCP
    #endif

#endif

    printf("Check Ethernet Link\r\n");
    while(1) //Wait link up
    {
        if(eth.link() == true) 
            break;
    }
    printf("Link up\r\n");

    eth.connect();
    printf("Server IP Address is %s\r\n", eth.getIPAddress());

    if (!svr.start(80, &eth)) {

        error("Server not starting !");
        exit(0);
    }

    while(1) {
        svr.poll();
    }
    
}

Schematics

WIZ750SR CONNECTION TO ARDUINO UNO
Screen shot 2018 07 09 at 2 44 31 pm a7orihltxe 1oi3kllnu8
Comptroller and WIZ Boards connection
E5 naqzvjsaob
Workflow
Wf qi0fxmasjk

Comments

Created by

Anshul Shaji

Are you Anshul Shaji? Claim this project and add it to your profile.

This is mine

Posted by

Photo
RAGUL M 1560912
  • 0 projects
  • 3 followers

Published on

July 29, 2018

Members who respect this project

ProfilepicErospeterDefault

and 7 others

See similar projects
you might like

Similar projects you might like

Alexa Based Smart Home Monitoring

Project tutorial by Adithya TG

  • 16,693 views
  • 19 comments
  • 47 respects

Smart Garden

Project showcase by patel Dipen

  • 22,380 views
  • 15 comments
  • 59 respects

Octopod: Smart IoT Home/Industry Automation Project

Project tutorial by Saksham Bhutani

  • 7,019 views
  • 8 comments
  • 30 respects

Smart Personal Money Vault Monitoring System Based on IoT

Project tutorial by Salah Uddin

  • 847 views
  • 0 comments
  • 6 respects

IOT Based Health Care System

Project showcase by Team Techie

  • 17,890 views
  • 16 comments
  • 42 respects

Android App-Based Home Automation System Using IOT

Project tutorial by Team Autoshack

  • 24,834 views
  • 17 comments
  • 75 respects
Add projectSign up / Login