PDF Report
PDF Report
INTRODUCTION
Nowadays, we have remote control for our television sets and other electronic system, which
have made our lives real easy. Have you ever wondered about Home automation which would
give the facility of controlling tube lights, Bulb, LED, Temperature sensors, fans and other
electrical appliances at home using a remote control? Off-course, Yes! But, are the available
options cost-effective? If the answer is no, we have found a solution to it. We have come up
with a new system called Arduino based home automation using Bluetooth. This system is
super cost-effective and can give the user, the ability to control any electronic devices without
even spending for a remote control. This project helps the user to control all the electronic
devices using her smartphone.
In home automation system internet access is used to control from far away. For years, internet
is used only for surfing pages, searching information and downloading software and other
things. Advancement of technology is forcing to make interaction internet with machineries
and devices. In home automation system comfort and security of houses have been enhanced.
Besides, people are concerning over costs. In offices, a division of people are employed only
to make supervision of some manual means typed work. Home automation is replacing those
arrangements. For this, cost is highly reduced. Besides, for manual labour engaged to control
appliances waste energy in cases. It is seen that appliances continue to run though people are
not present in their respective places. For this energy cannot stop consuming. If this happens
for a long time then there have possibility to misuse energy in a huge amount. To overcome
this obstacle home automation is encouraged to apply. Home automation does that challenging
work. That‘s why; home automation is presented as energy efficient. In recent years home
automation is gaining much popularity. The trend is also in favour of using home automation
technology. If we look around residences, malls, offices, use of home automation systems will
draw attention.
Home automation is providing home safety for dwellers. It automatically turn lights on in
closets, stairways, and other dark places. Thus accidentally tripping or running into thing is
decreased. Everywhere environmental issues are raised before introducing any technology. In
this regard home automation provides a better solution. Devices included in home automation
consume less power. Besides, it saves energy. Thus home automation technology is so far
environmentally suitable. Moreover, the technology keeps mind in peace. In most cases,
guardians face problems and always they keep tensioning for the safety of their children staying
in home.
Time is a valuable thing. Everybody wants to save time as much as they can. New technologies
are being introduced to save our time. To save peoples time we are introducing Home
Automation system using Bluetooth. With the help of this system you can control your home
appliances from your mobile phone. You can turn on/off your home appliances within the range
of Bluetooth.
Many existing, well-established home automation systems are based on wired communication.
This does not pose a problem until the system is planned well in advance and installed during
the physical construction of the building. But for already existing buildings the implementation
cost goes very high.
1
1.1 Aim:-
The aim of the project is to design and construct a home automation system that will remotely
switch on or off any household appliance connected to it, using a microcontroller, voice dial
on phone, or Bluetooth based android appliances. Home Automation using IOT and Arduino.
The main objective of this project is to build a smart home device which can be used to control
the home appliances via internet. This establishes the internet connection to the system and all
the home appliances can in turn be connected and controlled by internet.
1.2 Purpose:-
A home automation system is a technological solution that enables automating the bulk of
electronic, electrical and technology-based tasks within a home. It uses a combination of
hardware and software technologies that enable control and management over appliances and
devices within a home. The purpose of the proposed system is full security with automation of
home also controlling the appliances using WIFI. Temperature and humidity of the each room
is monitored. Water level controller also implemented by the use of Ultrasonic sensor. By using
PIR and Vibration Sensor Motion detection and thief identification also recorded by HD Spy
camera.
1.3 Scope:-
In real time web based home automation system this project can be extended in future to ensure
the high security, the motion and vibration can be monitored through online via HD spy camera.
With this, the system can be incorporated in a whole building of any institution or residential
building and can monitor from anywhere. This way, advantages of home automation can be
more availed.
According to Gartner (an information technology research and advisory firm), consumer
applications will drive the number of connected things, while Enterprise will account for most
of the revenue. Gartner estimated that 2.9 billion connected things are in use in the consumer
sector in 2015 and would increase to over 13 billion till 2020.
The UK government allocated £40,000,000 towards research into the Internet of Things in their
2015 budget. The British Chancellor of the Exchequer George Osborne posited that the Internet
of Things is the next stage of the information revolution and referenced the inter-connectivity
of everything from civil transport to healing devices to home appliances.
1.4 Objective:-
The objective of this project is to implement a low cost, reliable and scalable home automation
system that can be used to remotely switch on or off any household appliance, using a
microcontroller to achieve hardware simplicity, low cost short messaging service for feedback
and voice dial from any phone to toggle the switch state.
2
1.5 References:-
https://en.wikipedia.org/wiki/Home_automation
https://www.researchgate.net/publication/312559421_IoT_based_smart_sec
urity_and_home_automation_system
https://dzone.com/articles/home-automation-using-iot
https://www.instructables.com/id/Projects-on-Bolt-IoT
https://youtu.be/RDnTYlOkhWY
https://youtu.be/WTNMKJzGUOM
https://youtu.be/oQPX5T-aixc
https://www.elprocus.com/wireless-home-automation-using-internet-of-
things/
http://circuits4you.com/2016/05/19/iot-based-home-automation-project/
http://internetofthings-pune.blogspot.in/2013/07/this-is-open-source-home-
automation.html
3
2. OVERALL DESCRIPTION
Had a busy day at work today? Exhausted right? We know how it feels coming back home after
such a long tiring day from work. All you want and hope for is everything to be done on its own.
You want to control the lights, fan or AC at just the tip of our fingers, click a button and food is
right in front of you, served hot and delicious, tap your feet and the music is on letting you enjoy
the night. Isn't that really cool. But alas, even if most of us work with technology, we forget to
implement it even with the smallest of things which could make our life easier. But as it is rightly
said when there is a will there is a way, here's a simple way out for you to control the lights of
your home at just a click.
Home automation has three major parts:
Hardware
Software/Apps
Communication protocols
Each of these parts is equally important in building a truly smart home experience for your
customers. Having the right hardware enables the ability to develop your IOT prototype
iteratively and respond to technology pivots with ease.
A protocol selected with the right testing and careful consideration helps you avoid
performance bottlenecks that otherwise would restrict the technology and device integration
capabilities with sensors and IOT gateways.
Another important consideration is the firmware that resides in your hardware managing your
data, managing data transfer, firmware OTA updates, and performing other critical operations
to make things talk.
TechTrunk Ventures Pvt.Ltd. , Hyderabad started a summer training program on Bolt IOT. I
attend last year winter program in month of December. They explain us practically. I have
awesome experience with TechTrunk,they supported very well.
4
Bolt IOT platform gives you the capability to control your devices and collect data from IOT
devices safely and securely no matter where you are. Get actionable insights by deploying
machine learning algorithms with just a few clicks to detect anomalies as well as predict sensor
values. Bolt is an Internet of Things platform Hardware/Software that enables user to build
IOT products and projects. Using BOLT, users can control and monitor devices from any part
of the world.
However, all of these good ideas need a power source and the ESP8266 has become the go-to
board largely down to price, and not for its ease of use. But there are boards out there, based
on the ESP8266, that offer an easy to use interface that we can use to program the board to do
what we want!
5
6
3. MODULE OF HOMEAUTOMATION
3.1 Build a smart lamp and make your life easy:-
Had a busy day at work today? Exhausted right? We know how it feels coming back home after
such a long tiring day from work. All you want and hope for is everything to be done on its own.
You want to control the lights, fan or AC at just the tip of our fingers, click a button and food is
right in front of you, served hot and delicious, tap your feet and the music is on letting you enjoy
the night. Isn't that really cool. But alas, even if most of us work with technology, we forget to
implement it even with the smallest of things which could make our life easier. But as it is rightly
said when there is a will there is a way, here's a simple way out for you to control the lights of
your home at just a click.
Hardware components:-
7
Software apps and online services:-
Screwdriver
Wire stripper
Let us go now and gather all the required hardware from the shop required for the project.
8
4. Bulb holder.
5. Bulb.
6. Mobile Charger.
9
7. Pin Socket.
1. Connect the 5V supply pin and GND of the Bolt to the 5V and GND pins of the relay
module.
2. Connect any one of the digital pin I e (0-4) of the Bolt to the IN/REL pin of the relay
module.
10
3. Connect a wire from the bulb holder to the COM pin of the relay module.
4. Connect a wire from the NO pin of the relay module to the 2-pin socket.
5. Connect the remaining terminal of the bulb holder tot the other terminal of the 2-pin socket.
11
STEP 1. Connecting Bolt to cloud:-
If you already have an account on the cloud.boltiot.com then skip this step.
To create your new account and link your Bolt device to cloud click here.
12
STEP 3. Configure the product:-
13
STEP 4. Upload the code and save the configuration:-
Chose the js extension from dropdown, give a name to your code and then start writing your JS
code for controlling the device. You can read more details
here https://docs.boltiot.com/docs/controlling-devices
14
STEP 4. Link the Bolt to the product:-
15
STEP 6. Click on button to switch on the lamp and click on Off button to
switch Of the lamp:-
The working of the system is very simple and easy. Let's get it understood!
The system uses a simple use of API (Application Program Interface) call that turns the state of
the digital pin to HIGH or LOW. The state of this pin is further used to switch the relay ON or
OFF. And this API call is activated when you press the button on the browser.
When the relay is in OFF state it breaks the circuit between the Bulb and the power supply result
of which the bulb goes off whereas when the relay is in ON state it completes the circuit
connection between bulb and power supply as a result of which bulb lights up.
3.1.5 Code:-
singleButton({name:"On", action:"digitalWrite",
pin:"0", value:"HIGH",bgcolor:"green",
shape:"rectangle",align:"left","text_color":"white" })
singleButton({name:"Off", action:"digitalWrite",
pin:"0", value:"LOW", bgcolor:"red",
shape:"rectangle", align:"left", text_color:"black"})
3.1.6 Schematics:-
16
3.2 Build Voice Controlled Light:-
This project is based on the Bolt IOT Platform. Here is a money saving trick. You can get a Bolt
WiFi Module and Cloud with Lifetime Access for just $12 now on Kickstarter for a limited
time. The Lifetime cloud access is only for the early adopters of the platform via Kickstarter. I
am the Co-Founder and CEO of the Bolt IOT Platform. So I will praise it quite frequently during
this blog, of course, because I have to sell it but mainly because I sincerely believe that is the
best IOT platform ever. I have used many other IOT Platforms in the past and Bolt makes IoT
development seamless like none other.
In this project, I have assumed that you have already linked your Bolt WiFi module with your
Bolt cloud account. If you have not yet done so, please download the Bolt IOT app for IOS and
Android and follow the steps in the App.
Hardware components:-
3.2.2 STEPS:-
Plug the longer end of the LED in the Pin 0 of Bolt WiFi module shorter end to the ground pin
(GND).
17
Power on the Amazon Echo and Bolt WiFi Module.
Next click on the copy button to copy your API key. Your API key will may look something
like this: f1f918e9-d9c2-4e5b-aed0-b7cb743f74cf.
Since LED is a digital output device, we will need to get a Digital Write command that can be
sent to Bolt over the Internet to switch on the LED.
In Bolt Cloud go to Docs Tab -> API Documentation -> GPIO Commands API -> Write Digital
Output.
The command to write digital output is:
https://cloud.boltiot.com/remote/f1f918e9-d9c2-4e5b-aed0-
b7cb743f74cf/digitalWrite?pin=0&state=HIGH&deviceName=BOLT13819450
Make sure that you change the API Key to your own API Key and device ID which you got in
the previous step.
If you have connected the LED to any other pin other then Pin 0 then make a suitable change in
the pin no in your code.
18
click on +This
Choose Amazon Alexa -> Say Specific Phrase
Type the phrase you want to trigger the action. I used 'lights on' and click on 'Create Trigger'.
Click on +That
Select Web hooks and then make a web request
Enter the API URL you got in the previous Step. Make sure that you change the API Key and
device name.
Method will be GET
Content type will be Application/json
Here is how your screen will look like.
Just plug in the longer (+ve) end of LED in PIN0 and shorter (-ve) end of LED in GND
19
3.3 Humidity and Temperature Monitoring:-
A quick and easy system to monitor the Humidity and Temperature of your environment. The
Bolt team has recently updated the Bolt IOT-Arduino-Helper library, and I thought it would be
a good idea to try it out. The library now has example on how to interface DHT sensor with the
Bolt Cloud, and this project is all about doing just that.
Hardware components:-
DHT11 Temperature & Humidity Sensor (4 pins)
Bolt IOT Bolt WiFi Module
Arduino UNO & Genuino UNO
20
For the makers who are planning to use the Arduino however, this means connecting the Bolt
module using 4 male to male berge pin wires.
21
STEP 3. Install the required libraries:-
For this project you will require the BoltIoT-Arduino-Helper, the Adafruit_Sensor and
the DHT-Sensor-library Arduino libraries.
To install the libraries just go to the link above, and click on the clone or download button.
Then click on the Download ZIP button. A zip file containing the library will be downloaded.
22
Once the library is downloaded, go to the Arduino IDE's tool bar, Sketck>Include
Library>Add.ZIP Library.
Select the library file which you dowloaded earlier, and click on choose.
Remember to install ALL 3 LIBRARIES.
STEP 4. Upload the code:-
Go to Arduino IDE's tool bar, File>Examples>BoltIoT-Arduino-Helper>DHT2Cloud
The DHT library example will open in a new Arduino IDE window.
Connect your Boltduino to the PC and click on Upload.
CAUTION: For Arduino Uno users, remember to disconnect the Bolt module from the Arduino
while uploading the code
There have been quite a few projects developed around the Bolt WiFi module, so I believe the
reader has already created an Account on the Bolt Cloud and linked their Bolt WiFi module to
the Cloud account. If that is not the case, you might want to go through this.
STEP 1. Create a new product on the Bolt Cloud:-
Ensure to select the 'Input Devices' and 'UART' option.
23
STEP 2. Configure the product:-
I have shared the code for the software configuration. Once done save and exit the product
configuration view.
24
25
STEP 3. Link the Bolt device to your new product:-
Once the device is linked, remember to click on the Deploy Configurations button.
26
STEP 4. View your device:-
The Cloud polls the device for data every 5 minutes, so it would be best to leave the system be
for about 20 to 25 minutes before you check.
27
3.3.4 Circuit connections:-
IF you are using the Boltduino, just skip the part for using wires for Bolt WiFi module
28
3.4 Alert me on temperature data:-
Recently Bolt launched the alert feature, where you can send alerts based on the condition of
sensor data. This feature is very helpful and easy to implement without writing any code. In this
project, we will create alerts based on the temperature data of LM35 sensor and also plot the
graph for viewing the sensor data.
3.4.2 Prerequisite:-
In this experiment, I am assuming that you have done the setting up your Bolt device and have
linked your device to the cloud product. Refer the below link if you have not done.
3.4.3 Steps:-
29
Follow the instruction below to connect your LM35 sensor to Bolt Device:-
Make sure you have not powered on your Bolt Module white connecting the circuit. This
will ensure that in case we make any mistake, it will not short circuit your device. Switch
off the power if it is connected.
Connect the VCC pin of LM35 to 5V pin of the Bolt device.
Connect the GND pin of LM35 to GND pin of the Bolt device.
Connect the analog output pin of LM35 to A0 (analog input) pin of the Bolt device.
As we have already linked our device to the product, in this section, we will configure the
product or plotting the temperature data. The graph is showing the voltage data. If you want to
convert the voltage data in degree Celsius, then divide the voltage data by 10.24
Follow the below step for configuring the product.
30
31
STEP 3. Creating alert:-
Before creating the alert open Bolt IOT android app and login into the app. Follow steps for
creating the alerts.
32
Click on the add icon to see the option for creating the alerts.
Assign a name to the alert feature, choose the pin from where you are collecting the data,
assign the condition.
Enter the message and enable the alert from the toggle button and click on save.
33
After creating an alert, you will be redirected to alert dashboard.
Now select the alert and click on the link icon and choose the device to link with alert.
As soon, the device sends a data greater than 286, I received a push notification on
my android phone and you can check in the alert log. To see the alert log, click on
34
the profile icon and then click on the Alerts History and you can see all the push
notification sent.
35
4. SOFTWAR SPECIFICATION AND API :-
4.1 HTML:- HTML or Hyper Text Markup Language is the main markup language for
creating web pages and other information that can be displayed in a web browser.HTML is
written in the form of HTML elements consisting of tags enclosed in angle brackets (like
<html>), within the web page content. HTML tags most commonly come in pairs like <h1>
and </h1>, although some tags represent empty elements and so are unpaired, for example
<image>. The first tag in a pair is the start tag, and the second tag is the end tag (they are also
called opening tags and closing tags). In between these tags web designers can add text, further
tags, comments and other types of text-based content. The purpose of a web browser is to read
HTML documents and compose them into visible or audible web pages. The browser does not
display the HTML tags, but uses the tags to interpret the content of the page.HTML elements
form the building blocks of all websites. HTML allows images and objects to be embedded
and can be used to create interactive forms. It provides a means to create structured documents
by denoting structural semantics for text such as headings, paragraphs, lists, links, quotes and
other items. It can embed scripts written in languages such as JavaScript which affect the
behavior of HTML web pages.
Hyper Text:- HyperText simply means "Text within Text." A text has a link within it, is a
hypertext. Whenever you click on a link which brings you to a new webpage, you have clicked
on a hypertext. HyperText is a way to link two or more web pages (HTML documents) with
each other.
Markup language:- A markup language is a computer language that is used to apply layout
and formatting conventions to a text document. Markup language makes text more interactive
and dynamic. It can turn text into images, tables, links, etc.
Web Page:- A web page is a document which is commonly written in HTML and translated
by a web browser. A web page can be identified by entering an URL. A Web page can be of
the static or dynamic type. With the help of HTML only, we can create static web pages.
Hence, HTML is a markup language which is used for creating attractive web pages with the
help of styling, and which looks in a nice format on a web browser. An HTML document is
made of many HTML tags and each HTML tag contains different content.
It is a very easy and simple language. It can be easily understood and modified.
It is very easy to make an effective presentation with HTML because it has a lot
of formatting tags.
It is a markup language, so it provides a flexible way to design web pages along
with the text.
It facilitates programmers to add a link on the web pages (by html anchor tag), so
it enhances the interest of browsing of the user.
It is platform-independent because it can be displayed on any platform like
Windows, Linux, and Macintosh, etc.
It facilitates the programmer to add Graphics, Videos, and Sound to the web pages
which makes it more attractive and interactive.
HTML is a case-insensitive language, which means we can use tags either in lower-
case or upper-case.
36
4.2 CSS - Cascading Style Sheets (CSS) is a style sheet language used for describing the
look and formatting of a document written in a markup language. While most often used to
style web pages and interfaces written in HTML and XHTML, the language can be applied to
any kind of XML document, including plain XML, SVG and XUL. CSS is a cornerstone
specification of the web and almost all web pages use CSS style sheets to describe their
presentation.CSS is designed primarily to enable the separation of document content from
document presentation, including elements such as the layout, colors , and fonts. This
separation can improve content accessibility, provide more flexibility and control in the
specification of presentation characteristics, enable multiple pages to share formatting, and
reduce complexity and repetition in the structural content (such as by allowing for table less
web design).CSS can also allow the same markup page to be presented in different styles for
different rendering methods, such as on-screen, in print, by voice (when read out by a speech-
based browser or screen reader) and on Braille-based, tactile devices. It can also be used to
allow the web page to display differently depending on the screen size or device on which it is
being viewed. While the author of a document typically links that document to a CSS file,
readers can use a different style sheet, perhaps one on their own computer, to override the one
the author has specified. However if the author or the reader did not link the document to a
specific style sheet the default style of the browser will be applied.CSS specifies a priority
scheme to determine which style rules apply if more than one rule matches against a particular
element. In this so-called cascade, priorities or weights are calculated and assigned to rules, so
that the results are predictable.
CSS stands for Cascading Style Sheets. It is a style sheet language which is used to describe
the look and formatting of a document written in markup language. It provides an additional
feature to HTML. It is generally used with HTML to change the style of web pages and user
interfaces. It can also be used with any kind of XML documents including plain XML, SVG
and XUL. CSS is used along with HTML and JavaScript in most websites to create user
interfaces for web applications and user interfaces for many mobile applications .
Classes and IDs are case-sensitive, start with letters, and can include alphanumeric characters,
hyphens and underscores. A class may apply to any number of instances of any elements. An
ID may only be applied to a single element.
Pseudo-classes are used in CSS selectors to permit formatting based on information that is not
contained in the document tree. One example of a widely used pseudo-class is :hover , which
identifies content only when the user "points to" the visible element, usually by holding the
mouse cursor over it. It is appended to a selector as in a:hover or #elementid:hover . A pseudo-
class classifies document elements, such as :link or :visited , whereas a pseudo-element makes
a selection that may consist of partial elements, such as ::first-line or ::first-letter .
Selectors may be combined in many ways to achieve great specificity and
flexibility.[7] Multiple selectors may be joined in a spaced list to specify elements by location,
element type, id, class, or any combination thereof. The order of the selectors is important. For
example, div .my Class {color: red;} applies to all elements of class myClass that are inside
div elements, whereas .myClass div {color: red;} applies to all div elements that are in
elements of class my Class.
37
4.3 Java Script:-
Often abbreviated as JS, is a high-level, interpreted scripting language that conforms to the
ECMA Scriptspecification. JavaScript has curly-bracket syntax, dynamic typing, prototype-
based object-orientation, and first-class functions.
Alongside HTML and CSS, JavaScript is one of the core technologies of the World Wide Web.
JavaScript enables interactive web pages and is an essential part of web applications. The vast
majority of websites use it, and major web browsers have a dedicated JavaScript engine to
execute it.
As a multi-paradigm language, JavaScript supports event-driven, functional,
and imperative (including object-oriented and prototype-based) programming styles. It
has APIs for working with text, arrays, dates, regular expressions, and the DOM, but the
language itself does not include any I/O, such as networking, storage, or graphics facilities. It
relies upon the host environment in which it is embedded to provide these features.
Initially only implemented client-side in web browsers, JavaScript engines are now embedded
in many other types of host software, including server-side in web servers and databases, and
in non-web programs such as word processors and PDF software, and in runtime environments
that make JavaScript available for writing mobile and desktop applications, including desktop
widgets.
Although there are similarities between JavaScript and Java, including language name, syntax,
and respective standard libraries, the two languages are distinct and differ greatly in design.
JavaScript was influenced by programming languages such as Self and Scheme.
The JSON serialization format, used to store data structures in files or transmit them
across networks, is based on JavaScript.
Although it was developed under the name Mocha, the language was officially called Live
Script when it first shipped in beta releases of Netscape Navigator 2.0 in September 1995, but
it was renamed JavaScript when it was deployed in the Netscape Navigator 2.0 beta 3 in
December. The final choice of name caused confusion, giving the impression that the language
was a spin-off of the Java programming language, and the choice has been characterized as a
marketing ploy by Netscape to give JavaScript the cachet of what was then the hot new Web
programming language.
There is a common misconception that JavaScript was influenced by an earlier Web page
scripting language developed by Nombas named Cmm (not to be confused with the later C-
- created in 1997). Brendan Eich, however, had never heard of Cmm before he created Live
Script. Nombas did pitch their embedded Web page scripting to Netscape, though Web page
scripting was not a new concept, as shown by the Viola WWW Web browser. Nombas later
switched to offering JavaScript instead of Cmm in their Script Ease product and was part of
the TC39 group that standardized ECMA Scrip.
JavaScript has become one of the most popular programming languages on the Web. However,
many professional programmers initially denigrated the language due to the perceived target
audience of Web authors and other such "amateurs". The advent of Ajax returned JavaScript
to the spotlight and brought more professional programming attention. The result was a
proliferation of comprehensive frameworks and libraries, improved JavaScript programming
practices, and increased usage of JavaScript outside Web browsers, as seen by the proliferation
of Server-side JavaScript platforms. The Common JS project was founded with the goal of
specifying a common standard library mainly for JavaScript development outside the browser.
38
With the rise of single-page applications and JavaScript-heavy sites, it is increasingly being
used as a compile target for source-to-source compilers from both dynamic languages and static
languages.
4.4 Python:-
Python is an interpreted , high-level, general-purpose programming language. Created
by Guido van Rossum and first released in 1991, Python's design philosophy emphasizes code
readability with its notable use of significant whitespace. Its language constructs and object-
oriented approach aim to help programmers write clear, logical code for small and large-scale
projects.
Python is dynamically typed and garbage-collected. It supports multiple programming
paradigms, including procedural, object-oriented, and functional programming. Python is often
described as a "batteries included" language due to its comprehensive standard library.
Python was conceived in the late 1980s as a successor to the ABC language. Python 2.0,
released in 2000, introduced features like list comprehensions and a garbage collection system
capable of collecting reference cycles. Python 3.0, released in 2008, was a major revision of
the language that is not completely backward-compatible, and much Python 2 code does not
run unmodified on Python 3. Due to concern about the amount of code written for Python 2,
support for Python 2.7 (the last release in the 2.x series) was extended to 2020. Language
developer Guido van Rossum shouldered sole responsibility for the project until July 2018 but
now shares his leadership as a member of a five-person steering council.
Python interpreters are available for many operating systems. A global community of
programmers develops and maintains C Python, an open source reference implementation.
A non-profit organization, the Python Software Foundation, manages and directs resources for
Python and C Python development.
Python is a multi-paradigm programming language. Object-oriented
programming and structured programming are fully supported, and many of its features
support functional programming and aspect-oriented programming (including by meta
programming and meta objects (magic methods)).[56] Many other paradigms are supported via
extensions, including design by contract and logic programming.
Python uses dynamic typing and a combination of reference counting and a cycle-detecting
garbage collector for memory management. It also features dynamic name resolution (late
binding), which binds method and variable names during program execution.
Python's design offers some support for functional programming in the Lisp tradition. It
has filter , map , and reduce functions; list comprehensions, dictionaries, sets,
and generator expressions. The standard library has two modules (itertools and functools) that
implement functional tools borrowed from Haskell and Standard ML.
Python strives for a simpler, less-cluttered syntax and grammar while giving developers a
choice in their coding methodology. In contrast to Perl's "there is more than one way to do it"
motto, Python embraces a "there should be one—and preferably only one—obvious way to do
it" design philosophy. Alex Martelli, a Fellow at the Python Software Foundation and Python
book author, writes that "To describe something as 'clever' is not considered a compliment in
the Python culture."
A common neologism in the Python community is pythonic , which can have a wide range of
meanings related to program style. To say that code is pythonic is to say that it uses Python
39
idioms well, that it is natural or shows fluency in the language, that it conforms with Python's
minimalist philosophy and emphasis on readability. In contrast, code that is difficult to
understand or reads like a rough transcription from another programming language is
called unpythonic.
The language's core philosophy is summarized in the document The Zen of Python (PEP 20),
which includes aphorisms such as:-
Machine Learning became a household term when Facebook shut down it’s Artificial
Intelligence wing when one of its bots discovered a whole new language. With Elon Musk
commenting on it and netizens indicating an I-Robot in the future, most of us understood what
Machine Learning is all about.
On a very basic sense, machine learning in technology today is the process of elimination of
human intervention wherever possible. It is allowing the data to learn patterns by itself and take
autonomous decisions without a coder having to write a new set of codes. If you use your Siri,
for instance, you would notice that its responses are more polished and appropriate as you keep
using it. That is one of the basic applications of Machine Learning.
But when it comes to a complex concept like IOT, how would Machine Learning make things
better for the Internet of Things? Every time the IOT sensors gather data, there has to be
someone at the backend to classify the data, process them and ensure information is sent out
back to the device for decision making. If the data set is massive, how could an analyst handle
the influx? Driverless cars, for instance, have to make rapid decisions when on autopilot and
relying on humans is completely out of the picture. That’s where Machine Learning comes to
play with its.
To determine which algorithm has to be used for a particular set of task, we need to first define
the task. Some of the tasks include finding unusual data points, structure discovery, predicting
categories and values, feature extraction and more.
40
Classifying the data sets into different tasks would make it easier for a beginner to understand
the right algorithm application. For instance, to work on data structure discovery, clustering
algorithms such as K-means could be used. K-means is designed to handle massive chunks of
data including diverse data types. Quoting another example, the application of One-
Class Support Vector Machines and PCA-based Anomaly detection algorithms are best for
training data from unusual data points or data with high noises.
Without going too technical about the application of Machine Learning algorithms, if you
intend to stay on the surface and take your time to understand and take in the concepts, we
recommend watching this video by Hank Roark – a data scientist at H20.ai.
The Bolt Cloud API provides an interface for communication between the Bolt devices and
any 3rd party system e.g. mobile application, web server, python programs etc. The API
contains very intuitive control, monitoring, communication and utility functions for the Bolt
Devices connected to your account. The Bolt Cloud API uses HTTP protocol for the
communication and uses the HTTP GET and HTTP POST methods. Hence users can execute
actions and retrieve information from Bolt devices programmatically using conventional HTTP
requests.
Here are a few use cases of the API:
Use the API in native apps on iOS and Android to control and monitor Bolt devices over
the Internet.
Pull collect sensor data connect to Bolt device, to any other cloud to run your custom AI
algorithms and analytics.
Connect Bolt Cloud to any VPS (Virtual Private Server) and run your code in any language
of your choice. Refer sample codes.
Remote Operating System: Using the API, Bolt devices can work like a board with an OS
i.e. similar to Raspberry Pi or Beagle Bone, with the exception of the OS, which in this case,
will reside on a remote VPS (Virtual Private Server). The Bolt will receive data from the
sensors and push to the VPS with a Linux OS. The processing will take place on the VPS
and it will push the commands to control motors, LEDs, and actuators to the Bolt device.
You can use all the features of a Linux OS in this kind of a system.
This is a simple syntax for making an API request. In this request, the first parameter is the
API key and the second parameter is the command that we want to execute and the last
parameter is ID of Bolt device. The general syntax for the API request is:
41
https://cloud.boltiot.com/remote/your_api_key/command¶m1=...¶m2=...&deviceN
ame=BOLTXXXXX
The below example typically shows how to "restart" a Bolt device having device name as
BOLT916154:
https://cloud.boltiot.com/remote/44b2de6b-7e68-40e7-a27f-
814b58afe008/restart?&deviceName=BOLT9161541
url = "https://cloud.boltiot.com/remote/1cdfabea-306f-413f-a84b-552938aa8c5d/digitalWrite"
querystring = {"pin":"2","state":"HIGH","deviceName":"BOLT8795377"}
headers = {
'Cache-Control': "no-cache"
}
print(response.text)
Any cloud service has a limited bandwidth which is shared by its users. When any user overuses
the system beyond the specified limit it affects the usage for other users of Bolt cloud. The
effects could be a slower response rate for others or at times could even crash the Bolt Cloud.
To prevent this situation and to ensure that you get a continues uptime of the Bolt cloud, this
feature exists.
42
Bolt Cloud. You can upgrade to the pro version at a small monthly fee of $0.75 or Rs.50 INR.
This fee helps us pay the additional amount towards the cost of the AWS servers which is
required to offer the additional bandwidth.
Pin:- It is the Bolt GPIO connected to the servo motor that you want to control. It can take
any of the following values 0, 1, 2, 3, 4.
value:- It is the angle to which you want to set the servo motor. It can take a value between
0-180. NOTE: Some servo motors may not be calibrated, and may give a different output
angle than expected.
https://cloud.boltiot.com/remote/44b2de6b-7e68-40e7-a27f-
814b58afe008/servoWrite?pin=1&value=90&deviceName=BOLT1257632
https://cloud.boltiot.com/remote/44b2de6b-7e68-40e7-a27f-
814b58afe008/servoWrite?pin=1&value=135&deviceName=BOLT1257632
Command:- servoMultiWrite
Parameters:-
pins:- This is a CSV list of Bolt GPIO pins which are connected to the servo motor you want
to control.
values:- This is a CSV list of angles you want to set for the corresponding servo motors.
The values can be in the range of 0 to 180. NOTE: Some servo motors may not be calibrated,
and may give a different output angle than expected.
43
deviceName:- The name of the Bolt device you want to control.
Example:-
https://cloud.boltiot.com/remote/44b2de6b-7e68-40e7-a27f-
814b58afe008/servoMultiWrite?pins=1,2,3&values=20,90,180&deviceName=BOLT1257
632
browser output :
{"success":"1","value":"1"}
Pre-requisites:-
Parameters:-
deviceName:- The name of the Bolt device that you want to fetch data.
HTTP:-
https://cloud.boltiot.com/remote/44b2de6b-7e68-40e7-a27f-
814b58afe008/fetchData?deviceName=BOLT13819450
Response:- JSON
{
"success": 1,
"data_format": ["time_stamp", "ana0", "dig0", "dig3"],
"data": [
["2019-03-20 08:02:53", "244", "1", "0"],
["2019-03-20 08:04:09", "245", "0", "1"],
["2019-03-20 08:04:27", "246", "1", "1"]
]
}
44
5. HARDWARE SPECIFICATION, INTERFACING
CONTROLERS AND BOLT APP
45
5.1.2 General Specifications:-
5.1.3 Connectivity:-
46
5.1.4 LED Indicators:-
47
5.3 Bolt App:-
48
6. UNIFORM MODELIND LANGUAGES (UML)
DIAGRAMES:-
UML is an acronym that stands for Unified Modeling Language. Simply put, UML is a
modern approach to modeling and documenting software. In fact, it’s one of the most
popular business process modeling techniques. It is based on diagrammatic
representations of software components. As the old proverb says: “a picture is worth a
thousand words”. By using visual representations, we are able to better understand possible
flaws or errors in software or business processes.
UML was created as a result of the chaos revolving around software development and
documentation. In the 1990s, there were several different ways to represent and document
software systems. The need arose for a more unified way to visually represent those systems
and as a result, in 1994-1996, the UML was developed by three software engineers working
at Rational Software. It was later adopted as the standard in 1997 and has remained the standard
ever since, receiving only a few updates. Before we continue, here’s a shameless plug from
Amit (CEO of Tallyfy).
Mainly, UML has been used as a general-purpose modeling language in the field of software
engineering. However, it has now found its way into the documentation of several business
processes or workflows. For example, activity diagrams, a type of UML diagram, can be used
as a replacement for flowcharts. They provide both a more standardized way of modeling
workflows as well as a wider range of features to improve readability and efficacy.
Actors:– They interact with the system; an actor can be a human being, an organization
or an internal or external application
Within the circular containers, we express the actions that the actors perform. Such actions are:
purchasing and paying for the stock, checking stock quality, returning the stock or distributing
it. As you might have noticed, use case UML diagrams are good for showing dynamic
behaviors between actors within a system, by simplifying the view of the system and not
reflecting the details of implementation.
49
6.2 Class Diagram:-
These diagrams depict the behavioral pattern of the system, i.e. how each and every class is
inter-related to the other one, which relationship exists among each of the classes, etc. There
would be only one class diagram possible for a single system. Class diagrams of one system
can be linked to the class diagrams of another system, provided, there is a multi-system
requirement. Class UML diagram is the most common diagram type for software
documentation. Since most software being created nowadays is still based on the Object-
Oriented Programming paradigm, using class diagrams to document the software turns out to
be a common-sense solution. This happens because OOP is based on classes and the relations
between them.
In a nutshell, class diagrams contain classes, alongside with their attributes (also referred to as
data fields) and their behaviors (also referred to as member functions). More specifically, each
class has 3 fields: the class name at the top, the class attributes right below the name, the class
operations/behaviors at the bottom. The relation between different classes (represented by a
connecting line), makes up a class diagram.
50
6.3 Deployment Diagram:-
Deployment diagram is employed when we need to deploy the application we developed. A
single deployment diagram is possible for a single system.
Consoles / Computers for registration, login purposes by third party users and for quick
recharge by direct users.
Third Party Server to receive and respond to all the requests from various users.
Internet to provide access to users to recharge their accounts through payment gateways
by placing requests through Third Party Sites and Service Providers sites.
Payment Gateway Server like Bank's server to provide online payment through their
personal accounts to meet the requirements of the users.
Service Provider Server to maintain the records of the requests made by the users.
A deployment shows the assignment of concrete artifacts to computational nodes. It
shows the deployment of software elements to the physical architecture, and the
communication. Deployment diagrams are useful to communicate the physical and
deployment architecture.
In the deployment diagram the object reference in component diagram is also included
the deployment diagram. In this authority and system admin, interface through the
people.
51
6.4 Sequence Diagram:-
This diagram, as the name suggests, contains the sequence of flow of actions that are processed
through a system and the life lines of the entities, when and how are they accessed. It also
contains the security like which entity can process which entity and which one is visible, etc.
There can be many number of sequence diagrams per each activity being done. Sequence
Diagram for a user to recharge his account through third party sit.
Sequence diagrams are probably the most important UML diagrams among not only the
computer science community but also as design-level models for business application
development. Lately, they have become popular in depicting business processes, because of
their visually self-explanatory nature.
As the name suggests, sequence diagrams describe the sequence of messages and interactions
that happen between actors and objects. Actors or objects can be active only when needed or
when another object wants to communicate with them. All communication is represented in a
chronological manner. To get a better idea, check the example of a UML sequence diagram
below.
As the name suggests, structural diagrams are used to depict the structure of a system. More
specifically, it is used in software development to represent the architecture of the system and
how the different components are interconnected (not how they behave or communicate,
simply where they stand).
52
Either model generic interactions (showing all possible paths through the
interaction) or specific instances of a interaction (showing just one path through the
interaction).
An activity diagram portrays the control flow from a start point to a finish point showing the
various decision paths that exist while the activity is being executed. We can depict both
sequential processing and concurrent processing of activities using an activity diagram. They
are used in business and process modelling where their primary use is to depict the dynamic
aspects of a system.
53
We use Activity Diagrams to illustrate the flow of control in a system and refer to the steps
involved in the execution of a use case. We model sequential and concurrent activities using
activity diagrams. So, we basically depict workflows visually using an activity diagram. An
activity diagram focuses on condition of flow and the sequence in which it happens. We
describe or depict what causes a particular event using an activity diagram.
UML models basically three types of diagrams, namely, structure diagrams, interaction
diagrams, and behavior diagrams. An activity diagram is a behavioral diagram i.e. it depicts
the behavior of a system.
54
7. DATA VISUALIZATION
7.1 Line Graph:-
A line graph is a graphical display of information that changes continuously over time. A line
graph may also be referred to a line chart. Within a line graph, there are points connecting the
data to show a continuous change. The lines in a line graph can descend and ascend based on
the data. We can use a line graph to compare different events, situations, and information.
Note: Choose the file extension as js.
Output:-
55
setAxisName('X-Axis Name','Y-axis Name');
plotChart('time_stamp','your_variable_name');
Output:-
56
Sample Code:- JavaScript
setChartLibrary('google-chart');
setChartTitle('Your Graph Title');
setChartType('steppedGraph');
setAxisName('time_stamp','light_data','temp');
plotChart('time_stamp','light_data','temp');
Output:-
Output:-
57
7.6 Gauge:-
Gauge chart (also known as dial chart or speedometer chart) uses a single needle to show
information as a reading on a dial. On the gauge chart, the value for the needle is read on a
colored data range. This chart type is often used in executive dashboard reports to show key
business indicators. It’s a great tool to help visualize percentages, as well as other fixed-range
amounts for end users.
Note: Choose the file extension as js.
Output:-
58
8. SPECIFIC REQUIREMENTS
IEEE states that a requirement can be one of the following:
1. A condition or capability needed by a user to solve a problem or achieve an objective.
2. A condition or capability that must be met or possessed by a system or system component
to satisfy a contract, standard, specification, or other formality imposed document.
3. A documented representation of a condition or capability as in 1 or 2.
The following sections outline requirements as defined in bullet number one, by:
1. Stating the objective of the completed solution.
2. Stating the capabilities needed by users to obtain the objective.
3. Stating the systemic conditions required to obtain the capabilities.
59
constraints that, unlike functional requirements, are typically revisited as part of the Definition of
Done (DOD) for each Iteration, Program Increment (PI), or release. NFRs exist in all backlogs: Team,
Program, Solution, and Portfolio. Proper definition and implementation of NFRs is critical. Over-specify
them, and the solution may be too costly to be viable; under-specify or underachieve them, and the
system will be inadequate for its intended use. An adaptive and incremental approach to exploring,
defining, and implementing NFR’s.
8.3.2 Security:-
Home automation gives you access to control devices in your home from a mobile device
anywhere in the world. The term may be used for isolated programmable devices, like
thermostats and sprinkler systems, but home automation more accurately describes homes in
which nearly everything — lights, appliances, electrical outlets, heating and cooling systems
— are hooked up to a remotely controllable network. From a home security perspective, this
also includes your alarm system, and all of the doors, windows, locks, smoke detectors,
surveillance cameras and any other sensors that are linked to it.
The first and most obvious beneficiaries of this approach are “smart” devices and appliances
that can be connected to a local area network, via Ethernet or Wi-Fi. However, electrical
systems and even individual points, like light switches and electrical outlets, were also
integrated into home automation networks, and businesses have even explored the potential of
IP-based inventory tracking. Although the day is still far off when you’ll be able to use your
mobile browser to track down a lost sock, home networks are capable of including an increasing
number of devices and systems.
8.3.3 Portability:-
Portability is a characteristic attributed to a computer program if it can be used in an operating
systems other than the one in which it was created without requiring major rework. Porting is the task
of doing any work necessary to make the computer program run in the new environment.
Portability refers to the ability of an application to move across environments, not just across
platforms. To clarify, a computer platform generally refers to the operating system and
computer hardware only. A computer environment is much broader and may include the
hardware, the operating system and the interfaces with other software, users and programmers.
60
9. TESTING
Testing a home automation system is hard. In my experience, many professional shops don't
do it well, leaving customers unhappy and sapping profits from the project. Here is what I've
observed in the field over my 12 years in the audio, video and controls business
For testing the system follow the steps below:
Power up the Bolt device and ensure that it is connected to the cloud.
Connect the bulb holder to the AC power supply (i.e wall socket) using the 2- pin
socket.
Login into your account on cloud.boltiot.com and go to your product and click ' View
the action' button.
Now control the Bulb using the ON/OFF button over the internet to make home smart.
Testing isn't just about finding programming bugs in an automation system. It's also about
ensuring the project addresses the needs of the customer. The first level of testing a new system
is to validate that the system satisfies the clients' goals.
If the customers' primary requirements are for the automation system to save energy and
improve safety in their home, and the automation system does a great job providing whole-
house audio without integrating with the HVAC system or the security system, there is a major
issue.
The second tier of testing is to make sure the automation system is easy to use. Just because it
makes sense to the programmer doesn't mean it is going to make sense to the customer.
Unfortunately, my own experience has been that programmers tend to make things too
complicated. A good example is Crestron's implementation of Alexa voice control.
For example, the customer decides that in addition to wanting a cable TV box in their home
theater they also want to watch satellite TV. The code is then modified to provide control of
the new satellite TV box.
Unfortunately, the portion of the code used to turn on all the audio/video equipment in the
theater system was also modified and the order was changed. This results in the amplifier being
61
turned on before the satellite TV box. That results in a loud pop being generated that may
damage the speakers.
If cost didn't matter, you would go back and re-test the entire system after code changes have
been made. Typically, that isn't practical so you at least need to re-evaluate the functional areas
of the system and re-test the functional areas that have the highest probabilities of being
impacted by the changes.
High-quality testing isn't cheap and isn't easy; however, an investment in testing will provide
you with happier customers, a stronger reputation, and a better bottom line. If you are a
homeowner you will benefit from a much more reliable system and a happier family life.
62
63
64
65