---
title: "Comptroller Box: IoT based smart switch-board"
url: "https://maker.wiznet.io/josephsr/projects/comptroller-box%3A-iot-based-smart-switch-board/"
markdown_url: "https://maker.wiznet.io/josephsr/projects/comptroller-box%3A-iot-based-smart-switch-board/md"
type: "UCC: User Created Content"
author: "Ragul Karan"
author_url: "https://www.youtube.com/watch?v=SZj9Jpnej8c"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "Ragul Karan"
original_url: "https://www.youtube.com/watch?v=SZj9Jpnej8c"
published: "2023-03-03"
language: "en"
likes: 4
views: 242
comments: 1
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# Comptroller Box: IoT based smart switch-board

> A smart electric multipin plug box for various electrical appliances this box can be remotely controlled/operated using a web application

Original author: Ragul Karan (source: https://www.youtube.com/watch?v=SZj9Jpnej8c)

## Article

**StoryConcept**

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

**WhyThisProject?**

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

**RelatedWork/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

![Comptroller with WIZ-Wiki7500](https://maker.wiznet.io/upload/ckeditor5/254956471%5F1678438702%2Ejpeg)

1 / 4 • Comptroller with WIZ-Wiki7500

**UI/UX**

Evidence:

![UI/UX (i)](https://maker.wiznet.io/upload/ckeditor5/254956471%5F1678438702%5F0%2Ejpeg)

1 / 4 • UI/UX (i)

**Backend Establishment:**

![Sensor readings](https://maker.wiznet.io/upload/ckeditor5/254956471%5F1678438702%5F1%2Ejpeg)

1 / 2 • Sensor readings

**SchematicsWIZ750SR CONNECTION TO ARDUINO UNO**

![](https://maker.wiznet.io/upload/ckeditor5/254956471%5F1678438702%2Epng)

**Comptroller and WIZ Boards connection**

![텍스트, 실내, 전자기기, 혼잡한이(가) 표시된 사진 자동 생성된 설명](https://maker.wiznet.io/upload/ckeditor5/254956471%5F1678438702%5F3%2Ejpeg)

**Workflow**

![](https://maker.wiznet.io/upload/ckeditor5/254956471%5F1678438702%5F2%2Ejpeg)

**Code**

- **Connecting the database with Arduino:**

- LED operations

- Wiz750SR Connectivity Source Code

- WIZwiki-W7500 Source Code

**Connecting the database with Arduino:**

&lt;?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 &lt;SPI.h>

#include &lt;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);

}

---

Source: https://maker.wiznet.io/josephsr/projects/comptroller-box%3A-iot-based-smart-switch-board/
