0% found this document useful (0 votes)
15 views

Final Report

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Final Report

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 62

NEW DESIGN OF AI SMART SOCKET MODULE FOR

SMART HOME APPLICATION

A PROJECT REPORT

Submitted by

DHILIP KUMAR.S (812419106016)


JOSHUA.S (812419106022)
SENTHIL MURUGAN.C (812419106041)
YUVARAJA.E (812419106051)

in partial fulfillment for the award of the degree

of
BACHELOR OF ENGINEERING
IN
ELECTRONICS AND COMMUNICATION ENGINEERING
M.I.E.T. ENGINEERING COLLEGE, TRICHY

ANNA UNIVERSITY::CHENNAI 600025

MAY 2023
ANNA UNIVERSITY : CHENNAI 600025

BONAFIDE CERTIFICATE

Certified that this project report “NEW DESIGN OF AI SMART SOCKET


MODULE FOR SMART HOME APPLICATIONS” is the bonafide work of
S.DHILIP KUMAR (812419106016), S.JOSHUA(812419106022), C.SENTHIL
MURUGAN(812419106041), E.YUVARAJA(812419106051) who carried out
the project under my supervision.

SIGNATURE SIGNATURE

Dr.M.Vijai Meyyappan, M.Tech., Ph.D. Mrs.B.T.Krithika, M.E.,

HEAD OF THE DEPARTMENT SUPERVISOR

Department of Electronics and Department of Electronics and


Communication Engineering Communication Engineering
M.I.E.T. Engineering College M.I.E.T. Engineering College
Tiruchirappalli – 620007. Tiruchirappalli – 620007.

The Project Viva Voce held on ___________________

INTERNAL EXAMINER EXTERNAL EXAMINER

ii
ACKNOWLEDGEMENT

First, we would like to thank the Almighty for giving us talents and
opportunity to complete our project and then to our family members for their
unwavering support.

We would like to express our sincere gratitude to our college chairman and
founder Er.A.MOHAMED YUNUS B.E., M.Sc., for providing large facilities in
the institution for the completion of the project.

We would like to express our thanks and sincere gratitude to our respectfull
principal Dr. A.NAVEEN SAIT M.E., Ph.D., for encouraging us to do such an
innovative project.We wish to express our heartfelt thanks and sincere gratitude to
our Head of the Department Dr.M.Vijai Meyyappan, M.Tech., Ph.D. for his
valuable guidance which helped us to complete this work successfully and also for
his enthusiastic encouragement to make our effort worthwhile and fruitful.

We are extremely indebted to our project supervisor Mrs.B.T.Krithika,


M.E.,Assistant professor, Department of Electronics and Communication
Engineering. Who extended her full of co operation and valuable guidance which
helped us further steps to in our project.

We are extremely indebted to our project co-ordinator Dr.S.Archana,


M.Tech.,Ph.D. Assistant professor, Department of Electronics and
Communication Engineering, who extended his full co-operation to take further
steps in our project and also supporting us in all times to complete our project
successfully.

We also thank all other faculty members and supporting staffs in the
Department of Electronics and Communication Engineering for their support and
encouragement.
iii
ABSTRACT

The concept of the intelligent home represents a significant advancement in


the field of electrical environments. With the development of a specially designed
module, it becomes possible to utilize this technology in smart home applications
where electrical safety is of utmost importance. The module functions by
effectively measuring electrical current, voltage, and power consumption of
connected devices. These electrical parameters are continuously monitored and
controlled through a client application software, which can be accessed via widely
used internet browsers.

Furthermore, the module also incorporates additional features such as


monitoring the status of the plug and the surrounding temperature of the socket. By
including these functionalities, the design offers a comprehensive solution for
managing electrical devices within a smart home setting. One notable advantage of
this design is its versatility, as it can serve as a useful and essential module for
universal applications.

Extensive testing has been conducted on this module system, demonstrating


its seamless integration into smart home automation applications. The system
employs the ESP32 microcontroller, which efficiently logs data from various
sensors and measurement modules. The gathered information is then transmitted
via Wi-Fi, enabling real-time monitoring and control.

What sets this module apart is its ability to connect to any standard socket,
making it a universal solution for smart home implementations. With its robust
capabilities, encompassing electrical measurement, monitoring, and control, the
proposed module offers an innovative and practical solution for creating intelligent
homes of the future.

iv
TABLE OF CONTENT

CHAPTER NO. TITLE PAGE NO

ACKNOWLEDGEMENT iii

ABSTRACT iv

LIST OF FIGURES vi

LIST OF ABBREVIATION viii

1 INTRODUCTION 1

2 LITRATURE SURVEY 3

3 BLOCK DIAGRAM 7

3.1 Diagram of smart socket 8

3.2 Basic diagram of IOT system 10

3.3 Circuit diagram 10

3.4 Schematic design of smart socket module 11

4 HARDWARE DESCRIPTION 12

4.1 Voltage regulator 12

4.2 Step down transformer 13

4.3 Relay 20

4.4 ESP8266 25

v
5 SOFTWARE DESCRIPTION 32

5.1 Arduino 33

5.2 Multi-File Sketches 35

5.3 Targets 36

5.4 Upload Process 38

5.5 BLYNK IOT platform 38

5.6 IFTTT 41

6 HARDWARE KIT 43

OUTPUT 44

7 CONCLUSION 46

REFERENCES 47

APPENDIX 51

vi
LIST OF FIGURES

FIGURE.NO NAME OF THE FIGURES PAGE.NO.

1 Diagram of smart socket 8

2 Basic design of IOT system 10

3 Circuit diagram 10

4 Schematic design of smart socket module 11

5 LM7805 pinout diagram 13

6 Bridge Full wave rectifier 14

7 DC filteration 15

8 Relay 21

9 ESP32 pinout diagram 27

10 BLYNK APP Overview 39

11 BLYNK Cloud Architecture 40

12 IFTTT platform 42

vii
ABBREVIATION

Acronyms Explanations

ESP Espressif Systems

IEA International energy agency

GHE Green House Emission

BMS Building Management System

IOT Internet of Things

SMS Short Message Service

GSM Global System for Mobile


Communication

MCU Microcontroller Unit

PIR Pyro Electric Infrared

RFID Radio Frequency Identification

IC Integrated Circuit

PWM Pulse width Modulation

viii
CHAPTER 1
INTRODUCTION

Standby energy consumption, commonly known as the energy drawn down


by an electrical appliance when it is not in use, contributes a significant amount of
energy waste and safety issues in the built environment. With the increasing
integration of intelligent systems and involvement of customer electronics in the
built environment, the standby energy waste increases rapidly, which has been
attracting wide attention from both the academic studies and industries. A survey
conducted by the International Energy Agency (IEA) on developed countries
indicates that standby energy waste is responsible for up to 10% of household
electricity consumption [1]. That means that for a typical household television (TV),
with the standby power of 1.8 watts, a daily standby energy loss up to0.018 kWh,
which could be associated with 10 h’ operating. Additionally, the associated
greenhouse emissions (GHG) and cost expenditure with energy consumption cannot
be ignored. The waste of resources and environmental impacts contributed by
standby energy consumption have placed a heavy burden on human society, which
correspondingly encourages the technological improvement on standby energy
reduction. Over the years, a considerable amount of improvements have been
applied to power sockets for function enhancement, such as wireless control and
current monitoring. A great deal of these improvements have been developed to
contribute standby waste reduction for families.

To address the issues associated with standby energy consumption, this work
proposes the development of a smart socket system that is expected to reduce the
standby energy waste of electric appliances in the built environment.IOT is a system
consisting of several electronic devices which are put together including software
and sensors to detect objects7. Objects can be controlled remotely through an

1
existing internet network infrastructure; therefore the object’s state can be
monitored through a web that can be displayed on a laptop or mobile smart phone.

Thus it is expected that IOT system can monitor and control objects, as a
result it can increase the efficiency and accuracy of an object automatically.
Accordingly the application and usability of IOT can be applied to almost all areas
of life such as to monitor the environment, improve the efficiency of energy use,
monitor health systems, monitor activities related to transportation and monitor the
state of equipment at home or smart home. We can conclude that smart socket
method is a good method in exchange data between blynk IoT app and devices in
IOT system to support real-time applications, specifically for smart home.

The major characteristics of the proposed system can be summarized as


follows:
1. A host-slave mechanism was applied to the control strategy for standby energy
saving.
The working status (switching on or off) of auxiliary/slave devices are controlled by
that of the main/host equipment. Once the embodied power management unit built
on microchip
STM32F103 detected sharp current dropping in host plugs, which is supposed to be
a switch-off operation conducted by the occupants, it will then respond quickly to
power off the smart socket for the reduction of standby energy waste.
2. The smart socket is compatible with normal remote controllers of electrical
appliances, which expanded its application and allows the occupants to switch off or
power on the developed smart socket conveniently with normal remote controllers.
3. The safety protection measures have been employed to avoid overvoltage, which
is normally recognized to be hazardous in electricity consumption.

2
CHAPTER 2
LITERATURE SURVEY

2.1. Schneps-Schneppe, et.al.. Wired Smart Home: energy metering, security,


and emergency issues. In Ultra-Modern. (2012, October).Telecommunications
and Control Systems and Workshops (ICUMT), 2012 4th International
Congress on (pp. 405-410). IEEE [10]

In the author proposes a GSM smart socket, which is a simple device that
monitors the physical activity for older adults living alone, the observers will
receive SMS (Short Message Service) notifications, where the observers are
relatives and medical staff for nursing services. The product’s idea has been born
from a rethinking of the well-known device GSM (Global System for Mobile
Communication) Alarm - GSM socket. Also the sockets can send SMS about power
failure alerts. It could contain several sensors to send measured information too;
sensors could be temperature sensor, gas sensor, fire sensor, built-in microphone.

Other by sending notification to intermediate server, which routes it to End-


users . Using second choice (intermediate server) lets us to process the data, for
example : estimating the behavior of individual sockets, for example: the adult turns
on particular device in specific period of time every day, where the absence of this
activity will be notified and sent to End-users as an expected fault/alarm.
Intermediate server could send notifications by different transport mechanisms, as
like Push notification, and Twitter.

2.2. Design and Implementation of Standby Power Saving Smart Socket with
Wireless Sensor Network, Singaravelan.A, Kowsalya.M. [11]
The author illustrates a solution for the stand-by power of turned-off
appliances, which in the room - PIR (Pyro electric Infrared) sensor, and a

3
communication module (ZigBee). The work stated that the proposed socket is easy
to install, cheap and saves power efficiently. The work presented a compare
between the readings of CBCT conditioning circuit to Clamper readings.

The output reading from MCU is fed to ZigBee communication module,


ZigBee from socket side and ZigBee from Data Center side are configured as
Router and Coordinator respectively. The work contains a test for the algorithm
after constructed PIR sensor and CBCT conditioning circuit as inputs, Relay and
RS232 as output

2.3. Tiago M. Fernández-Caramés , An Intelligent Power Outlet System for the


Smart Home of the Internet of Things, International Journal of Distributed
Sensor Networks 2015(1):1-11 · November 2015. [12]
In work [12], the author presents an intelligent power outlet system that can
be controlled wirelessly and that has been specifically designed to monitor electrical
events in low-current loads. Each power outlet of the system embeds a
microcontroller, a 2.4GHz ZigBee interface, RFID (Radio Frequency Identification)
reader, a relay, and a current sensor. The main features of the system include the
remote control of the power outlet, real-time monitoring of the current consumption,
the customization and programming of the power supply time schedule, the
automatic interruption of vampire currents, types of electrical fires and
electrocutions. The author of the work [12] addresses some of the most common
problems that arise when interacting with power sockets and shows a novel
approach of electrical shockets.

2.4. Froiz-Míguez, et.al.. Design, Implementation and Practical Evaluation of


an IoT Home Automation System for Fog Computing Applications Based on
MQTT and ZigBee-WiFi Sensor Nodes. Sensors 2018, 18, 2660. [14]

4
It was stated that all commercial smart power sockets have mutual
functionalities: can switch on/off outlets, and monitor energy consumption. It was
stated also that although the traditionally electrical protections (e.g., circuit breaker
and fuses) achieve their goal when configured properly, they usually don't adapt
dynamically to the environment or to the connected appliances. The system
proposed by the author in work [12], prevents electrical shocks based on the
following principle: if there is no appliance connected to the outlet, electricity will
not be supplied. The solution of electrical shocks comes from sensing appliance
plug by RFID reader and tags; where the tag is attached to appliance's plug, the
electricity is on when the tag is a few centimeters away from reader in socket.

Recommended to replace the ZigBee module with ESP8266 which also


supports interfaces with mesh capabilities. It also explained the need of using WSN
(Wireless Sensor Network) based communication architecture, whose use of certain
nodes as repeaters allows for compensating signal attenuations. In a study of
preventing Electrical fires and shocks. Concluded the reaction time of the proposed
socket (1.23 ms) is faster than MCB (Miniature Circuit Breaker) trip time (20 ms).

2.5. Jiang Feng, Dai Jian, Wu Fei, Zou Yan, Design of Socket Based on
Intelligent Control and Energy Management, (IJACSA) International Journal
of Advanced Computer Science and Applications, Vol. 6, No. 10, 2015. [16]

Wall plug switches the power using a relay with output power up to 2.5 kW,
the plug visualize the load current by a color changing crystal LED ring. It could be
operated using the service button located on its casing, or via any Z-Wave
compatible controller. Fibaro is a wireless system, based on Z-Wave technology, the
radio signal is weakened by various obstacles located on its path, and in extreme
cases it fails to transfer required data. The advantage of the produced System is that

5
its devices are working as duplicators into the data center device. Fibaro is a bi-
directional wireless system. This means that the signal is not only sent to the
receivers, but also the receivers send the confirmation of its reception. Fibaro
operates in the free band for data transmission. Although Z-Wave is quite new
technology, it has already become recognizable and officially binding standard,
similarly to Wi-Fi. Fibaro generates a dynamic network structure. Real-time through
status.

6
CHAPTER 3

3.1. PROPOSED DIAGRAM

Fig 3.1.Block Diagram

A smart socket for home applications simplifies monitoring and control of


electrical devices. It uses microcontroller or IoT components like the ESP32 to
acquire, process, and communicate data. With internet connectivity, users can

7
remotely manage their devices through a mobile app or web interface. The
integration of these components forms the core of the smart socket, enabling
monitoring of voltage, current, and power, and facilitating communication with
smartphones or tablets. Additional safety features like temperature monitoring and
surge protection can be included. Designing a smart socket requires knowledge of
electrical engineering, programming, communication protocols, and safety
measures. It enhances efficiency, safety, and user control over energy usage and
costs.

Fig 3.2. Diagram of smart socket

3.2. Projct Description

The project aims to develop a state-of-the-art smart socket module for smart
homes. It will accurately measure electrical parameters, monitor plug status and
ambient temperature in real-time, and seamlessly connect through internet browsers
and standard sockets. By utilizing the ESP32 microcontroller and Wi-Fi

8
connectivity, users can remotely control and monitor their devices with ease. The
module prioritizes safety, convenience, and energy efficiency with integrated safety
features and the ability to optimize energy consumption. This innovative design
promises to greatly enhance the smart home experience by providing advanced
functionality, ease of use, and improved safety and efficiency.

3.3. Smart Socket Architecture

Fig3.3:Over all circuit diagram

9
Fig. 3.4: Basic design of IoT system

Fig. 3.5: Proposed circuit diagram

The main components are:

1. ESP32 Node MCU as a microcontroller, this version contains a built-in Wi-Fi


module; it's intended to connect things easily serving out the internet of things (IoT)
concept.

2. Automated smart power socket controlled by IoT mobile application.

3. Relay switch is used to trigger the load.


10
Fig 3.6. Schematic design of smart socket module.

The schematic connection design of the proposed module is illustrated in Fig


3.6. Module provides and open and open circuit tests of will be sent over Wi-Fi
channel to a server or smart phone . If no short circuit or open status circuit is
detected, the microcontroller connects the lead wire to the electricity network by
activation a relay. The parameters of electricity are measure by current sensor and
these parameters are transmitted over Wi-Fi channel to server.

The usage of AC 712 provides to calculate the current, voltage and consumed
power. The overload is defined by measuring the current flows across the wires and
measuring the temperature surrounding the hot line. If the system detects a notable
change in temperature surrounding the hot wire (100C from the room temperature),
the microcontroller will deactivate the relay and an alarm signal will be send to the
user. Sensor is a device which detects or measures a physical property and records,
indicates, or otherwise responds to it. In this study we designed and built a web and
data server and applications for smart phones and laptops along with their features
Data and information from the sensors on the smart house system will be sent
through the existing internet network infrastructure to the data base server.

11
CHAPTER 4
HARDWARE DESCRIPTION

POWER SUPPLY UNIT


In most of our electronic products or projects, a reliable power supply is
indispensable. It is required to convert the fluctuating mains AC voltage into a
stable and regulated DC voltage, which is crucial for the proper functioning of each
and every component. Without a well-designed power supply, electronic devices
may experience malfunctions or fail to operate altogether. Therefore, ensuring a
stable and regulated power supply is of utmost importance in order to guarantee the
optimal performance and longevity of electronic devices and projects.

Component List :

1. Step down transformer


2. Voltage regulator
3. Capacitors
4. Diodes

4.1. VOLTAGE REGULATOR :


As we require a 5V we need LM7805 Voltage Regulator IC.
7805 IC Rating :

Input voltage range 7V- 35VCurrent rating Ic = 1

Output voltage range VMax=5.2V ,VMin=4.8V

12
fig 4.1:LM7805 – Pin Diagram

4.2. STEP DOWN TRANSFORMER

A step down transformer will step down the voltage from the ac mains to the
required voltage level. The turn’s ratio of the transformer is so adjusted such as to
obtain the required voltage value. The output of the transformer is given as an input
to the rectifier circuit.

4.2.1. Rectification
The rectifier is a fundamental electronic circuit that is responsible for
converting alternating voltage or current into a pulsating unidirectional direct
current (dc) signal using diodes. This conversion is achieved by allowing the
positive and negative half-cycles of an alternating current input signal to pass
through the diodes of a full-wave or bridge rectifier configuration, resulting in a
positive pulsating dc output signal. The bridge rectifier, in particular, is preferred
over other configurations due to its higher efficiency and ability to handle greater
power levels. The four diodes in the bridge rectifier work together to create a path
for current flow and maintain a positive output polarity. The full-wave bridge
rectifier is a crucial component in power supply systems, enabling the efficient

13
conversion of ac power into a usable form for electronic devices and systems in our
daily lives.

Fig 4.2:Full wave rectifier bridge

A bridge rectifier consists of four p-n junction diodes connected in the above
shown manner. In the positive half cycle of the supply the voltage induced across
the secondary of the electrical transformeri.e. VMN is positive. Therefore point E is
positive with respect to F. Hence, diodes D3 and D2 are reversed biased and diodes
D1 and D4 are forward biased. The diode D3 and D2 will act as open switches
(practically there is some voltage drop) and diodes D1 andD4 will act as closed
switches and will start conducting. When voltage induced in secondary i.e. VMN is
negative than D3 and D2 are forward biased with the other two reversed biased and a
positive voltage appears at the input of the filter.

4.2.2. DC Filteration
The rectified voltage from the rectifier is a pulsating dc voltage having very
high ripple content. But this is not we want, we want a pure ripple free dc
waveform. Hence a filter is used. Different types of filters are used such as capacitor

14
filter, LC filter, Choke input filter, π type filter. Figure below shows a capacitor
filter connected along the output of the rectifier and the resultant output waveform.

Fig 4.3:Resultant Output Waveform

As the instantaneous voltage starts increasing the capacitor charges, it charges


till the waveform reaches its peak value. When the instantaneous value starts
reducing the capacitor starts discharging exponentially.

15
4.2.3. Regulation
This is the last block in a regulated DC power supply. Transistor series
regulator, Fixed and variable IC regulators or a zene diode operated in the zener
region can be used depending on their applications. With IC’s like LM 317 and 723
etc we can adjust the output voltage to a required constant value. Figure below
shows the LM317 voltage regulator. The output voltage can be adjusted with
adjusting the values of resistances R1 and R2. Usually coupling capacitors of values
about 0.01µF to 10µF.

Fig 4.4: Voltage Regulation

Fig 4.4 above shows the complete circuit of a regulated +5V DC power
supply using transformer, bridge rectifier, filter (smoothing) and a fixed +5 V
voltage regulator. Here we can use IC 7803(for 3V), 7809(for 9 V), 7812(for 12V)
etc.

16
Fig 4.5: Application of Regulated Power Supply

Regulated power supply is the main component of electrical, electronics and


as well as automation equipment. Mobile phone charger, oscilator, amplifier are
needed the regulated power supply.

4.2.4. Understanding 7805 IC Voltage Regulator


A regulated power supply is very much essential for several electronic
devices due to the semiconductor material employed in them have a fixed rate of
current as well as voltage. The device may get damaged if there is any deviation
from the fixed rate. The AC power supply gets converted into constant DC by this
circuit. By the help of a voltage regulator DC, unregulated output will be fixed to a
constant voltage.

From giving an unchanging voltage supply to building confident that output


reaches uninterrupted to the appliance, the diodes along with capacitors handle
elevated efficient signal conveyal.

17
As we have previously talked about that regulated power supply is a device
that mechanized on DC voltages and also it can uphold its output accurately at a
fixed voltage all the time although if there is a significant alteration in the DC input
voltage.

ICs regulator is mainly used in the circuit to maintain the exact voltage which
is followed by the power supply. A regulator is mainly employed with the capacitor
connected in parallel to the input terminal and the output terminal of the IC
regulator. For the checking of gigantic alterations in the input as well as in the
output filter, capacitors are used. While the bypass capacitors are used to check the
small period spikes on the input and output level. Bypass capacitors are mainly of
small values that are used to bypass the small period pulses straightly into the Earth.

A circuit diagram having regulator IC and all the above discussed


components arrangement revealed in the figure below.

Fig.4.6: IC circuit diagram

As we have made the whole circuit till now to be operated on the 5V DC


supply, so we have to use an IC regulator for 5V DC. And the most generally used
IC regulators get into the market for 5V DC regulation use is 7805. So we are
connecting the similar IC in the/ circuit as U1.

18
IC 7805 is a DC regulated IC of 5V. This IC is very flexible and is widely
employed in all types of circuit like a voltage regulator. It is a three terminal device
and mainly called input , output and ground. Pin diagram of the IC 7805 is shown in
the diagram below.

Fig 4.7 :Pin diagram

The output generated from the unregulated DC output is susceptible to the


fluctuations of the input signal.IC voltage regulator is connected with bridge
rectifier in series in these project so to steady the DC output against the variations in
the input DC voltage.To obtain a stable output of 5V, IC 7805 is attached with 6-0-
6V along with 500mA step down transformer as well as with rectifier.To suppress
the oscillation which might generate in the regulator IC, C2 capacitor of 0.1uF value
is used. When the power supply filter is far away from the regulated IC capacitor
C2 is used.Ripple rejection in the regulator is been improved by C4 capacitor(35uf)
by avoiding the ripple voltage to be amplified at the regulator output.The output
voltage is strengthen and deduction of the output voltage is done capacitor

19
C3(0.1uF). To the chance of the input get shorted D5 diode is used to save the
regulator. If D5 is not presented in the circuit, the output capacitor.

4.3. RELAY:

A relay is an electrically operated switch. Many relays use an electromagnet


to operate a switching mechanism mechanically, but other operating principles are
also used. Relays are used where it is necessary to control a circuit by a low-power
signal (with complete electrical isolation between control and controlled circuits), or
where several circuits must be controlled by one signal. The first relays were used
in long distance telegraph circuits, repeating the signal coming in from one circuit
and re-transmitting it to another. Relays were used extensively in telephone
exchanges and early computers to perform logical operations. A type of relay that
can handle the high power required to directly control an electric motor or other
loads is called a contactor. Solid-state relays control power circuits with no moving
parts, instead using a semiconductor device to perform switching. Relays with
calibrated operating characteristics and sometimes multiple operating coils are used
to protect electrical circuits from overload or faults; in modern. Electric power
systems these functions are performed by digital instruments still called "protective
relays".

Fig.4.8:Basic Design and Operation.

20
A simple electromagnetic relay consists of a coil of wire wrapped around a
soft iron core, an iron yoke which provides a low reluctance path for magnetic flux,
a movable iron armature, and one or more sets of contacts (there are two in the relay
pictured).The armature is hinged to the yoke and mechanically linked to one or
more sets of moving contacts. It is held in place by a spring so that when the relay is
de-energized there is an air gap in the magnetic circuit. In this condition, one of the
two sets of contacts in the relay pictured is closed, and the other set is open. Other
relays may have more or fewer sets of contacts depending on their function. The
relay in the picture also has a wire connecting the armature to the yoke. This ensures
continuity of the circuit between the opration moving contacts on the armature, and
the circuit track on the print circuit board(PCB) the yoke,which is soldered to the
PCB.

Fig4.9:Relay coil

When an electric current is passed through the coil it generates a magnetic


field that activates the armature, and the consequent movement of the movable
contact(s) either makes or breaks (depending upon construction) a connection with a
fixed contact. If the set of contacts was closed when the relay was de-energized,
then the movement opens the contacts and breaks the connection, and vice versa if
21
the contacts were open. Usually this force is provided by a spring, but gravity is also
used commonly inindustrial motor starters. Most relays are manufactured to operate
quickly. In a low-voltage application this reduces noise; in a high voltage or current
application it reduces arcing.When the coil is energized with direct current , a diode
is often placed across , which would otherwise generate as to semiconductor circuit
components. Some automotive relays include a diode inside the relay case.

Alternatively, a contact protection network consisting of a capacitor and


resistor in series (snubber circuit) may absorb the surge. If the coil is designed to be
energized with alternating current (AC), a small copper "shading ring" can be
crimped to the end of the solenoid, creating a small out-of-phase current which
increases the minimum pull on the armature during the AC cycle. [1]A solid-state
relay uses a thyristor or other solid-state switching device, activated by the control
signal, to switch the controlled load, instead of a solenoid. An opto coupler (a light-
emitting diode (LED) coupled with a photo transistor) can be used to isolate control
and controlled circuits.

4.3.1. Types of Relay:


• Latching relay
• Read relay
• Mercury-wetted relay
• Mercury relay
• Polarized relay
• Machine tool relay
• Ratchet relay
• Coaxial relay Contactor
• Solid state relay

22
• Solid state contactor relay
• Overload protection relay
• Vacuum relay

4.3.2. Pole and Throw:

Since relays are switches, the terminology applied to switches is also applied
to relays; a relay switches one or more poles, each of whose contacts can be thrown
by energizing the coil in one of three ways:

1.Normally-open (NO) contacts connect the circuit when the relay is


activated; the circuit is disconnected when the relay is inactive. It is also called a
Form A contact or "make" contact. NO contacts may also be distinguished as
"early-make" or NOEM, which means that the contacts close before the button or
switch is fully engaged.

2.Normally-closed (NC) contacts disconnect the circuit when the relay is


activated; the circuit is connected when the relay is inactive. It is also called a Form
B contact or "break" contact. NC contacts may also be distinguished as "late-break"
or NCLB, which means that the contacts stay closed until the button or switch is
fully disengaged.

3.Change-over (CO), or double-throw (DT), contacts control two circuits:


one normally-open contact and one normally-closed contact with a common
terminal.Contact utilizes a "make before break" functionality, then it is called a
Form D contact.

23
The following designations are commonly encountered:

• SPST – Single Pole Single Throw. These have two terminals which can be
connected or disconnected. Including two for the coil, such a relay has four
terminals in total. It is ambiguous whether the pole is normally open or
normally closed. The terminology "SPNO" and "SPNC" is sometimes used to
resolve the ambiguity.

• SPDT – Single Pole Double Throw. A common terminal connects to either of


two others. Including two for the coil, such a relay has five terminals in total.

• DPST – Double Pole Single Throw. These have two pairs of terminals.
Equivalent to two SPST switches or relays actuated by a single coil.
Including two for the coil, such a relay has six terminals in total. The poles
may be Form A or Form B (or one of each).

• DPDT – Double Pole Double Throw. These have two rows of change-over
terminals. Equivalent to two SPDT switches or relays actuated by a single
coil. Such a relay has eight terminals, including the coil.

4.3.2. Applications:
Relays are used for:

• Amplifying a digital signal, switching a large amount of power with a small


operating power. Some special cases are:
o A telegraph relay, repeating a weak signal received at the end of a long
wire
o Controlling a high-voltage circuit with a low-voltage signal, as in some
types of modems or audio amplifiers,

24
o Controlling a high-current circuit with a low-current signal, as in the
starter solenoid of an automobile.

• Detecting and isolating faults on transmission and distribution lines by


opening and closing circuit breakers (protection relays),Switching to a
standby power supply.

4.4. ESP8266
NodeMCU is an open-source firmware and development kit that helps
you to prototype or build IoT product. 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 firmware uses the Lua scripting language. It is based
on the Lua project, and built on the Espressif Non-OS SDK for ESP8266.

25
NodeMCU is an open source development board and firmware based in
the widely used ESP8266 -12E WiFi module. It allows you to program the
ESP8266 WiFi module with the simple and powerful LUA programming
language or Arduino IDE.With just a few lines of code you can establish a
WiFi connection and define input/output pins according to your needs exactly
like arduino, turning your ESP8266 into a web server and a lot more. It is the
WiFi equivalent of ethernet module. Now you have internet of things (IOT)
real tool.

With its USB-TTL , the nodeMCU Dev board supports directly flashing
from USB port. It combines features of WIFI accesspoint and station +
microcontroller. These features make the NodeMCU extremly powerful tool
for Wifi networking. It can be used as access point and/or station, host a
webserver or connect to internet to fetch or upload data.

4.4.1. Features
• Finally, programable WiFi module.
• Arduino-like (software defined) hardware IO.
• Can be programmed with the simple and powerful Lua programming
language or Arduino IDE.
• USB-TTL included, plug & play.
• 10 GPIOs D0-D10, PWM functionality, IIC and SPI communication, 1-
Wire and ADC A0 etc. all in one board.
• Wifi networking (can be used as access point and/or station, host a web
server), connect to internet to fetch or upload data.
• Event-driven API for network applications.
• PCB antenna.

26
MCU stands for MicroController Unit - which really means it is a computer
on a single chip. A microcontroller contains one or more CPUs (processor cores)
along with memory and programmable input/output peripherals. They are used
to automate automobile engine control, implantable medical devices, remote
controls, office machines, appliances, power tools, toys etc.

Fig 4.11:pinout diagram of ESP32


NodeMCU is an open source firmware for which open
source prototyping board designs are available. The name "NodeMCU" combines
"node" and "MCU" (micro-controller unit). The term "NodeMCU" strictly speaking
refers to the firmware rather than the associated development kit.

The firmware uses the cripting language. The firmware is based on the Lua
project, and built on the Espressif Non-OS SDK for ESP8266. It uses many open
27
source projects, such as lua-cjson[10] and SPIFFS.[11] Due to resource constraints,
users need to select the modules relevant for their project and build a firmware
tailored to their needs. Support for the 32-bit ESP32 has also been implemented.The
prototyping hardware typically used is a circuit board functioning as a dual in-line
package (DIP) which integrates a USB controller with a smaller surface-mounted
board containing the MCU and antenna.As Arduino.cc began developing new MCU
boards based on non-AVR processors like the ARM/SAM MCU and used in the
Arduino Due, they needed to modify the Arduino IDE so that it would be relatively
easy to change the IDE to support alternate tool chains to allow Arduino C/C++ to
be compiled for these new processors. They did this with the introduction of the
Board Manager and the SAM Core. A "core" is the collection of software
components required by the Board Manager and the Arduino IDE to compile an
Arduino C/C++ source file for the target MCU's machine language. Some ESP8266
enthusiasts developed an Arduino core for the ESP8266 WiFi SoC, popularly called
the "ESP8266 Core for the Arduino IDE".[18] This has become a leading software
development platform for the various ESP8266-based modules and development
boards, including NodeMCUs.

The Internet of Things (IoT) has been a trending field in the world of
technology. It has changed the way we work. Physical objects and the digital world
are connected now more than ever. Keeping this in mind, Espressif Systems (A
Shanghai-based Semiconductor Company) has released an adorable, bite-sized WiFi
enabled microcontroller.

ESP8266
The development board equips the ESP-12E module containing ESP8266
chip having Tensilica Xtensa® 32-bit LX106 RISC microprocessor which
operates at 80 to 160 MHz adjustable clock frequency and supports RTOS.
28
There’s also 128 KB RAM and 4MB of Flash memory (for program and
data storage) just enough to cope with the large strings that make up web pages,
JSON/XML data, and everything we throw at IoT devices nowadays.
The ESP8266 Integrates 802.11b/g/n HT40 Wi-Fi transceiver, so it can not
only connect to a WiFi network and interact with the Internet, but it can also set up
a network of its own, allowing other devices to connect directly to it. This makes
the ESP8266 NodeMCU even more versatile.As the operating voltage range of
ESP8266 is 3V to 3.6V, the board comes with a LDO voltage regulator to keep the
voltage steady at 3.3V. It can reliably supply up to 600mA, which should be
morethan enough when ESP8266 pulls as much as 80mA during RF
transmissions. The output of the regulator is also broken out to one of the sides of
the board and labeled as 3V3. This pin can be used to supply power to external
components.

Peripherals and I/O

The ESP8266 NodeMCU has total 17 GPIO pins broken out to the pin
headers on both sides of the development board. These pins can be assigned to all
sorts of peripheral duties, including:

• ADC channel – A 10-bit ADC channel.

• UART interface – UART interface is used to load code serially.

• PWM outputs – PWM pins for dimming LEDs or controlling motors.

The ESP8266 NodeMCU features two buttons. One marked as RST located
on the top left corner is the Reset button, used of course to reset the ESP8266 chip.
The other FLASH button on the bottom left corner is the download button used
while upgrading firmware.
29
Serial Communication.The board includes CP2102 USB-to-UART Bridge
Controller from Silicon Labs, which converts USB signal to serial and allows your
computer to program and communicate with the ESP8266 chip.

For the sake of simplicity, we will make groups of pins with similar
functionalities.Power Pins There are four power pins viz. one VIN pin & three 3.3V
pins. The VIN pin can be used to directly supply the ESP8266 and its peripherals, if
you have a regulated 5V voltage source. The 3.3V pins are the output of an on-
board voltage regulator. These pins can be used to supply power to external
components.

GND is a ground pin of ESP8266 NodeMCU development board.

I2 C Pins are used to hook up all sorts of I2 C sensors and peripherals in


your project. Both I2 C Master and I2 C Slave are supported. I2 C interface
functionality can be realized programmatically, and the clock frequency is 100 kHz
at a maximum. It should be noted that I2 C clock frequency should be higher than
the slowest clock frequency of the slave device.

GPIO Pins ESP8266 NodeMCU has 17 GPIO pins which can be assigned to
various functions such as I2 C, I2 S, UART, PWM, IR Remote Control, LED Light
and Button programmatically. Each digital enabled GPIO can be configured to
internal pull-up or pull-down, or set to high impedance. When configured as an
input, it can also be set to edge-trigger or level-trigger to generate CPU interrupts.

ADC Channel .The NodeMCU is embedded with a 10-bit precision SAR


ADC. The two functions can be implemented using ADC viz. Testing power supply
voltage of VDD3P3 pin and testing input voltage of TOUT pin. However, they
cannot be implemented at the same time.

30
UART Pins ESP8266 NodeMCU has 2 UART interfaces, i.e. UART0 and
UART1, which provide asynchronous communication (RS232 and RS485), and can
communicate at up to 4.5 Mbps. UART0 (TXD0, RXD0, RST0 & CTS0 pins) can
be used for communication. It supports fluid control. However, UART1 (TXD1 pin)
features only data transmit signal so, it is usually used for printing log. SPI Pins
ESP8266 features two SPIs (SPI and HSPI) in slave and master modes.

These SPIs also support the following general-purpose SPI features:


• 4 timing modes of the SPI format transfer
• Up to 80 MHz and the divided clocks of 80 MHz
• Up to 64-Byte FIFO
• SDIO Pins ESP8266 features Secure Digital Input/Output Interface (SDIO)
which is used to directly interface SD cards. 4-bit 25 MHz SDIO v1.1 and 4-
bit 50 MHz SDIO v2.0 are supported.

PWM Pins : The board has 4 channels of Pulse Width Modulation (PWM). The
PWM output can be implemented programmatically and used for driving digital
motors and LEDs. PWM frequency range is adjustable from 1000 μs to 10000 μs,
i.e., between 100 Hz and 1 kHz.

Control Pins are used to control ESP8266. These pins include Chip Enable pin
(EN), Reset pin (RST) and WAKE pin.
EN pin – The ESP8266 chip is enabled when EN pin is pulled HIGH. When
pulled LOW the chip works at minimum power.
RST pin – RST pin is used to reset the ESP8266 chip.
WAKE pin – Wake pin is used to wake the chip from deep-sleep

31
CHAPTER-5

SOFTWARE DESCRIPTION

Arduino is a cross-platform IDE that works in conjunction with an arduino


controller in order to write, compile and upload code to the board.The software
provides support for a wide array of arduino boards, including Arduino Uno, Nano,
Mega, Esplora, Ethernet, Fio, Pro or Pro Mini, as well as LilyPad Arduino.

The universal languages for Arduino are C and C++, thus the software is fit
for professionals who are familiar with these two. Features such as syntax
highlighting, automatic indentation and brace matching makes it a modern
alternative to other IDEs.Wrapped inside a streamlined interface, the software
features both the looks and the functionality that appeal to Arduino developers,
paving the way to a successful output via the debugging modules.

All of its features are hosted inside a few buttons and menus that are easy to
navigate and understand, especially for professional programmers. Also, the built-in
collection of examples might be of great help for Arduino first timers.Provided that
you’ve connected the Arduino board to the computer and installed all the necessary
drivers, one of the first steps we see fit is to choose the model you’ll be working
with using the Tools menu of the application.

Then, you can start writing the programs using the comfortable environment
that Arduino offers. The program includes a rich array of built-in libraries such as
EEPROM, Firmata, GSM, Servo, TFT, WiFI, etc, but adding your own is also
possible. Designs can be verified and compiled, with an error log displayed in the
lower part of the UI that allows you to review the code.If the debugging process
returns no errors, you can start the upload process and have your program delivered

32
to the board so you can proceed with further testing.All in all, Arduino comes across
as an extremely useful asset.

5.1.ARDUINO

Arduino is an open-source computer hardware and software company, project


and user community that designs and manufactures microcontroller-based kits for
building digital devices and interactive objects that can sense and control objects in
the physical world.

The project is based on microcontroller board designs, manufactured by


several vendors, using various microcontrollers. These systems provide sets of
digital and analog I/O pins that can be interfaced to various expansion boards
("shields") and other circuits.

The boards feature serial communications interfaces, including USB on some


models, for loading programs from personal computers. For programming the
microcontrollers, the Arduino project provides an integrated development
environment (IDE) based on the Processing project, which includes support for
the C and C++ programming languages.

The first Arduino was introduced in 2005, aiming to provide an inexpensive


and easy way for novices and professionals to create devices that interact with their
environment using sensors and actuators. Common examples of such devices
intended for beginner hobbyists include simple robots, thermostats, and motion
detectors.
Arduino boards are available commercially in preassembled form, or as do-it-
yourself kits.The hardware design specifications are openly available, allowing the
Arduino boards to be manufactured by anyone.

33
Arduino programs may be written in any programming language with a
compiler that produces binary machine code. Atmel provides a development
environment for their microcontrollers, AVR Studio and the newer Atmel Studio.

The Arduino project provides the Arduino integrated development


environment (IDE), which is a cross-platform application written in Java.

It originated from the IDE for the Processing programming language project
and the Wiring project. It is designed to introduce programming to artists and other
newcomers unfamiliar with software development. It includes a code editor with
features such assyntax highlighting, brace matching, and automatic indentation, and
provides simple one-click mechanism for compiling and loading programs to an
Arduino board. A program written with the IDE for Arduino is called a "sketch".

The Arduino IDE supports the C and C++ programming languages using
special rules of code organization. The Arduino IDE supplies a software
library called "Wiring" from the Wiring project, which provides many common
input and output procedures. A typical Arduino C/C++ sketch consists of two
functions that are compiled and linked with a program stub main () into an
executable cyclic program:

• setup(): a function that runs once at the start of a program and that can initialize
settings.
• loop(): a function called repeatedly until the board powers off.

After compilation and linking with the GNU tool chain, also included with the IDE
distribution, the Arduino IDE employs the programavrdude to convert the
executable code into a text file in hexadecimal coding.

34
Overview
A number of things have to happen for your Arduino code to get onto the
Arduino board. First, the Arduino environment performs some small
transformations to make sure that the code is correct C or C++ (two common
programming languages). It then gets passed to a compiler (avr-gcc), which turns
the human readable code into machine readable instructions (or object files). Then,
your code gets combined with (linked against), the standard Arduino libraries that
provide basic functions like digital Write () or Serial. Print ().

The result is a single Intel hex file, which contains the specific bytes that need
to be written to the program memory of the chip on the Arduino board.This file is
then uploaded to the board: transmitted over the USB or serial connection via the
bootloader already on the chip or with external programming hardware.

5.2. MULTI-FILE SKETCHES

A sketch can contain multiple files (tabs). To manage them, click on the
right-facing arrow just above the scroll bar near the top of the environment. Tabs
have one of four extensions: no extension, .c, .cpp, or .h (if you provide any other
extension, the period will be converted to an underscore). When your sketch is
compiled, all tabs with no extension are concatenated together to form the "main
sketch file". Tabs with .c or .cpp extensions are compiled separately. To use tabs
with a .h extension, you need to #include it (using "double quotes" not <angle
brackets.

The Arduino environment performs a few transformations to your main


sketch file (the concatenation of all the tabs in the sketch without extensions) before

35
passing it to the avr-gcc compiler.First, #include "Arduino.h", or for versions less
than 1.0, #include "WProgram.h" is added to the top of your sketch.

This header file (found in <ARDUINO>/hardware/cores/<CORE>/) includes


all the defintions needed for the standard Arduino core.Next, the environment
searches for function definitions within your main sketch file and creates
declarations (prototypes) for them. These are inserted after any comments or pre-
processor statements (#includes or #defines), but before any other statements
(including type declarations).

This means that if you want to use a custom type as a function argument, you
should declare it within a separate header file. Also, this generation isn't perfect: it
won't create prototypes for functions that have default argument values, or which
are declared within a namespace or class.

5.3. TARGETS

The Arduino environment supports multiple target boards with different chips
(currently, only AVRs), CPU speeds, or bootloaders. These are defined in a
board preferences file. Relevant variables include:

<BOARD>.name: the name to display in the Boards menu

<BOARD>.build.mcu: the microcontroller on the board (normally "atmega8" or


"atmega168").

<BOARD>.f_cpu: the clock speed at which the microcontroller operates (normally


"16000000L", or, for an ATmega168running on its internal clock, "8000000L").

36
<BOARD>.core: which sub-directory of the hardware/cores/ directory to link
sketches against (normally "arduino").

Also useful is this setting in the main preferences.txt file:

Build.verbose: whether or not to print debugging messages while building a


sketch (e.g. "false"). If true, will print the complete command line of each external
command executed as part of the build process.

Note: that in Arduino 0004 and later, build.extension is unused - the main sketch
file is always treated as a .cpp file.

The include path includes the sketch's directory, the target directory
(<ARDUINO>/hardware/core/<CORE>/) and the avr include directory
(<ARDUINO>/hardware/tools/avr/avr/include/), as well as any library directories
(in <ARDUINO>/hardware/libraries/) which contain a header file which is included
by the main sketch file.

When you verify a sketch, it is built in a temporary directory in the system


temp directory (e.g. /tmp on the Mac). When you upload it, it is built in the applet/
subdirectory of the sketch's directory (which you can access with the "Show Sketch
Folder" item in the "Sketch" menu).The .c and .cpp files of the target are compiled
and output with .o extensions to this directory, as is the main sketch file and any
other .c or .cpp files in the sketch and any .c or .cpp files in any libraries which are
#included in the sketch. These files are then linked together into a static library and
the main sketch file is linked against this library. Only the parts of the library
needed for your sketch are included in the final .hex file, reducing the size of most
sketches.

37
The hex file is the final output of the compilation which is then uploaded to
the board. During a "Verify" the .hex file is written to /tmp (on Mac and Linux) or
\Documents and Settings\<USER>\Local Settings\Temp (on Windows). During
upload, it's written to the applet sub-directory of the sketch directory (which you can
open with the "Show Sketch Folder" item in the Sketch menu).

5.4. UPLOAD PROCESS

Sketches are uploaded by avrdude. The upload process is also controlled by


variables in the boards and main preferences files.

Those in the boards file include:

<BOARD>.upload. Protocol: the protocol that avrdude should use to talk to the
board (typically "stk500").

<BOARD>.upload. Speed: the speed (baud rate) avrdude should use when
uploading sketches (typically "19200").

<BOARD>.upload.maximum_size: the maximum size for a sketch on the board


(dependent on the chip and the size of the boot loader).

5.5. BLYNK IOT PLATFORM

Blynk is a Platform with IOS and Android apps to control Arduino,


Raspberry Pi and the likes over the Internet. It's a digital dashboard where you can
build a graphic interface for our project by simply dragging and dropping widgets.
It's really simple to set everything up and you'll start tinkering in less than 5 mins.
Blynk is not tied to some specific board or shield. Instead, it's supporting hardware
of your choice. Whether your Arduino or Raspberry Pi is linked to the Internet over

38
Wi-Fi, Ethernet or this new ESP8266 chip, Blynk will get you online and ready for
the Internet of Your Things.

Fig 5.1 : Blynk app overview

There are three major components in the platform:

• Blynk App - allows to you create amazing interfaces for your projects
using various widgets we provide.
• Blynk Server - responsible for all the communications between the
smartphone and hardware. You can use our Blynk Cloud or run your private
Blynk server locally. Its open-source, could easily handle thousands of
devices and can even be launched on a Raspberry Pi.
39
• commands Blynk Libraries - for all the popular hardware platforms -
enable communication with the server and process all the incoming and out
coming.

Now imagine, every time you press a Button in the Blynk app, the
message travels to the Blynk Cloud, where it magically finds its way to your
hardware. It works the same in the opposite direction and everything happens
in a blynk of an eye.

Fig5.2:Blynk cloud architecture

Characteristics of Blynk are: Similar API & UI for all supported hardware &
devices Connection to the cloud can be done using Ethernet, Wi-Fi, Bluetooth, BLE
and USB (Serial) Set of easy-to-use Widgets Direct pin manipulation with no code
writing Easy to integrate and add new functionality using virtual pins History data
monitoring via History.

40
5.6. IFTTT
IFTTT, which stands for "If This, Then That," is a popular web-based
automation service that allows users to connect different digital platforms and
devices to create automated tasks and workflows. With IFTTT, users can set up
conditional statements, known as applets, to trigger specific actions when certain
events occur. These events can range from receiving an email or a social media
mention to changes in weather conditions or device interactions.

IFTTT operates on a simple principle: If a specific trigger event occurs (the


"this" part), then a corresponding action is executed (the "that" part). These triggers
and actions are pre-defined by IFTTT and can be customized and combined in
various ways to create powerful automations.

The platform supports a vast array of services, including popular social media
platforms, smart home devices, productivity apps, and more. Users can easily
connect their accounts and devices to IFTTT, allowing for seamless integration and
automation across multiple platforms.

The possibilities with IFTTT are virtually endless. Users can create applets to
automate tasks like automatically saving email attachments to cloud storage,
syncing notifications between devices, controlling smart home devices based on
location or time, posting content to social media platforms simultaneously, and
much more. IFTTT simplifies complex workflows and eliminates the need for
manual intervention, saving time and effort for users.

IFTTT offers a user-friendly interface and an extensive library of pre-built


applets that cater to a wide range of needs. Users can also create their own applets
with the easy-to-use applet creator, enabling them to personalize their automations
according to their specific requirements.

41
With its versatility and ability to connect various services and devices, IFTTT
empowers users to streamline their digital lives and create a more efficient and
connected ecosystem of applications and devices.

Fig5.3 IFTT platform

42
CHAPTER 6

HARDWARE KIT:

43
OUTPUTS:

44
45
CHAPTER-7
CONCLUSION

A smart socket module for smart home applications has been meticulously
designed and developed to enhance the convenience and functionality of modern
households. This innovative module offers a universal solution that seamlessly
integrates with any standard socket, making it easily adaptable to various electrical
devices.

At the heart of this smart socket module lies the powerful ESP32
microcontroller system. Leveraging its capabilities, the module efficiently logs data
from multiple sensors and measurement modules. This data is then transmitted
wirelessly via Wi-Fi to a client application, providing users with real-time insights
and control over their connected devices.

The entire system operates within the framework of the Internet of Things
(IoT), encompassing a comprehensive range of both hardware and software
components. These components work harmoniously to enable the seamless transfer
of data from sensors, the processing of raw data into valuable information, and the
intuitive display of this information on compatible devices such as laptops or
smartphones.

With this intelligent module, homeowners can effortlessly monitor energy


consumption, control appliances remotely, and optimize their overall energy
efficiency. The smart socket module revolutionizes the way we interact with our
homes, bringing us one step closer to a fully automated and interconnected living
environment.

46
REFERENCE

[1] Ma Yan, The Design and Application of Intelligent Electrical Outlet for
Campus’s Electricity Saving and Emission Reduction, JOURNAL OF
COMPUTERS, VOL. 7, NO. 7, JULY 2012
[2] Aru, OkerekeEze,IhekweabaGozie, Opara, F.K., Design Exploration of a
Microcontroller Based RF Remote Control 13amps Wall Socket, IOSR Journal of
Computer Engineering (IOSR-JCE) e-ISSN: 2278-0661, p- ISSN: 2278-
8727Volume 11, Issue 1 (May. - Jun. 2013), PP
[3] Abdelrasoul Jabar Alzubaidi 1, YousifTahaYousif lamin, Design of Switches &
Sockets Testers based on Microcontroller, IOSR Journal of Engineering
(IOSRJEN), Vol. 04, Issue 08 (August. 2014), ||V4|| PP 40-43
[4] Yang Yaxuan, Zhang Chunyan *, Huang Yunwei, GuoYunshan and Xu Jiayan,
The Design and Research of a Creative Automatic Bouncing Socket, Mathematical
Modelling Of Engineering Problems, A publication of IIETA , Vol. 3, No. 2, June
2016, pp. 67-70.
[5] ChenRuihui and Lin Miao, Wu Zhenpeng and Chen Liang, “Research on the
size of the standard of the single-phase plug socket and the converter in China,”
Standard Science, vol. 3, pp. 50-60, 2014.
[6] Damon Taylor, Plugging in: Power sockets, standards and the valencies of
national habitus, Journal of Material Culture, November 25, 2014 Volume: 20 issue:
1, Sage publishing, page(s): 59-75
[8] Smart Guide Wiring: step-by-step projects, Fran J. Donegan, Creative
Homeowner Press, 2004, p.74
[7] Tatsuyoshi Kajikawa, EijiTakegami, Kohji Higuchi, Kazushi Nakano, and
Satoshi Tomioka**, Robust Digital Control of DC-DC Power Supply with Remote
Sensing, IJAT Vol.4 No.6 pp. 502-509doi: 10.20965/ijat.2010.p0502(2010)

47
[9] Tzimenakis, J.; Holland, D. (2000). Electrical Product Safety: A Step-by-step
Guide to LVD Self-assessment Newnes. p. 58. ISBN 9780750646048. Retrieved 7
February 2016.
[10] Schneps-Schneppe, M., Namiot, D., Maximenko, A., &Malov, D. (2012,
October). Wired Smart Home: energy metering, security, and emergency issues. In
Ultra-Modern Telecommunications and Control Systems and Workshops (ICUMT),
2012 4th International Congress on (pp. 405-410). IEEE
[11] Design and Implementation of Standby Power Saving Smart Socket with
Wireless Sensor Network, Singaravelan.A, Kowsalya.M.
[12] Tiago M. Fernández-Caramés , An Intelligent Power Outlet System for the
Smart Home of the Internet of Things, International Journal of Distributed Sensor
Networks 2015(1):1-11 · November 2015.[13] Lobaccaro, G.; Carlucci, S.;
Löfström, E. A review of systems and technologies for smart homes and smart
grids. Energies 2016, 9.

[14] Froiz-Míguez, I.; Fernández-Caramés, T.; Fraga-Lamas, P.; Castedo, L.; Froiz-
Míguez, I.; Fernández-Caramés, T.M.; Fraga-Lamas, P.; Castedo, L. Design,
Implementation and Practical Evaluation of an IoT Home Automation System for
Fog Computing Applications Based on MQTT and ZigBee-WiFi Sensor Nodes.
Sensors 2018, 18, 2660.

[15] Ting-Li Chien, Kuo-Lan Su, and Jr-Hung Guo, Intelligent Home-Automation
Security SystemIJAT Vol.3 No.2 pp. 121-129doi: 10.2096

[16] Jiang Feng, Dai Jian, Wu Fei, Zou Yan, Design of Socket Based on Intelligent
Control and Energy Management, (IJACSA) International Journal of Advanced
Computer Science and Applications, Vol. 6, No. 10, 2015.

48
[17] A. Zipperer, P. A. Aloise-Young, Electric Energy Management in the Smart
Home: Perspectives on Enabling Technologies and Consumer Behavior, Journal
Article NREL/JA-5500-57586 August 2013, Laboratory (NREL) at

[18] Atsushi Mitani and TamonHosoya, Mechatronics Education in School of


Design – Development of Educational Tool to Study Design Expression Using
Mechatronics, JRM Vol.23 No.5 pp. 629-637, doi: 10.20965/jrm.2011.p0629
[19] KazuhitoHyodo, HirokazuNoborisaka, and Takashi Yada, Development of
Mechatronics Teaching Materials for Embedded System Engineer Education, JRM
Vol.23 No.5 pp. 611-617, doi: 10.20965/jrm.2011.p0611(2011)
[20] FeiXu ,Liping Wang and Rongrong Wang, Adaptive Control with ESP32 for
Anti-windup Design of Actuator with , 7th International Conference on Education,
Management, Computer and Society (EMCS 2017), Advances in Computer Science
Research (ACSR), volume 61
[21] RubaAlawneh, Aism El Sheikh, Raid Kanaan, Development of Embedded
Personal Health CareRecord System, IBusiness, volume 3, issue 6.
[22] Tariq M. Younes, Development of LVDT Signal Conditioner Using
Waveguide Acoustic Resonance Tube, Sensors & Transducers, Vol. 206, Issue 11,
November 2016, pp. 88-94.
[23] Chen, C.-Y.; Liu, C.-Y.; Kuo, C.-C.; Yang, C.-F.; Chen, C.-Y.; Liu, C.-Y.;
Kuo, C.-C.; Yang, C.-F. Web-Based Remote Control of a Building’s Electrical
Power, Green Power Generation and Environmental System Using a Distributive
Microcontroller.
[24] Vechet, S.; Hrbacek, J.; Krejsa, J. Environmental data analysis for learning
behavioral patterns in smart homes. In Proceedings of the 2016 17th International
Conference on Mechatronics-Mechatronika (ME), Prague, Czech Republic, 7–9
December 2016
49
[25] Tariq M. Younes, Computer-Based Acoustic Detector for Determining the
Type and Concentration of a Solution, Journal of Applied Research and
Technology, pp 859-866,Vol. 10, December 2012

50
APPENDIX

#include <Blynk.h>
#define BLYNK_TEMPLATE_ID "TMPLSiNPRqC_"
#define BLYNK_TEMPLATE_NAME "Smart Socket"
#define BLYNK_AUTH_TOKEN "7WarAmSoyyk99dOLUYOnFqj3cBxrcZh9"
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

char auth[] = BLYNK_AUTH_TOKEN;


char ssid[] = "JÖSHÜA"; // type your wifi name
char pass[] = "6382785607"; // type your wifi password

BLYNK_WRITE(V0)
{
int value = param.asInt();
Serial.println(value);
if(value == 1)
{
digitalWrite(D0, HIGH);
Serial.println("LED ON");
}
if(value == 0)
{
digitalWrite(D0, LOW);
Serial.println("LED OFF");
51
}
}
BLYNK_WRITE(V1)
{
int value = param.asInt();
Serial.println(value);
if(value == 1)
{
digitalWrite(D1, HIGH);
Serial.println("LED ON");
}
if(value == 0)
{
digitalWrite(D1, LOW);
Serial.println("LED OFF");
}
}
BLYNK_WRITE(V2)
{
int value = param.asInt();
Serial.println(value);
if(value == 1)
{
digitalWrite(D2, HIGH);
Serial.println("LED ON");
}
if(value == 0)
52
{
digitalWrite(D2, LOW);
Serial.println("LED OFF");
}
}
BLYNK_WRITE(V3)
{
int value = param.asInt();
Serial.println(value);
if(value == 1)
{
digitalWrite(D3, HIGH);
Serial.println("LED ON");
}
if(value == 0)
{
digitalWrite(D3, LOW);
Serial.println("LED OFF");
}
}
BLYNK_WRITE(V4)
{
int value = param.asInt();
Serial.println(value);
if(value == 1)
{
digitalWrite(D3, LOW);
53
digitalWrite(D2,HIGH);
digitalWrite(D1,HIGH);
digitalWrite(D0,HIGH);
Serial.println("LED ON");
}
if(value == 0)
{
digitalWrite(D0,LOW);
digitalWrite(D2,LOW);
digitalWrite(D1, LOW);
digitalWrite(D3,HIGH);
Serial.println("LED OFF");
}
}
void setup()
{
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
pinMode(D0,OUTPUT);
pinMode(D1,OUTPUT);
pinMode(D2,OUTPUT);
pinMode(D3,OUTPUT);
}
void loop()
{
Blynk.run();
}
54

You might also like