0% found this document useful (0 votes)
426 views8 pages

Home Automation with Telegram Bot

This document describes a home automation system using a Telegram bot and Raspberry Pi. The system allows users to control home appliances like lights and fans using voice commands or a Telegram app. Sensors like the DHT11 measure temperature and humidity, and the Raspberry Pi acts as a central server, receiving commands and controlling devices. When temperature rises, the fan is automatically turned on. The Telegram bot interface lets users monitor sensors and control devices from anywhere using their phone through messages.

Uploaded by

chakravarthy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
426 views8 pages

Home Automation with Telegram Bot

This document describes a home automation system using a Telegram bot and Raspberry Pi. The system allows users to control home appliances like lights and fans using voice commands or a Telegram app. Sensors like the DHT11 measure temperature and humidity, and the Raspberry Pi acts as a central server, receiving commands and controlling devices. When temperature rises, the fan is automatically turned on. The Telegram bot interface lets users monitor sensors and control devices from anywhere using their phone through messages.

Uploaded by

chakravarthy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

HOME AUTOMATION USING TELEGRAM BOT

Ch SreeVardhan1, V V N Chakravarthy2, K KishoreBabu3, V GopiRam4


Department of Electronics and Communication Engineering,
Koneru Lakshmaiah Education Foundation, Vaddeswaram, Guntur (Dist.), Andhra Pradesh,
India, 522502.

[email protected]

Abstract

IOT means devices or things connected over internet. With the rapid improvements in
IOT heading in the direction of virtual generation wherein device to device interplay takes
area with the assist of The Internet of things. The home equipment with inside the home,
workplace and enterprise have become clever each day. This paper includes manipulation
of home equipment the use of voice indoor, while in out of doors manipulate the use of App
MQTT. In addition, the gadgets can engage and standing may be monitored and managed
the use of a messaging carrier referred to as Telegram. Open supply hardware which
include Raspberry Pi that is a palm PC to interface the home equipment with inside the
home. To execute a home mechanization one should examine the inner parts of the
equipment, which couldn't be conceivable by exclusive equipment. So this paper is an
opportunity, and picked open equipment for the usage of an occurrence of uses of IOT. PI
sheets are practical and simple to execute. Upon few programming guidelines, the Pi
board would fill in according to the directions with the associated gadgets. This paper
includes a PI board with an OS and an application called, “Telegram Bot” to send the
IOT programming to detect and express the temperature and moistness of an area. 

Keywords App, appliances, Telegram Bot, Raspberry Pi, Home Automation.

1 Introduction

A Raspberry Pi is a charge card estimated PC which can be utilized for creating different
applications. This task depends on The internet of Things (IOT). Internet of Things is an
organization of gadgets, for example, electrical machines for network which empowers
these gadgets to interface and trade information. This task speaks to an adaptable method to
control gadgets. In this venture, we are taking a shot at an android application where a
client will give voice orders for control gadgets, for example, “Turn light on " which will
be associated with raspberry pi and as per it the necessary cycle will work through Wi-Fi
[1]. It likewise gives security from outsider clients. It permits controlling number of home
apparatuses all the while. Python is utilized as the fundamental programming language

1
which is default, given by Raspberry Pi[2]. It gives an intuitive and easy to use interface on
the customer side, and the gadgets can be controlled and observed extremely simple. Prior
days the web has been broadly utilized for cycles, for example, riding site pages, data
search, talking, downloading files [3]. By the progression of new innovations,
controlling , and checking administrations have been begun to send over the web which
gives collaboration with gadgets and hardware. This framework can be introduced in a few
spots like emergency clinics, labs, banks and different enterprises, which significantly
diminishes the expense and time alongside keeping up security and comfort[4]. Any actual
boundaries from the true like temperature, dampness, pressure and so on can be observed
using sensors associated with the Internet from any ideal area on the planet. We use
applications like MQTT dashboard which associate with the workers and control the
apparatuses and read the status of the sensors utilizing MQTT convention which is a
machine to machine convention particularly utilized for gadget to gadget
correspondence[5]. The wire is a free and open source social informing application which
gives visiting administration furthermore, bot administration. By making another bot
utilizing the message application one can control the machines present in the home or
office by visiting to the bot. We can design the  pins of raspberry pi to control various
gadgets at home or on the other hand office.it is extremely simple to control the gadgets at
home in view of its adaptability and simple to introduce[6]. This application is utilized to
impart between individuals yet in addition, we can control the gadgets which likewise read
the status from sensors and are logged to Twitter and Gmail[7]. Cell phones are utilized
broadly all finished the world by numerous people.so just by visiting with the bot we can
control any gadget at our home or office from any piece of the world. The voice
acknowledgment innovation is advancing and numerous applications, for example, google
partner, Apple Siri, Microsoft Cortana  use voice acknowledgment and reacts to the client
inquiries[8].

2 Literature Survey

2.1 Chat box

Michael Yuan IBM developer works IBM's engineer manual for planning and creating
bots. A pleasant review of stages, systems and AI benefits that can be filled in as bot
foundation. Twitter’s comprehensive list of AI-driven bots and assistants organized by
function.  

2.2 Run Your Own Bot API Server

Bot API source code is currently accessible at message bot-programming interface.


Running own Bot API worker locally, boosting your bots presentation. Added the
technique logout, which can be utilized to log out from the cloud Bot API worker prior to
dispatching bot locally. Log out the bot prior to running it locally, in any case there is no
2
assurance that the bot will get all updates. Added the technique close, which can be utilized
to close the bot occurrence prior to moving it starting with one neighborhood worker then
onto the next.

3. Design Methodology

Telegram messenger is used to control household appliances, and also read the status of the
sensors such as temperature, pressure, humidity, etc. which is frequently used to chat with
people. The MQTT panel application is used to take the user defined inputs from the user
and control the devices using the node.js. Raspberry Pi is used as a central server to
activate all outputs. It is also connected to a chat application like Telegram. By using it, we
can control the light and fan that are connected to it. It will give us the temperature, and
when the temperature is high, it will automatically turn on the fan.

3.1 Block diagram

Figure.1 Architecture Diagram

Figure 1, shows the use of Wi-Fi sensor hubs, USB webcam, and Raspberry pi with
Raspbian Jessie working framework introduced on it and android telephone with android
application Telegram. Various sensor hubs are associated with the Raspberry pi by means

3
of Wi-Fi channel. MQTT's convention is utilized for correspondence. Sensor hub contains
sensor module like DHT11 sensor, PI camera sensor, gets signal from the sensor and
distribute message as needs be to the Raspberry pi which goes about as a worker with
MQTT Broker. Python content is written in the Raspberry pi to peruse messages as gotten
from the sensor hubs utilizing MQTT convention. A choice is then taken and afterward a
message is shipped off the android telephone utilizing android application Telegram, which
is a non-benefit cloud-based texting administration. 

4. Implementation

4.1 Telegram Bot

Telegram is an immediately messaging utility that we use every day to speak with the own
circle of relatives and friends. The loose and open supply nature of Telegram helped
builders release a hard and fast of APIs used to expand bots. Bots are the programs that
automate chores. By the use of this bot, it's far viable chat with home equipment from
everywhere the world. In this paper, improvement of this bot jogging on Raspberry Pi
linked to sensors inclusive of temperature, humidity and domestic family home equipment
inclusive of fans, lights, etc. The bot gets person commands with the aid of using telegram
and responds to them in consequence. The commands are strings that they're programmed
to reply to the person. Alongside photograph or message, framework likewise sends date
that the consumer is probably knowledgeable approximately the hour of occurrence (at the
off hazard that at the off hazard that he/she cannot get Telegram message proper away due
to no organization or a few different reason). Telegram is a non-advantage cloud-primarily
based totally texting administration. Customers can get admission to from Android, IOS,
Windows Phone, Windows NT, Macintosh OS and Linux[5]. Utilizing these customers can
ship messages, photographs, recordings, files, sound and a few different documents. At the
factor while any motion is diagnosed with the aid of using the framework, it's going to
seize the photograph/video making the use of the digital camera and ship it to the message
utility[2].

4.2 Raspberry Pi Camera

The Camera Module may be applied to take advanced pleasant video, simply as stills
photos. It's something however hard to apply for tenderfoots, but has bounty to deliver to
the desk stepped forward customers in case you are hoping to increase your insight. There
are hundreds of fashions online of people making use of it for time-slip by, slow-
movement, and different video intelligence[4]. You can likewise make use of the libraries
we % with the digital camera to make effects. The digital camera works with all fashions of
Raspberry Pi 1, 2, three and 4. It has a tendency to be gotten to through the MMAL and
V4L APIs, and there are numerous outsider libraries labored for it, together with the Pi
camera Python library.

4.3 DHT11
4
The 4-pin system would require a resistor (4.7K-10K) to be placed among Pin 1 (3.3V) and
Pin 2 (Data). The three-pin modules will more commonly have this resistor blanketed
which makes the wiring truly simpler. Thus, Figure 2 indicates becoming a member of Pi
with a piece of three-manner DuPont link. Various carriers might also additionally twine
the module sticks distinctively so test the PCB markings to apprehend VCC (+), facts and
Ground (-).

Figure.2 Interface of pi with


DHT11

4.4 Two Channel Relay

2-Channel 5V Relay Module is a switch interface board it thoroughly can be managed


straightforwardly with the aid of using an extensive scope of microcontrollers, for example,
Arduino, AVR, PIC, ARM, etc. It makes use of a low degree spark off manage sign (3.3-
5VDC) to manipulate the switch. Setting off the switch works the usually open or generally
close contacts. It is regularly applied in a programmed manage circuit. To lay it out plainly,
its miles a programmed alternate to manipulate a high-modern circuit with a low-modern
sign.5V switch sign fact's voltage range, 0-5V. VCC potential to the framework. JD-VCC
hand-off with inside the pressure flexibly. JD-VCC and VCC may be a shorted.

Figure.3 1x2 Channel 5V Relay Module

4.5 DC fan

An immediate flow (DC) engine is a sort of electric machine that changes over electrical
energy into mechanical energy. DC's engines take electrical force through direct flow, and
convert this energy into mechanical revolution. DC's engines utilize attractive fields that
5
happen from the electrical flows produced, which controls the development of a rotor fixed
inside the yield shaft. The yield force and speed relies on both the electrical information
and the plan of the engine.

5 Software Tools
5.1 Telepot and Data publishing in Telegram app

Telepot encourages you fabricate applications for Telegram Bot API. It deals with Python
2.7 and Python 3. The accompanying outcome shows the sensor information that is gotten
from the temperature , and stickiness sensors and furthermore the status of the apparatus
this we can realize how much temperature can be estimated , controlled and differed by
given air conditions. 

6. Results and Discussions

Figure.4.1 Hardware setup

6
S No Temperature Humidity
Time values (in Celsius) (Percentage)
1. 10 sec 300 64
2. 20 sec 32 65
3. 30 sec 35 67
4. 40 sec 27 45
5. 50 sec 25 44 Table.1
Temperature 6. 60 sec 15 35 and Humidity
values by 7. 1min10sec 22 41 DHT11

The end result in Figure 4.1 indicates the hardware control usage of the telegram app with
which we can send the user instructions to have interaction with Pi, Telegram app and
various sensors.

Open the telegram at the raspberry board and open the home automation temperature
sensor bot after giving commands, /getouts - indicates the repute of the 2 relays /setout1
ON or OFF, /setout2 ON or OFF units one of the outputs to ON or OFF, /gettemp-
indicates the real temperature, /gethum - indicates the real humidity. Table.1 are the few
display values of the output, in which the temperature and humidity is been plotted. /start-
issued it indicates the technique isn't begun out and it indicates that command isn't within
side the listing.

In the identical technique we are able to join exclusive sensors to screen and manage the
devices.

7. Conclusion
The home framework proposed through this paper was tentatively demonstrated to work
with the help of the different techniques actualized like voice, Telegram and application.
Control of apparatuses accomplished through these techniques with voice in home and
distantly through applications anyplace on the world. This will assist the client with
examining the conditions in the home whenever anyplace. The framework is like an
attachment and play which can be mounted anyplace in the house with not so much
expense, but rather more security. This solitary is conceivable by utilizing open equipment
and free and open source programming.

8. References

7
[1] Z. Alkar and U. Buhur, “An Internet based wireless home automation system for
multifunctional devices”, IEEE Transactions on Consumer Electronics, Vol. 51, No. 4,
pp. 1169-1174, Nov. 2005.

[2] Xiaohua Zeng, Abraham O. Fapojuwo, and Robert J (2007), „Design and Performance
Evaluation of Voice Activated Wireless Home Devices‟, IEEE Transactions on
Consumer Electronics, Vol. 52, No. 31, pp. 983 – 989.

[3] R. G. Anvekar and R. M. Banakar, “IOT application development: Home security


system”, IEEE Technological Innovations in ICT for Agriculture and Rural Development
(TIAR 2017), Apr. 7-8, 2017, Chennai, India, pp. 68-72.

[4] N. S. Yamanoor and S. Yamanoor, "High quality, low cost education with the
Raspberry Pi," 2017 IEEE Global Humanitarian Technology Conference (GHTC),
San Jose, CA, 2017, pp. 1-5.

[5] A. Makled Esraa, H. Halawa Hassan, Ramez M. Daoud, H. Amer Hassanein, "Wi-Fi-
based Hierarchical Wireless Networked Control Systems", Electronics and
Communications Engineering Department American University in Cairo (AUC) Cairo
Egypt IEEE, 2015..

[6] Zhao, Yanbo, and Zhaohui Ye, “A low cost GSM/GPRS based wireless home security
System”, IEEE Transactions on Consumer Electronics 54, no. 2 (2008).

[7] Rakesh, V. S., P. R. Sreesh, and Sudhish N. George, “An improved real-time
surveillance system for home security system using BeagleBoard SBC, Zigbee and FTP
webserver,” IEEE Int.Con, 2012, pp. 1240-1244.

[8] Ansari, Aamir Nizam, Mohamed Sedky, Neelam Sharma, and Anurag Tyagi, “An
Internet of things approach for motion detection using Raspberry Pi,” IEEE Int.Con.
Intelligent Computing and Internet of Things, 2014, pp. 131-134

You might also like