Mini-Project Final Pavan
Mini-Project Final Pavan
i
GURU NANAK INSTITUTE OF TECHNOLOGY
(UGC Autonomous Institution, NAAC A+ & NBA Accredited for ECE, CSE &
MECH,Approved By AICTE, New Delhi & Affiliated to JNTUH Hyderabad)
Khanapur Village, Ibrahimpatnam, Manchal Mandal, Ranga Reddy Dist, Telangana -501506.
DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING
CERTIFICATE
This is to certify that the project report entitled “IOT BASED HOME
AUTOMATION-SMART WAY TO CONTROLLING YOUR HOME
FROM ANYWHERE” is being submitted by ANKARI PAVAN bearing roll
number 20831A0202in partial fulfilment for the award of the Degree of Bachelor
of Technology in Electrical and Electronics Engineering to the Jawaharlal Nehru
Technological University, Hyderabad.
External Examiner
ii
ACKNOWLEDGEMENT
It’s our privilege and pleasure to express our profound sense of gratitude to D. Yesu Raja,
Assistant Professor, Department of EEE for his/her guidance throughout this dissertation work.
We express our sincere thanks to Mr. M. Sreekanth, Project Coordinator for his precious
suggestions for the successful completion of this project.
We express our sincere thanks to our entire faculty, without their constant encouragement and
everlasting support this work would not have been possible.
We express our sincere gratitude to Dr. Nagaraja Kumari.CH, Head of the Department,
Electrical and Electronics Engineering for her precious suggestions for the successful completion
of this project. She is also a great source of inspiration to our work.
We would like to express our profound sense of gratitude to Dr. S. Sreenatha Reddy,
Principal for his constant and valuable guidance.
We would like to express our deep sense of gratitude to Dr. H. S. Saini, Managing
Director, Guru Nanak Group of Institutions for his tremendous support, encouragement and
inspiration. Lastly, we thank almighty, our parents, friends for their constant encouragement
without which this assignment would not be possible. We would like to thank all the other staff
members, both teaching and non- teaching, which have extended their timely help and eased my
work.
iii
DECLARATION
We hereby declare that the result embodied in this project report entitled “IOT Based
Home Automation-Smart Way to Controlling Your Home from Anywhere” is
carried out by us during the year 2022-2023 for the partial fulfilment ofthe award
of Bachelor of Technology in Electrical and Electronics Engineering, from Guru
Nanak Institute of Technology. We have not submitted this project report to any other
Universities/ Institute for the award of any degree.
iv
VISION OF THE INSTITUTION
To be a world class educational and research institution in the service of humanity
by promoting high quality Engineering and Management Education.
M3: Maintain high academic standards and teaching quality that promotes the analytical
thinking and independent judgment.
M5: Offer collaborative industry programs in emerging areas and spirit of enterprise.
QUALITY POLICY
To be recognized as one of the best EEE department in the region and to develop
the department to a level of par excellence that produces Electrical Engineers who can
be an asset to the country.
1 * * * *
2 * * * * *
3 * * * * * * * *
4 * * * * * * * * * *
Home automation is a famous and most used technology in the world. The main object of this
project is to develop a home automation system with Android operating system using Wi-Fi
technology. The Automation technology, life is getting simpler and easier in all aspects. In today’s
world Automatic systems are being preferred over manual system. With the rapid increase in the
number of users of internet over the past decade has made Internet a part and parcel of life, and IOT
is the latest and emerging internet technology. Internet of things is a growing network of everyday
object-from industrial machine to consumer goods that can share information and complete tasks
while you are busy with other activities. Wireless Home Automation system (WHAS) using IOT is
a system that uses computers or mobile devices to control basic home functions and features
automatically through internet from anywhere around the world, an automated home is sometimes
called a smart home. It is meant to save the electric power and human energy. The home automation
system differs from other system by allowing the user to operate the system from anywhere around
the world through internet connection. In this paper we present a Home Automation system (HAS)
using Intel Galileo that employs the integration of cloud networking, wireless communication, to
provide the user with remote control of various lights, fans, and appliances within their home and
storing the data in the cloud. The system will automatically change on the basis of sensors’ data.
This system is designed to be low cost and expandable allowing a variety of devices to be controlled.
The process of controlling or operating various equipment, machinery, industrial processes, and
other applications using various control systems and also with less or no human intervention is
termed as automation. There are various types of automation based on the application they can be
categorized as home automation, industrial automation, autonomous automation, building
automation, etc.…In this project, we are discussing about wireless home automation. Home
Automation is the process of controlling home appliances automatically using various control
system techniques. The electrical and electronic appliances in the home such as fan, lights, outdoor
lights, fire alarm, kitchen timer, etc., can be controlled using various control techniques. In recent
years, wireless systems like Wi-Fi have become more and more common in-home networking. Also,
in home and building automation systems, the use of wireless technologies gives several advantages
that could not be achieved using a wired network only.
INDEX
TITLE PAGE NO
ABSTRACT i
LIST OF FIGURES ii
LIST OF TABLES iii
2.2.10 Finance 9
2.3 Overview Of Embedded System Architecture 9
2.5.3 Rectifier 14
2.5.4 Bridge Rectifier 14
2.5.5 Smoothing 15
2.5.6 Voltage Regulator 15
2.6 Microcontroller 16
2.6.1 ESP32 17
2.6.2 Block Diagram 17
2.10.1 Features 39
2.10.2 Applications 40
2.11.1 Description 40
2.11.2 Specifications 41
2.12.1 Feature 41
2.13 Bluetooth 42
2.13.1 Some Specifications of Bluetooth 43
2.13.2 Difference 43
2.14 Communication 44
2.17 Security 52
2.18 Power Management 53
2.18.1 What is Bluetooth for 55
2.19 ULN2003 56
2.19.1 Features 57
2.20.2 Working 58
2.20.3 Advantages of Relay 59
2.21 Buzzer 59
2.21.1 Introduction 59
2.21.2 Uses 60
2.22 Conclusion 60
CHAPTER-3: SOFTWARE SPECIFICATIONS 61
3.3 File 63
3.4 Edit 64
3.5 Sketch 65
3.5.1 Tools 66
3.5.2 HELP 67
3.5.3 Sketchbook 67
3.5.4 Uploading 68
3.5.5 Libraries 68
3.6 Serial Monitor 69
3.7 Preferences 69
3.7.1 Language Support 69
3.8 BOARDS 70
CHAPTER-4: IMPLEMENTATIONS 71
CHAPTER-6: CONCLUSION 75
REFERENCES 76
APPENDIX 78
LIST OF FIGURES
Figure No. Name of the Figure Page No.
Figure 1.1 IoT Based Smart Home 1
Figure 2.1 Layered Architecture Embedded System 9
Figure 2.2 Building Blocks of the Hardware of an
Embedded System 10
Figure 2.3 Block diagram 11
Figure 2.4 Block Diagram Of Power Supply 13
Figure 2.5 Bridge Rectifier 14
Figure 2.6 Output Waveform Of DC 15
Figure 2.7 Regulator 16
Figure 2.8 Circuit Diagram Of Power Supply 16
Figure 2.9 ARDUINO UNO 17
Figure 2.10 Pin Diagram 18
Figure 2.11 OLED vs LCD 27
Figure 2.12 Library to connect and communicate to
Module OLED 29
Figure 2.13 Arduino 29
Figure 2.14 Example of an IOT system. 32
Figure 2.15 DHT11 Sensor 38
Figure 2.16 DHT11 39
Figure 2.17 Gas Sensor 39
Figure 2.18 Fire sensor 41
Figure 2.19 Bluetooth packet structure 45
Figure 2.20 Discovering a Bluetooth device 46
Figure 2.21 Position of audio in the Bluetooth stack 47
Figure 2.22 Stages in setting up an SDP session 49
Figure 2.23 Bluetooth profiles 52
Figure 2.24 QoS Messaging 54
Figure 2.25 ULN2003 56
Figure 2.26 Logic Diagram of ULN2003 57
Figure 2.27 Relay 58
Figure 2.28 Representation of Relay 58
Figure 2.29 Buzzer 59
Figure 3.1 Creates a new sketch. 62
Figure 3.2 Saves your sketch 62
Figure 3.3 Open recent sketch 63
Figure 3.4 Verify and compile 65
Figure 3.5 Compiles and loads the binary file 65
Figure 3.6 Language Support 69
Figure 4.1 Implementations 71
Figure 5.1 Design 73
LIST OF TABLES
Table No. Name of the Table Page No.
Table 2.1 ESP32 Technical Specifications 19
Smart Home means home appliance with a cloud-controlled electrical system. A smart home is
a time- and money-saving. It will allow you to feel more relaxed with the ability to monitor the
temp before you climb out of bed or protect your home even though you’re not in there.
Essentially, a smart home will help make your house smarter, it’s the place where after a long
boring day one choice or reasons to be. The System overview is shown in Fig. 1.1 below. A small
Internet of Things device to help them monitor their appliances at home, or play their favourite
music, etc. Smart lighting uses LED bulbs that use less energy than an incandescent bulb equal
to wattage. Remote notifications: Have you left your bedroom with the light on? A connected
smart home will warn you if you have the home appliance remotely controlled and allow you to
do so. It’s movie night and you’re already cuddling up on the couch with your significant other.
Simply use your phone, tablet, or laptop to change the lighting, video streaming capable of
allowing live television to your smartphone, tablet, or desktop from inside or around your smart
home. You will get a warning notification.
In the IoT based Smart home ecosystem also known as the IoT Home automation ecosystem,
which is based on several essential sensors installed in the home collecting the home information
and sending it to a remote server pre-installed in the cloud.
Moreover, it would be safer if anything like heating water from the bath and changing the room
temperature had already been completed before they could achieve their house simply by giving
a controlled speech.
1
A number of works have been performed but most of them managed using Bluetooth or GSM
technology. Now information technology is helpful enough that only the good to do culture
people are blessed with these modern home gadgets, as these gadgets cost a little bit. Not
everyone is rich enough to the ability for a human companion, or any smart home package,
though.
Therefore the need for normal families to find affordable and smart assistants continues to grow.
This paper provides such a cost-effective method. It uses the voice along with the webapplication
and the android version. All the components are connected to the cloud using the internet which
puts this device under the IoT.
A prototype built with an algorithm to allow home conditions to be monitored and home appliance
controls to be automated over the Internet at any time and anywhere. This device microcontroller
unit is an internet gateway for the communication of various sensors.
The data obtained from various sensors Identification, ultrasonic, temperature, moisture sensors
can be accessed via If this is the case then The over the Internet on user devices, regardless of
where they are located. Now days, the developments in Technology are mostly focused on the IoT.
Nowadays, technological advances concentrate more on the Internet of Things. IoT-based systems
improve the home-based setting in a real-world situation and are used in different applications.
IoT-based home automation is common in applications. Furthermore, BC-based smart home
platform. They demonstrate that their planned BC-based smart home platform is safe by thoroughly
evaluating its protection with respect to key confidentiality, integrity, and availability security
objectives. In the end, they present simulation results to illustrate that the overheads posed by their
strategy are small compared to their gains in protection and privacy.
Title: Keeping the Smart Home Private with Smart(er) IoT Traffic Shaping
Authors: N. Apthorpe, D. Y. Huang, D. Reisman, A. Narayanan, and N. Feamster.
ABSTRACT:
The proliferation of smart home Internet of things (IoT) devices presents unprecedented challenges
for preserving privacy within the home. In this paper, we demonstrate that a passive network
observer (e.g., an Internet service provider) can infer private in-home activities by analyzing
Internet traffic from commercially available smart home devices even when the devices use end-
to-end transport-layer encryption. We evaluate common approaches for defending against these
types of traffic analysis attacks, including firewalls, virtual private networks, and independent link
padding, and find that none sufficiently conceal user activities with reasonable data overhead. We
develop a new defense, “stochastic traffic padding” (STP), that makes it difficult for a passive
network adversary to reliably distinguish genuine user activities from generated traffic patterns
designed to look like user interactions. Our analysis provides a theoretical bound on an adversary’s
ability to accurately detect genuine user activities as a function of the amount of additional cover
traffic generated by the defense technique.
Title: Iot based smart home automation system using sensor node
Authors: H. Singh, V. Pallagani, V. Khandelwal, and U. Venkanna.
ABSTRACT:
In recent years, the advancements in Information and Communication Technology (ICT) are
mainly focused on the Internet of Things (IoT). In a real-world scenario, IoT based services
improve the domestic environment and are used in various applications. Home automation based
IoT is versatile and popular applications. In home automation, all home appliances are networked
together and able to operate without human involvement. Home automation gives a significant
change in humans life which gives smart operating of home appliances. This motivated us to
develop a new solution which controls some home appliances like light, fan, door cartons, energy
consumption, and level of the Gas cylinder using various sensors like LM35, IR sensors, LDR
module, Node MCU ESP8266, and Arduino UNO. The proposed solution uses the sensor and
detects the presence or absence of a human object in the housework accordingly. Our solution also
provides information about the energy consumed by the house owner regularly in the form of
message. Also, it checks, the level of gas in the gas cylinder if it reaches lesser than the threshold,
4
it automatically books the gas and sends a reference number as a message to the house owner. The
proposed solution is deployed and tested for various conditions. Finally, in this paper, the working
model of our proposed solution is developed as a prototype and explained as a working model
References:
[1] Khan Mohammad Shayshab Aza, Nayon Hossai , Nafisa Anjum Sami , Arif Hossai,”A Cost-
Effective Internet of Things Based Smart Home System for Upcoming Technologies”, IEEE,
June 2021.
[2] A. Akbari-Dibavar, S. Nojavan, B. Mohammadi-Ivatloo, and K. Zare, “Smart home energy
management using hybrid robust-stochastic optimization,” Computers & Industrial
Engineering, p. 106425, 2020.
[3] N. Apthorpe, D. Y. Huang, D. Reisman, A. Narayanan, and N. Feamster, “Keeping the smart
home private with smart (er) iot traffic shaping,” Proceedings on Privacy Enhancing Technologies,
vol. 2019, no. 3, pp. 128–148, 2019.
[4] H. Singh, V. Pallagani, V. Khandelwal, and U. Venkanna, “Iot based smart home automation
system using sensor node,” in 2018 4th International Conference on Recent Advances in
Information Technology (RAIT). IEEE, 2018, pp. 1–5.
1.5 Conclusion
Chapter 1 deals with Literature Review, this chapter reflects a comprehended form of the existing
projects related to the topic. It credits the projects along with a brief paragraph of summery about
the project. This reflects the various people worked on this area, how different and advanced
each project is from one another.
5
CHAPTER 2
PROJECT DESCRIPTION
An embedded system can be defined as a computing device that does a specific focused job.
Appliances such as the air-conditioner, VCD player, DVD player, printer, fax machine, mobile
phone etc. are examples of embedded systems. Each of these appliances will have a processor
and special hardware to meet the specific requirement of the application along with the
embedded software that is executed by the processor for meeting that specific requirement. The
embedded software is also called “firm ware”. The desktop/laptop computer is a general purpose
computer. You can use it for a variety of applications such as playing games, word processing,
accounting, software development and so on.
In contrast, the software in the embedded systems is always fixed listed below:
• Embedded systems do a very specific task, they cannot be programmed to do different
things.
• Embedded systems have very limited resources, particularly the memory. Generally, they
do not have secondary storage devices such as the CDROM or the floppy disk. Embedded
systems have to work against some deadlines. A specific job has to be completed within
a specific time. In some embedded systems, called real-time systems, the deadlines are
stringent. Missing a deadline may cause a catastrophe-loss of life or damage to property.
Embedded systems are constrained for power. As many embedded systems operate
through a battery, the power consumption has to be very low.
• Some embedded systems have to operate in extreme environmental conditions such as
very high temperatures and humidity.
7
2.2.6 Telecommunications
In the field of telecommunications, the embedded systems can be categorized as subscriber
terminals and network equipment. The subscriber terminals such as key telephones, ISDN
phones, terminal adapters, web cameras are embedded systems. The network equipment includes
multiplexers, multiple access systems, Packet Assemblers Dissemblers (PADs), sate11ite
modems etc. IP phone, IP gateway, IP gatekeeper etc. are the latest embedded systems that
provide very low-cost voice communication over the Internet.
2.2.8 Insemination
Testing and measurement are the fundamental requirements in all scientific and engineering
activities. The measuring equipment we use in laboratories to measure parameters such as
weight, temperature, pressure, humidity, voltage, current etc. are all embedded systems. Test
equipment such as oscilloscope, spectrum analyzer, logic analyzer, protocol analyzer, radio
communication test set etc. are embedded systems built around powerful processors. Thank to
miniaturization, the test and measuring equipment are now becoming portable facilitating easy
testing and measurement in the field by field-personnel.
2.2.9 Security
Security of persons and information has always been a major issue. We need to protect our homes
and offices; and also, the information we transmit and store. Developing embedded systems for
security applications is one of the most lucrative businesses nowadays. Security devices at
homes, offices, airports etc. for authentication and verification are embedded systems.
Encryption devices are nearly 99 per cent of the processors that are manufactured end up in~
embedded systems. Embedded systems find applications in every industrial segment- consumer
electronics, transportation, avionics, biomedical engineering, manufacturing, process control
and industrial automation, data communication, telecommunication, defense, security etc. Used
to encrypt the data/voice being transmitted on communication links such as telephone lines.
Biometric systems using fingerprint and face recognition are now being extensively used for
8
user authentication in banking applications as well as for access control in high security
buildings.
2.2.9 Finance
Financial dealing through cash and cheques are now slowly paving way for transactions using
smart cards and ATM (Automatic Teller Machine, also expanded as Any Time Money) machines.
Smart card, of the size of a credit card, has a small micro-controller and memory; and it interacts
with the smart card reader! ATM machine and acts as an electronic wallet. Smart card technology
has the capability of ushering in a cashless society. Well, the list goes on. It is no exaggeration
to say that eyes wherever you go, you can see, or at least feel, the work of an embedded system.
9
Now, let us see the details of the various building blocks of the hardware of an embedded system.
As shown in Fig. the building blocks are;
· Central Processing Unit (CPU)
· Memory (Read-only Memory and Random Access Memory)
· Input Devices
· Output devices
· Communication interfaces
· Application-specific circuitry
2.3.2 Memory
The memory is categorized as Random Access Memory (RAM) and Read Only Memory (ROM).
The contents of the RAM will be erased if power is switched off to the chip, whereas ROM
retains the contents even if the power is switched off. So, the firmware is stored in the ROM.
When power is switched on, the processor reads the ROM; the program is program is executed.
10
2.3.3 Input Devices
Unlike the desktops, the input devices to an embedded system have very limited capability. There
will be no keyboard or a mouse, and hence interacting with the embedded system is no easy task.
Many embedded systems will have a small keypad-you press one key to give a specific
command. A keypad may be used to input only the digits. Many embedded systems used in
process control do not have any input device for user interaction; they take inputs from sensors
or transducers 1’fnd produce electrical signals that are in turn fed to other systems.
11
2.4 BLOCK DIAGRAM
Power IOT
Supply
OLED
NODEMCU
Driver Exhaust
Circuit motor
Driver Appliance
Circuit
Alarm
After designing the program induce, i.e. we need to set the What exactly does it take to perform
when the voice senses the power that we are only setting up? This is determined by setting out
the app’s” Who.” We click on the” What” button, then pick [15] webhooks, and then click the
link. Webhooks allow us to send instructions to the Remote Server. Now we type the remote
server’s IP address in the URL followed by the Authentication token given by the remote server
and then the pin of the Nedelcu to which the computer is being controlled is connected. Then
12
we pick ’PUT’ in the technique and the content material form is JSON and we write ”1” to turn
ON in the body and ”0” to switch OFF. That creates the trigger action i.e. the voice order. The
action it takes is to quickly send a request to the remote server app in order to either turn the
connected gadget on or off. Finally, the microcontroller is programmed with the behavior that it
needs to perform until the remote server application transmits it. Before that, both the remote
server and the microcontroller can communicate and the conversation is conducted over the
internet, and because the microcontroller contains NodeMCU with the built-in Wi-Fi module, it
is designed to connect to the chosen network until it is plugged in. Hardware implementation.
The language ’C’ is used to program the microcontroller and is built in the Arduino IDE.
2.5 MODULES
2.5.1 POWER SUPPLY
The power supply section is the section which provide +5V for the components to work.
IC LM7805 is used for providing a constant power of +5V.
The ac voltage, typically 220V, is connected to a transformer, which steps down that ac voltage
down to the level of the desired dc output. A diode rectifier then provides a full-wave rectified
voltage that is initially filtered by a simple capacitor filter to produce a dc voltage. This resulting
dc voltage usually has some ripple or ac voltage variation.
A regulator circuit removes the ripples and also retains the same dc value even if the input dc
voltage varies, or the load connected to the output dc voltage changes. This voltage regulation is
usually obtained using one of the popular voltage regulator IC units.
2.5.2 Transformer
Transformers convert AC electricity from one voltage to another with little loss of power.
Transformers work only with AC and this is one of the reasons why mains electricity is AC.
Step-up transformers increase voltage, step-down transformers reduce voltage. Most power
supplies use a step-down transformer to reduce the dangerously high mains voltage (230V in
India) to a safer low voltage.
The input coil is called the primary and the output coil is called the secondary. There is no
electrical connection between the two coils; instead, they are linked by an alternating magnetic
field created in the soft-iron core of the transformer. Transformers waste very little power so the
13
power out is (almost) equal to the power in. Note that as voltage is stepped down current is
stepped up.
The transformer will step down the power supply voltage (0-230V) to (0- 6V) level. Then the
secondary of the potential transformer will be connected to the bridge rectifier, which is
constructed with the help of PN junction diodes. The advantages of using bridge rectifier are it
will give peak voltage output as DC.
2.5.3 Rectifier
There are several ways of connecting diodes to make a rectifier to convert AC to DC.
The bridge rectifier is the most important and it produces full-wave varying DC. A full-wave
rectifier can also be made from just two diodes if a centre-tap transformer is used, but this method
is rarely used now that diodes are cheaper. A single diode can be used as a rectifier but it only
uses the positive (+) parts of the AC wave to produce half-wave varying Dc.
14
ii. The single secondary winding is connected to one side of the diode bridge network and the
load to the other side as shown below.
iii. The result is still a pulsating direct current but with double the frequency.
2.5.5 Smoothing
Smoothing is performed by a large value electrolytic capacitor connected across the DC
supply to act as a reservoir, supplying current to the output when the varying DC voltage from
the rectifier is falling. The capacitor charges quickly near the peak of the varying DC, and then
discharges as it supplies current to the output.
15
Fig 2.7: Regulator
2.6 MICROCONTROLLER
2.6.1 ESP32
Overview ESP32 is a single 2.4 GHz Wi-Fi-and-Bluetooth combo chip designed with the
TSMC ultra-low-power 40 nm technology. It is designed to achieve the best power and RF
performance, showing robustness, versatility and reliability in a wide variety of applications and
power scenarios. The ESP32 series of chips includes ESP32-D0WD-V3, ESP32-U4WDH,
ESP32-S0WD, ESP32-D0WDQ6-V3 (NRND), ESP32-D0WD (NRND), and ESP32-D0WDQ6
(NRND), among which, ESP32-D0WD-V3, ESP32-D0WDQ6-V3 (NRND), and ESP32-
U4WDH are based on ECO
V3 wafer. For details on part numbers and ordering information, please refer to Section 7. For
details on ECO V3 instructions, please refer to ESP32 ECO V3 User Guide. 1.1 Featured
Solutions 1.1.1 Ultralow Power Solution ESP32 is designed for mobile, wearable electronics,
and Internet-of-Things (IoT) applications. It features all the state-of-the-art characteristics of
low-power chips, including fine-grained clock gating, multiple power modes, and dynamic power
scaling. For instance, in a low-power IoT sensor hub application scenario, ESP32 is woken up
periodically only when a specified condition is detected. Low-duty cycle is used to minimize the
amount of energy that the chip expends. The output of the power amplifier is also adjustable,
thus contributing to an optimal trade-off between communication range, data rate and power
consumption.
ESP32 is a series of powerful, power-efficient, cheap microcontrollers that comes with
integrated Wi-Fi and dual-mode Bluetooth. In this post, you will find ESP32 Dev board Pinout,
Specifications, datasheet, and Schematic in detail.
16
The ESP32 series consist of a Ten silica Xena LX6 32-bit, dual-core microprocessor (has
two processors) running at 240MHz and includes built-in antenna switches, RF balun, power
amplifier, low-noise receive amplifier, filters, and power management modules. ESP32 is
developed by a semiconductor-based company Espressif Systems in China, and it is
manufactured by TSMC (Taiwan Semiconductor Manufacturing Company). It is a successor to
their previous ESP8266 microcontroller module.
2.6.2 Block Diagram
18
2.6.4 ESP32 Technical Specifications
Microprocessor Tensilica Xtensa LX6
SRAM 520 KB
19
The ESP32 operates on 3.3V and can be programmed with ESP-IDF or with Arduino IDE which
is still under development; the Arduino operates at 5V and is known for its easy-to-use Arduino
IDE and strong community support. So to conclude, if you have prior experience with
programming and your project really requires some heavy processing with IoT capabilities, then
ESP32 can be preferred over Arduino.
Touch Sensor: The ESP32 comes with 10 capacitive touch sensors connected to GPIO pins-
• Touch0 (GPIO4)
• Touch1 (GPIO0)
• Touch2 (GPIO2)
• Touch3 (GPIO15)
• Touch4 (GPIO13)
• Touch5 (GPIO12)
• Touch6 (GPIO14)
• Touch7 (GPIO27)
• Touch8 (GPIO33)
• Touch9 (GPIO32)
These GPIO pins can sense variations if it touches anything that conducts electricity like the
human skin. So, when we touch the GPIO pin with our finger it generates this variation that is
read by the sensor. We can use the touchRead(GPIO) function to read the value from the touch
sensor.
The ESP 32 board consists of a set of 38 pins that can be used to connect it with the external
sensors and components. Out of these 38 pins, 25 pins are GPIO pins that can be used for a
number of different functions
20
2.6.7 Power Pins:
The board comes with two power pins – a 5V pin & a 3.3V pin. The 5V pin can be used to
directly supply the ESP32 and its peripherals if you have a regulated 5V voltage source. While
the 3.3V pin is the output of a voltage regulator (CP2102), it can be used to power up the external
components.
GND: The ground pin of ESP32 is used to complete the circuit.
22
2.6.12 VSPI Pins:
• HSPI_ID (GPIO13)
• HSPI_WP (GPIO2)
• HSPI_HD (GPIO4)
• HSPI_Q (GPIO12)
• HSPI_CLK (GPIO14)
• HSPI_CS0 (GPIO15) PWM Pins:
The board comes with 25 PWM enabled pins (Nearly All GPIO pins) The PWM output can be
used for driving digital motors and LEDs.
EN or Enable Pin:
EN stands for Enable, this pin is a 3.3 V regulator enable pin. When this is pulled LOW it resets
the micro-controller.
NOTE: Not all development boards expose all the pins on the chip. The ESP32 board(breakout
board) shown here has all the pins of the ESP-WROOM-32 chip exposed. Whereas some ESP32
boards have only 30 or 36 pins exposed(available for external connection), although they have
the same WROOM32 chip installed in them.
23
• Hall effect sensor
• Ultra-low-power analog pre-amplifier
• All security feature of IEEE 802.11 standard, like WFA, WPA/WPA2, and WAPI,
secure boot, Flash encryption
• Cryptographic hardware acceleration method like AES, SHA-2, RSA, elliptic curve
cryptography (ECC), random number generator (RNG)
24
• Internal 8 MHz oscillator with calibration
• Internal RC oscillator with calibration
• External 2 MHz ~ 60 MHz crystal oscillator (40 MHz only for Wi-Fi/Bluetooth functionality)
• External 32 kHz crystal oscillator for RTC with calibration
• Two timer groups, including 2 × 64-bit timers and 1 × main watchdog in each group
• One RTC timer
• RTC watchdog
Advanced Peripheral Interfaces
• 34 × programmable GPIOs
• 12-bit SAR ADC up to 18 channels
• 2 × 8-bit DAC
• 10 × touch sensors
• 4 × SPI
• 2 × I2S
• 2 × I2C
• 3 × UART
• 1 host (SD/eMMC/SDIO)
• 1 slave (SDIO/SPI)
• Ethernet MAC interface with dedicated DMA and IEEE 1588 support
• TWAI®, compatible with ISO 11898-1 (CAN Specification 2.0)
• RMT (TX/RX)
• Motor PWM
• LED PWM up to 16 channels
• Hall sensor Security
• Secure boot
• Flash encryption
• 1024-bit OTP, up to 768-bit for customers
• Cryptographic hardware acceleration:
– AES
– Hash (SHA-2)
– RSA
– ECC
– Random Number Generator (RNG)
Applications (A Non-exhaustive List)
25
• Generic Low-power IoT Sensor Hub
• Generic Low-power IoT Data Loggers
• Cameras for Video Streaming
• Over-the-top (OTT) Devices
• Speech Recognition
• Image Recognition
• Mesh Network
• Home Automation
– Light control
– Smart plugs
– Smart door locks
• Smart Building
– Smart lighting
– Energy monitoring
• Industrial Automation
– Industrial wireless control
– Industrial robotics
• Smart Agriculture
– Smart greenhouses
– Smart irrigation
– Agriculture robotics
• Audio Applications
– Internet music players
– Live streaming devices
– Internet radio players – Audio headsets
• Health Care Applications
– Health monitoring
– Baby monitors
• Wi-Fi-enabled Toys
– Remote control toys
– Proximity sensing toys
– Educational toys
• Wearable Electronics
– Smart watches
– Smart bracelets
26
• Retail & Catering Applications
– POS machines
– Service robots
27
• Wearable OLEDs
• Foldable OLEDs and rollable OLEDs which can be used to create new mobile devices
• Transparent OLEDs embedded in windows or car windshdields
• And many more we cannot even imagine today...
Flexible OLEDs are already on the market for many years (in smartphones, wearables and other
devices) and since 2019, with the introduction of the Samsung Galaxy Fold, foldable devices are
increasing in popularity. In 2019 LG also announced the world's first rollable OLED - its 65"
OLED R TV that can roll into its base!
An OLED is made by placing a series of organic thin films between two conductors. When
electrical current is applied, a bright light is emitted. Click here for a more detailed view of the
OLED technology. OLEDs are organic because they are made from carbon and hydrogen. There's
no connection to organic food or farming - although OLEDs are very efficient and do not contain
any bad metals - so it's a real green technology.
OLED is the best display technology - and indeed OLED panels are used today to create the
most stunning TVs ever - with the best image quality combined with the thinnest sets ever. And
this is only the beginning, as in the future OLED will enable large rollable and transparent TVs!
Currently the only company that produces OLED TV panels is LG Display. The Korean display
maker is producing a wide range of OLED TV panels, offering these to LG
Electronics, Panasonic, Sony, Philips and others.
2.7.4 Specifications
Use CHIP No.SH1106
Use 3.3V-5V POWER SUPPLY
Graphic LCD 1.3” in width with 128x64 Dot Resolution
White Display is used for the model OLED 1.3 I2C WHITE and blue Display is used for
the model OLED 1.3 I2C BLUE
Use I2C Interface
Directly connect signal to Microcontroller 3.3V and 5V without connecting through
Voltage Regulator Circuit
Total Current when running together is 8 mA - PCB Size: 33.7 mm x 35.5 mm
28
Table shows name and function of Pin OLED
29
2.8 Internet of things (IoT)
Internet of things (IoT), is another advance technology in IT sector, provides
internetworking for numerous of devices such as sensors, actuators, PLCs and other electronic
embedded smart devices and controls, and various software’s’ and provides systems network
configuration and connectivity, which enables communication between these numerous devices
for information exchanging.
In 1995, “thing to thing” was coined by BILL GATES. In 1999, IoT (Internet of Things)
was come up by EPC global. IOT interconnects human to thing, thing to thing and human to
human. The goal of IoT is bring out a huge network by combining different types connected
devices. IoT targets three aspects Communication, automation, cost saving in a system. IOT
empowers people to carry out routine activities using internet and thus saves time and cost
making them more productive. IOT enables the objects to be sensed and/or controlled remotely
across existing network model. IOT in environmental monitoring helps to know about the air
and water quality, temperature and conditions of the soil, and also monitor the intrusion of
animals in to the field. IOT can also play a significant role in precision farming to enhance the
productivity of the farm.
Recent advancements, such as the vision of the Internet of Things (IoT), the cloud computing
model, and cyber-physical systems, provide support for the transmission and management of
huge amounts of data regarding the trends observed in environmental parameters. In this context,
the current work presents three different IoT-based wireless sensors
for environmental and ambient monitoring: one employing User Datagram Protocol (UDP)-
based WiFi communication, one communicating through Wi-Fi and Hypertext Transfer Protocol
(HTTP), and a third one using Bluetooth Smart. All of the presented systems provide the
possibility of recording data at remote locations and of visualizing them from every device with
an Internet connection, enabling the monitoring of geographically large areas. The development
details of these systems are described, along with the major differences and similarities between
them. The feasibility of the three developed systems for implementing monitoring applications,
taking into account their energy autonomy, ease of use, solution complexity, and Internet
connectivity facility, was analysed, and revealed that they make good candidates for IoT-based
solutions.
Nowadays, IoT is one of the most advanced, efficient, and cost less technological solution
which encompasses various hardware and software resources; and allows remotely connected
sensing devices to sense with more capabilities, provides efficiency and can be monitored and
controlled through deployed of existing systems or infrastructures, resulting the physical World
integration with computer controllers (or systems).
30
As IoT provides interconnectivity among various real-time sensing sensors and PLC and
other intelligent devices, therefore this technology will be an entity indicated for the more
advance cybersystems encircling the significant developments, “such as smart grid, smart
vehicle systems, smart medical systems, smart cities, and others smart systems.” In early future,
IoT has striven to provide advance or smart connectivity for variety of electronic and intelligent
equipment’s or devices, ITbased systems and the more advanced services through deploying of
various traditional and real-time protocols, networks domains, and system software/hardware
applications, which will be an work followed by machine-to-machine technological concept.
Through interconnection of various devices and managing of the internet of things (IoT)
is the network of physical devices, vehicles, buildings and other items embedded with
electronics, software, sensors, actuators, and network connectivity that enable these objects to
collect and exchange data. In 2013 the Global Standards Initiative on Internet of Things (IoT-
GSI) defined the IoT as "the infrastructure of the information society. The IoT allows objects to
be sensed and controlled remotely across existing network infrastructure, creating opportunities
for more direct integration of the physical world into computer-based systems, and resulting in
improved efficiency, accuracy and economic benefit.
When IoT is augmented with sensors and actuators, the technology becomes an instance
of the more general class of cyber-physical systems, which also encompasses technologies such
as smart grids, smart homes, intelligent transportation and smart cities. Each thing is uniquely
identifiable through its embedded computing system but is able to interoperate within the
existing Internet infrastructure. Experts estimate that the IoT will consist of almost 50 billion
objects by 2020.
IoT is a system defines an environment that encompasses numerous of objects; sensors
that connected with these objects are accessible over the Internet through employing of various
Networks connections, such wired or wireless. IoT can be able to carry information from various
embedded sensors attached with the physical World, human and any inanimate object, and then
transmit them to a system for further analyses. In early future, IoT will be able to connect almost
components or parts of industrial infrastructures, smart medical tele monitoring systems, and
smart transportation systems; and will provide the information sharing facilities in order to make
systems and peoples always updated.
32
2.8.3 Why is IoT important
The internet of things helps people live and work smarter, as well as gain complete control over
their lives. In addition to offering smart devices to automate homes, IoT is essential to business.
IoT provides businesses with a real-time look into how their systems really work, delivering
insights into everything from the performance of machines to supply chain and logistics
operations.
IoT enables companies to automate processes and reduce labor costs. It also cuts down on waste
and improves service delivery, making it less expensive to manufacture and deliver goods, as
well as offering transparency into customer transactions.
As such, IoT is one of the most important technologies of everyday life, and it will continue to
pick up steam as more businesses realize the potential of connected devices to keep them
competitive.
33
buildings, bridges and other infrastructure. This brings benefits with it, such as cost saving, saved
time, quality-of-life workflow changes and paperless workflow.
A home automation business can utilize IoT to monitor and manipulate mechanical and electrical
systems in a building. On a broader scale, smart cities can help citizens reduce waste and energy
consumption.
IoT touches every industry, including businesses within healthcare, finance, retail and
manufacturing.
34
• LiteOS is a Unix-like operating system (OS) for wireless sensor networks. LiteOS
supports smartphones, wearables, intelligent manufacturing applications, smart homes
and the internet of vehicles (IoV). The OS also serves as a smart device development
platform.
• OneM2M is a machine-to-machine service layer that can be embedded in software and
hardware to connect devices. The global standardization body, OneM2M, was created to
develop reusable standards to enable IoT applications across different verticals to
communicate.
• Data Distribution Service (DDS) was developed by the Object Management Group
(OMG) and is an IoT standard for real-time, scalable and high-performance M2M
communication.
• Advanced Message Queuing Protocol (AMQP) is an open source published standard
for asynchronous messaging by wire. AMQP enables encrypted and interoperable
messaging between organizations and applications. The protocol is used in client-server
messaging and in IoT device management.
• Constrained Application Protocol (CoAP) is a protocol designed by the IETF that
specifies how low-power, compute-constrained devices can operate in the internet of
things.
• Long Range Wide Area Network (LoRaWAN) is a protocol for WANs designed to
support huge networks, such as smart cities, with millions of low-power devices.
35
communication protocol that serves as the communication language between the device
and the cloud.
• Calvin is an open source IoT platform released by Ericsson designed for building and
managing distributed applications that enable devices to talk to each other. Calvin
includes a development framework for application developers, as well as a runtime
environment for handling the running application.
36
2.8.8 IoT security and privacy issues
The internet of things connects billions of devices to the internet and involves the use of billions
of data points, all of which need to be secured. Due to its expanded attack surface, IoT security
and IoT privacy are cited as major concerns.
In 2016, one of the most notorious recent IoT attacks was Mirai, a botnet that infiltrated domain
name server provider Dyn and took down many websites for an extended period of time in one
of the biggest distributed denial-of-service (DDoS) attacks ever seen. Attackers gained access to
the network by exploiting poorly secured IoT devices.
Because IoT devices are closely connected, all a hacker has to do is exploit one vulnerability to
manipulate all the data, rendering it unusable. Manufacturers that don't update their devices
regularly - or at all -- leave them vulnerable to cybercriminals.
Additionally, connected devices often ask users to input their personal information, including
names, ages, addresses, phone numbers and even social media accounts -- information that's
invaluable to hackers.
Hackers aren't the only threat to the internet of things; privacy is another major concern for IoT
users. For instance, companies that make and distribute consumer IoT devices could use those
devices to obtain and sell users' personal data.
Beyond leaking personal data, IoT poses a risk to critical infrastructure, including electricity,
transportation and financial services.
37
Fig 2.15: DHT11 Sensor
38
Fig 2.16: DHT11
As you can see the data pin is connected to an I/O pin of the MCU and a 5K pull-up resistor is
used. This data pin outputs the value of both temperature and humidity as serial data. If you are
trying to interface DHT11 with Arduino then there are ready-made libraries for it which will give
you a quick start.
If you are trying to interface it with some other MCU then the datasheet given below will come
in handy. The output given out by the data pin will be in the order of 8bit humidity integer data
+ 8bit the Humidity decimal data +8 bit temperature integer data + 8bit fractional temperature
data +8 bit parity bit.
2.10.1 FEATURES
* High sensitivity to LPG, natural gas , town gas .
* Small sensitivity to alcohol, smoke.
* Fast response .
* Stable and long life.
* Simple drive circuit.
2.10.2 APPLICATION
They are used in gas leakage detecting equipments in family and industry, are suitable for
detecting of LPG, natural gas , town gas, avoid the noise of alcohol and cooking fumes and
cigarette smoke.
40
2.11.2 Specifications
Adopts high quality of RF-04 double sided material.
Area: 5cm x 4cm nickel plate on side,
Anti-oxidation, anti-conductivity, with long use time;
Comparator output signal clean waveform is good, driving ability, over 15mA;
Potentiometer adjust the sensitivity;
Working voltage 5V;
Output format: Digital switching output (0 and 1) and analog voltage output AO;
With bolt holes for easy installation;
Small board PCB size: 3.2cm x 1.4cm;
Uses a wide voltage LM393 comparator
2.12.1 Feature
• Typical Maximum Range :2 m .
• Indicator LED with 3 pin easy interface connector.
• Operating Voltage 5v
An automatic fire sensor sense the unwanted presence of fire by monitoring environmental
changes associated with combustion. In general, a fire alert system is classified as either
automatically actuated, manually actuated, or both. Fire sensor are intended to notify the fire in
the building occupants to evacuate in the event of a fire or other emergency, report the event to
an off-premises location in order to summon emergency services, and to prepare the structure
and associated systems to control the spread of fire and smoke.
2.13 BLUETOOTH
Bluetooth is a wireless technology standard for exchanging data over short distances
(using short-wavelength UHF radio waves in the ISM band from 2.4 to 2.485 GHz) from fixed
and mobile devices and building personal area networks (PANs). In 1994 a group of engineers
at Ericsson, a Swedish company, invented a wireless communication technology, later called
42
Bluetooth. In 1998, the original group of Promoter companies—Ericsson, Intel, Nokia, Toshiba
and IBM—came together to form the Bluetooth Special Interest Group (SIG).
Bluetooth networking transmits data via low-power radio waves. It communicates on a
frequency of 2.45 gigahertz (actually between 2.402 GHz and 2.480 GHz, to be exact). This
frequency band has been set aside by international agreement for the use of industrial, scientific
and medical devices (ISM). By comparison, the most powerful cell phones can transmit a signal
of 3 watts. The low power limits the range of a Bluetooth device to about 10 meters (32 feet),
cutting the chances of interference between your computer system and your portable telephone
or television.
2.13.2 DIFFERENCE
There are many other wireless communication techniques are available in the market like IEEE
802.11 (Wi-Fi), IrDA, GSM, GPRS etc. But still Bluetooth is very popular among them. There
are many reasons like some techniques required huge infrastructure like GSM, GPRS etc. and
also they are not suitable for Adhoc networks like Bluetooth. But some wireless communications
techniques are there that are the competitors of Bluetooth. Some main competitors are IEEE
802.11 and IrDA (Infrared Data Association). In this section we will discuss the differences b/w
these and Bluetooth.
It is a family of IEEE standards for wireless LANs that were designed to extend 802.3 (wired
Ethernet) into the wireless domain. The 802.11 standard is more widely known as "Wi-Fi". Based
on the Bluetooth Specification, is now an IEEE standard under the denomination of 802.15
WPANs
43
The first 802.11 specifications were introduced in 1997 and included two spread spectrum
methods for transmission in the unlicensed 2.4GHz band: 1 Mbps frequency hopping (FHSS)
and 1 and 2 Mbps direct sequence (DSSS).
In 1999, 802.11b boosted speed to 11 Mbps using DSSS. The 1 and 2 Mbps DSSS modes are
still valid, and devices can throttle down to the lower speeds to maintain a connection when
signals are weak.
An 802.11 system works in two modes. In "infrastructure" mode, wireless devices communicate
to a wired LAN via base stations known as "access points." Each access point and its wireless
devices are known as a Basic Service Set (BSS). An Extended Service Set (ESS) is two or more
BSSs in the same subnet.
In "ad hoc" mode, also known as "peer-to-peer" mode, wireless devices communicate with each
other directly without an access point. This is an Independent BSS (IBSS).
2.14 COMMUNICATION
A Bluetooth transceiver is a frequency hopping spread-spectrum (FHSS) device that uses
the unlicensed (worldwide) 2.4 GHz ISM (Industrial, Scientific, Medical) frequency band. In
most countries, there are 79 channels available. The nominal bandwidth for each channel is
1MHz. When connected to other Bluetooth devices, a Bluetooth device hops (changes
frequencies) at the rate of 1600 times per second for typical use, with a residence time of 625
µsec.
When in inquiry or page mode, it hops at 3200 hops per second with a residence time of
312.5 µsec. A Bluetooth transceiver uses all 79 channels, and hops pseudo-randomly across all
channels at a rate of 1600 hops per second for standard transmissions. It has a range of
approximately10 meters, although ranges up to 100 meters can be achieved with amplifiers.
Because the transceiver has an extremely small footprint, it is easily embedded into physical
devices, making it a truly ubiquitous radio link. The Bluetooth specification uses time division
duplexing (TDD) and time division multiple access (TDMA) for device communication.
44
A single time slot is 625 µ sec in length, representing the length of a single-slot packet.
At the Baseband layer, a packet consists of an access code, a header, and the payload, as shown
in Fig. 3. The access code contains the piconet address (to filter out messages from other
piconets) and is usually 72 bits in length. The header contains link control data, encoded with a
forward error-correcting code (FEC) with a 1/3 rate for high reliability. Such code is a repetition
code and thus every bit in the header is transmitted three times. The header is usually 18 bits in
length, and includes the active member address for a currently active slave.
The payload can contain from 0 to 2745 bits of data, and may be protected by a 1/3 rate
FEC (simple bit repetition, for SCO packets only), a 2/3 rate FEC (which is a (15,10) shortened
Hamming code capable of correcting all one-bit errors and detecting all two-bit errors), or a 3/3/
rate (no FEC). For SCO connections, packets must be exactly one time-slot in length. For ACL
links, packets may be 1, 3, or 5 time slots in length. Bluetooth uses polling-based packet
transmission. All communication between devices takes place between a master and a slave,
using time-division duplex (TDD), with no direct slave-to slave communication.
The master will poll each active slave to determine if it has data to transmit. The slave
may only transmit data when it has been polled. Also, it must send its data in the time slot
immediately following the one in which it was polled. The master transmits only in even
numbered time slots, while the slaves transmit only in odd-numbered time slots. In each time
slot, a different frequency channel f is used (a hop in the hopping sequence).
45
Each Bluetooth device has a 48 bit IEEE MAC address that is used for the derivation of
the access code. The access code has pseudo-random properties and includes the identity of the
piconet master. All the packets exchanged on the channel are identified by this master identity.
That prevents packets sent in one piconet to be falsely accepted by devices in another piconet
that happens to use the same hopping frequency in the certain time slot. . All packets have the
same format, starting with an access code, followed by a packet header and ending with the user
payload.
The Link Controller - The link control layer is responsible for managing device discoverability,
establishing connections and maintaining them. In Bluetooth, three elements have been defined
to support connection establishment: scan, page and inquiry.
Inquiry is a process in which a device attempts to discover all the Bluetooth enabled
devices in its local area. A unit that wants to make a connection broadcasts an inquiry message
that induces the recipients to return their addresses. Units that receive the inquiry message return
an FHS (FHsynchronization) packet which includes, among other things, their identity and clock
information. The identity of the recipient is required to determine the page message and wake-
up sequence. For the return of FHS packets, a random back off mechanism is used to prevent
collisions.
Inquiry
o
o
o
Laptop Mobile
Inquiry
Computer Phone
FHS
A unit in idle mode wants to sleep most of the time to save power, but, from time to time,
it also has to listen whether other units want to connect (page scan). In truly ad hoc system, there
46
is no common control channel a unit can lock to in order to listen for page messages. So, every
time the unit wakes up, it scans at a different hop carrier for an extended time. A trade-off has to
be made between idle mode power consumption and response time: increasing the sleep time
reduces power consumption but prolongs the time before an access can be made. The unit that
wants to connect has to solve the frequency-time uncertainty: it doesn't know when the idle unit
will wake up and on which frequency. For that reason, the paging unit transmits the access code
repeatedly at different frequencies: every 1.25ms the paging unit transmits two access codes and
listens twice for a response. In 10ms period, 16 different hop carriers are visited. If the idle unit
wakes up in any of these 16 frequencies, it will receive the access code and start with a
connection setup procedure. First, it will notify the paging unit by returning a message, and then
it will transmit a FHS packet which contains all of the pager's information. This information is
then used by both units to establish the piconet. Once a baseband link is established, the master
and slave can exchange roles if they wish, so that slave becomes master and master becomes
slave.
It should be noted that the control of links rests completely with the local device. If it
doesn't make itself discoverable by page scanning it cannot be found, if it does not make itself
connectable by page scanning it cannot be linked with, and once in a connection it is free to
disconnect without warning at any time.
Audio - Audio data is carried via SCO (Synchronous Connection Oriented) channels. These SCO
channels use pre-reserved slots to maintain temporal consistency of the audio carried on them.
This allows us to build devices such as wireless headsets, microphones and headphones using
Bluetooth for many consumer products such as cellular phones, call centre switchboards, or even
personal musical playback.
There are two routes for audio to pass through a Bluetooth system: through the HCI as
data in HCI packets, and via direct PCM connection to the baseband CODECs.
Control
Audio L2CAP
Host Controller Interface
Link Manager
Baseband
Radio
47
The HCI route has some deficiencies in carrying audio data, i.e. packets crossing the HCL
are subject to flow control and therefore to variable latency due to microcontroller executing the
HCI and LM (Link Manager) tasks. The direct PCM route is not well specified in the Bluetooth
specifications, but is very common in commercial implementations.
The Link Manager - The host drives a Bluetooth device through Host Controller Interface
(HCI) commands, but it is the link manager that translates those commands into operations at
the baseband level. Its main functions are to control piconet management (establishing and
destruction of the links and role change), link configuration, and security and QoS functions.
Link manager communicates with its peers on other devices using the Link Management
Protocol (LMP). Every LMP message begins with a flag bit which is 0 if a master initiated the
transaction and 1 if the slave initiated the transaction. That bit is followed by a 7-bit Operation
Code, and by the message's parameters.
When a link is first set up, it uses single-slot packets by default. Multi-slot packets make
more efficient use of the band, but there are some occasions when they can't be used, for example
on noisy links or if SCO links don't leave sufficient space between their slots for multi-slot
packets.
LMP also provides a mechanism for negotiating encryption modes and coordinating
encryption keys used by devices on both ends of the link. In addition, LMP supports messages
for configuration of the quality of service on a connection. Packet types can automatically change
according to the channel quality, so that the data can be transferred at a higher rate when the
channel quality is good, and on lower rates with more error protection if the channel quality
deteriorates.
48
RFCOMM - RFCOMM is a simple, reliable transport protocol that provides emulation of the
serial cable line settings and status of an RS-232 serial port. It provides connections to multiple
devices by relying on L2CAP to handle multiplexing over single connection. RFCOMM
supports two types of devices:
• Type 1 - Internal emulated serial port. These devices usually are the end of a
communication path, for example a PC or printer.
• Type 2 - Intermediate device with physical serial port. These are devices that sit in the
middle of a communication path, for example a modem.
Up to 30 data channels can be set up, so RFCOMM can theoretically support 30 different
services at once. RFCOMM is based on GSM TS 07.10 standard, which is an asymmetric
protocol used by GSM cellular phones to multiplex several streams of data onto one physical
serial cable. The Service Discovery Protocol - One of the most important members of the
Bluetooth protocol stack is Service Discovery Protocol (SDP). It provides a means for an SDP
client to access information about services offered by SDP servers. An SDP server is any
Bluetooth device which offers services to other Bluetooth devices. Information about services is
maintained in SDP databases. There is no centralized database, so each SDP server maintains its
own database. The SDP database is simply a set of records describing all the services which a
Bluetooth device can offer to another Bluetooth device, and service discovery protocol provides
a means for another device to look at these records. To make it easier to find the service you
want, services are arranged in a hierarchy structure as a tree which can be browsed. Clients begin
by examining the root of the tree, then follow the hierarchy out to the leaf nodes where individual
services are described.
To browse service classes, or get information about a specific service, SDP clients and
servers exchange messages which are carried in SDP Protocol Data Units (PDUs). The first byte
of PDU is an ID, identifying the message in the PDU. Services have Universally Unique
Identifiers (UUIDs) that describe them. The services defined by the Bluetooth profiles have
UUIDs assigned by the standard, but service providers can define their own services and assign
their own UUIDs to those services.
SDP relies on L2CAP links being established between SDP client and server, before
retrieving SDP information. Stages in setting up an SDP connection are shown on a figure.
49
Inquiry
Link Controller Paging
Connection Setup
LMP_host connection_req
LMP_accepted
LMP_name_req
LMP_name_res
Link Manager
LMP_Setup_complete
LMP_Setup_complete
L2CAP_connection_req
L2CAP
L2CAP_connection_res
Connection Setup
SDP_inquires
SDP Session SDP_responses
The Wireless Access Protocol (WAP) - WAP provides a protocol stack similar to the IP stack,
but it is tailored for the needs of mobile devices. It supports the limited display size and resolution
typically found on mobile devices by providing special formats for Web pages whichsuit their
capabilities. It also provides for the low bandwidth of mobile devices by defining a method for
WAP content to be compressed before it is transmitted across a wireless link. WAP can use
Bluetooth as a bearer layer in the same way as it can use GSM, CDMA and other wirelessservices.
The WAP stack is joined to the Bluetooth stack using User Datagram Protocol (UDP),Internet
Protocol (IP) and Point to Point Protocol (PPP).
50
Object Exchange Protocol (OBEX) - OBEX is a protocol designed to allow a variety of devices
to exchange data simply and spontaneously. Bluetooth has adopted this protocol from the
Infrared Data Association (IrDA) specifications. OBEX has a client/server architecture and
allows a client to push data to a server or pull data from the server. For example, a PDA might
pull a file from a laptop, or a phone synchronizing an address book might push it to a PDA. The
similarities between the two communications protocols' lower layers mean that IrDA's OBEX
protocol is ideally suited to transferring objects between Bluetooth devices.
The Telephony Control Protocol - Bluetooth's Telephony Control protocol Specification (TCS)
defines how telephone calls should be sent across a Bluetooth link. It gives guidelines for the
signaling needed to set up both point to point and point to multipoint calls. By use of TCS, calls
from an external network can be directed to other Bluetooth devices. For instance, a cellular
phone could receive a call and use TCS to redirect the call to a laptop, allowing the laptop to be
used as a hands-free phone. TCS is driven by a telephony application which provides the user
interface, and provides the source of voice or data transferred across the connection set up by
TCS.
Applications: The Bluetooth Profiles - In addition to protocols which guarantee that two units
speak the same language, Bluetooth specification defines the profiles. They are associated with
applications. The profiles specify which protocol elements are mandatory in certain applications.
This concept prevents devices with little memory and processing power implementing the entire
Bluetooth stack when they only require a small fraction of it. Simple devices like a headset or
mouse can thus be implemented with a strongly reduced protocol stack.
The Bluetooth profiles are organized into groups, with each profile building upon the one
beneath and inheriting features from below. For developers, this means that key features of one
Bluetooth solution can be reused in other solutions, bringing down development costs and
speeding up the development cycle.
51
Generic Access Profile Telephony Control Protocol Specification
FAX
Object Push
Headset
Synchronization
LAN Access
2.17 SECURITY
Basic security elements need to be considered to prevent unauthorized usage and
eavesdropping in Bluetooth system though it is mainly intended for short-range connectivity
between personal devices. Security features are included at the link level and are based on a
52
secret link key that is shared by a pair of devices. To generate this key a pairing procedure is
used when the two devices communication for the first time.
At connection establishment, an authentication process is carried out to verify the
identities of the units involved. The authentication process uses a conventional challenge-
response routine. The verifier compares signed response (SRES) produced by the claimant with
its own SRES and decides if the challenger may continue with connection establishment. To
prevent eavesdropping on the link, which is a danger inherent to radio communications, the
payload of each packet is encrypted. Encryption is based on stream ciphering; the payload bits
are modulo-2 added to a binary key stream.
The central element in the security process is the 128-bit link key. This link key is a secret
key residing in the Bluetooth hardware and is not accessible by the user. The link key is generated
during an initialization phase. Once the initialization has been carried out, the 128-bit link keys
reside in the devices and can from then on be used for automatic authentication without user
interaction. In addition, methods are available to use the same encryption keys for all slaves in a
single piconet.
Bluetooth provides limited number of security elements at the lowest level. More
advanced security procedures can be implemented at higher layers.
53
needs to send a packet on the channel once in a while such that all slaves can resynchronize their
clocks and compensate for drift. During continuous TX/RX operations, a unit starts to scan for
the access code at the beginning of the RX slot. If the access code is not found, or even if it is
found but the slave address does not match the recipient, the unit goes to sleep until the next slot.
The header indicates what type of packet it is and how long the packet will last; therefore, the
non-addressed recipients can determine how long they can sleep.
The nominal transmit power used by most Bluetooth applications for short-range
connectivity is 0 dBm. This restricts current consumption and keeps interference to other systems
to a minimum. However, the Bluetooth radio specifications allow TX power up to 20 dBm.
Above 0 dBm, closedloop received signal strength indication power control is mandatory. This
power control can compensate for propagation losses and slow fading.
In low-power modes many layers of the Bluetooth protocol stack are involved: as after
periods of inactivity, the device may lose synchronization and need to listen for transmissions
over a wider window than usual, the baseband layer alters correlator properties. The link manager
provides a variety of messages to configure and negotiate the low-power modes between ends
of a connection. HCI provides a set of commands that may be used by a host to configure and
control the power-saving capabilities of a module. L2CAP must be aware of low-power modes
for its quality of service commitments.
Different Bluetooth devices may have different requirements for data rate, delay
variance, and reliability. The specification provides Quality Of Service (QOS) configuration for
the properties of links according to the requirements of higher layer applications or protocols.
These properties include the type of QOS, token rate, token rate bucket size, peak bandwidth,
latency and delay variation.
Logical Link Control and Adaptation L2CAP QOS Logical Link Control and Adaptation
54
Figure shows how to use message throughout the Bluetooth protocol stack to control QOS.
Messages configuring and setting up QOS flow vertically up and down the layers of the stack,
while Link manager and Logical Link control and Adaptation layer (L2CAP) configure QOS in
peer to peer negotiations. Link Manager actually implements QOS policies for it configures and
controls the baseband links and has various means to try to meet the QOS which L2CAP
requests.
When a link is first set up, QOS is requested from the higher layer to L2CAP. Then the
negotiation packets of QOS configuration are sent between local and remote L2CAP. The link
manager provides QOS capabilities according to the requests from L2CAP. On systems with an
HCI, this interaction between L2CAP and Link Manager is accomplished through a series of
HCI commands and events. LMP commands can be used to configure the poll interval, the
maximum interval between packets sent from Master to Slave, and the broadcast packet repeat
times. QOS setup completion is generated when LMP has finished setting. If failed, message
will be sent back to higher layer to decide whether to try again or to give up. If succeeded, the
channel will then open for transferring data at the desired QOS.
Even a channel has been configured, it is important that applications are aware whether
their QOS is not as requested, as they may wish to either shut down the link rather than run it at
an inappropriate quality, or shut down other links to improve this link. In such case, lower layers
send QOS violation events to tell the higher layers and let them decide what to do about it.
55
Presently, Nokia and Fujifilm are working on a mobile imaging technology that should
enable Nokia to add a Bluetooth chip to its clamshell-shaped 9110 Communicator so that it can
receive images taken on a Bluetooth-equipped Fujifilm digital camera.
Finnish telecom operator Sonera has even demonstrated a Bluetooth enabled vending
machine - consumers buy products out of the machine by simply signaling an account code from
a Bluetooth cell phone or PDA.
Many other applications can be also thought of Bluetooth can serve as a means for
connecting laptop computers or other devices to the public Internet in airport lounges and
conference centres through permanent access points. It can also enable its users to exchange
business cards with everyone who passed on a street through a Bluetooth enabled Palm - but not
unless it has been given permission to identify the user to anyone. Maybe it would be neat to
have a system that would automatically reset all the digital clocks in a house following the power
outage. Or, to have a Bluetooth link between the roller blades and a speedometer in a digital
watch. But all these applications will have to wait for some more time before they hit the market,
since there is still a lot of work to be done, mostly regarding interoperability issues and final test
procedures for Bluetooth products.
2.19 ULN2003
The ULN2003 is a monolithic IC consists of seven NPN darlington transistor pairs with high
voltage and current capability. It is commonly used for applications such as relay drivers, motor,
display drivers, led lamp drivers, logic buffers, line drivers, hammer drivers and other high
voltage current applications. It consists of common cathode clamp diodes for each NPN
darlington pair which makes this driver IC useful for switching inductive loads.
56
The output of the driver is open collector and the collector current rating of each darlington pair
is 500mA. Darlington pairs may be paralleled if higher current is required. The driver IC also
consists of a 2.7KΩ base resistor for each darlington pair. Thus each darlington pair can be
operated directly with TTL or 5V CMOS devices. This driver IC can be used for high voltage
applications up to 50V.
2.19.1 FEATURES
* 500mA rated collector current (Single output)
* High-voltage outputs: 50V
* Inputs compatible with various types of logic.
* Relay driver application
57
Fig2.24: Relay
2.20.1 History
The first relay was invented by Joseph Henry in 1835. The name relay derives from the
French noun relays’ that indicates the horse exchange place of the postman. Generally a relay is
an electrical hardware device having an input and output gate. The output gate consists in one or
more electrical contacts that switch when the input gate is electrically excited. It can implement
a decoupled, a router or breaker for the electrical power, a negation, and, on the base of the
wiring, complicated logical functions containing and, or, and flip-flop. In the past relays had a
wide use, for instance the telephone switching or the railway routing and crossing systems. In
spite of electronic progresses (as programmable devices), relays are still used in applications
where ruggedness, simplicity, long life and high reliability are important factors (for instance in
safety applications)
2.20.2 Working
Generally, the relay consists a inductor coil, a spring (not shown in the figure), Swing
terminal, and two high power contacts named as normally closed (NC) and normally opened
(NO). Relay uses an Electromagnet to move swing terminal between two contacts (NO and NC).
When there is no power applied to the inductor coil (Relay is OFF), the spring holds the swing
terminal is attached to NC contact.
58
Whenever required power is applied to the inductor coil, the current flowing through the
coil generates a magnetic field which is helpful to move the swing terminal and attached it to the
normally open (NO) contact. Again when power is OFF, the spring restores the swing terminal
position to NC.
2.21 BUZZER
2.21.1 Introduction
A buzzer or beeper is a signaling device, usually electronic, typically used in automobiles, house
hold appliances such as a microwave oven, or game shows.
It most commonly consists of a number of switches or sensors connected to a control unit that
determines if and which button was pushed or a preset time has lapsed, and usually illuminates
a light on the appropriate button or control panel, and sounds a warning in the form of a
continuous or intermittent buzzing or beeping sound. Initially this device was based on an
electromechanical system which was identical to an electric bell without the metal gong (which
makes the ringing noise). Often these units were anchored to a wall or ceiling and used the ceiling
or wall as a sounding board. Another implementation with some AC-connected devices was to
implement a circuit to make the AC current into a noise loud enough to drive a loudspeaker and
hook this circuit up to a cheap 8-ohm speaker. Nowadays, it is more popular touse a ceramic-
based piezoelectric sounder like a Sonalert which makes a high-pitched tone. Usually these were
hooked up to “driver” circuits which varied the pitch of the sound or pulsedthe sound on and off.
In game shows it is also known as a “lockout system,” because when one person signals (“buzzes
in”), all others are locked out from signalling. Several game shows have large buzzer buttons
which are identified as “plungers”.
59
2.21.2 USES
• Annunciator panels
• Electronic metronomes
• Game shows
• Microwave ovens and other household appliances
• Sporting events such as basketball games
• Electrical alarms
2.22 Conclusion
Chapter 2 deals with the projects along with a brief paragraph of summery about the project. This
reflects the various people worked on this area, how different and advanced each project isfrom
one another. It has the Theory that has been acquired to commence the project work. This
discussed about IOT, the advantages, disadvantages the network topologies and communication
protocols. This chapter also briefs about the main microcontroller unit of the prototype, Node
MCU. Its pin configuration, various functional units of the development board and the
installation process of the device. The chapter further giver a brief overview of the project, a
block diagram of the system and the circuit diagram.
60
CHAPTER 3
SOFTWARE SPECIFICATIONS
3.1 THE ARDUINO INTEGRATED DEVELOPMENT ENVIRONMENT
Arduino Software (IDE) - contains a text editor for writing code, a message area, a text console,
a toolbar with buttons for common functions and a series of menus. It connects to the Arduino
and Genuino hardware to upload programs and communicate with them.
Upload
New
Creates a new sketch.
61
Fig 3.1: Creates a new sketch.
Open
Presents a menu of all the sketches in your sketchbook. Clicking one will open it
within the current window overwriting its content.
Note: due to a bug in Java, this menu doesn't scroll; if you need to open a sketch late
in the list, use the File | Sketch book menu instead.
Save
Saves your sketch.
Serial Monitor
62
Additional commands are found within the five menus: File, Edit, Sketch, Tools, Help. The
menus are context sensitive, which means only those items relevant to the work currently being
carried out are available.
3.3 FILE
• New
Creates a new instance of the editor, with the bare minimum structure of a sketch already in
place.
• Open
Allows to load a sketch file browsing through the computer drives and
folders.
• Open Recent
Provides a short list of the most recent sketches, ready to be opened.
63
It shows the Page Setup window for printing.
• Print
Sends the current sketch to the printer according to the settings defined in Page Setup.
• Preferences
Opens the Preferences window where some settings of the IDE may be customized, as the
language of the IDE interface.
• Quit
Closes all IDE windows. The same sketches open when Quit was chosen will be automatically
reopened the next time you start the IDE.
3.4 EDIT
• Undo/Redo
Goes back of one or more steps you did while editing; when you go back, you may go forward
with Redo.
• Cut
Removes the selected text from the editor and places it into the clipboard.
• Copy
Duplicates the selected text in the editor and places it into the clipboard.
• Copy for Forum
Copies the code of your sketch to the clipboard in a form suitable for posting to the forum,
complete with syntax coloring.
• Copy as HTML
Copies the code of your sketch to the clipboard as HTML, suitable for embedding in web pages.
• Paste
Puts the contents of the clipboard at the cursor position, in the editor.
• Select All
Selects and highlights the whole content of the editor.
• Comment/Uncomment
Puts or removes the // comment marker at the beginning of each selected line.
• Increase/Decrease Indent
Adds or subtracts a space at the beginning of each selected line, moving the text one space on
the right or eliminating a space at the beginning.
• Find
Opens the Find and Replace window where you can specify text to search inside the current
sketch according to several options.
• Find Next
64
Highlights the next occurrence - if any - of the string specified as the search item in the Find
window, relative to the cursor position.
• Find Previous
Highlights the previous occurrence - if any - of the string specified as the search item in the Find
window relative to the cursor position.
3.5 SKETCH
• Verify/Compile
Checks your sketch for errors compiling it; it will report memory usage for code and variables
in the console area.
65
This will overwrite the bootloader on the board; you will need to use Tools > Burn Bootloader
to restore it and be able to Upload to USB serial port again. However, it allows you to use the
full capacity of the Flash memory for your sketch. Please note that this command will NOT burn
the fuses. To do so a Tools -> Burn Bootloader command must be executed.
• Export Compiled Binary
Saves a .hex file that may be kept as archive or sent to the board using other tools.
• Show Sketch Folder
Opens the current sketch folder.
• Include Library
Adds a library to your sketch by inserting #include statements at the start of your code. For more
details, see libraries below. Additionally, from this menu item you can access the Library
Manager and import new libraries from .zip files.
• Add File...
Adds a source file to the sketch (it will be copied from its current location). The new file appears
in a new tab in the sketch window. Files can be removed from the sketch using the tab menu
accessible clicking on the small triangle icon below the serial monitor one on the right side o the
toolbar.
3.5.1 TOOLS
• Auto Format
This formats your code nicely: i.e. indents it so that opening and closing curly braces line up,
and that the statements inside curly braces are indented more.
• Archive Sketch
Archives a copy of the current sketch in .zip format. The archive is placed in the same directory
as the sketch.
• Fix Encoding & Reload
Fixes possible discrepancies between the editor char map encoding and other operating systems
char maps.
• Serial Monitor
Opens the serial monitor window and initiates the exchange of data with any connected board
on the currently selected Port. This usually resets the board, if the board supports Reset over
serial port opening.
• Board
Select the board that you're using. See below for descriptions of the various boards.
• Port
66
This menu contains all the serial devices (real or virtual) on your machine. It should
automatically refresh every time you open the top-level tools menu.
• Programmer
For selecting a harware programmer when programming a board or chip and not using the
onboard USB-serial connection. Normally you won't need this, but if you're burning a bootloader
to a new microcontroller, you will use this.
• Burn Bootloader
The items in this menu allow you to burn a bootloader onto the microcontroller on an Arduino
board. This is not required for normal use of an Arduino or Genuino board but is useful if you
purchase a new ATmega microcontroller (which normally come without a bootloader). Ensure
that you've selected the correct board from the Boards menu before burning the bootloader on
the target board.
3.5.2 Help
Here you find easy access to a number of documents that come with the Arduino Software (IDE).
You have access to Getting Started, Reference, this guide to the IDE and other documents locally,
without an internet connection. The documents are a local copy of the online ones and may link
back to our online website. • Find in Reference
This is the only interactive function of the Help menu: it directly selects the relevant page in the
local copy of the Reference for the function or command under the cursor.
3.5.3 SKETCHBOOK
The Arduino Software (IDE) uses the concept of a sketchbook: a standard place to store your
programs (or sketches). The sketches in your sketchbook can be opened from the File
>Sketchbook menu or from the Open button on the toolbar. The first time you run the Arduino
software, it will automatically create a directory for your sketchbook. You can view or change
the location of the sketchbook location from with the Preferences dialog.
Beginning with version 1.0, files are saved with a .ino file extension. Previous versions use the
.pde extension. You may still open .pde named files in version 1.0 and later, the software will
automatically rename the extension to .ino.
Tabs, Multiple Files, and Compilation
Allows you to manage sketches with more than one file (each of which appears in its own tab).
These can be normal Arduino code files (no visible extension), C files (.c extension), C++ files
(.cpp), or header files (.h).
67
3.5.4 UPLOADING
Before uploading your sketch, you need to select the correct items from the Tools > Board and
Tools > Port menus. The boards are described below. On the Mac, the serial port is probably
something like /dev/tty.usbmodem241 (for an Uno or Mega2560 or Leonardo) or
/dev/tty.usbserial-1B1 (for a Duemilanove or earlier USB board), or /dev/tty.USA19QW1b1P1.1
(for a serial board connected with a Keyspan USB-to-Serial adapter). On Windows, it's probably
COM1 or COM2 (for a serial board) or COM4, COM5, COM7, or higher (for a USB board) - to
find out, you look for USB serial device in the ports section of the Windows Device Manager.
On Linux, it should
be /dev/ttyACMx , /dev/ttyUSBx or similar. Once you've selected the correct serial port and
board, press the upload button in the toolbar or select the Upload item from the Sketch menu.
Current Arduino boards will reset automatically and begin the upload. With older boards (pre-
Diecimila) that lack auto-reset, you'll need to press the reset button on the board just before
starting the upload. On most boards, you'll see the RX and TX LEDs blink as the sketch is
uploaded. The Arduino Software (IDE) will display a message when the upload is complete, or
show an error.
When you upload a sketch, you're using the Arduino bootloader, a small program that has been
loaded on to the microcontroller on your board. It allows you to upload code without using any
additional hardware. The bootloader is active for a few seconds when the board resets; then it
starts whichever sketch was most recently uploaded to the microcontroller. The bootloader will
blink the on-board (pin 13) LED when it starts (i.e. when the board resets).
3.5.5 LIBRARIES
Libraries provide extra functionality for use in sketches, e.g. working with hardware or
manipulating data. To use a library in a sketch, select it from the Sketch > Import Library menu.
This will insert one or more #include statements at the top of the sketch and compile the library
with your sketch. Because libraries are uploaded to the board with your sketch, they increase the
amount of space it takes up. If a sketch no longer needs a library, simply delete its
#includestatements from the top of your code. There is a list of libraries in the reference. Some
libraries are included with the Arduino software. Others can be downloaded from a variety of
sources or through the Library Manager. Starting with version 1.0.5 of the IDE, you do can
import a library from a zip file and use it in an open sketch. See these instructions for installing
a third-party library.
To write your own library, see this tutorial.
Third-Party Hardware
68
Support for third-party hardware can be added to the hardware directory of your sketchbook
directory. Platforms installed there may include board definitions (which appear in the board
menu), core libraries, bootloaders, and programmer definitions. To install, create the hardware
directory, then unzip the third-party platform into its own sub-directory. (Don't use "arduino" as
the sub-directory name or you'll override the built-in Arduino platform.) To uninstall, simply
delete its directory. For details on creating packages for third-party hardware, see the Arduino
IDE 1.5 3rd party Hardware specification.
3.7 PREFERENCES
Some preferences can be set in the preferences dialog (found under the Arduino menu on the
Mac, or File on Windows and Linux). The rest can be found in the preferences file, whose
location is shown in the preference dialog.
3.7.1 LANGUAGE SUPPORT
69
Since version 1.0.1, the Arduino Software (IDE) has been translated into 30+ different languages.
By default, the IDE loads in the language selected by your operating system. (Note: on Windows
and possibly Linux, this is determined by the locale setting which controls currency and date
formats, not by the language the operating system is displayed in.)
If you would like to change the language manually, start the Arduino Software (IDE) and open
the Preferences window. Next to the Editor Language there is a dropdown menu of currently
supported languages. Select your preferred language from the menu, and restart the software to
use the selected language. If your operating system language is not supported, the Arduino
Software (IDE) will default to English.
You can return the software to its default setting of selecting its language based on your operating
system by selecting System Default from the Editor Language drop-down. This setting will take
effect when you restart the Arduino Software (IDE). Similarly, after changing your operating
system's settings, you must restart the Arduino Software (IDE) to update it to the new default
language.
3.8 BOARDS
The board selection has two effects: it sets the parameters (e.g. CPU speed and baud rate) used
when compiling and uploading sketches; and sets and the file and fuse settings used by the burn
bootloader command. Some of the board definitions differ only in the latter, so even if you've
been uploading successfully with a particular selection you'll want to check it before burning the
bootloader. You can find a comparison table between the various boards here.
Arduino Software (IDE) includes the built in support for the boards in the following list, all based
on the AVR Core. The Boards Manager included in the standard installation allows to addsupport
for the growing number of new boards based on different cores like Arduino Due, Arduino Zero,
Edison, Galileo and so on.
Conclusion
Chapter 3 describes the Hardware Modelling and setup of the project. The chapter
points the main features of the prototype, gives a layout of the project, lists the
components requires. It briefly describes the various setup processes involved with
the project, including hardware interfacing and software installation and setup
according to our requirement. It finally gives the hardware assembly involved.
70
CHAPTER 4
IMPLEMENTATION
The system process is made up of the NodeMCU microcontroller and the Channel Relay
board. The Relay board manages the relays using ULN 2803 IC. The Android device unit
conveys the desired signal through the internet with the microcontroller. The so-called
Control Unit hardware also includes the NodeMCU microcontroller and the Realy monitor.
Digital output pins of NodeMCU are attached to Relay board relay pins. Each Relay is
essentially linked to an appliance. The flow chart of implementations.
After designing the program induce, i.e. we need to set the What exactly does it
take to perform when the voice senses the power that we are only setting up? This is
determined by setting out the app’s ”Who.” We click on the ”What” button, then pick
webhooks, and then click the link. Webhooks allow us to send instructions to the Remote
Server. Now we type the remote server’s IP address in the URL followed by the
Authentication token given by the remote server and then the pin of the nodemcu to which
the computer is being controlled is connected. Then we pick ’PUT’ in the technique and
the content material form is JSON and we write ”1” to turn ON in the body and ”0” to
switch OFF. That creates the trigger action i.e. the voice order. The action it takes is to
quickly send a request to the remote server app in order to either turn the connected gadget
on or off. Finally, the microcontroller is programmed with the behavior that it needs to
71
perform until the remote server application transmits it. Before that, both the remote server
and the microcontroller can communicate and the conversation is conducted over the
internet, and because the microcontroller contains NodeMCU with the built-in Wi-Fi
module, it is designed to connect to the chosen network until it is plugged in. Hardware
implementation is shown in Fig. 4. The language ’C’ is used to program the microcontroller
and is built in the Arduino IDE.
Conclusion
Chapter 4 is the Logic and operation of the project. A flow chart presents the actions describe
the working process of the prototype. It discussed the principle of operation of the system
with the advantages and disadvantages of the microcontroller unit.
72
CHAPTER 5
SIMULATION AND DESIGN
5.1 OUTPUT SCREEN SHOTS
5.1 ADVANTAGES
1. You can manage all the home devices from one place at the same time.
Wireless home automation systems give you enormous amount of convenience and help
you to use modern technology for home management. All you have to do is to learn using
an app on your smart phone or tablet, and you’ll be able control myriad of functions and
devices in your home with a single click.
2. Your home security is maximized.
When you integrate security in your smart home network, your home security can be
significantly maximized. There are a number of devices which can help you in securing your
home. For instance, motion detectors, surveillance cameras, smart door locks, and many
others. Also, you can receive security alerts on your devices and supervise the activities in
your home from any location.
5.2 APPLICATIONS
➢ Manufacturing
➢ Energy Management
➢ Environmental Monitoring
➢ Office Automation and Smart Buildings
➢ Medical & Healthcare
5.4 Conclusion
Chapter 5 is the conclusion and Future scope. This chapter includes the result of the project
work carried, the limitations it possesses, the further enhancements and modification that
can be integrated into the prototype and finally concludes the project work carried so far. It
consists of lists the References that have been used for the commencement of the project
work.
74
CHAPTER 6
CONCLUSION
It is evident from this project work that an individual control home automation system can be cheaply
made from low-cost locally available components and can be used to control multifarious home
appliances ranging from the security lamps, the television to the air conditioning system and even the
entire house lighting system. And better still, the components required are so small and few that they can
be packaged into a small inconspicuous container. The designed home automation system was tested a
number of times and certified to control different home appliances used in the lighting system, air
conditioning system, home entertainment system and many more . Hence, this system is scalable and
flexible.
75
REFERENCES
1. “Smart Energy Efficient Home Automation System using IOT”, by Satyendra K. Vishwakarma,
Prashant Upadhyaya, Babita Kumari, Arun Kumar Mishra.
2. “IOT Based Smart Security and Home Automation”, by Shardha Somani, Parikshit Solanke, Shaunak
Oke, Parth Medhi, Prof. P. P. Laturkar.
3. “A Dynamic Distributed Energy Management Algorithm of Home Sensor Network for Home
Automation System”, by Tui-Yi Yang, Chu-Sing Yang, Tien-Wen Sung; in 2016 Third International
Conference on Computing Measurement Control and Sensor Network.
4. “Enhance Smart Home Automation System based on Internet of Things”, by Tushar Churasia and
Prashant Kumar Jain; in Proceedings of the Third International Conference on I-SMAC (IoT in Social,
Mobile, Analytics and Cloud) (I-SMAC 2019) IEEE Xplore Part Number: CFP19OSVART; ISBN:978-
1-7281-4365-1
5. “Visual Machine Intelligence for Home Automation”, by Suraj, Ish Kool, Dharmendra Kumar, Shovan
Barman.
6. “A Low-Cost Home Automation System Using Wi-Fi based Wireless Sensor Network Incorporating
internet of Things”, by Vikram, Harish’s, Nihal’s. S, Raksha Umesh, Shetty Aashik Ashok Kumar; in
2017 IEEE 7th International Advance Computing Conference.
7. “Voice Controlled Home Automation System using Natural Language Processing and Internet of
Things”, by Mrs. Paul Jasmin Rani, Jason Bakthakumar, Praveen Kumar, Praveen Kumar, Santhosh
Kumar; in 2017 Third International Conference on Science Technology Engineering & Management
(ICONSTEM)
8. Wikipedia (2009). HomeAutomation. From https://en.wikipedia.org/wiki/Home_automation 9. Theory
of IOT from: https://internetofthingsagenda.techtarget.com/definition/Internet-of-Things-IoT 10. About
Node MCU from: https://lastminuteengineers.com/esp8266-nodemcu-arduino-tutorial.
76