You are on page 1of 44

IOT BASED FAN LIGHT CONTROL

ABSTRACT:

The project proposes an efficient implementation for IoT (Internet of Things) used for
monitoring and controlling the home appliances via World Wide Web. Home automation system
uses the portable devices as a user interface. They can communicate with home automation
network through an Internet gateway, by means of low power communication protocols like
Zigbee, Wi-Fi etc. This project aims at controlling home appliances via Smartphone using Wi-Fi
as communication protocol and iot server system. The user here will move directly with the
system through a web-based interface over the web, whereas home appliances like lights, fan and
door lock are remotely controlled through easy website. The server will be interfaced with relay
hardware circuits that control the appliances running at home. The communication with server
allows the user to select the appropriate device. The communication with server permits the user
to pick out the acceptable device. The server communicates with the corresponding relays. If the
web affiliation is down or the server isn't up, the embedded system board still will manage and
operate the appliances domestically. By this we provide a climbable and price effective Home
Automation system.
INTRODUCTION

In home automation is one of the most important thing to automatically ON and OFF the
home appliances without inclusion of human. In present days most of the automation system
utilize the combination of hardware and wireless system for controlling appliances. In this
project we design and development of controlling of home automation system via the Wi-Fi
module or Webpage server using arduino. This project is concern with programmed control of
light or whatever other home appliances. The user will communicate to Arduino through internet
via Wi-Fi network. This system is less costly, allowing additional home appliances. Its more
Secure for us. IOT or Internet of Things is an upcoming technology that allows us to control
hardware devices through the internet. Here we proposed to use IOT in order to control Home
Appliances, thus automating modern home through the internet. Three Loads are used in this
system to demonstrate as home lighting and fan. A smart home is one that equipped with
lighting, heating, and electronic devices that can be controlled by a smart phone or via the
internet. Home electronic devices controlling by internet based Home automation system
whether you are inside or outside your home. Using a Wi-Fi shield to act as a application for the
arduino eliminates the need for wired conection between the arduino board and internet. In this
Project, we discuss design and development of activation and controlling of home automation
system via Android application using arduino. In this project the programmed using a wiring
based language similar to C++. Internet of Things is interlinked through these networks because
of the popularity of the home automation is improved by the quality of service provided by the
devices.
LITERATURE SURVEY

Home automation system using android and Wi-Fi:-

The idea of automation can be dated to October 2014, When Kunal Khivensara, Gulam
Husssain, Nitish Bansal, Vikas Kumar developed the idea of having a remote control. It is Wi-Fi
based system. This project proposed which is very different than existing system. They were
going to implement it with the help of directly Wi-Fi which fits the bill of WLAN 802.11
standards. The main advantage of this system was that it can be implemented with a wider range
of not more than 200 meters. It allows communicating with a brief and small setup without zap
wired connection. This system could be extended for a proper HVAC.

Design exploration of Microcontroller using RF remote control:-

This Project was developed by Aru, Okereke Eze, Ihekweaba Gozie, Opara, F.K. In this
project, Home electronic devices whether we are inside or outside our room is control by the RF
remote control wall socket. An individual the ability to remotely or automatically control things
around the home without moving from place to place gives by RF remote control wall socket. A
home appliances is a device or instrument design to perform a specific function. This project was
design to control electrical devices that were connected to an AC power supply through the RF
remote wall socket ON/OFF using RF remote control whosw operation is independent of the
direction/position unlike the infrared remote control which was line of sight. This project was
uses the 89c52 microcontroller.
Android based Home Automation system using Bluetooth and Vice
command:-

This project was developed by Bhavik Pandya, Mihir Mehta, Nilesh Jain. In this project
the arduino microcontroller for connecting the appliances a Bluetooth module for signal transfer
and a smart phone running the android application. This project proposed was primarily
concerned with the home automation system which uses bluetooth for interaction between the
android mobile application and the appliances under the control of the system.

A design and prototype implementation of new home automation system

The System that uses WiFi technology as a network infrastructure connecting its parts.
Their system consists of two main components; the first part is the server (web server), which
presents system core that manages, controls, and monitors users’ home. Users and system
administrator can locally (LAN) or remotely (internets) manage and control system code. Second
part is hardware interface module, which provides appropriate interface to sensors and actuator
of home automation system. Unlike most of available home automation system in the market the
proposed system is scalable that one server can manage many hardware interface modules as
long as it exists on Wi-Fi network coverage. System supports a wide range of home automation
devices like power management components, and security components. The proposed system is
better from the scalability and flexibility point of view than the commercially available home
automation systems
BLOCK DIAGRAM

Block Diagram of System Architecture

Explanation of Block Diagram:-

The block diagram of proposed system is shown in figure. Wi-Fi module is connected
with the arduino which interface is the mobile phone with the arduino. The arduino controller is
program such that the fan and light are control based on the data send by the mobile phone to the
arduino through the Wi-Fi interfacing model. Wi-Fi protocols provides more security for secure
connection and an Android application has two methods to create a link. The first one is using
Web page server of the Wi-Fi module directly coded into the initial testing. The second one is, it
allow user to search for the device, which becomes a Final Decision. Then user can select the
device from the list, for making connection. Arduino is an open source platform used for
building electronic projects. It consists of both the Programmable circuit board and the piece of
the software or IDE that runs on the computer used to write and upload computer code to the
physical board. The household electronic or electrical appliances to connect the PC by using
Relay interface circuit. To drive the relay energizing Input and connector to Interface parallel
port through freewheeling diode and transistor. For testing suppose we are using one LIGHT and
and LED. The device which is use in project.

CIRCUIT DIAGRAM
DESCRIPTION AND FABRICATION OF COMPONENT
POWER SUPPLY:

This unit was developed around, built and incorporated in the arduinouno board. The power
supply source for the system would be mains AC. The circuit would use a 12v DC and consists
of the rectifier diode, smoothening capacitor and the voltage regulator:

 Step down transformer.


 Bridge rectifier circuit.
 Input filter.
 Voltage regulators.
 Output filter.
 Indicator unit.
STEP DOWN TRANSFORMER:

The step-down transformer is used to step down the supply voltage of 230v ac from
mains to lower values, as the various IC’s used in this project require reduced voltages. The
transformer consists of primary and secondary coils.
To reduce or step down the voltage, the transformer is designed to contain less number of
turns in its secondary core. The outputs from the secondary coil which is center tapped are the
ac values of 0v, 15v and 15v. The conversion of these ac values to dc values to dc values is done
using the full wave rectifier unit.

RECTIFIER UNIT:

A diode bridge is an arrangement of four diodes connected in a bridge circuit. That


provides the polarity of output voltage of any polarity of the input voltage. When used in its most
common application, for conversion of alternating current (A.C) input into direct current (D.C)
output, it is known as a bridge rectifier.
The diagram describes a diode-bridge design known as a full wave rectifier. This design
can be used to rectify single phase A.C. when no transformer center tap is available. A bridge
rectifier makes use of four diodes in a bridge arrangement to achieve full wave rectification. This
is a widely used configuration, both with individual diodes wired as shown and with single
component bridges where the diode bridge is wired internally.
For both positive and negative swings of the transformer, there is a forward path through
the diode bridge. Both conduction paths cause current to flow in the same direction through the
load resister, accomplishing full-wave rectification. While one set of diodes is forward biased,
the other set is reversing biased and effectively eliminated from the circuit.
INPUT FILTER:

Capacitors are used as filters. The ripples from the dc voltages are removed and pure dc
voltage is obtained. The primary action performed by capacitor is charging and discharging. It
charges in positive half cycle of the ac voltage and it will discharge in negative half cycle. So it
allows only ac voltage and does not allow the dc voltage. This filter is fixed before the regulator.
Capacitors used here are of the value 1000uF.

REGULATOR UNIT:

Regulator regulates the output voltage to a specific value. The output voltage is
maintained irrespective of the fluctuations in the input dc voltage. Whenever there are any ac
voltage fluctuations, the dc voltage also changes, and to avoid this regulators are used.
REGULATORS CAN BE CLASSIFIED AS:

1. Positive regulator, which regulates the positive voltage(7805,7812)


1. > input pin

2. > ground pin

3. > output pin

2. Negative regulator, which regulates the negative voltage (7912).


1. > ground pin

2. > input pin

3. > output pin

Regulators used in this application are: -

 7805 which provides 5v dc


 7812 which provides 12v dc
 7912 which provides -121v dc

OUTPUT FILTER:

This filter is fixed after the Regulator circuit to filter any of the possibly found ripples in
the output received finally. Capacitors used here are of value 10F.

ARDUINO UNO

Arduino interface boards provide the engineers,artists,designers,hobbyists and anyone who


tinker with technology with a low-cost,easy-to-use technology to create their creative,interactive
objects,useful projects etc.,A whole new breed of projects can now be built that can be controlled
from a computer.

WHAT IS ARDUINO?
Figure 1.1 ARDUINO UNO

Arduino is a open source electronics prototyping platform based on flexible,easy-to-use


hardware and software.It’s intended for artists,designers,hobbyists,and anyone interested in
creating interactive objects or environments.It’s an open-source physical computing platform
based on a microcontroller board,and a development environment for writing software for the
board.

In simple words,Arduino is a small microcontroller board with a USB plug to connect to your
computer and a number of connection sockets that can be wired up to external electronics,such as
motors,relays,light sensors,laser diodes,loudspeakers,microphones,etc.,They can either be
powered through the USB connection from the computer or from a 9V battery.They can be
controlled from the computer or programmed by the computer and then disconnected and allowed
to work independently.

Anyone can buy this device through online auction site or search engine.Since the Arduino
is an open-source hardware designs and ccreate their own clones of the Arduino and sell them,so
the market for the boards is competitive.An official Arduino costs about $30,and a clone often
less than $20.

The name “Arduino” is reserved by the original makers. However, clone Arduino designs often
have the letters “duino” on the end of their name, for example, Freeduino or DFRduino. The
software for programming your Arduino is easy to use and also freely available for Windows,
Mac, and LINUX computers at no cost.
Microcontroller
Microcontroller can be described as a computer embedded on a rather small circuit
board.To describe the function of a microcontroller more precisely,it is a single chip that can
perform various calculations and tasks,and send/receive signals from other devices via the
available pins. Precisely what tasks and
communication with the world it does, is what is governed by what instructions we give to
the Microcontroller. It is this job of telling the chip what to do, is what we refer to as
programming on it.
However, the uC by itself, cannot accomplish much; it needs several external inputs:
power, for one; a steady clock signal, for another. Also, the job of programming it has to be
accomplished by an external circuit. So typically, a uC is used along with a circuit which
provides these things to it; this combination is called a microcontroller board. The Arduino Uno
that you have recieved, is one such microcontroller board. The actual microcontroller at its heart
is the chip called Atmega328. The advantages that Arduino offers over other microcontroller
boards are largely in terms of reliability of the circuit hardware as well as the ease of
programming and using it.

Open-source hardware
Open-source hardware shares much of the principles and approach of free and open-
source software.The founders of Arduino wanted people to study their hardware,to understand
how it works,make changes to it,and share those changes with the world.To facilitate this,they
release all of the original design files(Eagle CAD)for the Arduino hardware.These files are
licensed under a Creative Common Attribution Share-Alike license,which allows for both
personal and commercial derivative works,as long as they(people) credit Arduino and release
their designs under the same license.
The Arduino software is also oen-source.The source code for the Java environment is
released under the GPL and the C/C++ microcontroller libraries are under the LGPL
HISTORY OF ARDUINO
While teaching a physical computing class at the Interaction Design Institute Ivrea in 2005,
Massimo Banzi’s students were unwilling to spend the 76 euros for the BASIC Stamp
microcontrollers commonly used in such applications. Banzi and his collegues looked for
alternatives, finally settling on the wiring platform developed by one of Banzi’s students. In his
own words:
“…we started to figure out how could we make the whole platform even simpler, even cheaper,
even easier to
use. And then we started to essentially reimplement the whole thing as an open source project.”
Once they had a prototype, a student wrote the software that would allow wiring programs to run
on the new platform. Upon seeing the project, visiting professor Casey Reas suggested that there
might be wider applications than just design schools for the new product. The prototype was
redesigned for mass production and a test run of 200 boards was made. Orders began coming in
from other design schools and the students looking for Arduinos, and the Arduino project was
born and  Massimo Banzi and David Cuartielles became its founders.”ARDUINO” is an Italian
word,meaning “STRONG FRIEND”.The English version of the name is “Hardwin”. As of May
2011,more than 300,000 Arduino units are “in the wild”.
Design Goals
 Work with a Mac (as most design students use one)
 USB connectivity (MacBooks don’t have serial ports
 Look nice
 Cheap (about 20 euros, the cost of going out for pizza in Europe)
 More powerful than a BASIC stamp
 Something you could build/fix yourself
Simple and easy to use by someone without formal electronics training
Business Models
Since the entire project is open source, anyone can build and sell Arduino-compatible
devices. So in this sense, the Arduino project relies heavily on its branding for it’s financial
success . Other projects manufacture compatible and cheaper boards, however people are loyal to
the Arduino branded boards because they associate quality and a certain image to the
final product .
By the Numbers
Year Units Sold
2005 200
2006 10 000
2010 120 000
2011 300 000
Competitors
Before Arduino, the largest players in the design/hobbyist market segment were the PIC
microcontroller family (made by Microchip) and the BASIC Stamp (made by Parallax). Since
the introduction of the Arduino, other large companies have tried to enter the hobbyist market,
including Texas Instruments , and even Microsoft . However, the open-sourced tools
of the Arduino and the size of its community are large barriers for new platforms to overcome.

Community
Figure 2 GOOGLE trends comparing ARDUINO with its biggest competitors

As the project is aimed at


students and hobbyists who may not have any formal electronics background, there are many
excellent guides online covering everything from making a light blink to creating a laser harp.
The official forum has almost
60 000 registered users,
and along with helping users with
their projects, is extremely active
in developing new libraries to
extend the functionality of the
Arduino . The open-source share
and share alike sentiment is very strong, and the vast majority of users freely publish the code to
their projects.

PHYSICAL COMPUTING
Physical Computing is an approach to learn how humans communicate through computers
that starts by considering how humans express themselves physically.

PLATFORM
HARDWARE

ARDUINO Board Layout

Figure 3 ARDUINO board layout

ARDUINO pin diagram


Figure 4 ARDUINO pin diagram

ATmega8(Microcontroller)

 16 MHz
 8 Kbyte Flash RAM(1K taken by the boot loader)
 1 Kbyte RAM(eg.for auto/local variables and stack)
 14 digital Input/Output Ports

Figure 5 ATmega8

Single chip USB to async. Serial data transfer interface

 USB 2.0 compatible


 Transmit and receive LED frive signals
 256 Byte receive,128 Byte transmit buffer
 Data transfer rate from 300bits/sec to 2 Mb/sec

Fig2.1 Android Software Architecture


The OFF-the shelf adapter
 must be a DC adapter (i.e. it has to put out DC, not AC)
 should be between 9V and 12V DC 
 must be rated for a minimum of 250mA current output, although you will likely want
something more like 500mA or 1A output, as it gives you the current necessary to power
a servo or twenty LEDs if you want to.
 must have a 2.1mm power plug on the Arduino end, and
 the plug must be "centre positive", that is, the middle pin of the plug has to be the +
connection.
Current rating: Since you'll probably be connecting other things to the Arduino (LEDs, LCDs,
servos) you should get an adapter that can supply at least 500mA, or even 1000 mA (1 ampère).
That way you can be sure you have enough juice to make each component of the circuit function
reliably.

The Arduino's on-board regulator can actually handle up to 20V or more, so you can actually use
an adapter that puts out 20V DC. The reasons you don't want to do that are twofold: you'll lose
most of that voltage in heat, which is terribly inefficient. Secondly, the nice 9V pin on the
Arduino board will actually be putting out 20V or so, which could lead to potential disaster when
you connect something expensive to what you thought was the 9V pin. Our advice is to stick
with the 9V or 12V DC adapter.

Basic Terminologies in ARDUINO:


1.Analog to digital converter(ADC)
The process of Analog to digital conversion is shown in figure.
The Arduino has 10 bits of Resolution when reading analog signals.
2 power 10=1024 increments
Influence also by how fast you sample

2.Pulse width modulation (PWM)


The Arduino has 8bit of resolution,when outputting a signal using PWM.The range of output
voltage is from 0 to 5 Volts
2power 8=255 Increments
Average of on/off(digital signals to make an average voltage),Duty cycle in 100% of 5Volts.

LANGUAGE REFERENCES:
The Microcontroller on the board is programmed using the Arduino programming
language(based on wiring) and the arduino development environment(based on processing).
Arduino Programming Language(APL)(based on wiring)
The Arduino programming language is an implementation of Wiring, a similar physical
computing platform, which is based on the Processing multimedia programming environment.
Wiring
Wiring is an open-source programming framework for microcontrollers. Wiring allows
writing cross-platform software to control devices attached to a wide range of microcontroller
boards to create all kinds of creative coding, interactive objects, spaces or physical experiences.
The framework is thoughtfully created with designers and artists in mind to encourage a
community where beginners through experts from around the world share ideas, knowledge and
their collective experience. There are thousands of students, artists, designers, researchers, and
hobbyists who use Wiring for learning, prototyping, and finished professional work production.
Arduino development environment(based on processing)
Processing
Processing is an open source programming language and environment for people who
want to create images, animations, and interactions. Initially developed to serve as a software
sketchbook and to teach fundamentals of computer programming within a visual context,
Processing also has evolved into a tool for generating finished professional work. Today, there
are tens of thousands of students, artists, designers, researchers, and hobbyists who use
Processing for learning, prototyping, and production.

Software
The software used by the arduino is Arduino IDE.

The Arduino IDE is a cross-platform application written in Java, and is derived from the IDE for
the Processing programming language and the Wiringproject. It is designed to introduce
programming to artists and other newcomers unfamiliar with software development. It includes a
code editor with features such as syntax highlighting, brace matching, and automatic indentation,
and is also capable of compiling and uploading programs to the board with a single click. There
is typically no need to edit makefiles or run programs on acommand-line interface. Although
building on command-line is possible if required with some third-party tools such as Ino.

The Arduino IDE comes with a C/C++ library called "Wiring" (from the project of the same
name), which makes many common input/output operations much easier. Arduino programs are
written in C/C++, although users only need define two functions to make a runnable program:

 setup() – a function run once at the start of a program that can initialize settings
 loop() – a function called repeatedly until the board powers off

Figure 6 A screenshot of the Arduino IDE showing the "Blink"program,a simple biginner program
A typical first program for a microcontroller simply blinks a LED on and off. In the Arduino
environment, the user might write a program like this:
#define LED_PIN 13

void setup () {
pinMode (LED_PIN, OUTPUT); // enable pin 13 for digital output
}

void loop () {
digitalWrite (LED_PIN, HIGH); // turn on the LED
delay (1000); // wait one second (1000
milliseconds)
digitalWrite (LED_PIN, LOW); // turn off the LED
delay (1000); // wait one second
}

For the above code to work correctly, the positive side of the LED must be connected to pin 13
and the negative side of the LED must be connected to ground. The above code would not be
seen by a standard C++ compiler as a valid program, so when the user clicks the "Upload to I/O
board" button in the IDE, a copy of the code is written to a temporary file with an extra include
header at the top and a very simple main() function at the bottom, to make it a valid C++
program.

The Arduino IDE uses the GNU toolchain and AVR Libc to compile programs, and
uses avrdude to upload programs to the board.

For educational purposes there is third party graphical development environment called Minibloq
available under a different open source license.

3.1 Why Arduino is popular?

Here are five reasons why the Arduino is more popular than beagleboard:

 Starter Projects: Editing and rewriting is often easier than writing from scratch. It’s the
same with electronics. It’s easier to mod an idea than start with a blank slate.That’s where
the BeagleBoard falls short. “It has virtually no example application that you can just
copy and hack to learn from,” says Massimo Banzi, one of the co-founders of the
Arduino project. It’s a chicken-and-egg problem for the BeagleBoard. Unless there are
more example codes out there, it is difficult to draw in the audience. And without the
audience it is challenging to get enough sample projects into the community.

 Cost and Durability: At $30 a piece, an Arduino is an inexpensive investment for


someone who wants to try it out. “It’s the price of a few sandwiches,” says Torrone.
Compare that to the BeagleBoard-xM, which costs $180. One reason why the Arduino is
so cheap is because it is easy to clone. The microcontroller is completely open source so
the “components are all commodity,” says Torrone. With the BeagleBoard, hobbyists
don’t have the same amount of freedom. They have to work closely with Texas
Instruments or its partners, says Torrone. Arduino is also very resilient. Drop it, smash it
and it still stays alive. Add to that its low-power requirement, and the product becomes a
must-have for DIYers. An Arduino can run on a 9V-battery for days. “The BeagleBoard
is fast and powerful but that also means lots of energy is needed, which makes it difficult
for simple projects,” says Torrone.

 A Thriving Community: Arduino’s popularity means it’s easy to get started. Companies
such as Adafruit, SparkFun and Liquidware not only sell chips, but they also host blogs
that suggest ideas on how to use your Arduino while providing extensive project plans to
guide you in completing your creations. Will Chellman, a student who has played with
Arduino for years, says he’s now experimenting with the BeagleBoard. But finding
documentation and information to work off is not easy, he says. The lack of well-
documented projects done with the BeagleBoard can be intimidating to new users as well,
says Banzi. “There’s lots of of interesting stuff (about the BeagleBoard) but it is very
technical,” he wrote in a comment recently on Gadget Lab in response to the launch of
BeagleBoard-xM. Banzi says BeagleBoard documentation is also scattered and
fragmented. “Parts of it have aged and you spend quite a bit of time jumping from wikis
to mailing list to track which specific bit of documentation applies to your board,
bootloader etc.,” he says.
 Maturity is the key: Arduino has had a head start on the BeagleBoard. By October 2008,
about 50,000 Arduino boards had already been shipped. That year, the first BeagleBoards
started making their way into the hands of hardware enthusiasts. The BeagleBoard is just
two years old. Since it hasn’t been around long enough, there’s not enough people
building apps based on it,” says Chellman. That’s not to say that BeagleBoard isn’t
catching up. Earlier this month, we showed five projects ranging from a videowall to the
iPad of ham radios that use the BeagleBoard. There’s also a build-your-own tablet kit that
is based off the BeagleBoard.

 Simple is attractive: With its single-board computer configuration, 1-GHz processing


power and the choice of accessories, the BeagleBoard is a creative engineer’s dream
come true. But the same reasons make it intimidating to those who want to geek out on a
DIY project but don’t have the technical know-how. Arduino users point out that it is
simple to connect external sensors to the board, and the example codes out there make it
easy to get started quickly. Arduino is a simple system designed for creative people with
little or “no prior knowledge of electronics,” says Banzi. “It’s cheap and open source with
lots of documentation written in a not too technical language. Above all, it has a very
welcoming attitude towards beginners and tries not to scare them too much.”
Liquid Crystal Display

Introduction:

Advances in the features, miniaturization, and cost of LCD (Liquid Crystal Display)
controller chips have made LCDs usable not only in commercial products but also in hobbyist
projects. By themselves, Liquid Crystal Displays can be difficult to drive because they require
multiplexing, AC drive waveforms, and special voltages. LCD modules make this driving
simpler by attaching hardware to the raw glass LCD to assist in some or all of these rudimentary
driving tasks. LCD modules can be split into two groups: those that have built-in controller and
driver chips, and those that have only driver chips. LCD displays that do not have controllers are
typically used with powerful hardware, such as a laptop computer, where a video controller is
available to generate the complex drive signals necessary to run the display. Most color and large
(greater than 320x240) monochrome displays are of this type. Other common sizes are 16x1,
20x1, 20x2, 20x4, 40x1, and 40x2 (characters x lines). Fortunately, all HD44780-based displays
(of any size) use the same standard 14-wire interface.

Therefore, code and hardware made for one size/type display can be painlessly adapted to
work for any HD44780 compatible. Information about these displays can be easily obtained on
the web by including “HD44780” in our search keywords. Because of their widespread use, these
displays can be purchased surplus with typical prices of $3 for small displays to $20 for large
ones.

3.4.2. Interfacing our LCD module:

The microcontroller/microprocessor interface to HD44780 LCD modules (hereafter


generically Referred to as character LCD modules) is almost always 14 pins. We May find that
some displays have additional pins for backlighting or other purposes, but the first 14 pins still
serve as the interface.
The first three pins provide power to the LCD module. Pin 1 is GND and should be
grounded to the power supply. Pin 2 is VCC and should be connected to +5V power. Pin 3 is the
LCD Display Bias. By adjusting the voltage or duty cycle of pin 3, the contrast of the display can
be adjusted. Most character LCDs can achieve good display contrast with a voltage between 5V
and 0V on pin 3. Note that greater contrast comes with lower voltage and we should never apply
a VLCD higher than VCC. Some displays, which are specially made to work over a large
temperature range, may require a negative voltage to achieve readable contrast.

3.4.3. Basic 16x 2 Characters LCD - Black on Green 5V:

Description:

This is a basic 16 character by 2-line display. Black text on Green background. Utilizes
the extremely common HD44780 parallel interface chipset. Interface code is freely available. We
will need ~11 general I/O pins to interface to this LCD screen. Includes LED backlight.

Fig3.4.1 16/2 character LCD display

Pin Description: The most commonly used LCDs found in the market today are 1 Line, 2 Line
or 4 Line LCDs which have only 1 controller and support at most of 80 characters, whereas
LCDs supporting more than 80 characters make use of 2 HD44780 controllers.
Fig 3.4.2 Pin Description of LCD

Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins (two
pins are extra in both for back-light LED connections). Pin description is shown in the table
below.
Figure 3.4.3: Character LCD type HD44780 Pin diagram

Pin description of character LCD:

Pin No. Name Description


Pin no. 1 VSS Power supply (GND)
Pin no. 2 VCC Power supply (+5V)
Pin no. 3 VEE Contrast adjust
0 = Instruction input
Pin no. 4 RS
1 = Data input
0 = Write to LCD module
Pin no. 5 R/W
1 = Read from LCD module
Pin no. 6 EN Enable signal
Pin no. 7 D0 Data bus line 0 (LSB)
Pin no. 8 D1 Data bus line 1
Pin no. 9 D2 Data bus line 2
Pin no. 10 D3 Data bus line 3
Pin no. 11 D4 Data bus line 4
Pin no. 12 D5 Data bus line 5
Pin no. 13 D6 Data bus line 6
Pin no. 14 D7 Data bus line 7 (MSB)

Table 3.4.1: Character LCD pins with 1 Controller

Pin No. Name Description


Pin no. 1 D7 Data bus line 7 (MSB)
Pin no. 2 D6 Data bus line 6
Pin no. 3 D5 Data bus line 5
Pin no. 4 D4 Data bus line 4
Pin no. 5 D3 Data bus line 3
Pin no. 6 D2 Data bus line 2
Pin no. 7 D1 Data bus line 1
Pin no. 8 D0 Data bus line 0 (LSB)
Pin no. 9 EN1 Enable signal for row 0 and 1 (1stcontroller)
Pin no. 10 R/W 0 = Write to LCD module
1 = Read from LCD module
0 = Instruction input
Pin no. 11 RS
1 = Data input
Pin no. 12 VEE Contrast adjust
Pin no. 13 VSS Power supply (GND)
Pin no. 14 VCC Power supply (+5V)
Pin no. 15 EN2 Enable signal for row 2 and 3 (2ndcontroller)
Pin no. 16 NC Not Connected

Table 3.4.2: Character LCD pins with 2 Controller

3.4.4. LCD Background:

Frequently, an 8051 program must interact with the outside world using input and
output devices that communicate directly with a human being. One of the most common devices
attached to an 8051 is an LCD display. Some of the most common LCDs connected to the 8051
are 16x2 and 20x2 displays. This means 16 characters per line by 2 lines and 20 characters per
line by 2 lines, respectively.

3.4.5. Interfacing Example - 16 Characters x 2 Lines LCD:

Description: This is the first interfacing example for the Parallel Port. We will start with
something simple. This example doesn't use the Bi-directional feature found on newer ports, thus
it should work with most, if no all Parallel Ports. It however doesn't show the use of the Status
Port as an input. A 16 Character x 2 Line LCD Modules to the Parallel Port. These LCD
Modules are very common these days, and are quite simple to work with, as all the logic required
running them is on board.

3.4.6Schematic:
Fig 3.4.4 Schematic Diagram of 2 line 16 character LCD display

3.4.7 Circuit Description:

Above is the quite simple schematic. The LCD panel's Enable and Register Select is
connected to the Control Port. The Control Port is an open collector / open drain output. While
most Parallel Ports have internal pull-up resistors, there is a few which don't. Therefore by
incorporating the two 10K external pull up resistors, the circuit is more portable for a wider
range of computers, some of which may have no internal pull up resistors. We make no effort to
place the Data bus into reverse direction. Therefore we hard wire the R/W line of the LCD panel,
into write mode. This will cause no bus conflicts on the data lines. As a result we cannot read
back the LCD's internal Busy Flag which tells us if the LCD has accepted and finished
processing the last instruction. This problem is overcome by inserting known delays into our
program.

The 10k Potentiometer controls the contrast of the LCD panel. Nothing fancy here. As
with all the examples, I've left the power supply out. We can use a bench power supply set to 5v
or use an onboard +5 regulator. Remember a few de-coupling capacitors, especially if we have
trouble with the circuit working properly.

NODE MCU ESP8266


Esp8266 D1 Mini NodeMCU Wifi Development Board is an Arduino Compatible mini
wifi board with 4MB flash based on ESP8266EX. The board is with 11 digital input/output pins,
all pins have interrupt/PWM/I2C/one-wire supported(except D0) 1 analog input(3.3V max input)
and a Micro USB connection.

The development board features WiFi-SoC ESP8266 and is made for fast Internet-of-
Things (IoT) prototyping. It is flashed with the latest firmware version and can be set up and
programmed right away with the onboard micro USB connection. With only a few lines of code,
the NodeMCU Dev Kit connects to your local network and ready for control by other network
members like computers and smartphones.

The D1 mini is an ESP8266 development board that is compact, versatile and very easy
to use with the Arduino IDE. It supports natively by the Expressive SDK.

Features of Esp8266 D1 Mini Node MCU Wifi Development Board:

 Use BRT (Bias Resistor Transistor)


 Easier into flash mode.
 30% increase in radiating area
 Good stability.
 11 digital input/output pins, all pins have interrupt/pwm/I2C/one-wire supported(except
for D0)
 1 analog input(3.2V max input)
 Micro USB connection
 Compatible with Arduino
 Compatible with nodemcu
 Support OTA wireless uploading
 11 x I/O pins,1 x ADC pin

Specifications of Esp8266 D1 Mini Node MCU Wifi Development Board:


 Microcontroller ESP-8266EX
 Operating Voltage 3.3 V
 Digital I/O Pins 11
 Analog Input Pins 1(Max input: 3.2V)
 Clock Speed 80MHz/160MHz
 Flash 4M bytes
 Length 34.2mm
 Width 25.6mm

Introduction to NodeMCU

NodeMCU V3 is an open-source firmware and development kit that plays a vital role in
designing your own IoT product using a few Lua script lines.

Multiple GPIO pins on the board allow you to connect the board with other peripherals
and are capable of generating PWM, I2C, SPI, and UART serial communications.

The interface of the module is mainly divided into two parts including both Firmware and
Hardware where former runs on the ESP8266 Wi-Fi SoC and later is based on the ESP-12
module.

The firmware is based on Lua – A scripting language that is easy to learn, giving a simple
programming environment layered with a fast scripting language that connects you with a well-
known developer community.

PIN DIAGRAM
You can see from the pinout image above, there are five ground pins and three 3V3 pins
on the board. The board can be powered up using the following three ways.

USB Power. It proves to an ideal choice for loading programs unless the project you aim to
design requires separate interface i.e. disconnected from the computer.

Provide 3.3V. This is another great option to power up the module. If you have your own off-
board regulator, you can generate an instant power source for your development kit.

Power Vin. This is a voltage regulator that comes with the ability to support up to 800 mA. It can
handle somewhere between 7 to 12 V. You cannot power the devices operating at 3.3 V, as this
regulator unable to generate as low as 3.3V.

The most basic way to use the ESP8266 module is to use serial commands, as the chip is
basically a WiFi/Serial transceiver. However, this is not convenient. What we recommend is
using the very cool Arduino ESP8266 project, which is a modified version of the Arduino IDE
that you need to install on your computer. This makes it very convenient to use the ESP8266
chip as we will be using the well-known Arduino IDE.

This board is pre-flashed with NodeMCU – a Lua-based firmware for the ESP8266
which allows easy control via a neat scripting language – Lua – so you’re ready to go in just a
few minutes.

The ESP-12 Lua Nodemcu WIFI Dev Board Internet Of Things with ESP8266 is an all-
in-one microcontroller + WiFi platform that is very easy to use to create projects with WiFi and
IoT (Internet of Things) applications.

The board is based on the highly popular ESP8266 WiFi Module chip with the ESP-12
SMD footprint. This WiFi development board already embeds in its board all the necessary
components for the ESP8266 (ESP-12E) to program and upload code. It has a built-in USB to
serial chip upload codes, 3.3V regulator, and logic level converter circuit so you can immediately
upload codes and connect your circuits.
APPLICATIONS

NodeMCU V3 is mainly used in the WiFi Applications which most of the other
embedded modules fail to process unless incorporated with some external WiFi protocol.
Following are some major applications used for NodeMCU V3.

 Internet Smoked Alarm


 VR Tracker
 Octopod
 Serial Port Monitor
 ESP Lamp
 Incubator Controller
 IoT home automation

RELAY

A relay is an electrically operated switch. Many relays use an electromagnet to


mechanically operate a switch, but other operating principles are also used, such as solid-state
relays. Relays are used where it is necessary to control a circuit by a low-power signal (with
complete electrical isolation between control and controlled circuits), or where several circuits
must be controlled by one signal. The first relays were used in long distance telegraph circuits as
amplifiers: they repeated the signal coming in from one circuit and re-transmitted it on another
circuit. Relays were used extensively in telephone exchanges and early computers to perform
logical operations.
A type of relay that can handle the high power required to directly control an electric
motor or other loads is called a contactor. Solid-state relays control power circuits with
no moving parts, instead using a semiconductor device to perform switching. Relays with
calibrated operating characteristics and sometimes multiple operating coils are used to protect
electrical circuits from overload or faults; in modern electric power systems these functions are
performed by digital instruments still called "protective relays".

BASIC DESIGN AND OPERATION:

A simple electromagnetic relay consists of a coil of wire wrapped around a soft iron core,
an iron yoke which provides a low reluctancepath for magnetic flux, a movable iron armature,
and one or more sets of contacts (there are two in the relay pictured). The armature is hinged to
the yoke and mechanically linked to one or more sets of moving contacts. It is held in place by
a spring so that when the relay is de-energized there is an air gap in the magnetic circuit. In this
condition, one of the two sets of contacts in the relay pictured is closed, and the other set is open.
Other relays may have more or fewer sets of contacts depending on their function. The relay in
the picture also has a wire connecting the armature to the yoke. This ensures continuity of the
circuit between the moving contacts on the armature, and the circuit track on the printed circuit
board (PCB) via the yoke, which is soldered to the PCB.

When an electric current is passed through the coil it generates a magnetic field that
activates the armature, and the consequent movement of the movable contact(s) either makes or
breaks (depending upon construction) a connection with a fixed contact. If the set of contacts
was closed when the relay was de-energized, then the movement opens the contacts and breaks
the connection, and vice versa if the contacts were open. When the current to the coil is switched
off, the armature is returned by a force, approximately half as strong as the magnetic force, to its
relaxed position. Usually this force is provided by a spring, but gravity is also used commonly in
industrial motor starters. Most relays are manufactured to operate quickly. In a low-voltage
application this reduces noise; in a high voltage or current application it reduces arcing.
When the coil is energized with direct current, a diode is often placed across the coil to
dissipate the energy from the collapsing magnetic field at deactivation, which would otherwise
generate a voltage spike dangerous to semiconductor circuit components. Some automotive
relays include a diode inside the relay case. Alternatively, a contact protection network
consisting of a capacitor and resistor in series (snubbercircuit) may absorb the surge. If the coil is
designed to be energized with alternating current (AC), a small copper "shading ring" can be
crimped to the end of the solenoid, creating a small out-of-phase current which increases the
minimum pull on the armature during the AC cycle.[1]

APPLICATIONS

Relays are used wherever it is necessary to control a high power or high voltage circuit
with a low power circuit. The first application of relays was in long telegraph systems, where the
weak signal received at an intermediate station could control a contact, regenerating the signal
for further transmission. High-voltage or high-current devices can be controlled with small, low
voltage wiring and pilots switches. Operators can be isolated from the high voltage circuit. Low
power devices such as microprocessors can drive relays to control electrical loads beyond their
direct drive capability. In an automobile, a starter relay allows the high current of the cranking
motor to be controlled with small wiring and contacts in the ignition key.

Electromechanical switching systems including Strowger and Crossbar telephone


exchanges made extensive use of relays in ancillary control circuits. The Relay Automatic
Telephone Company also manufactured telephone exchanges based solely on relay switching
techniques designed by Gotthilf Ansgarius Betulander. The first public relay based telephone
exchange in the UK was installed in Fleetwood on 15 July 1922 and remained in service until
1959.

The use of relays for the logical control of complex switching systems like telephone
exchanges was studied by Claude Shannon, who formalized the application of Boolean
algebra to relay circuit design in A Symbolic Analysis of Relay and Switching Circuits. Relays
can perform the basic operations of Boolean combinatorial logic. For example, the boolean AND
function is realised by connecting normally open relay contacts in series, the OR function by
connecting normally open contacts in parallel. Inversion of a logical input can be done with a
normally-closed contact. Relays were used for control of automated systems for machine tools
and production lines. The Ladder programming language is often used for designing relay
logic networks.

Early electro-mechanical computers such as the ARRA, Harvard Mark II, Zuse Z2,


and Zuse Z3 relays for logic and working registers. However, electronic devices proved faster
and easier to use.

Because relays are much more resistant than semiconductors to nuclear radiation, they
are widely used in safety-critical logic, such as the control panels of radioactive waste-handling
machinery. Electromechanical protective relays are used to detect overload and other faults on
electrical lines by opening and closing circuit breakers.
SOFTWARE REQUIREMENTS
The Arduino Integrated Development Environment (Arduino IDE) is the free software
required to interact with your Arduino controller board, without the Arduino IDE you can’t
program your Arduino microcontroller to do cool stuff like control a cool robot car. Almost all
Arduino modules are compatible with this software that is an open source and is readily available
to install and start compiling the code on the go.

Choose a device to install the Arduino IDE software on, in the example below I’ll be
installing the software on a Desktop PC running Windows 7.

Introduction to Arduino IDE

 Arduino IDE is an open source software that is mainly used for writing and compiling the
code into the Arduino Module.
 It is an official Arduino software, making code compilation too easy that even a common
person with no prior technical knowledge can get their feet wet with the learning process.
 It is easily available for operating systems like MAC, Windows, Linux and runs on the
Java Platform that comes with inbuilt functions and commands that play a vital role for
debugging, editing and compiling the code in the environment.
 A range of Arduino modules available including Arduino Uno, Arduino Mega, Arduino
Leonardo, Arduino Micro and many more.
 Each of them contains a microcontroller on the board that is actually programmed and
accepts the information in the form of code.
 The main code, also known as a sketch, created on the IDE platform will ultimately
generate a Hex File which is then transferred and uploaded in the controller on the board.
 The IDE environment mainly contains two basic parts: Editor and Compiler where
former is used for writing the required code and later is used for compiling and uploading
the code into the given Arduino Module.
 This environment supports both C and C++ languages.
Go to the Arduino IDE Download webpage & download the relevant version for your
device. https://www.arduino.cc/en/Main/Software. The Arduino IDE software is available for
Windows, Mac and Linux operating systems.

Install the Arduino IDE Software

Install the Arduino IDE software by running the downloaded file and follow the
instructions. Installing the IDE software is like installing any software on a PC, lots of mouse
clicking.:
 This can take sometime and you’ll be presented with various drivers to install including
Arduino USB drivers and COM/LPT port drivers, I suggest you install them all.
 When complete the Arduino IDE Software is ready to run.

 Attach your Arduino Microcontroller board (I’m working with an Arduino UNO clone)
to your device with a USB cable.
 After connecting the Arduino UNO via USB to a Desktop PC, the power light on the
Arduino UNO will light up (the USB cable powers the UNO board, no need for a power
supply) and you should get a “Found New Hardware” message from Windows.
 Windows will attempt to install the Arduino Driver Software. Some Arduino tutorials
recommend canceling Windows automatically installing the Arduino driver software and
installing manually via the Device Manager. No idea why they recommend making the
process more difficult?
It took a while for Windows to install the driver for my UNO, but everything worked perfectly
first time and the Arduino UNO was installed on COM4.We are almost done.

Select the Correct COM Port

 Although Windows has successfully installed the Arduino on COM4 (could be COM3 or
another port) the Arduino IDE Software doesn’t automatically select the relevant serial
port.
 To select the correct port click “Tools”, hoverover ‘Port:”COM4 Arduino Genuino
UNO”‘ and click “COM4 Arduino Genuino UNO”.
 The check mark appearing in the circular button is used to verify the code. Click this
once you have written your code.
 The arrow key will upload and transfer the required code to the Arduino board.
 The dotted paper is used for creating a new file.
 The upward arrow is reserved for opening an existing Arduino project.
 The downward arrow is used to save the current running code.
 The button appearing on the top right corner is a Serial Monitor – A separate pop-up
window that acts as an independent terminal and plays a vital role for sending and
receiving the Serial Data. You can also go to the Tools panel and select Serial Monitor, or
pressing Ctrl+Shift+M all at once will open it instantly. The Serial Monitor will actually
help to debug the written Sketches where you can get a hold of how your program is
operating. Your Arduino Module should be connected to your computer by USB cable in
order to activate the Serial Monitor.
 You need to select the baud rate of the Arduino Board you are using right now. For my
Arduino Uno Baud Rate is 9600, as you write the following code and click the Serial
Monitor, the output will show as the image below.

 That’s it, you’ve successfully installed the Arduino IDE Software. Feel free to confirm
everything is setup correctly by going to “Tools” > “Get Board Info”.

It is important to note that the recent Arduino Modules will reset automatically as you
compile and press the upload button the IDE software, however, older version may require the
physical reset on the board.

Once you upload the code, TX and RX LEDs will blink on the board, indicating the desired
program is running successfully.
CONCLUSION

The proposed Home Automation System enhances mobility and supports monitoring and
control of devices from any remote location within Wi-Fi range. Being a simple and user friendly
application it serves as an application of great help to the old aged or physically disabled people.
Thus, the Internet of Things based Home Automation System is better than all traditional
existing Home Automation Systems.

APPLICATIONS

 In Industry, for controlling various operation equipments, machinary, factory operations,


etc. Automatically using contol system. In industry automation system we use to control
automated mining system, automated waste management system.
 For Militry, The IOT system used in War field to know about the status of enemies
around the area.
 In Home, We use this project to controlling home appliances, for eg. TV, Fan or any type
of electrical appliances.

SCOPE OF FUTURE ENHANCEMENT

 This application can be further developed into system with the following enhancements:
 Bill functionality can be added to the home automation system which can predict bill of
any selected period.
 Gas leakage and light dimming functionality can also be added in near future.
REFERENCES

1. Shrikanthan N. Tan F Karande A., “Bluetooth Based Home Automation” , Microprocessors


Micro sysytems, Elsevier Science, B.V. vol.26,no.6, pp281-289,(2009)

2. Piyare R., Tazil M., “Bluetooth based Home automation system using Cell Phone”. Consumer
Electronics, IEEE 15th International Symposium on, vol.45, no.3, pp.192-195(2011).

3. EASAMBATTU, Thejaswini; REDDY, P. Ajay Kumar; RAMAIAH, G.N. Kodanda.


Controlling home appliances through GSM modem and Internet. International journal of
Electronics Engineering Research, [S.I.], p. 1-7, oct 2013.

4. P. Magrassi, T. Berg, “A World of Smart Objects”, Gartner research report R-17-2243,12


August 2002.

5. White Paper: “Internet of Things Strategic Research Roadmap”, Antoine de Saint-Exupery, 15


sep 2009.

6. Souza, Alberto M.C. Amazonas, Jose R.A. “A Novel Smart Home Application Using an
Internet of Things Middleware”, Proceedings of 2013 European Conference on Smart Objects,
Systems and Technologies (SmartSysTech), pp. 1 – 7, June 2013.

7. Perumal, T, Ramli, A.R, Chui Yew Leong, “Design and implementation of SOAP based
residential management for smart home systems”, IEEE Transactions on

8. Ming Wang, Guiqing Zhang, Chenghui Zhang, Jianbin Zhang, Chengdong Li. “An IoT-based
appliance control system for smart homes”, Fourth International

9. Conference on Intelligent Control and Information Processing (ICICIP), pp. 744 – 747, June
2013.

10. Yepeng Ni, Fang Miao, Jianbo Liu, Jianping Chai. “Implementation of Wireless Gateway for
Smart Home”, Communications and Network, pp. 16-20,2013.
11. Kelly, S.D.T., Suryadevara, N.K.; Mukhopadhyay, S.C. “Towards the Implementation of IoT
for Environmental Condition Monitoring in Homes”, Sensors Journal, IEEE, Volume: 13, pp-
3846 – 3853, May 2013.

You might also like