Minor Final Report
Minor Final Report
N ODE MCU
Bachelor of Technology
in
Computer Science & Engineering
By
Signature of Supervisor
Dr. M. A Mukunthan. B.E, M.E, Ph.D.
Professor
Computer Science & Engineering
School of Computing
Vel Tech Rangarajan Dr.Sagunthala R&D
Institute of Science and Technology
June 2022
i
DECLARATION
We declare that this written submission represents my ideas in our own words and where others ideas
or words have been included, we have adequately cited and referenced the original sources. We
also declare that we have adhered to all principles of academic honesty and integrity and have not
misrepresented or fabricated or falsified any idea source in our submission. We understand that any
violation of the above will be cause for disciplinary action by the Institute and can also evoke penal
action from the sources which have thus not been properly cited or from whom proper permission has
not been taken when needed.
(G. BHARGAV)
Date: / /
ii
APPROVAL SHEET
This project report entitled ”CONTROL HOME APPLIANCE BY TELEGRAM APP USING NodeMCU
” by CH. ANKITH REDDY (19UECS0206), A. VISHWA TEJA (19UECS0061), G. BHAR-
GAV (19UECS0273) is approved for the degree of B.Tech in Computer Science & Engineering.
Examiners Supervisor
Date: / /
Place: Chennai
iii
ACKNOWLEDGEMENT
We express our deepest gratitude to our respected Founder Chancellor and President Col. Prof.
Dr. R. RANGARAJAN B.E. (EEE), B.E. (MECH), M.S (AUTO). DSc., Foundress President Dr.
R. SAGUNTHALA RANGARAJAN M.B.B.S. Chairperson Managing Trustee and Vice President.
We are very much grateful to our beloved Vice Chancellor Prof. S. SALIVAHANAN, for provid-
ing us with an environment to complete our project successfully.
We also take this opportunity to express a deep sense of gratitude to Our Internal Supervisor
Dr. M. A MUKUNTHAN B.E, M.E, Ph.D. PROFESSOR for his cordial support, valuable infor-
mation and guidance, he helped us in completing this project through various stages.
We thank our department faculty, supporting staff and friends for their help and guidance to com-
plete this project.
iv
ABSTRACT
Since from a decade many areas becoming trendy from them social media and internet of things are
more in need for today life.Here from social media chatting platform named telegram is been used
parallel to make things work much easier than before. The micro controller Node MCU major role in
implementing the control of multiple devices using IoT.Telegram application which has a capability
of having bot to communicate.In this project basic text created by telegram bot will be used as ma-
jor instructions and these instructions will be read by NodeMCU and control home appliances like
bulbs,fans,air conditioners,televisions,etc as instructed in the telegram bot.All mentioned functions
can be controlled in all modes of connectivity’s like internet,WiFi,etc. Which will leads us to save
power and time majorly and also leads to enhance the life of the appliances.As of now most will be
frequently checking social media,even suggestions timer(optional) can also be given to the people
like to switch of the device that was been running for a couple of minutes.So people can also have
tracking on appliances functioning.No matters on which network interface a particular user uses ap-
pliances can be controlled from entire world.
Keywords:WiFi, Internet of Things,NodeMCU,Telegram Bot,Home Appliances.
v
LIST OF FIGURES
vi
LIST OF ACRONYMS AND
ABBREVIATIONS
IR Infrared
OS Operating System
vii
TABLE OF CONTENTS
Page.No
ABSTRACT v
LIST OF FIGURES vi
1 INTRODUCTION 1
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Aim of the project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3 Project Domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.4 Scope of the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2 LITERATURE REVIEW 3
3 PROJECT DESCRIPTION 5
3.1 Existing System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.2 Proposed System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.3 Feasibility Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.3.1 Economic Feasibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.3.2 Technical Feasibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.3.3 Social Feasibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.4 System Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.4.1 Hardware Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.4.2 Software Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.4.3 Standards and Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4 MODULE DESCRIPTION 9
4.1 General Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.2 Design Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.2.1 Data Flow Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.2.2 Use Case Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.2.3 Class Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.3 Module Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.3.1 Telegram Bot creation and server . . . . . . . . . . . . . . . . . . . . . . . 13
4.3.2 Telegram Bot API Token . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.3.3 NodeMCU control Home Appliances via Relay . . . . . . . . . . . . . . . . 15
4.4 Steps to execute/run/implement the project . . . . . . . . . . . . . . . . . . . . . . . 16
4.4.1 System Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.4.2 Application Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.4.3 WiFi Integrity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.4.4 Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
References 36
Chapter 1
INTRODUCTION
1.1 Introduction
Now a Days people are busy and they have no time to check whether they are switching off appliances
or not due to that many problems like wastage of power,life of machinery will decrease rapidly.Home
device market is growing every year due to development of smart devices Smart devices can be easily
controlled using user friendly mobile applications installed in smart phones that are connected to the
internet or a local network.It is the process of automatically performing everyday functions around
the home to save the time, energy, money “Automation replaces human workers by machines”. The
system is about remotely managed automation and appliance like fan, lamps etc. using telegram and
NodeMCU here users of this system has simple interface to control there home appliances from any
where
As NodeMCU has inbuild ESP8266 WiFi Module, it can be able to control home appliances using
telegram application.Aim of the project is to control home appliances from any where without any
user presence using Telegram application.
The term IoT, or Internet of Things, refers to the collective network of connected devices and the tech-
nology that facilitates communication between devices and the cloud, as well as between the devices
themselves. Thanks to the advent of inexpen- sive computer chips and high bandwidth telecommuni-
cation, we now have billions of devices connected to the internet. This means everyday devices like
toothbrushes, 1 vacuums, cars, and machines can use sensors to collect data and respond intelligently
to users. The Internet of Things integrates everyday “things” with the internet. Computer Engineers
1
have been adding sensors and processors to everyday objects since the 90s. However, progress was
initially slow because the chips were big and bulky. Low power computer chips called RFID tags
were first used to track expensive equipment. As computing devices shrank in size, these chips also
became smaller, faster, and smarter over time
Scope of the project is to build an smart home using NodeMCU.As NodeMCU can be connected to
internet using ESP8266 Module,it can be integrated using Api Token.Once they got connected then
it can be controlled using Triggers in Telegram application from any where.and To save power by
switching off home appliances when they are no more need to be used.
2
Chapter 2
LITERATURE REVIEW
[1]Kim Baraka, et al., Home Automation and Security System,Home automation plays a very
important role in modern era because of its flexibility in using it at different places with high
precision which will save money and time by decreasing human hard work. Prime focus of this
technology is to control the household equipment’s like light,fan, door, AC etc. automatically.
[2]M. A. Hoque et al., Design and Implementation of an IoT-Based Smart Home Security System
will have great use on controlling electronic appliances where all types of appliances can be
controlled from any place and any time with out any human power.
[3]N. Hossain et al.,Security Framework for IOT based Smart Home Automation System, pre-
sented basic idea of how can control home devices by computer technology. It saves energy and
provides security, and accessing home devices by website, which can access it even if we are far
away from home where the Wi-Fi is available.
[4]S. Kousalya et al.,IoT based smart security and smart home automation, presents a low cost
flexible and reliable home automation system with additional security using Arduino micro-
controller, with IP connectivity through local WiFi for accessing and controlling devices by
authorized user remotely using Smart phone application. The proposed system is server inde-
pendent and uses Internet of things to control human desired appliances starting from industrial
machine to consumer goods.The user can also use different devices for controlling by the help
of web-browser, smart phone or IR remote module.
[5]Shih-Pang Tseng et al.,An Application of Internet of Things with Motion Sensing on Smart
House,design a system that can perform different functions to be performed at home. This
allows accessibility via internet from any position in the world. The project used to minimize
the usage of energy and reduce human efforts. The smart home system incorporates different
aspects of technologies such as wireless networking, communication via cloud.The user can
access multiple home devices over the internet as per their convenience.
3
[6]Shiu Kumar,Smart Home System Using Android Application “, International Journal of Com-
puter Networks Communications (IJCNC) Vol.6, No.1, presents a low cost and flexible home
control and environmental monitoring system. In today’s world advancement of technology in
the fields of automation is getting simpler and better in all aspects. There is a rapid increase in
number of internet users. Smart phones have played a very important role in helping users with a
much better internet service and different online applications. The concept of home automation
is applied using internet of things.
[7]Tongzhu Z., Xueping W., Jiangwei C., Xianghai L.,Pengfei C., 2010 .Automotive recycling
information management based on the internet of things and RFID technology, proposed an
IoT based home automation system using NODEMCU ESP8266 Wi-Fi module and.Using this
we will be able to control home appliances through a web browser using your PC or mobile.
These AC mains appliances will be connected to relays which are controlled by the NodeMCU
ESP8266 and NodeMCU acts as a Web Server and we will send control commands through a
Web Browser like Google Chrome etc. ESP8266 is the one of the most popular and low-cost
Wi-Fi module available in the market today. The goal of this project is to develop a home
automation system that gives the user complete control over all remotely controllable aspects of
his/her home.
[8]Yinghui H., Guanyu L., Descriptive Models for Internet of Things. IEEE International Con-
ference on Intelligent Control and Information Processing, Dalian. Home automation is respon-
sible for providing a safe and stylish home, and proposes a capable architecture of home automa-
tion for both short-range and long-range utilizing multiple communication technologies, namely
LoRaWAN, server-based LoRa gateway, and Bluetooth connectivity. This integrated system ef-
fectively controls distinct types of home appliances and keeps smart management among all the
electronics components. A regular user can easily manage these unified systems by using an
Android application.
4
Chapter 3
PROJECT DESCRIPTION
The system has two parts, namely; hardware and software. The hardware system consists of ar-
duino uno board, arduino wi-fi shield, sensors and home appliances. The software system consists
of a java based android application also arduino language is used to configure the arduino uno board
and the sensors. In this system, the components used are arduino uno board, arduino wi-fi shield,
sensors(lm35.LDR). These hardware components are used in order to control the home appliances.
Arduino uno board will help to develop an interface between the hardware and the software appli-
cation. This system also consists of a software application which is developed using android. The
arduino wi-fi shield will help in transmitting and receiving the input given by the user.
Disadvantages :
NodeMCU are the powerful controller where IoT can be done in very budget price.In
tegration of Telegram bot and Micro-controllers to communicate within the telegram
and NodeMCU can be established by using the ESP8266as Raspberry Pi Pico will
not have wifi module.once connection established then user can send data to rasp-
5
berry pi pico using telegram an nodeMCU.As signals from nodemcu Raspberry Pi
Pico will control the relay to turm on and off the home appliances.
Advantages :
Feasibility study is the preliminary study that determines whether a proposed system
project is financially, technically and operationally. Feasibility study is essential to
evaluate the cost and benefits of the new system. The alternative analysis usually
include as part of the feasibility study, identifies alternatives for the system design
and development.
The system to be developed is economically feasible and the benefit is out weighing
the cost. Since this project already computerizes the existing system and more ad-
vanced than the current system reduces and change the labor force to computerize
system. Reduces the cost of the materials used.
6
micro-controllers and NodeMCU respectively and Send Pulse to create Triggers in
Telegram Bot.Our focus is to develop well organised implementation of project that
is technically efficient and effective for controlling of home appliances.Therefore, it
can be concluding that the system is technically feasible.
The system to be developed will provide accurate, active, secured service and de-
creases labor of workers and also it is not limited to particular groups or body. The
system will easily operational, as it doesn’t affect the existing organizational struc-
ture and support the current system. So the system will be operationally feasible.
• Raspberry Pi Pico
• NodeMCU
• Power Adapter
• Relay
• Home Appliances
• Telegram Application
• NodeMCU Flasher
• Teleport
• Thonny
7
• Arduino IDE
Arduino IDE
Arduino IDE is a type of command line interface which explicitly deals with the
micro c++ modules.And navigator is available in all the Windows,Linux and Ma-
cOS.The Arduino IDE has many number of Micro controller which make the coding
easier.
Standard Used: ISO/IEC 27001
Telegram
It’s like an open source Android application that allows us to share and create the
documents which contains the many Virtual Input receivers and output senders. It
can be used for data transformation, numerical simulation, statistical modeling, data
visualization.
Standard Used: ISO/IEC 27001
8
Chapter 4
MODULE DESCRIPTION
Description
Here there are two steps in connecting whole circuit. Initially there Telegram Bot
will be connected to NodeMCU as shown above. GPIO 12,GPIO 13,GPIO 14,GPIO
15 of NodeMCU connect to Relay IN1,IN2,IN3,IN4 respectively.According the user
requirment relay will be used to control home appliances like turning on or off.
9
4.2 Design Phase
Description
Initially System takes time to start, once system got initiated then nodeMcu will
connect to given wifi using given SSID an Password then the system in network.
Then nodeMCU will scan for any requests in telegram bot, if any requests found
then it will read requests and send signals to raspberry pi pico and raspberry pi will
send signals to the relay to turn on or off.
10
4.2.2 Use Case Diagram
Description
A use case diagram is usually simple. It does not show the detail of the use cases, It
only summarizes some of the relationships between use cases, actors, and systems. It
does not show the order in which steps are performed to achieve the goals of each use
case.Here there are multiple users connected to the telegram bot chat to control home
appliances where there is only one controller unit to control home appliances,so as
many appliances present as many relays are required to control.
11
4.2.3 Class Diagram
Description
As it is an IOT Based system people who ever in the same Telegram Bot chat can
control the appliances using this System.Initially User send trigger in telegram bot
and that chat will be read by program inside NodeMCU in an interval of time,after
reading the trigger according to that trigger NodeMCU will send Instructions to
Raspberry pi Pico according to instructions Raspberry Pi Pico Control Relay and
the Connection will break or re circuited as required.
12
4.3 Module Description
Description
Initially Telegram Bot is created to establish communication point to the user and
the system to control Home appliances.In Telegram app there is an option called
BotFather to create telegram bots.on giving a command to create new Bot then it
will ask to give a name for the bot once all the required details given then it will
processed to next step.
13
4.3.2 Telegram Bot API Token
Description
Once succeeded in creation of telegram bot then BotFather will provide an chat
link an Id followed by API token which is used to create communication between
NodeMCU and Telegram user.This API token will be given to the program of NodeMCU
and connection between the Telegram bot.Once connection established then system
is ready to get commands from telegram bot chat.
14
4.3.3 NodeMCU control Home Appliances via Relay
Description
NodeMCU will try to read telegram bot chat line by line when ever the user send
command in telegram bot chat,if any new command founds in the chat then the bot
will read the command and execute as programmed for that particular command.For
example if the command is to turn on bulb1 and bulb3 then ”bulb1on” and ”bulb3on”
then system will turn on the bulb1 and bulb3 by changing the circuit in 4 channel
relay.
15
4.4 Steps to execute/run/implement the project
16
4.4.4 Programming
17
Chapter 5
18
5.1.2 Output Design
5.2 Testing
Unit Testing will describe about individual functionality of the each component whether they are
programmed or connected in right manner.Here using arduino IDE all the led components are tested
thoroughly by programming each separately and got output successfully.
Input
1 # d e f i n e LED D0
2 void setup ( ) {
3 pinMode ( LED , OUTPUT) ;
4 }
5 void loop ( ) {
19
6 d i g i t a l W r i t e ( LED , HIGH ) ; /
7
8 delay (1000) ;
9 d i g i t a l W r i t e ( LED , LOW) ;
10 delay (1000) ; / / wait f o r 1 second .
11 }
1 # d e f i n e LED D1
2 void setup ( ) {
3 pinMode ( LED , OUTPUT) ;
4 }
5 void loop ( ) {
6 d i g i t a l W r i t e ( LED , HIGH ) ; /
7
8 delay (1000) ;
9 d i g i t a l W r i t e ( LED , LOW) ;
10 delay (1000) ; / / wait f o r 1 second .
11 }
Test result
20
Figure 5.4: LED 3 ON
It is a type of software testing that validates the software system against the functional require-
ments/specifications. Here it was tested against telegram bot server and NodeMCU program to control
home appliances and got output successfully.
Input
10 i f ( t e x t == ” / l e d 1 o n ” )
11 {
12 d i g i t a l W r i t e ( l e d P i n 1 , HIGH ) ; / / t u r n t h e LED on ( HIGH i s t h e v o l t a g e l e v e l )
13 led1Status = 1;
14 b o t . s e n d M e s s a g e ( c h a t i d , ” Led1 i s ON” , ” ” ) ;
15 }
16
21
17 i f ( t e x t == ” / l e d 1 o f f ” )
18 {
19 d i g i t a l W r i t e ( l e d P i n 1 , LOW) ; / / t u r n t h e LED o f f (LOW i s t h e v o l t a g e l e v e l )
20 led1Status = 0;
21 b o t . s e n d M e s s a g e ( c h a t i d , ” Led1 i s OFF” , ” ” ) ;
22 }
23
24 i f ( t e x t == ” / l e d 2 o n ” )
25 {
26 d i g i t a l W r i t e ( l e d P i n 2 , HIGH ) ; / / t u r n t h e LED on ( HIGH i s t h e v o l t a g e l e v e l )
27 led2Status = 1;
28 b o t . s e n d M e s s a g e ( c h a t i d , ” Led2 i s ON” , ” ” ) ;
29 }
30
31 i f ( t e x t == ” / l e d 2 o f f ” )
32 {
33 d i g i t a l W r i t e ( l e d P i n 2 , LOW) ; / / t u r n t h e LED o f f (LOW i s t h e v o l t a g e l e v e l )
34 led2Status = 0;
35 b o t . s e n d M e s s a g e ( c h a t i d , ” Led2 i s OFF” , ” ” ) ;
36 }
37 i f ( t e x t == ” / l e d 3 o n ” )
38 {
39 d i g i t a l W r i t e ( l e d P i n 3 , HIGH ) ; / / t u r n t h e LED on ( HIGH i s t h e v o l t a g e l e v e l )
40 led3Status = 1;
41 b o t . s e n d M e s s a g e ( c h a t i d , ” Led3 i s ON” , ” ” ) ;
42 }
43
44 i f ( t e x t == ” / l e d 3 o f f ” )
45 {
46 led3Status = 0;
47 d i g i t a l W r i t e ( l e d P i n 3 , LOW) ; / / t u r n t h e LED o f f (LOW i s t h e v o l t a g e l e v e l )
48 b o t . s e n d M e s s a g e ( c h a t i d , ” Led3 i s OFF” , ” ” ) ;
49 }
50
51 i f ( t e x t == ” / l e d 4 o n ” )
52 {
53 d i g i t a l W r i t e ( l e d P i n 4 , HIGH ) ; / / t u r n t h e LED on ( HIGH i s t h e v o l t a g e l e v e l )
54 led4Status = 1;
55 b o t . s e n d M e s s a g e ( c h a t i d , ” Led4 i s ON” , ” ” ) ;
56 }
57
58 i f ( t e x t == ” / l e d 4 o f f ” )
59 {
60 led4Status = 0;
61 d i g i t a l W r i t e ( l e d P i n 4 , LOW) ; / / t u r n t h e LED o f f (LOW i s t h e v o l t a g e l e v e l )
62 b o t . s e n d M e s s a g e ( c h a t i d , ” Led4 i s OFF” , ” ” ) ;
63 }
64 }
22
Test result
It is a software testing method in which the functionalities of software applications are tested without
having knowledge of internal code structure, implementation details and internal paths. Here will
have end interface,Telegram Bot chat where user can give triggers in chat and can turn on and off the
home appliances.
Input
Here user given input as /start bulb1 to turn on bulb 1 and /start bulb3 to turn on bulb3 respectively.
23
Test result
Once user gives trigger according the that trigger NodeMCU will turn on or off the required home
appliances.
24
Chapter 6
IoT has generated excitement for a few years now, with start-ups and established businesses placing
bets on the industrys growth. Along with the business solutions, IoT has been very vital in connecting
things to the internet. Thereby achieving a communication among the connected devices. In this
report, I have conducted a research on opportunities and challenges of IoT. In the research study,
I explored the need of IoT,possible ways to implement IoT, various sensors and devices etc. The
study has been well explained in this report.Internet of Things has definition, pros and cons. Various
implementations of IoT could be done by using both proprietary hardware and open hardware. To
implement a home automation, I need to study the insides of the hardware, which could not be possible
by proprietary hardware. So I found the freedom and chose open hardware for the implementation
of an instance of applications of IoT. NodeMCU boards has been very cost effective and easy to
implement.Upon few software instructions, the NodeMCU board would work as per the instructions
with the connected devices. I have place a NodeMCU board with an OS and an application called
“Telegram” to deploy the IoT software to control Home Appliances.
This project is basically built on the process of wireless communication through the WiFi network
with the help of NodeMCU plays a very important role in the present day life of a person. Each
and every person now-a-days has a cell phone with him and WiFi network make the people across
the world to communicate with each other. So as technology is increasing so vastly now-a-days,
everything in the world is being automated and wireless for the comfort of man. So here we are
building a device based on the Raspberry pi based wireless monitoring of home appliances and Wi-fi
network to control the electrical appliances through a cellular phone. Here we are going to design a
cell phone based remote control of electrical appliances. Existing system has WiFi compatibility but it
cannot be useful to control from all places such as if person from out of range of WiFi which system
connected then user cannot control the home appliances.So in this project Telegram application is
25
been used which can be connect to NodeMCU even though you are out side of WiFi range which
your NodeMCU connected you are able to control your Home appliances.
Output
26
Figure 6.2: Controlling Home Appliances
1 # i n c l u d e <ESP8266WiFi . h>
2 # i n c l u d e <W i F i C l i e n t S e c u r e . h>
3 # i n c l u d e <U n i v e r s a l T e l e g r a m B o t . h>
4
5 / / Wifi network s t a t i o n c r e d e n t i a l s
6 # d e f i n e WIFI SSID ” r e a l m e ”
7 # d e f i n e WIFI PASSWORD ” 12345679 ”
8 / / T e l e g r a m BOT Token ( Get from B o t f a t h e r )
9 # d e f i n e BOT TOKEN ” 1 9 9 0 4 8 3 4 6 9 : AAFwpcqRCrXthAuSvpWSeUuMprc X7MrcBI ”
10
27
15 U n i v e r s a l T e l e g r a m B o t b o t ( BOT TOKEN , s e c u r e d c l i e n t ) ;
16 unsigned long b o t l a s t t i m e ; / / l a s t t i m e m e s s a g e s ’ s c a n h a s b e e n done
17
27 void loop ( )
28 {
29 i f ( m i l l i s ( ) − b o t l a s t t i m e > BOT MTBS )
30 {
31 i n t numNewMessages = b o t . g e t U p d a t e s ( b o t . l a s t m e s s a g e r e c e i v e d + 1 ) ;
32
33 w h i l e ( numNewMessages )
34 {
35 S e r i a l . p r i n t l n ( ” got response ” ) ;
36 handleNewMessages ( numNewMessages ) ;
37 numNewMessages = b o t . g e t U p d a t e s ( b o t . l a s t m e s s a g e r e c e i v e d + 1 ) ;
38 }
39
28
Chapter 7
7.1 Conclusion
The ideas and benefits that are brought by the adaption of the IoT are likely to revolutionize how
humans respond to their environment. The developments have made it possible for humans to operate
the various functions within a home from one system. Even though there are security concerns on
having all the house functions being managed by a single system, the fears are baseless. The tech-
nology customizes the features, and in case of intrusion in one area of the system, the chances of the
homeowner noticing the change are high. More so, the IoT concept is beneficial to the environment
where it embraces the responsible use of resources in the community.
Today everything is reliant on calculation and data innovation, Raspberry Pi turns out to be a savvy,
monetary and effective stage for executing the home automation. This project gives an essential
utilization of Raspberry Pi in home automation. The code used is very generic and adaptable in
an easy to use way and can be stretched out for any future usage like power control mechanism,
surveillance system, anti-theft system and so forth, effectively. Also, this strategy is superior to other
home automation techniques is a few ways. Since Telegram is a cloud based messaging application
with focus on security and speed, it makes it easy to use by anyone since it is being offered in most
of the platforms available in the market. What makes it unique is the secure end-to-end user protocol
that it makes use of and the speed which it provides. On the other hand, it offers the unique property
of being heavily encrypted and self-destruction of messages.
29
Chapter 8
PLAGIARISM REPORT
30
Chapter 9
1 # i n c l u d e <ESP8266WiFi . h>
2 # i n c l u d e <W i F i C l i e n t S e c u r e . h>
3 # i n c l u d e <U n i v e r s a l T e l e g r a m B o t . h>
4
5 / / Wifi network s t a t i o n c r e d e n t i a l s
6 # d e f i n e WIFI SSID ” r e a l m e ”
7 # d e f i n e WIFI PASSWORD ” 12345679 ”
8 / / T e l e g r a m BOT Token ( Get from B o t f a t h e r )
9 # d e f i n e BOT TOKEN ” 1 9 9 0 4 8 3 4 6 9 : AAFwpcqRCrXthAuSvpWSeUuMprc X7MrcBI ”
10
27 v o i d handleNewMessages ( i n t numNewMessages )
28 {
29 S e r i a l . p r i n t ( ” handleNewMessages ” ) ;
30 S e r i a l . p r i n t l n ( numNewMessages ) ;
31
31
36
41 i f ( t e x t == ” / l e d 1 o n ” )
42 {
43 d i g i t a l W r i t e ( l e d P i n 1 , HIGH ) ; / / t u r n t h e LED on ( HIGH i s t h e v o l t a g e l e v e l )
44 led1Status = 1;
45 b o t . s e n d M e s s a g e ( c h a t i d , ” Led1 i s ON” , ” ” ) ;
46 }
47
48 i f ( t e x t == ” / l e d 1 o f f ” )
49 {
50 d i g i t a l W r i t e ( l e d P i n 1 , LOW) ; / / t u r n t h e LED o f f (LOW i s t h e v o l t a g e l e v e l )
51 led1Status = 0;
52 b o t . s e n d M e s s a g e ( c h a t i d , ” Led1 i s OFF” , ” ” ) ;
53 }
54
55 i f ( t e x t == ” / l e d 2 o n ” )
56 {
57 d i g i t a l W r i t e ( l e d P i n 2 , HIGH ) ; / / t u r n t h e LED on ( HIGH i s t h e v o l t a g e l e v e l )
58 led2Status = 1;
59 b o t . s e n d M e s s a g e ( c h a t i d , ” Led2 i s ON” , ” ” ) ;
60 }
61
62 i f ( t e x t == ” / l e d 2 o f f ” )
63 {
64 d i g i t a l W r i t e ( l e d P i n 2 , LOW) ; / / t u r n t h e LED o f f (LOW i s t h e v o l t a g e l e v e l )
65 led2Status = 0;
66 b o t . s e n d M e s s a g e ( c h a t i d , ” Led2 i s OFF” , ” ” ) ;
67 }
68 i f ( t e x t == ” / l e d 3 o n ” )
69 {
70 d i g i t a l W r i t e ( l e d P i n 3 , HIGH ) ; / / t u r n t h e LED on ( HIGH i s t h e v o l t a g e l e v e l )
71 led3Status = 1;
72 b o t . s e n d M e s s a g e ( c h a t i d , ” Led3 i s ON” , ” ” ) ;
73 }
74
75 i f ( t e x t == ” / l e d 3 o f f ” )
76 {
77 led3Status = 0;
78 d i g i t a l W r i t e ( l e d P i n 3 , LOW) ; / / t u r n t h e LED o f f (LOW i s t h e v o l t a g e l e v e l )
79 b o t . s e n d M e s s a g e ( c h a t i d , ” Led3 i s OFF” , ” ” ) ;
80 }
81
82 i f ( t e x t == ” / l e d 4 o n ” )
83 {
84 d i g i t a l W r i t e ( l e d P i n 4 , HIGH ) ; / / t u r n t h e LED on ( HIGH i s t h e v o l t a g e l e v e l )
85 led4Status = 1;
32
86 b o t . s e n d M e s s a g e ( c h a t i d , ” Led4 i s ON” , ” ” ) ;
87 }
88
89 i f ( t e x t == ” / l e d 4 o f f ” )
90 {
91 led4Status = 0;
92 d i g i t a l W r i t e ( l e d P i n 4 , LOW) ; / / t u r n t h e LED o f f (LOW i s t h e v o l t a g e l e v e l )
93 b o t . s e n d M e s s a g e ( c h a t i d , ” Led4 i s OFF” , ” ” ) ;
94 }
95
96 i f ( t e x t == ” / h e l p ” ) {
97 S t r i n g h e l p = ” Welcome t o U n i v e r s a l R a s p b e r r y P i T e l e g r a m Bot l i b r a r y , ” + from name + ” . \ n ” ;
98 h e l p += ” T h i s i s IOT Bot . \ n\n ” ;
99 h e l p += ” / l e d 1 o n : t o s w i t c h t h e Led1 ON\n ” ;
100 h e l p += ” / l e d 1 o f f : t o s w i t c h t h e Led1 OFF\n ” ;
101 h e l p += ” / l e d 2 o n : t o s w i t c h t h e Led2 ON\n ” ;
102 h e l p += ” / l e d 2 o f f : t o s w i t c h t h e Led2 OFF\n ” ;
103 h e l p += ” / l e d 3 o n : t o s w i t c h t h e Led3 ON\n ” ;
104 h e l p += ” / l e d 3 o f f : t o s w i t c h t h e Led3 OFF\n ” ;
105 h e l p += ” / l e d 4 o n : t o s w i t c h t h e Led4 ON\n ” ;
106 h e l p += ” / l e d 4 o f f : t o s w i t c h t h e Led4 OFF\n ” ;
107 h e l p += ” / s t a t u s : R e t u r n s c u r r e n t s t a t u s o f LED\n ” ;
108 b o t . s e n d M e s s a g e ( c h a t i d , h e l p , ” Markdown ” ) ;
109 }
110
111 i f ( t e x t == ” / s t a t u s ” )
112 {
113 if ( led1Status )
114 {
115 b o t . s e n d M e s s a g e ( c h a t i d , ” Led1 i s ON” , ” ” ) ;
116 }
117 else
118 {
119 b o t . s e n d M e s s a g e ( c h a t i d , ” Led1 i s OFF” , ” ” ) ;
120 }
121
122 if ( led2Status )
123 {
124 b o t . s e n d M e s s a g e ( c h a t i d , ” Led2 i s ON” , ” ” ) ;
125 }
126 else
127 {
128 b o t . s e n d M e s s a g e ( c h a t i d , ” Led2 i s OFF” , ” ” ) ;
129 }
130
131 if ( led3Status )
132 {
133 b o t . s e n d M e s s a g e ( c h a t i d , ” Led3 i s ON” , ” ” ) ;
134 }
135 else
33
136 {
137 b o t . s e n d M e s s a g e ( c h a t i d , ” Led3 i s OFF” , ” ” ) ;
138 }
139
140 if ( led4Status )
141 {
142 b o t . s e n d M e s s a g e ( c h a t i d , ” Led4 i s ON” , ” ” ) ;
143 }
144 else
145 {
146 b o t . s e n d M e s s a g e ( c h a t i d , ” Led4 i s OFF” , ” ” ) ;
147 }
148 }
149
150 i f ( t e x t == ” / s t a r t ” )
151 {
152 S t r i n g welcome = ” Welcome t o U n i v e r s a l A r d u i n o T e l e g r a m Bot l i b r a r y , ” + from name + ” . \ n ” ;
153 welcome += ” T h i s i s IOT Bot . \ n\n ” ;
154 welcome += ” / l e d (NUMBER) on : t o s w i t c h t h e Led (NUMBER) ON\n ” ;
155 welcome += ” / l e d (NUMBER) o f f : t o s w i t c h t h e Led (NUMBER) OFF\n ” ;
156 welcome += ” / s t a t u s : R e t u r n s c u r r e n t s t a t u s o f LED\n ” ;
157 b o t . s e n d M e s s a g e ( c h a t i d , welcome , ” Markdown ” ) ;
158 }
159 }
160 }
161
162
163
164
34
186 {
187 Serial . print (” . ”) ;
188 delay (500) ;
189 }
190 S e r i a l . p r i n t ( ” \ nWiFi c o n n e c t e d . I P a d d r e s s : ” ) ;
191 S e r i a l . p r i n t l n ( WiFi . l o c a l I P ( ) ) ;
192
211 w h i l e ( numNewMessages )
212 {
213 S e r i a l . p r i n t l n ( ” got response ” ) ;
214 handleNewMessages ( numNewMessages ) ;
215 numNewMessages = b o t . g e t U p d a t e s ( b o t . l a s t m e s s a g e r e c e i v e d + 1 ) ;
216 }
217
35
9.2 Poster Presentation
36
References
[1] Kim Baraka, Marc Ghobril, Sami Malek, RouwaidaKanj, AymanKayssi “Low cost
Arduino/Android-based Energy-Efficient Home Automation System with Smart Task Schedul-
ing”, 2013 Fifth International Conference on Computational Intelligence,Communication
Systems and Networks.
[2] M. A. Hoque and C. Davidson, “Design and Implementation of an IoT-Based Smart Home
Security System,” Int. J. Networked Distrib. Comput., vol. 7, no. 2, pp. 85–92, 2019
[3] N. Hossain, M. A. Hossain, R. Sultana, and F. A. Lima, “A Security Framework for IOT based
Smart Home Automation System,” Glob. J. Comput. Sci. Technol., 2020.
[4] S. Kousalya, G. Reddi Priya, R. Vasanthi, and B. Venkatesh, “IOT based smart security and smart
home automation,” Int J Eng Res TechnolIJERT, vol. 7, no. 04, pp. 2278–0181, 2018.
[5] Shih-Pang Tseng, Bo-Rong Li, Jun-Long Pan, and ChiaJuLin,”An Application of Internet of
Things with Motion Sensing on Smart House“, 978-1-4799-6284-6/14 c 2014 IEEE.
[6] Shiu Kumar,Smart Home System Using Android Application “, International Journal of Com-
puter Networks Communications (IJCNC) Vol.6, No.1, January 2019.
[7] Tongzhu Z., Xueping W., Jiangwei C., Xianghai L.,Pengfei C., 2010 .Automotive recycling in-
formation management based on the internet of things and RFID technology. IEEE International
Conference on Advanced Management Science (ICAMS), Changchun, China, page(s):620 – 622.
[8] Yinghui H., Guanyu L., Descriptive Models for Internet of Things. IEEE International Confer-
ence on Intelligent Control and Information Processing, Dalian, China, Pages: 483- 486,2018.
37