Monitoring and Controlling of Single Phase Induction Motor Using Wi-Fi Module
Monitoring and Controlling of Single Phase Induction Motor Using Wi-Fi Module
net/publication/334680282
CITATIONS READS
0 1,417
4 authors, including:
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Sonam Gyaljen Tamang on 25 July 2019.
A
FINAL YEAR PROJECT REPORT
ON
PROJECT SUPERVISOR
Prof. Dr. Indraman Tamrakar
Er. Nischal Guruwacharya
PROJECT MEMBERS
RABIN LIMBU (071/BEL/026)
August 2018
COPYRIGHT
The copyright of this report is reserved solely on the authors and no part of this publication
may be reproduced, distributed, or transmitted in any form without the prior permission from
the authors or the supervisors involved with this publication. The authors have agreed that
the Library, Department of Electrical Engineering, Kathmandu Engineering College may
make this report freely available for inspection. Moreover, the author has agreed that
permission for extensive copying of this project report for scholarly purpose may be granted
by the supervisors who supervised the project work recorded herein or, in their absence, by
the Head of the Department wherein the project report was done. It is understood that the
recognition will be given to the author of this report and to the Department of Electrical
Engineering, Kathmandu Engineering College in any use of the material of this project
report. Copying or publication or the other use of this report for financial gain without
approval of to the Department of Electrical Engineering, Kathmandu Engineering College
and author’s written permission is prohibited. Request for permission to copy or to make
any other use of the material in this report in whole or in part should be addressed to:
Head of Department
Department of Electrical Engineering
Kathmandu Engineering College
Kathmandu, Nepal
iii
ACKNOWLEDGEMENT
We are very grateful to our supervisors Prof. Dr. Indraman Tamrakar and Er. Nischal
Guruwacharya for their supervision and for their guidance regarding the project which
helped us greatly strive in the right direction.
We are grateful to Er. Bhuban Dhamala for providing guidelines in project and for his
unconditional support and help. Thanks are dues to all the department lecturers and teachers
for their cooperation for the completion of this project.
At last, we’d like to express our deep appreciation to our lecturers and friends, for endless
support and help from the inception of this project till its end, whether directly or indirectly.
iv
ABSTRACT
Now days, induction motor has remained the most popular type of motor for industrial
applications. The primary advantage of the induction motor is because of its straightforward
rotor construction leading to low cost, ruggedness, and low- maintenance requirements. This
project presents a remote controlling and monitoring system for a single phase induction
motor based on wireless communication with the help of a microcontroller (Arduino Uno)
and a Wi-Fi module (NodeMCU), for safe and economic data communication in industrial
fields. A module of transducers and sensors monitors the parameters like RPM, load current
and voltage of induction motor and the obtained measurements are sent to the
microcontroller, which will analyze and display the parameters, here the processing unit also
communicates with the Wi-Fi module, which acts as a server in order to send information to
the client for remote monitoring. The information sent by the server is available through a
webpage which can be opened either in any phone or computer. The system also presents
the automatic and manual control methods to stop or start the induction machine to avoid
system failures. In addition to the control methods, the system also allows to change the
speed of the induction motor. The control methods is also available in the webpage.
v
TABLE OF CONTENTS
ACKNOWLEDGEMENT ................................................................................................ iv
ABSTRACT...................................................................................................................... v
1. INTRODUCTION ......................................................................................................... 1
1.1. Background ......................................................................................................... 1
1.2. Objective............................................................................................................. 2
1.3. Scope of project .................................................................................................. 2
1.4. Methodology ....................................................................................................... 2
vi
3.2. Proteus Simulation ................................................................................................ 15
3.2.1. Simulation Results .......................................................................................... 16
REFERENCES................................................................................................................ 32
APPENDIX A ................................................................................................................. 33
vii
LIST OF FIGURES
viii
LIST OF TABLES
ix
1. INTRODUCTION
1.1. Background
Before the invention of AC induction motors, DC motors were commonly used for industrial
needs. With the invention of AC induction motors due to their higher performance attributes
over DC motor, industrial automation is being frequently done with it. Induction motors are
electro-mechanical devices used in most industrial applications for the transformation of
power from electrical to mechanical form. Induction motors are utilized all over the world
as the workhorse as a part of mechanical provisions due to their simple, robust, reliable
behavior.
Monitoring, controlling and specially, protection of induction motor, for that matter any
other electrical equipment is an important topic in industries and factories where there are
numerous numbers of motors run daily. Manually monitoring and controlling the motor is a
tedious to do so if there are large number of motors. Also, manually switching off the motors,
in case of any abnormal condition such as high voltage or high current, for large numbers of
motor in industry is even more tiresome. Hence, remote monitoring, controlling and
automatic protection of those motors is needed.
1
1.2. Objective
To monitor the voltage, current, speed and power factor of the induction motor and
control the motor and the speed via Wi-Fi module.
The major objective of this project is to develop a system to remotely monitor the parameters
of the induction motor and protect the motor from any anomalous conditions as well as
develop a control strategy to change the speed as required.
In this project, there is provision of remotely observing the current, voltage, power factor
and speed of the induction motor, switching on or off of the motor and changing the speed
of the induction motor; all through the webpage. This project is microcontroller based and
is easily controllable. It has wide range of applications when employed for monitoring
required parameters and controlling speed of a single phase induction motor in industrial
sectors.
1.4. Methodology
The following methodology is took upon in order to carry out the specified objectives:
1. Primary study of induction motor and the speed sensors as well as analysis of current
and voltage measuring circuit and speed control circuit
2. Design of schematic for the circuitry of the measurement circuits as well as the speed
control circuit
3. Programming in Arduino IDE software for the Arduino Uno microcontroller
4. Simulation of the voltage and current measurement circuit and speed control circuit
in Proteus software to determine the required parameters of the hardware
5. Design and fabrication of hardware of proposed scheme
6. Testing and debugging of fabricated hardware
7. Documentation of the project with final report
2
2. RELEVANT THEORY
3
2.1.1. Working Principle of Single Phase Induction Motor
When the stator of a single phase motor is fed with single phase supply, it produces
alternating flux in the stator winding. The alternating current flowing through stator winding
causes induced current in the rotor bars (of the squirrel cage rotor) according to Faraday's
law of electromagnetic induction. This induced current in the rotor will also produce
alternating flux. Even after both alternating fluxes are set up, the motor fails to start (the
reason is explained below). However, if the rotor is given an initial start by external force in
either direction, then motor accelerates to its final speed and keeps running with its rated
speed. This behavior of a single phase motor can be explained by double-field revolving
theory.
The double-field revolving theory states that, any alternating quantity (here, alternating flux)
can be resolved into two components having magnitude half of the maximum magnitude of
the alternating quantity, and both these components rotating in opposite direction. Following
figures will help you understanding the double field revolving theory.
4
Figure 2.3 Double-field revolving theory
The stator of a single phase induction motor is wound with single phase winding. When the
stator is fed with a single phase supply, it produces alternating flux (which alternates along
one space axis only). Alternating flux acting on a squirrel cage rotor cannot produce rotation,
only revolving flux can. That is why a single phase induction motor is not self-starting.
Every day engineers design products that employ single-phase induction motors. Speed
control of single-phase induction motors is desirable in most motor control applications since
it not only provides variable speed but also reduces energy consumption and audible noise.
Most single-phase induction motors are unidirectional, which means they are designed to
rotate in one direction. Either by adding extra windings, external relays and switches, or by
adding gear mechanisms, the direction of rotation can be changed. Using microcontroller-
based control systems, one can add speed variation to the system. In addition to the option
of speed variation, the direction of rotation can also be changed, depending upon the motor
control algorithms used.
5
2.2.1. Unidirectional and Bidirectional Control
VF control in one direction makes the drive topology and control algorithm relatively easy.
The task is to generate a variable voltage and frequency power supply from a fixed voltage
and frequency power supply (such as a wall-outlet power supply). Motor windings are
connects to the center of each half bridge on the output-inverter section. Many motors
available off the shelf have both the main and start windings connected together with a
capacitor connected in series with the start winding. The motor may have only two
protruding wires (M1 and M2).
It is capable of outputting up to three pairs of PWMs with dead band in between the pairs.
Dead band is essential in an induction motor control application to avoid cross conduction
of the dc bus through the power switches when one turns OFF and the other turns ON. The
diagnostic circuit may include motor current monitoring, dc-bus voltage monitoring, and
temperature monitoring on the heat sink connected to the power switches and the motor.
Most PSC motors are designed to run in one direction. However, many applications call for
bidirectional motor rotation. Historically, gear mechanisms or external relays and switches
were used to achieve bidirectional rotation. When mechanical gears are used, the motor shaft
runs in one direction, and the gears for forward and reverse engage and disengage according
to the direction required. Using relays and switches, the polarity of the starting winding is
electrically reversed based on the direction required. Unfortunately, all of these components
increase the cost of the system for basic ON and OFF control in two directions.
The drive topologies discussed here produce effective voltages, which drive the main
winding and start winding at 90-degree phase shifts to each other. This enables the system
designer to remove the capacitor, which is in series with start winding, from the circuit
permanently thereby reducing the total system cost.
6
2.2.2. H-Bridge Inverter
This method has a voltage double on the input side; on the output side. One end of the main
and start windings are connected to each half bridge; the other ends are connected together
at the neutral point of the ac power supply, which also serves as the center point for the
voltage double. The control circuit requires four PWMs with two complementary pairs and
sufficient dead-band between the complementary outputs. PWM0-PWM1 and PWM2-
PWM3 are the PWM pairs with dead band. Using PWMs, the dc bus is synthesized to
provide two sine voltages at 90 degrees out of phase with varying amplitude and varying
frequency, according to the VF profile. If the voltage applied to the main winding lags the
start winding by 90 degrees, then the motor runs in the forward direction. To reverse the
direction of rotation, the voltage supplied to the main winding should lead the voltage
supplied to the start winding.
This H-bridge inverter method of controlling a PSC type motor has following disadvantages.
The main and start windings have different electrical characteristics. Thus, the current
flowing through each switch is unbalanced. This can lead to the premature breakdown of
switching devices in the inverter. The common point of the windings is directly connected
to the neutral power supply. This may increase the switching signals creeping into the main
7
power supply, and may increase the noise emitted onto the line. In turn, this may limit the
EMI level of the product, violating certain design goals and regulations.
The effective dc voltage handled is relatively high due to the input-voltage double circuit.
Lastly, the cost of the voltage double circuit itself is high due to two large power capacitors.
The input section is replaced with a standard diode-bridge rectifier. The output section has
a three-phase inverter bridge. The main difference from the previous scheme is the method
used to connect the motor windings to the inverter. One end of the main and start windings
are connected to one half bridge each. The other ends are tied together and connected to the
third half bridge.
With this drive topology, control becomes more efficient. However, the control algorithm
becomes more complex. The winding voltages, Va, Vb, and Vc, should be controlled to
achieve the phase difference between the effective voltages across the main and starting
windings, in order to have a 90-degree phase shift to each other.
In order to have equal voltage-stress levels on all devices, which improves the device
utilization and provides the maximum possible output voltage for a given dc bus voltage, all
three inverter-phase voltages are kept at the same amplitude, as given by:
| Va | = | Vb | = | Vc | (2.1)
The effective voltage across the main and starting windings as given by:
8
The direction of rotation can be easily controlled by the Vc phase angle with respect to Va
and Vb. Using the three-phase inverter control method on a 300W compressor gave a power
saving of 30 percent compared to the first two methods.
Another advantage of using the three-phase control method is that the same drive-hardware
topology can be used to control a three-phase induction motor. In this scenario, the
microcontroller should be reprogrammed to output sine voltages with 120-degree phase shift
to each other, which drives a three-phase induction motor. This reduces the development
time.
Single-phase induction motors are very popular in appliances, and industrial and consumer
applications. PSCs are the most popular type of single-phase induction motors. Controlling
the motor speed has many advantages, such as power efficiency, reduced audible noise and
better control over the application. In this article, we discussed different methods of speed
control that can be used with a PSC motor in unidirectional and bidirectional. Controlling a
PSC motor using a three-phase inverter topology provides the best results.
The circuit makes use of current sensor ACS712. One connection is done with the incoming
phase wire and the other connection is done with the wire on which the induction motor is
connected. For current the upper limit is set to certain value that should not be exceeded in
9
the circuit. The limit should be as such that the current should not damage the electrical
equipment. The limit can be easily altered in case the load is changed. When the current limit
is surpassed in the circuit, the microcontroller should act quickly in order to protect the
motor. Therefore, the relay is operated by the microcontroller as soon as the limit is crossed,
to cut off the supply from the motor. A message is displayed noting that overcurrent has
occurred.
For the voltage measurement circuit, one connection is done with the incoming phase wire
and the other connection is done with the neutral wire. The suitable working voltage range
is set between 180V and 230V. The voltage is varied with the help of potentiometer or an
autotransformer for the purpose of testing in the project. The limit can be easily altered as
per the requirement. The circuit operates satisfactorily if the voltage is within the limits.
Similar to the current measurement circuit, the relay operates and isolates the circuit if the
voltage falls outside of the above limits. A message is displayed in the LCD screen stating
the sensed condition as under voltage when the voltage supply drops below 180V or over
voltage when the voltage supply rises above 230V. If the voltage comes back within the
limit, the relay again connects the motor with the supply.
10
2.5. Power Factor Estimation
P = √3VI (2.4)
Where, V and I are the line voltage and current respectively. The active power, accounting
for supplying the load, is given as
P
PF = = cos ϕ (2.6)
P
The motor current, I would have two components, Iactive and Ireactive. Active part of the current
(Iactive) accounts for the torque, changing according to the load (from no-load to full/over-
load). Reactive part of the current (Ireactive) accounts for the magnetizing current of the
induction motor, without changing much from the no-load to the full-load condition,
practically remaining constant. This is because for induction motor, the magnetizing circuit,
i.e., the stator coil inductances remain same.
I= I +I (2.7)
I = I cos ϕ (2.8)
I = I sin ϕ (2.9)
11
Eq. (2.6) can be rewritten as
I
PF = cos ϕ = 1 − sin ϕ = 1−( ) (2.11)
I
As the reactive component remains constant, it can be estimated from the nominal condition
given by the manufacturer data and/or nameplate data using (2.10). Now, as the motor load
increases, the total motor current (I) in (2.11) would increase, while Ireactive remains constant.
Hence, the ratio of (Ireactive =I) in (2.6) decreases, causing the PF to increase towards unity.
Theoretically, at no-load condition, there is no active current flow. So, at no-load, I = I reactive,
making the PF = 0, theoretically. That is, physically, at no-load, there is not much mechanical
resistance, so the whole circuit is mostly inductive due to the stator coils, causing low power
factor. Increase in motor load is essentially similar to adding resistances to the circuit,
causing the PF to improve. Therefore, in the current-only PF estimation approach, we would
estimate the Ireactive using (2.10) from the nominal PF out of the nameplate data. Then, from
the measured motor current and the constant Ireactive, using (2.11), it is able to estimate the
operating PF. It would not require synchronized voltage and current measurement like in the
displacement PF measurement principle. The displacement PF measurement principle uses
the zero-crossing instants and compares the differences between the voltage and the current.
It will be shown later in details for comparative analysis of the results using different
approaches.
Speed is measured with the Infrared (IR) sensor. An aluminum foil is placed in the rotating
blades of the motor. The sensor senses the foil and the microcontroller records the time it is
being sensed. The microcontroller process the time in to RPM.
Aluminum foil is used set a reference point. Also it reflects light thus enhances sensitivity
of IR sensor. The sensor gives HIGH output, when aluminum foil comes in front of the
sensor.
12
Here in this project, we have used highest priority interrupt to detect rpm and we have
configured it in rising mode. So that whenever sensor output goes LOW to HIGH,
microcontroller. And as we have used one blade rotor, it means the function will be called 2
times in one revolution.
Once the time taken is known we can calculate the RPM by using the below formulae, Where
1000/time taken will give us the RPS and further multiplying it with 60 will give you the
RPM.
13
3. SIMULATION STUDIES
Before carrying out activities in hardware, schematics were made for the current
measurement circuit, voltage measurement circuit, speed sensing circuit and speed control
circuit in KiCad software. In addition to that, simulations were carried out in software such
as Proteus. This chapter is mainly concerned with the simulations in these software.
3.1. Schematics
The schematic of the project for software simulations and hardware fabrication is shown in
the figure 3.1.
14
3.2. Proteus Simulation
After designing schematics on KiCad software, simulations were carried out on Proteus
software. Before this, basic code was written in Arduino IDE to display the current and
voltage, sensed by their respective circuits, to the LCD screen. The hex code was generated
after compilation of the source code, was loaded in the microcontroller. The layout of
Proteus simulation is shown in figure 3.2. The load used in this simulation is an inductive
load, an inductor, as single phase induction motor was not available in the software.
15
3.2.1. Simulation Results
The following figures depicts the results of the Proteus simulation. The voltage measurement
output is shown in figure 3.3 and the current measurement output is shown in figure 3.4.
The simulation also shows that when current exceeds the limit, “high current switch off”
message is shown on the LCD screen of the simulation as depicted in figure 3.5. Then the
system is isolated from the supply proving success in simulation part for the project.
16
4. HARDWARE DESIGN AND FABRICATION
The scheme is the design of a system that monitors and controls the single phase induction
motor and also protects the motor from any abnormal conditions.
The system is proposed using two Arduino Uno microcontroller. The first Arduino Uno is
used to change the speed of the microcontroller and the second Arduino Uno is used for the
purpose of processing the data from sensors. The main advantage of using the Arduino Uno
microcontrollers is its real time approach as instantaneous values of various components
such as phase voltage, phase current, power factor, speed etc. will be displayed on the screen
17
in real time. Various sensors are used to measure the voltage, current and rotor speed of the
induction motor. Other perimeters such as voltage, current, power factor and speed are also
displayed on the laptop screen or phone screen through the website as well as on the LCD
display.
The component we have used to design each circuit are discussed briefly in the following
topics:
For the purpose of the project two Arduino Uno microcontroller has been used; one for the
processing of sensor values and the other for the control of the speed of the induction motor.
Arduino Uno is a microcontroller board based on 8-bit ATmega328P microcontroller. Along
with ATmega328P, it consists other components such as crystal oscillator, serial
communication, voltage regulator, etc. to support the microcontroller. Arduino Uno has 14
digital input/output pins (out of which 6 can be used as PWM outputs), 6 analog input pins,
a USB connection, A Power barrel jack, an ICSP header and a reset button.
18
Table 4.1 Technical Specification of Arduino Uno
Operating Voltage 5V
SRAM 2 KB
EEPROM 1 KB
Single phase induction motor is used for the project. Basically, the induction motor used for
the project was a household water pump. The specification of the pump is given in the
following table:
19
Figure 4.3 Specification of the induction motor
4.2.3. NodeMCU
The Wi-Fi module used in the project is the NodeMCU. NodeMCU is an open source IoT
platform. It includes firmware which runs on the ESP8266 Wi-Fi SoC from Espressif
Systems, and hardware which is based on the ESP-12 module. The term "NodeMCU" by
default refers to the firmware rather than the development kits. The firmware uses the Lua
scripting language. It is based on the eLua project, and built on the Espressif Non-OS SDK
for ESP8266. It uses many open source projects, such as lua-cjson and SPIFFS. NodeMCU
provides access to the GPIO (General Purpose Input/Output) and a pin mapping table is part
of the API documentation.
20
Table 4.3 Specification of NodeMCU board
CPU ESP8266
Memory 128kBytes
Storage 4Mbytes
Power By USB
GPIO 10
The voltage is sensed using a simple potential transformer connected in parallel. It steps
down the voltage value that can be used by the microcontroller.
4.2.5. LCD
LCD stands for Liquid Crystal Display. It is a device that can be used with microcontrollers
to display different messages. Here, this information about the present load consumption,
rate at the real time, units consumed and total cost of energy consumed till date is displayed
in LCD display unit. LCD has a controller chip that controls the action of LCD. To control
the LCD, different command word as to be sent to this controller using the pins of LCD. In
this way, any messages can be displayed using microcontroller, which provide an easy way
to communicate with the hardware.
21
Table 4.4 Pin description of LCD
1 VSS GND
0=Instruction Input
4 RS
1=Data Input
0=Write to LCD
5 R/W
1=Read From LCD
6 EN Enable Signal
7 D0 Bit 0 LSB
8 D1 Bit 1
9 D2 Bit 2
10 D3 Bit 3
11 D4 Bit 4
12 D5 Bit 5
13 D6 Bit 6
14 D7 Bit 7 MSB
22
4.2.6. Triac
Triacs are a subset of thyristors and are related to silicon controlled rectifiers (SCRs). Triacs
differ from SCRs in that they allow current flow in both directions, whereas an SCR can
only conduct current in a single direction. Most triacs can be triggered by applying either a
positive or negative voltage to the gate (an SCR requires a positive voltage). Once triggered,
SCRs and TRIACs continue to conduct, even if the gate current ceases, until the main current
drops below a certain level called the holding current.
For the purpose of the project, BT139 has been used which has the following features:
High blocking voltage capability
Planar passivated for voltage ruggedness and reliability
Less sensitive gate for high noise immunity
Triggering in all four quadrants
23
4.2.7. Optocoupler
Features:
400 V Photo-triac driver output
Gallium-Arsenide-Diode Infrared Source and Optically-Coupled Silicon triac driver
Output Driver Designed for 220 Vac
Standard 6-terminal plastic DIP
24
4.2.8. Hall Effect Sensor
The ACS712 Module uses the famous ACS712 IC to measure current using the Hall Effect
principle. The module gets its name from the IC (ACS712) used in the module, so for you
final products use the IC directly instead of the module.
These ACS712 module can measure current AC or DC current ranging from +5A to -5A,
+20A to -20A and +30A to -30A. You have to select the right range for your project since
you have to trade off accuracy for higher range modules. This modules outputs Analog
voltage (0-5V) based on the current flowing through the wire; hence it is very easy to
interface this module with any microcontroller.
Specifications:
Measures both AC and DC current
Available as 5A, 20A and 30A module
Provides isolation from the load
Easy to integrate with MCU, since it outputs analog voltage
Voltage at 0A is 2.5VDC(dc offset)
25
Table 4.7 Pin description of ACS712
Pin Number Pin Name Description
4.2.10. Relay
Relays are switches that open and close circuits electromechanically or electronically.
Relays control one electrical circuit by opening and closing contacts in another circuit. As
relay diagrams show, when a relay contact is normally open (NO), there is an open contact
when the relay is not energized.
26
Figure 4.9 Relay module
This section includes the discussion of various hardware circuits actually used.
The first Arduino Uno processes all the data that is received by it from the microcontroller
while the second Arduino Uno’s sole responsibility is to change the speed of the motor at
suitable times only when the zero crossing is detected in the supply. The user can switch on
or off the motor through the controls provided in the website and also change the speed of
the motor. The first Arduino Uno is also interfaced with the NodeMCU which is the Wi-Fi
module. The module acts as a server and sends the data to the webpage which is the client
in the case for this project.
27
4.4. Hardware Results
After proper design and fabrication of the hardware, the results were observed on the LCD
screen and the website on laptop screen. The following pictures depict the results with this
project.
28
4.4.1.3 Speed and Power Factor Measurement
29
5. CONCLUSION AND RECOMMENDATION
5.1. Conclusion
The schematics and Proteus simulation proved to be successful to check for the circuitry of
the system to monitor and control the induction motor. The simulation was also conducted
with success for automatic turning off the motor, when high voltage is supplied to motor and
similarly proved to be successful in case of high currents flowing through the circuits.
5.2. Recommendation
Monitoring, controlling and protection system for the single phase induction motor was
successfully designed and fabricated with success as per the aim of the project, but there is
always room for improvement in any project to enhance the project. The following are the
recommended suggestions for future enhancement:
The project only considers single phase induction motors but in reality, other
electrical equipment can also be controlled and monitored using the same system.
There are other parameters of motors such as temperature, frequency, etc. that can
also be monitored in addition to the parameters in the project.
The wireless system in this project requires the remote monitor to be specifically
connected to the Wi-Fi module i.e. it has a limited range but for future works using
internet the range can be improved.
Estimation of power factor is done with the measured current and manufacturer data,
which may not be accurate. Instead of using this estimation technique circuits can be
developed that measures the actual power factor of the system.
30
In addition to only monitoring the power factor of the motor, another feature or
addition to the project may be the inclusion of a system that has the strategy to
improve the power factor in case of any abnormalities.
31
REFERENCES
[1] A. Cakir, H. Calis, G. Turan, “Remote Controlling and Monitoring of Induction Motors
through Internet”, TELKOMNIKA Indonesian Journal of Electrical Engineering,
Vol.12, No.12, pp.8051 ~ 8059, 2014.
[2] R. Singh, R, Nayak, “Monitoring and Controlling of Single Phase Induction Motor for
Advancement Speed Control in Forward and Reverse Direction Using PLC and
SCADA”, ISSN 2321 3361 © 2016 IJESC.
[3] V.S.D Rekha, Dr. K.S Ravi, “Induction Motor Condition Monitoring and Controlling
Based on IoT”, IJEECS ISSN 2348-117X, Vol.6, Issue 9, 2017.
[4] M.A Velan, M.A Raj, K. Kannadasan, D.Kirubakaran, “Monitoring and Control of
Three Phase Induction Motor Using Iota Based Concept”, IOSR Journal of Engineering
(IOSRJEN), ISSN 2250-3021, pp.27-31, 2018.
[5] P. Ahuja, R. Kumar, K. Dhiraj, “Control and Monitoring of 3 – Phase Induction Motor
Using PLC”, IJIRSET, Vol.5, Issue 2, 2016.
[6] A. Hayat, M.N Khan, “Speed Control and Power Factor Improvement of a Single Phase
AC Motor”, Universal Journal of Electrical and Electronic Engineering, pp.328-336,
2014.
[7] A. Ukil, R. Bloch, A. Andenna, “Estimation of Induction Motor Operating Power Factor
From Measured Current and Manufacturer Data”, IEEE Transactions on Energy
Conversion, 2011.
32
APPENDIX A
SOURCE CODE
void setup() {
pinMode(AC_pin, OUTPUT);
attachInterrupt(digitalPinToInterrupt(ZERO_CROSS_PIN),
zero_cross_detect, RISING);
Timer1.initialize(freqStep);
Timer1.attachInterrupt(dim_check, freqStep);
Serial.begin(115200);
}
void zero_cross_detect() {
zero_cross = true;
i = 0;
digitalWrite(AC_pin, LOW);
}
void dim_check() {
if (zero_cross == true) {
if (i >= dim) {
digitalWrite(AC_pin, HIGH);
i = 0;
zero_cross = false;
}
else {
i++;
}
}
}
void loop() {
if (Serial.available()) {
String msg = Serial.readStringUntil('@');
33
if (msg.toInt() > 0) {
dim = msg.toInt();
}
Serial.println(dim);
}
}
void setup()
{
pinMode(RELAY_IN_PIN, OUTPUT);
digitalWrite(RELAY_IN_PIN, LOW);
lcd.begin(16, 2);
lcd.setCursor(0, 0);
lcd.print("Monitor and control");
lcd.setCursor(0, 1);
lcd.print(" of Induction Motor");
delay(500);
Serial.begin(115200);
34
SoftSerial.begin(115200);
}
void loop()
{
readRawVoltageAndCurrentAndSpeed();
calcVoltage();
calcCurrent();
calcSpeed();
calcPf();
checkOverCurrentAndVoltage();
lcdDisp();
updateStatus();
}
void readRawVoltageAndCurrentAndSpeed() {
long startTime = millis();
int rawCurrent = 0;
long voltageCounter = 0;
long rawVoltageSum = 0;
int lastSpeedValue = 0;
int newSpeedValue = 0;
int speedCounter = 0;
rawMaxCurrent = 0;
while (millis() - startTime < 500) {
rawCurrent = analogRead(CURRENT_IN_PIN);
if (rawCurrent > rawMaxCurrent) {
rawMaxCurrent = rawCurrent;
}
rawVoltageSum += analogRead(VOLTAGE_IN_PIN);
voltageCounter++;
lastSpeedValue = newSpeedValue;
newSpeedValue = analogRead(SPEED_IN_PIN);
if (newSpeedValue < 50 && lastSpeedValue > 50) {
speedCounter++;
}
}
rawAvgVoltage = rawVoltageSum / voltageCounter;
rawAvgSpeed = speedCounter;
}
void calcSpeed() {
rpm = rawAvgSpeed * 120;
Serial.print("Speed=");
Serial.println(rpm);
String rpmStr = String(rpm);
35
rpmStr = "Speed" + rpmStr + "rpm!";
SoftSerial.print (rpmStr);
}
void calcVoltage() {
Vrms = rawAvgVoltage / 3.69 ;
Vpeak = Vrms * sqrt(2);
Serial.print("Vrms=");
Serial.println(Vrms);
String VrmsStr = String(Vrms);
VrmsStr = "Vrms" + VrmsStr + "V!";
SoftSerial.print (VrmsStr);
String VpeakStr = String(Vpeak);
VpeakStr = "Vpeak" + VpeakStr + "V!";
SoftSerial.print (VpeakStr);
}
void calcCurrent() {
float equivalentVoltage = (rawMaxCurrent / 1023.0) * 5000; //
Gets you mV
Ipeak = ((equivalentVoltage - OFFSET_VOLTAGE) / SENSITIVITY) ;
Irms = Ipeak / sqrt(2);
Serial.print("Irms= ");
Serial.println(Irms);
String IrmsStr = String(Irms);
IrmsStr = "Irms" + IrmsStr + "A!";
SoftSerial.println (IrmsStr);
String IpeakStr = String(Ipeak);
IpeakStr = "Ipeak" + IpeakStr + "A!";
SoftSerial.println (IpeakStr);
}
void checkOverCurrentAndVoltage() {
if (Vrms > 250) {
overVoltage = true;
SoftSerial.print ("Over Voltage!");
} else {
overVoltage = false;
}
if (Irms > 5) {
overCurrent = true;
SoftSerial.print ("Over Current!");
} else {
overCurrent = false;
}
}
36
void calcPf() {
float Ireactive = 2.10;
Serial.println("Ireactive==");
Serial.println(Ireactive);
float I = (Ireactive / Irms);
Serial.println("Ireactive/Irms==");
Serial.println(I);
float Isquare = pow(I, 2);
Serial.println("Isquare==");
Serial.println(Isquare);
pf = sqrt(1 - Isquare);
Serial.println("pF==");
Serial.println(pf);
String pfStr = String(pf);
pfStr = "PF" + pfStr + "!";
SoftSerial.print (pfStr);
}
void updateStatus() {
if (SoftSerial.available()) {
String msg = SoftSerial.readStringUntil('@');
Serial.print("message is ");
Serial.println(msg);
if (msg.indexOf("OFF") >= 0) {
digitalWrite(RELAY_IN_PIN, HIGH);
} else if (msg.indexOf("ON") >= 0) {
digitalWrite(RELAY_IN_PIN, LOW);
}
}
}
void lcdDisp()
{
if (millis() - displayRefreshTime > 1000) {
displayRefreshTime = millis();
lcd.clear();
if (overVoltage) {
//Show Over Voltage
lcd.setCursor(0, 0);
lcd.print("Over Voltage");
lcd.setCursor(0, 1);
lcd.print("Switch off");
digitalWrite(RELAY_IN_PIN, HIGH);
}
else if (overCurrent) {
//Show Over Current
37
lcd.setCursor(0, 0);
lcd.print("Over Current");
lcd.setCursor(0, 1);
lcd.print("Switch off");
digitalWrite(RELAY_IN_PIN, HIGH);
}
else if (displayMenuNumber == 0) {
lcd.setCursor(0, 0);
lcd.print("Ipeak="); lcd.print(Ipeak); lcd.print(" ");
lcd.print("A");
lcd.setCursor(0, 1);
lcd.print("Irms="); lcd.print(Irms); lcd.print(" ");
lcd.print("A");
} else if (displayMenuNumber == 1) {
lcd.setCursor(0, 0);
lcd.print("Vpeak="); lcd.print(Vpeak); lcd.print(" ");
lcd.print("V");
lcd.setCursor(0, 1);
lcd.print("Vrms="); lcd.print(Vrms); lcd.print(" ");
lcd.print("V");
} else if (displayMenuNumber == 2) {
lcd.setCursor(0, 0);
lcd.print("Speed="); lcd.print(rpm); lcd.print(" ");
lcd.print("rpm");
lcd.setCursor(0, 1);
lcd.print("PF="); lcd.print(pf);
}
displayMenuNumber++;
if (displayMenuNumber > 2) {
displayMenuNumber = 0;
}
}
}
38
WebSocketsServer webSocket = WebSocketsServer(81);
void setup() {
USE_SERIAL.begin(115200);
USE_SERIAL.println();
USE_SERIAL.println();
USE_SERIAL.println();
for(uint8_t t = 4; t > 0; t--) {
USE_SERIAL.printf("[SETUP] BOOT WAIT %d...\n", t);
USE_SERIAL.flush();
delay(1000);
}
pinMode(13 , OUTPUT);
digitalWrite(13, 1);
WiFiMulti.addAP("smps", "432FACC99A");
while(WiFiMulti.run() != WL_CONNECTED) {
39
delay(100);
}
webSocket.begin();
webSocket.onEvent(webSocketEvent);
if(MDNS.begin("esp8266")) {
USE_SERIAL.println("MDNS responder started");
USE_SERIAL.println(WiFi.localIP());
}
server.on("/", []() {
server.send(200, "text/html", " <html> <head> <script> var
connection = new WebSocket('ws://' + location.hostname + ':81/',
['arduino']); connection.onopen = function()
{connection.send('Connect ' + new Date()); }; connection.onerror =
function(error) {console.log('WebSocket Error ', error); };
connection.onmessage = function(e) {console.log('Server: ',
e.data); if (e.data.indexOf('Irms') >= 0) {var ret =
e.data.replace('Irms',''); console.log('Irms:',ret);
document.getElementById('Irms').innerHTML=ret; } else
if(e.data.indexOf('Ipeak') >= 0){var ret =
e.data.replace('Ipeak',''); console.log('Ipeak:',ret);
document.getElementById('Ipeak').innerHTML=ret; } else
if(e.data.indexOf('Vrms') >= 0){var ret =
e.data.replace('Vrms',''); console.log('Vrms:',ret);
document.getElementById('Vrms').innerHTML=ret; } else
if(e.data.indexOf('Vpeak') >= 0){var ret =
e.data.replace('Vpeak',''); console.log('Vpeak:',ret);
document.getElementById('Vpeak').innerHTML=ret; }else
if(e.data.indexOf('Speed') >= 0){var ret =
e.data.replace('Speed',''); console.log('Speed:',ret);
document.getElementById('Speed').innerHTML=ret; }else
if(e.data.indexOf('PF') >= 0){var ret = e.data.replace('PF','');
console.log('PF:',ret);
document.getElementById('powerFactor').innerHTML=ret; } };
function on(){console.log('on'); connection.send('#1'); } function
off(){console.log('off:'); connection.send('#0'); } function
sendSpeed(spd){console.log('speed percentage:' + spd); spd = '*' +
spd; connection.send(spd); } </script> </head> <title>Group
8</title> <body> <!--header start --> <h2>MONITORING AND
CONTROLLING <br /> SINGLE PHASE INDUCTION MOTOR </h2> <h3>Motor
Operation</h3> <button id=\"send\" onclick=\"on();\">ON</button>
<button id=\"send\" onclick=\"off();\">OFF</button> <h3>Data
Readings</h3> <table width=\"283\" border=\"0\" > <tr> <td
width=\"55\">Vrms : </td> <td width=\"73\" id=\"Vrms\"> </td>
<td width=\"10\"> </td> <td width=\"55\">Vpeak : </td> <td
width=\"73\" id=\"Vpeak\"> </td> </tr> <tr> <td>Irms : </td>
<td id=\"Irms\"> </td> <td> </td> <td>Ipeak : </td> <td
40
View publication stats
void loop() {
webSocket.loop();
server.handleClient();
int numchars=Serial.available();
if (numchars>0){
String str=Serial.readStringUntil('!');
Serial.println(str);
webSocket.sendTXT((uint8_t)0,str);
}
}
41