0% found this document useful (0 votes)
40 views18 pages

Iot Jury

Uploaded by

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

Iot Jury

Uploaded by

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

Introduction to Internet of Things

Semester V

Group Members:
Archna Singh (BFT/21/22)
Asmita Bala (BFT/21/410)
Shambhavi Arya (BFT/21/44)

Topic: Machine health monitoring through


various sensors and collection of real-time data

Submitted to: Dr. Rashmi Thakur


1. INTROUDCTION

1.1. Problem Statement: Machine health monitoring through various sensors and collection of real-time
data

The current state of industrial sewing machines is marred by a critical issue: frequent breakdowns caused
by an excessive flow of electrical current. This recurrent problem not only disrupts production processes
but also results in significant financial losses due to downtime, repair costs, and potential damage to
materials in progress.

The root cause of these breakdowns is the lack of an effective current monitoring and regulation system
within the sewing machines. The absence of mechanisms to detect and mitigate excess current flow in
real-time exacerbates the risk of equipment failure, posing a significant challenge to the sustainable and
efficient operation of sewing processes.

Hence, the central problem to be addressed is the design and implementation of a reliable current
monitoring and regulation system for industrial sewing machines. This system should be capable of
promptly identifying instances of excessive current flow and initiating appropriate corrective actions to
prevent breakdowns. The ultimate aim is to enhance the operational resilience of sewing machines,
minimize unplanned downtimes, and reduce the economic impact associated with repairs and material
wastage.

1.2. Things in use:


● ACS712T current sensor:

○ The ACS712T is part of the Allegro Microsystems' ACS712 series, a family of Hall
effect-based linear current sensors designed for accurate and precise current
measurement.

○ Leveraging the Hall effect, these sensors generate a linear output proportional to the
current flowing through a nearby conductor.

○ The ACS712T variant is known for its high precision, low-noise performance, and
user-friendly interface.

○ Available in compact modules with various current measurement ranges, it offers


flexibility for diverse applications such as motor control, power supply monitoring, and
battery management systems.

○ Engineers and hobbyists often integrate ACS712T sensors into their projects for reliable
and real-time current monitoring, benefiting from the sensor's compact form factor and
ease of use.

● FL-3FF-S-Z relay
○ FL: This could be an abbreviation related to the type, function, or series of the relay. For
example, it might stand for "Flasher" or refer to a specific series.

○ 3FF: This part of the code might indicate the relay's form factor, package type, or pin
configuration. "3FF" could potentially refer to a 3 Form Factor, which is a common
terminology in relay configurations.

○ S-Z: These letters may provide additional details about the relay's features or
specifications. Without specific information, it's challenging to determine the exact
meaning of these letters.

● Jumper wire

○ Jumper wires are essential components in electronics and prototyping, commonly used to
establish electrical connections between various components on a breadboard or between
different points on a circuit.

○ These wires typically consist of insulated copper conductors with male or female
connectors at each end, allowing for easy and temporary connections.

● Socket board 20 A

○ It is an electrical device designed to provide multiple power outlets for devices and
appliances with a total current rating of up to 20 amps.

○ The board typically includes multiple sockets, allowing users to connect several electrical
devices simultaneously.

○ These socket boards are commonly used in households, offices, and other locations where
multiple devices need to be powered from a single power source.

○ It's important to ensure that the total current drawn from all connected devices does not
exceed the specified ampere rating to avoid overloading the circuit.

○ Socket boards are convenient for organizing and powering various electronic gadgets and
appliances in a centralized and accessible manner.

○ Users should always adhere to safety guidelines and the manufacturer's recommendations
when using electrical socket boards.

● Wire 1 m

● Esp 8266 Node MCU

○ A versatile open-source development board that combines the ESP8266 Wi-Fi module
with an integrated USB and serial converter.

○ This compact and cost-effective board is widely used in Internet of Things (IoT) projects
and prototyping.

○ Key features of the NodeMCU ESP8266 include its ability to connect to Wi-Fi networks,
making it suitable for wireless communication and IoT applications.
Bill of Materials

S. no. Component Description Qty Price (in Rs.)

1. Computer or Laptop To run the facial recognition software. 1 60,000

establishing electrical conductivity


2. Wire between two devices of an electrical 1 100
circuit.

to connect the electronic component's


3. connecting pins, like an integrated 1 200
Socket board (20A)
circuit, in order to securely grab the
contact and create a solid connection

4. Vibration sensor detects mechanical vibrations 1 85

5. ESP8266 give any microcontroller access to your 1 419


WiFi network

6. ACS 712T to measure AC current as well as DC 2 480


current

7. Jumper Wires connects remote electric circuits used 8 159


for printed circuit boards

8. Breadboard (large) building temporary circuits 1 395

9. External Power Supply power products - -

10. Relay A relay is an electrically operated switch 1 139


Bill of Materials (Industrial)
S. no. Component Description Qty Price (in Rs.)
establishing electrical conductivity
between two devices of an electrical
1. 1 100
Wire circuit.
to connect the electronic component's
connecting pins, like an integrated circuit,
in order to securely grab the contact and
2. 1 300
Socket board (20A) create a solid connection
Accelerometer sensors have the ability to
alter obtained physical acceleration from
3. 1 2,400
Accelerometer Sensor & Module motion or gravity into a voltage output
provides economical and precise solutions
for AC or DC current sensing in
industrial, commercial, and
4. 1 95
ACS712 communications systems
5. Breadboard For building temporary circuits. 1 691.90

increase safety by grounding, isolating,


and protecting the other components in
6. Terminal Block 1 200
the electrical circuit
An industrial-grade Wi-Fi module
designed for embedded applications,
offering features like hardware
encryption, secure boot, and industrial
7. 1
Microchip WINC1500 temperature range 12,564.49
8. 1
Relay A relay is an electrically operated switc 12,900
2. BLOCK DIAGRAM
3. FOGWING PLATFORM

Key features of Fogwing IoT platform include :

● Device Management:
○ Fogwing enables users to register, manage, and monitor IoT devices remotely.
○ This includes features such as device provisioning, authentication, and configuration.
● Data Ingestion and Storage:
○ The platform allows users to collect, store, and manage data generated by IoT devices.
○ This data can include sensor readings, telemetry data, and other information.
● Connectivity:
○ Fogwing provides connectivity options for various IoT devices.
○ This often includes support for common IoT communication protocols such as MQTT
(Message Queuing Telemetry Transport).
● Real-time Monitoring and Dashboards:
○ Users can monitor the status and performance of their IoT devices in real-time through
dashboards.
○ This feature is essential for tracking the health and behavior of IoT deployments.
● Data Analytics:
○ Fogwing may offer tools and features for analyzing the data collected from IoT devices.
○ This could involve real-time analytics, historical analysis, and the extraction of actionable
insights from the data.

Get started with Fogwing: Connecting ESP8266 with Fogwing

3.1. Create a fogwing account.

3.2. Set up a project.

3.3. Create a Device Type: Define the device type for the ESP8266 module.

3.4. Get Fogwing Credentials:Obtain the necessary credentials (Device ID, Access Key, Secret Key) from
Fogwing for the device. These credentials are used to authenticate the ESP8266 module with the Fogwing
platform.
3.5. Programming ESP8266:

#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include <ACS712.h> // Include ACS712 library

const char* ssid = "A-102";


const char* password = "Nift@hostel";

const char* mqttServer = "iothub.fogwing.net";


const int mqttPort = 8883; // Secure Port
const char* username = "9988e96e316a186f";
const char* mqttTopic = "fwent/edge/9988e96e316a186f/inbound";
const char* clientID = "1151-3942-2604-4090";
const char* mqttPassword = "Bbjbaqoy9$"; // MQTT password (leave empty for now)

const int relayPin = 16; // GPIO16, corresponds to pin labeled as D0

WiFiClientSecure espClient; // Using WiFiClientSecure for SSL/TLS

PubSubClient client(espClient);

ACS712 sensor(A0, 5.0, 1023, 66); // Initialize ACS712 sensor object for 30A variant on pin A0

void setup() {
Serial.begin(115200);
delay(100);

pinMode(relayPin, OUTPUT);
digitalWrite(relayPin, HIGH); // Initially, set the relay pin to HIGH (Closed position)

// Connect to WiFi
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi...");
}

Serial.println("Connected to WiFi!");

espClient.setInsecure(); // Set SSL/TLS parameters

// Connect to Fogwing MQTT broker


client.setServer(mqttServer, mqttPort);
while (!client.connected()) {
if (client.connect(clientID, username, mqttPassword)) {
Serial.println("Connected to MQTT broker");
} else {
Serial.print("Failed, rc=");
Serial.println(client.state());
delay(2000);
}
}
}

void loop() {
float acCurrent = sensor.mA_AC(); // Measure AC current using ACS712 library

// Prepare payload in JSON format


String payload = "{\"current\":" + String(acCurrent) + "}";

// Publish data to Fogwing MQTT broker


if (client.connected()) {
client.publish(mqttTopic, payload.c_str());
delay(5000); // Adjust delay as needed for sending frequency
}

digitalWrite(relayPin, HIGH); // Keep the relay closed (turned ON) constantly

if (!client.connected()) {
reconnect();
}
}

void reconnect() {
while (!client.connected()) {
if (client.connect(clientID, username, mqttPassword)) {
Serial.println("Connected to MQTT broker");
} else {
Serial.print("Failed, rc=");
Serial.println(client.state());
delay(2000);
}
}
}
3.6. Data collection process on Fogwing platform:

Graphical view of current sensor data

Ideal Machine Current when machine is on.

Ideal Data
When the machine is working at maximum speed.

When the machine is working at medium speed.

When the machine is connected to the main but the power supply is off.
When the machine is running at medium speed.

Data Alert for Excess Current Flow


4. BLYNK PLATFORM

Blynk is a platform designed to simplify the development of Internet of Things (IoT) projects by
providing a user-friendly interface for building mobile applications to control and monitor connected
devices. The platform is particularly popular among makers, hobbyists, and developers involved in IoT
and home automation projects. Here's a brief overview of the key features and components of the Blynk
platform:

● Cloud Connectivity:
○ Blynk provides a cloud-based infrastructure that facilitates communication between the
mobile app and the connected IoT devices.
○ This allows for remote monitoring and control over the internet.

● Wide Range of Supported Hardware:


○ Blynk supports a variety of microcontrollers and development boards, including Arduino,
Raspberry Pi, ESP8266, ESP32, and more.
○ This flexibility makes it easy to integrate Blynk into diverse hardware projects.

● Widgets and Functionality:


○ Blynk offers a range of widgets that can be added to the mobile app interface, such as
buttons, sliders, displays, and notifications.
○ These widgets enable users to interact with and visualize data from their connected
devices.

● Blynk Library:
○ The Blynk library provides a set of APIs for various programming languages (Arduino,
Python, Node.js, etc.) to enable seamless integration of Blynk functionality into the
firmware of IoT devices.

● Energy System:
○ Blynk employs an "energy" system where users are allocated a certain amount of energy
for free, and additional energy can be purchased if needed.
○ Each widget added to the mobile app consumes a specific amount of energy.

Overall, Blynk simplifies the process of creating IoT applications, making it accessible to a broad
audience with varying levels of programming expertise. It is well-suited for projects ranging from simple
home automation setups to more complex industrial IoT applications.

4.1. CODE FOR BLYNK

4.1.1. For Vibration

#define BLYNK_TEMPLATE_ID "TMPL3oKW9XqI3"


#define BLYNK_TEMPLATE_NAME "ESP01"

#define BLYNK_PRINT Serial


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

char auth[] = "eh6d5tH5RcgfbaYy451HJgBhAhxLJwhX"; // Blynk authentication token


char ssid[] = "A-102"; // Your Wi-Fi network name
char pass[] = "Nift@hostel"; // Your Wi-Fi network password

int vibrationPinAnalog = A0; // Analog pin for vibration sensor


int windowSize = 10; // Adjust for your needs, determines the smoothing effect
const int vibrationThreshold = 200; // Threshold for extreme vibration
const long vibrationDuration = 5000; // Duration in milliseconds (10 seconds)

unsigned long previousMillis = 0;


unsigned long vibrationStart = 0;

void setup() {
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
pinMode(vibrationPinAnalog, INPUT);
}

void loop() {
Blynk.run();

unsigned long currentMillis = millis();

int totalValue = 0;
for (int i = 0; i < windowSize; i++) {
totalValue += analogRead(vibrationPinAnalog);
delay(10); // Adjust delay between readings
}

int averageValue = totalValue / windowSize;

// You can perform actions based on the averaged sensor value


// For example, send the value to Blynk app widget
Blynk.virtualWrite(V3, averageValue); // Send average value to V1 in Blynk app

// Check for extreme vibration event


if (averageValue > vibrationThreshold) {
if (vibrationStart == 0) {
vibrationStart = currentMillis;
} else if (currentMillis - vibrationStart >= vibrationDuration) {
// Trigger extreme vibration event in Blynk
Blynk.logEvent("extreme_vibration"); // Log the event "extreme_vibration" in Blynk
vibrationStart = 0; // Reset vibrationStart to detect new events
}
} else {
vibrationStart = 0; // Reset vibrationStart if the value drops below the threshold
}
}

_____________________________________________________________________________________

4.1.2. For Current


#define BLYNK_TEMPLATE_ID "TMPL3a0yTONuP"
#define BLYNK_TEMPLATE_NAME "Machine monitoring"

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <ACS712.h> // Include ACS712 library

char auth[] = "LwUpIf0dw_W06jdWFNggcrDGBvKJj3Px"; // Replace with your Auth Token

char ssid[] = "A-102";


char pass[] = "Nift@hostel";

ACS712 sensor(A0, 3.3, 1023, 185); // Initialize ACS712 sensor object for 30A variant on pin A0

const int relayPin = 16; // GPIO16, corresponds to pin labeled as D0


const int surgeThreshold = 2000; // Threshold in milliamps (30 Amperes)
const long surgeDuration = 10000; // Duration in milliseconds (2 seconds)
const long relayOffDuration = 5000; // Duration to keep relay off in milliseconds (5 seconds)

unsigned long previousMillis = 0;


unsigned long relayOffStartTime = 0;
bool relayOff = false;

const long interval = 1000; // Interval to calculate power consumption (1 second)

void setup() {
Serial.begin(115200);
delay(100);

pinMode(relayPin, OUTPUT);
digitalWrite(relayPin, HIGH); // Initially, set the relay pin to HIGH (Closed position)

Blynk.begin(auth, ssid, pass); // Connect to Wi-Fi and Blynk using your Auth Token, Wi-Fi SSID, and
password

// Print a debug message


Serial.println("Connected to Wi-Fi and Blynk");
}

void loop() {
Blynk.run(); // Run Blynk

unsigned long currentMillis = millis();

// Calculate power consumption every 'interval' milliseconds


if (currentMillis - previousMillis >= interval) {
previousMillis = currentMillis;

float acCurrent = sensor.mA_AC(); // Measure AC current using ACS712 library

float voltage = 230.0; // Assuming standard voltage (modify according to your region)
float power = (acCurrent / 1000.0) * voltage; // Calculate power in watts
float powerConsumption = power * (interval / 3600000.0); // Calculate power consumption in kWh

// Send AC current, power, and power consumption data to Blynk virtual pins V0, V1, and V2
Blynk.virtualWrite(V0, acCurrent);
Blynk.virtualWrite(V1, power);
Blynk.virtualWrite(V2, powerConsumption);

Serial.print("Current: ");
Serial.println(acCurrent);

// Check for surge event


if (acCurrent > surgeThreshold) {
static unsigned long surgeStart = 0;
if (surgeStart == 0) {
surgeStart = currentMillis;
} else if (currentMillis - surgeStart >= surgeDuration) {
// Trigger critical surge event in Blynk
Blynk.logEvent("current_surge"); // Log the event "current_surge" in Blynk

if (!relayOff) {
Serial.println("Turning off relay");
digitalWrite(relayPin, LOW); // Turn off the relay
relayOff = true;
relayOffStartTime = currentMillis;
} else if (currentMillis - relayOffStartTime >= relayOffDuration) {
Serial.println("Turning on relay");
digitalWrite(relayPin, HIGH); // Turn on the relay after relayOffDuration
relayOff = false;
}

surgeStart = 0; // Reset surgeStart to detect new surges


}
} else {
static unsigned long surgeStart = 0; // Declare surgeStart in the else statement
surgeStart = 0; // Reset surgeStart if the current drops below the threshold
}
}

delay(100); // Add a delay for stability


}

_____________________________________________________________________________________

5. RESULTS AND DISCUSSION

The prototype of the proposed system during the on-state and the off-state of the sewing machine,
respectively. The ACS712 current sensor was placed in the circuitry of the main power supply in fig. 5.1.
(a) and (b), while the LM393 vibration sensor was placed right on the motor’s surface to ensure that the
vibration produced by the motor can be sensed effectively, shown in fig. 5.2. (a) and (b).
Fig. 5.1. (a) Fig. 5.1. (b)

Fig. 5.2. (a) Fig. 5.2. (b)

The graphical user interface (GUI) in the Blynk application is shown.


Fig. 5.3. Real-time monitoring of Current and Power

Fig. 5.4. Real-time monitoring of Vibration

Fig. 5.5. (a), (b) and (c) shows the notification message from Blynk as displayed on the mobile dashboard.
When the user opens the Blynk application, the Blynk server will retrieve the data from the Blynk cloud
to display the measurement values on all widgets added to the page.

Fig. 5.5. (a) Notification message from Blynk Fig. 5.5. (b) Graphical User Interface in
application displayed on the mobile dashboard. T Blynk Application

You might also like