0% found this document useful (0 votes)
9 views10 pages

AbitGrp 3

This project presents an ESP-32 based monitoring and control system for induction motors, aimed at enhancing industrial automation and defect monitoring. It focuses on critical parameters such as current, voltage, and temperature to ensure optimal motor performance and prevent issues like over-voltage and over-temperature. The system utilizes wireless technology for real-time data transmission and monitoring, thereby improving productivity and safety in industrial settings.

Uploaded by

Chandan Sahoo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views10 pages

AbitGrp 3

This project presents an ESP-32 based monitoring and control system for induction motors, aimed at enhancing industrial automation and defect monitoring. It focuses on critical parameters such as current, voltage, and temperature to ensure optimal motor performance and prevent issues like over-voltage and over-temperature. The system utilizes wireless technology for real-time data transmission and monitoring, thereby improving productivity and safety in industrial settings.

Uploaded by

Chandan Sahoo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 10

ABSTRACT

In this project, we give a novel perspective on industrial automation and defect


monitoring. Induction motors
are used in a variety of sectors. As a result, industrial automation is required
for precise and accurate operation.
For safe and cost-effective data transmission in industrial settings, the ESP-32
based parameter monitoring
system for induction motor project presents an induction motor control and
monitoring system based on the
Arduino communication protocol. The current, voltage, and temperature of an
induction motor are all important
components in its control system. These critical characteristics have a direct
impact on an induction motor's
performance. Controlling the gadgets during continuous operation, on the other
hand, is difficult. The ESP-32
system is used to collect and store data as well as provide control signals to
start and stop the induction
machine. Some of the issues we monitor are over voltage, over current, and over
temperature. By continuously
checking for problems and determining preventive maintenance, this strategy will
increase machine
productivity.

INTRODUCTION

Improved efficiency and the ability to use them for a longer period of time. Single
phase induction motors are
utilised to drive mechanical systems and numerous production processes in an
industrial setting. The motor's
performance has a direct impact on the product's quality and quantity, therefore
it's important to keep an eye
on it. Wireless systems are now widely used for monitoring and control in a variety
of fields, including
manufacturing, robotics, and building automation. Wireless monitoring is being used
in industry for robotics
and manipulation systems in some cases. A Wi- Fi-based industrial real-time
measurement and monitoring
system is provided. Recently, there has been a surge in interest in this building
automation standard. They were
chosen because to their low energy consumption and capabilities, as well as their
ease of maintenance and data
collection. Another advantage of this method is that it continuously monitors the
devices for changes in
parameters and displays the relevant data. A high level of protection can be
provided by informing the user
with the appropriate message, allowing the operator to take action to protect
thermometer. Remote systems
can be used to monitor a variety of practical applications as a result of recent
advancements in wireless
technology and devices. In measurement equipment, wireless devices based on
industry standards, such as
Arduino kits, are commonly utilised. By allowing individuals to turn off appliances
during peak hours,
automation also helps to cut peak hour power consumption. Home automation,
industrial automation, and
other forms of automation are all examples of automation. Earlier methods, such as
phone- based systems for
automation and control using hardware remote controller and an intelligent system,
were primarily based on
the usage of telephone lines. As a result, the portable device also has the ability
to rescue the entire system from
numerous problems or unanticipated faults by cutting off the main supply. The use
of motors, control systems,
and information technology to increase productivity in the manufacturing of goods
and the delivery of services is
known as automation. Automation entails utilising the power of technology to lessen
reliance on human
presence and decision- making in any process.

MATERIALS USED

1. ESP-32
2. Induction Motor
3. Relay Module
4. Temp Sensor
5. Potentiometer
6. LCD Module
7. LCD Driver
8. Voltage Regulator
9. Voltage Sensor
10. Panel Indicator Lights
11. Capacitors
12. Resistors
13. Vero Board
14. Header Pins
15. wires
16. Clamps
17. Adapater

CODING PART

#include <ESP32WiFi.h>
#include <ESP32WebServer.h>
#include <ESP32HTTPUpdateServer.h>
#include <DNSServer.h>

ESP32WebServer server(80);
ESP32HTTPUpdateServer httpUpdater;
DNSServer dnsServer;
const byte DNS_PORT = 53;

#ifdef BLYNK_USE_SPIFFS
#include <FS.h>
#else
const char* config_form = R"html(
<!DOCTYPE HTML>
<html>
<head>
<title>WiFi setup</title>
<style>
body {
background-color: #fcfcfc;
box-sizing: border-box;
}
body, input {
font-family: Roboto, sans-serif;
font-weight: 400;
font-size: 16px;
}
.centered {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);

padding: 20px;
background-color: #ccc;
border-radius: 4px;
}
td { padding:0 0 0 5px; }
label { white-space:nowrap; }
input { width: 20em; }
input[name="port"] { width: 5em; }
input[type="submit"], img { margin: auto; display: block; width: 30%; }
</style>
</head>
<body>
<div class="centered">
<form method="get" action="config">
<table>
<tr><td><label for="ssid">WiFi SSID:</label></td> <td><input type="text"
name="ssid" length=64 required="required"></td></tr>
<tr><td><label for="pass">Password:</label></td> <td><input type="text"
name="pass" length=64></td></tr>
<tr><td><label for="blynk">Auth token:</label></td><td><input type="text"
name="blynk" placeholder="a0b1c2d..." pattern="[-_a-zA-Z0-9]{32}" maxlength="32"
required="required"></td></tr>
<tr><td><label for="host">Host:</label></td> <td><input type="text"
name="host" value="blynk.cloud" length=64></td></tr>
<tr><td><label for="port_ssl">Port:</label></td> <td><input type="number"
name="port_ssl" value="443" min="1" max="65535"></td></tr>
</table><br/>
<input type="submit" value="Apply">
</form>
</div>
</body>
</html>
)html";
#endif

void restartMCU() {
ESP.restart();
delay(10000);
ESP.reset();
while(1) {};
}

void getWiFiName(char* buff, size_t len, bool withPrefix = true) {


byte mac[6] = { 0, };
WiFi.macAddress(mac);
uint32_t unique = 0;
for (int i=0; i<4; i++) {
unique = BlynkCRC32(&mac, sizeof(mac), unique);
}
unique &= 0xFFFFF;

if (withPrefix) {
snprintf(buff, len, "Blynk %s-%05X", BLYNK_DEVICE_NAME, unique);
} else {
snprintf(buff, len, "%s-%05X", BLYNK_DEVICE_NAME, unique);
}
}

void enterConfigMode()
{
char ssidBuff[64];
getWiFiName(ssidBuff, sizeof(ssidBuff));

WiFi.mode(WIFI_OFF);
delay(100);
WiFi.mode(WIFI_AP_STA);
WiFi.softAPConfig(WIFI_AP_IP, WIFI_AP_IP, WIFI_AP_Subnet);
WiFi.softAP(ssidBuff);
delay(500);

IPAddress myIP = WiFi.softAPIP();


DEBUG_PRINT(String("AP SSID: ") + ssidBuff);
DEBUG_PRINT(String("AP IP: ") + myIP[0] + "." + myIP[1] + "." + myIP[2] + "." +
myIP[3]);

if (myIP == (uint32_t)0)
{
config_set_last_error(BLYNK_PROV_ERR_INTERNAL);
BlynkState::set(MODE_ERROR);
return;
}

// Set up DNS Server


dnsServer.setTTL(300); // Time-to-live 300s
dnsServer.setErrorReplyCode(DNSReplyCode::ServerFailure); // Return code for non-
accessible domains
#ifdef WIFI_CAPTIVE_PORTAL_ENABLE
dnsServer.start(DNS_PORT, "*", WiFi.softAPIP()); // Point all to our IP
server.onNotFound(handleRoot);
#else
dnsServer.start(DNS_PORT, CONFIG_AP_URL, WiFi.softAPIP());
DEBUG_PRINT(String("AP URL: ") + CONFIG_AP_URL);
#endif

httpUpdater.setup(&server, "/update");

#ifndef BLYNK_USE_SPIFFS
server.on("/", []() {
server.send(200, "text/html", config_form);
});
#endif
server.on("/config", []() {
DEBUG_PRINT("Applying configuration...");
String ssid = server.arg("ssid");
String ssidManual = server.arg("ssidManual");
String pass = server.arg("pass");
if (ssidManual != "") {
ssid = ssidManual;
}
String token = server.arg("blynk");
String host = server.arg("host");
String port = server.arg("port_ssl");

String ip = server.arg("ip");
String mask = server.arg("mask");
String gw = server.arg("gw");
String dns = server.arg("dns");
String dns2 = server.arg("dns2");

bool save = server.arg("save").toInt();

String content;

DEBUG_PRINT(String("WiFi SSID: ") + ssid + " Pass: " + pass);


DEBUG_PRINT(String("Blynk cloud: ") + token + " @ " + host + ":" + port);

if (token.length() == 32 && ssid.length() > 0) {


configStore.setFlag(CONFIG_FLAG_VALID, false);
CopyString(ssid, configStore.wifiSSID);
CopyString(pass, configStore.wifiPass);
CopyString(token, configStore.cloudToken);
if (host.length()) {
CopyString(host, configStore.cloudHost);
}
if (port.length()) {
configStore.cloudPort = port.toInt();
}

IPAddress addr;

if (ip.length() && addr.fromString(ip)) {


configStore.staticIP = addr;
configStore.setFlag(CONFIG_FLAG_STATIC_IP, true);
} else {
configStore.setFlag(CONFIG_FLAG_STATIC_IP, false);
}
if (mask.length() && addr.fromString(mask)) {
configStore.staticMask = addr;
}
if (gw.length() && addr.fromString(gw)) {
configStore.staticGW = addr;
}
if (dns.length() && addr.fromString(dns)) {
configStore.staticDNS = addr;
}
if (dns2.length() && addr.fromString(dns2)) {
configStore.staticDNS2 = addr;
}

if (save) {
configStore.setFlag(CONFIG_FLAG_VALID, true);
config_save();
content = R"json({"status":"ok","msg":"Configuration saved"})json";
} else {
content = R"json({"status":"ok","msg":"Trying to connect..."})json";
}
server.send(200, "application/json", content);

BlynkState::set(MODE_SWITCH_TO_STA);
} else {
DEBUG_PRINT("Configuration invalid");
content = R"json({"status":"error","msg":"Configuration invalid"})json";
server.send(500, "application/json", content);
}
});
server.on("/board_info.json", []() {
DEBUG_PRINT("Sending board info...");
const char* tmpl = BLYNK_TEMPLATE_ID;
char ssidBuff[64];
getWiFiName(ssidBuff, sizeof(ssidBuff));
char buff[512];
snprintf(buff, sizeof(buff),

R"json({"board":"%s","tmpl_id":"%s","fw_type":"%s","fw_ver":"%s","ssid":"%s","bssid
":"%s","last_error":%d,"wifi_scan":true,"static_ip":true})json",
BLYNK_DEVICE_NAME,
tmpl ? tmpl : "Unknown",
BLYNK_FIRMWARE_TYPE,
BLYNK_FIRMWARE_VERSION,
ssidBuff,
WiFi.softAPmacAddress().c_str(),
configStore.last_error
);
server.send(200, "application/json", buff);
});
server.on("/wifi_scan.json", []() {
DEBUG_PRINT("Scanning networks...");
int wifi_nets = WiFi.scanNetworks(true, true);
const uint32_t t = millis();
while (wifi_nets < 0 &&
millis() - t < 20000)
{
delay(20);
wifi_nets = WiFi.scanComplete();
}
DEBUG_PRINT(String("Found networks: ") + wifi_nets);

if (wifi_nets > 0) {
// Sort networks
int indices[wifi_nets];
for (int i = 0; i < wifi_nets; i++) {
indices[i] = i;
}
for (int i = 0; i < wifi_nets; i++) {
for (int j = i + 1; j < wifi_nets; j++) {
if (WiFi.RSSI(indices[j]) > WiFi.RSSI(indices[i])) {
std::swap(indices[i], indices[j]);
}
}
}
wifi_nets = BlynkMin(15, wifi_nets); // Show top 15 networks

// TODO: skip empty names


server.setContentLength(CONTENT_LENGTH_UNKNOWN);
server.send(200, "application/json", "[\n");

char buff[256];
for (int i = 0; i < wifi_nets; i++){
int id = indices[i];

const char* sec;


switch (WiFi.encryptionType(id)) {
case ENC_TYPE_WEP: sec = "WEP"; break;
case ENC_TYPE_TKIP: sec = "WPA/PSK"; break;
case ENC_TYPE_CCMP: sec = "WPA2/PSK"; break;
case ENC_TYPE_AUTO: sec = "WPA/WPA2/PSK"; break;
case ENC_TYPE_NONE: sec = "OPEN"; break;
default: sec = "unknown"; break;
}

snprintf(buff, sizeof(buff),
R"json( {"ssid":"%s","bssid":"%s","rssi":%i,"sec":"%s","ch":%i,"hidden":
%d})json",
WiFi.SSID(id).c_str(),
WiFi.BSSIDstr(id).c_str(),
WiFi.RSSI(id),
sec,
WiFi.channel(id),
WiFi.isHidden(id)
);

server.sendContent(buff);
if (i != wifi_nets-1) server.sendContent(",\n");
}
server.sendContent("\n]");
} else {
server.send(200, "application/json", "[]");
}
});
server.on("/reset", []() {
BlynkState::set(MODE_RESET_CONFIG);
server.send(200, "application/json", R"json({"status":"ok","msg":"Configuration
reset"})json");
});
server.on("/reboot", []() {
restartMCU();
});

#ifdef BLYNK_USE_SPIFFS
if (SPIFFS.begin()) {
server.serveStatic("/img", SPIFFS, "/img");
server.serveStatic("/", SPIFFS, "/index.html");
} else {
DEBUG_PRINT("Webpage: No SPIFFS");
}
#endif

server.begin();
while (BlynkState::is(MODE_WAIT_CONFIG) || BlynkState::is(MODE_CONFIGURING)) {
delay(10);
dnsServer.processNextRequest();
server.handleClient();
app_loop();
if (BlynkState::is(MODE_WAIT_CONFIG) && WiFi.softAPgetStationNum() > 0) {
BlynkState::set(MODE_CONFIGURING);
} else if (BlynkState::is(MODE_CONFIGURING) && WiFi.softAPgetStationNum() == 0)
{
BlynkState::set(MODE_WAIT_CONFIG);
}
}

server.stop();

#ifdef BLYNK_USE_SPIFFS
SPIFFS.end();
#endif
}

void enterConnectNet() {
BlynkState::set(MODE_CONNECTING_NET);
DEBUG_PRINT(String("Connecting to WiFi: ") + configStore.wifiSSID);

WiFi.mode(WIFI_STA);

char ssidBuff[64];
getWiFiName(ssidBuff, sizeof(ssidBuff));
String hostname(ssidBuff);
hostname.replace(" ", "-");

WiFi.hostname(hostname.c_str());

if (configStore.getFlag(CONFIG_FLAG_STATIC_IP)) {
if (!WiFi.config(configStore.staticIP,
configStore.staticGW,
configStore.staticMask,
configStore.staticDNS,
configStore.staticDNS2)
) {
DEBUG_PRINT("Failed to configure Static IP");
config_set_last_error(BLYNK_PROV_ERR_CONFIG);
BlynkState::set(MODE_ERROR);
return;
}
}

if (!WiFi.begin(configStore.wifiSSID, configStore.wifiPass)) {
config_set_last_error(BLYNK_PROV_ERR_CONFIG);
BlynkState::set(MODE_ERROR);
return;
}

unsigned long timeoutMs = millis() + WIFI_NET_CONNECT_TIMEOUT;


while ((timeoutMs > millis()) && (WiFi.status() != WL_CONNECTED))
{
delay(10);
app_loop();
if (!BlynkState::is(MODE_CONNECTING_NET)) {
WiFi.disconnect();
return;
}
}

if (WiFi.status() == WL_CONNECTED) {
IPAddress localip = WiFi.localIP();
if (configStore.getFlag(CONFIG_FLAG_STATIC_IP)) {
BLYNK_LOG_IP("Using Static IP: ", localip);
} else {
BLYNK_LOG_IP("Using Dynamic IP: ", localip);
}

BlynkState::set(MODE_CONNECTING_CLOUD);
} else {
config_set_last_error(BLYNK_PROV_ERR_NETWORK);
BlynkState::set(MODE_ERROR);
}
}

void enterConnectCloud() {
BlynkState::set(MODE_CONNECTING_CLOUD);

Blynk.config(configStore.cloudToken, configStore.cloudHost,
configStore.cloudPort);
Blynk.connect(0);

unsigned long timeoutMs = millis() + WIFI_CLOUD_CONNECT_TIMEOUT;


while ((timeoutMs > millis()) &&
(!Blynk.isTokenInvalid()) &&
(Blynk.connected() == false))
{
delay(10);
Blynk.run();
app_loop();
if (!BlynkState::is(MODE_CONNECTING_CLOUD)) {
Blynk.disconnect();
return;
}
}

if (millis() > timeoutMs) {


DEBUG_PRINT("Timeout");
}

if (Blynk.isTokenInvalid()) {
config_set_last_error(BLYNK_PROV_ERR_TOKEN);
BlynkState::set(MODE_WAIT_CONFIG);
} else if (Blynk.connected()) {
BlynkState::set(MODE_RUNNING);

if (!configStore.getFlag(CONFIG_FLAG_VALID)) {
configStore.last_error = BLYNK_PROV_ERR_NONE;
configStore.setFlag(CONFIG_FLAG_VALID, true);
config_save();
}
} else {
config_set_last_error(BLYNK_PROV_ERR_CLOUD);
BlynkState::set(MODE_ERROR);
}
}

void enterSwitchToSTA() {
BlynkState::set(MODE_SWITCH_TO_STA);

DEBUG_PRINT("Switching to STA...");

delay(1000);
WiFi.mode(WIFI_OFF);
delay(100);
WiFi.mode(WIFI_STA);

BlynkState::set(MODE_CONNECTING_NET);
}

void enterError() {
BlynkState::set(MODE_ERROR);

unsigned long timeoutMs = millis() + 10000;


while (timeoutMs > millis() || g_buttonPressed)
{
delay(10);
app_loop();
if (!BlynkState::is(MODE_ERROR)) {
return;
}
}
DEBUG_PRINT("Restarting after error.");
delay(10);

restartMCU();
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy