Final Report
Final Report
A PROJECT REPORT
Submitted by
of
BACHELOR OF ENGINEERING
IN
ELECTRONICS AND COMMUNICATION ENGINEERING
M.I.E.T. ENGINEERING COLLEGE, TRICHY
MAY 2023
ANNA UNIVERSITY : CHENNAI 600025
BONAFIDE CERTIFICATE
SIGNATURE SIGNATURE
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 also thank all other faculty members and supporting staffs in the
Department of Electronics and Communication Engineering for their support and
encouragement.
iii
ABSTRACT
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
ACKNOWLEDGEMENT iii
ABSTRACT iv
LIST OF FIGURES vi
1 INTRODUCTION 1
2 LITRATURE SURVEY 3
3 BLOCK DIAGRAM 7
4 HARDWARE DESCRIPTION 12
4.3 Relay 20
4.4 ESP8266 25
v
5 SOFTWARE DESCRIPTION 32
5.1 Arduino 33
5.3 Targets 36
5.6 IFTTT 41
6 HARDWARE KIT 43
OUTPUT 44
7 CONCLUSION 46
REFERENCES 47
APPENDIX 51
vi
LIST OF FIGURES
3 Circuit diagram 10
7 DC filteration 15
8 Relay 21
12 IFTTT platform 42
vii
ABBREVIATION
Acronyms Explanations
IC Integrated Circuit
viii
CHAPTER 1
INTRODUCTION
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.
2
CHAPTER 2
LITERATURE SURVEY
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.
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.
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.
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
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.
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.
9
Fig. 3.4: Basic design of IoT system
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
Component List :
12
fig 4.1:LM7805 – Pin Diagram
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.
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.
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 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
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.
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.
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:
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
22
• Solid state contactor relay
• Overload protection relay
• Vacuum relay
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:
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.
• 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:
24
o Controlling a high-current circuit with a low-current signal, as in the
starter solenoid of an automobile.
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.
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.
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:
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.
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.
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.
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
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
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.
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.
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.
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 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:
36
<BOARD>.core: which sub-directory of the hardware/cores/ directory to link
sketches against (normally "arduino").
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.
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).
<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").
38
Wi-Fi, Ethernet or this new ESP8266 chip, Blynk will get you online and ready for
the Internet of Your Things.
• 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.
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.
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.
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.
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.
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
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>
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