You are on page 1of 52

Google Voice & Internet Based Robotic Water Sprinkler System

We live in an exciting time where more and more everyday items


“things” are becoming smart! “Things” have sensors and can
communicate to other “things” and can provide control to more “things”.
The Internet of Things, IoT, is upon us in a huge way and people are
rapidly inventing new gadgets that enhance our lives. The price of
microcontrollers with the ability to talk over a network keeps dropping
and developers can now tinker and build things inexpensively.

In this project we will develop and automated system for Water


system using Google Voice & Internet. Here we will switch this sprinkler
Smart Phone Interface using Bluetooth Connectivity. We will use a
Microcontroller As Phone Interface with system. We will put instruction
from our phone using Google Voice to switch a relay connected to pump.
As we switch ON, pump will start sprinkling with the help of relay
connected to it. Accordingly it can be switched off. System can be
operated using Google voice as well as text if internet is not available.
System and phone will be connected using Bluetooth Wireless.

Whole setup will be a movable robotic design. This robotic design will
be controlled wirelessly by Bluetooth and its operation (Forward /
Backward /Left / Right / Stop) will be directly controlled by user using
smart phone and android. Water sprinkling on the robot will be having a
manual valve which can control water flow as required. Whole System
operation will be controlled by user’s smartphone using Google Voice /
text. For Google Voice Application, Internet is mandatory.
INTRODUCTION:

Sprinkler robots are playing an important function inside the agriculture area
as it does now not require extra people to perform and might shop lots of
charges and time for watering vegetation each day. Hence, this mission is all
approximately developing a sprinkler robot which is supplied with solar
electricity. The boundaries of water sources and global population growth has
led states and governments global to boom agricultural merchandise
consistent with unit and optimize soil and water sources productiveness with
the use of new irrigation methods. India is agrarian economies and most of
rural populations rely on agriculture to earn their livelihood. The farming
methods at present are guide or semi-automated with excessive involvement
of employees. In the latest years, the number of hard work availability is
decreasing constantly along with growth of their wages. There is a
requirement of higher productiveness. Hence the tool is to be designed which
allows farmers to overcome the said problem. This robotic can offer us the
answer. The essential application of robots in the business zone has been
concerned with the substitution of manual human hard work via robots or
mechanized systems to make the work more time green, accurate, uniform
and much less costly. The farmer’s benefits are found in greater green
preservation of the plants and both less work for themselves or a reduced
need for the employment of others. This challenge presents the design and
creation of an self-sustaining robot that seeks to address some of the human
health worries associated with farms. This robot is designed as a base for
growing systems to enable the automation of farming techniques such as the
spraying of water, cattle watering, irrigation and metropolis water deliver.
Major Electronic Components Used

 Power Supply System


 Microcontroller
 Motor Driver
 Relay
 Bluetooth
 Pump
 DC Motor

Power Supply Circuit

Power supply is the circuit from which we get a desired dc voltage


to run the other circuits. The voltage we get from the main line is 230V
AC but the other components of our circuit require 5V DC. Hence a step-
down transformer is used to get 12V AC which is later converted to 12V
DC using a rectifier. The output of rectifier still contains some ripples even
though it is a DC signal due to which it is called as Pulsating DC. To remove
the ripples and obtain smoothed DC power filter circuits are used. Here a
capacitor is used. The 12V DC is rated down to 5V using a positive voltage
regulator chip 7805. Thus a fixed DC voltage of 5V is obtained.

A 5V regulated supply is taken as followed:


Each of the blocks is described in more detail below:

 Transformer - steps down high voltage AC mains to low voltage AC.


 Rectifier - converts AC to DC, but the DC output is varying.
 Smoothing - smoothes the DC from varying greatly to a small ripple.
 Regulator - eliminates ripple by setting DC output to a fixed voltage.

TRANSFORMER

Transformer is the electrical device that converts one voltage to another


with little loss of power. Transformers work only with AC. There are two
types of transformers as Step-up and Step-down transformer. Step-up
transformers increase voltage, step-down transformers reduce voltage.
Most power supplies use a step-down transformer to reduce the
dangerously high mains voltage to a safer low voltage. Here a step down
transformer is used to get 12V AC from the supply i.e. 230V AC.

RECTIFIERS

A rectifier is a circuit that converts AC signals to DC. A rectifier circuit is


made using diodes. There are two types of rectifier circuits as Half-wave
rectifier and Full-wave rectifier depending upon the DC signal generated.
Half-wave Rectifier: It is the rectifier circuit that rectifies only half part of
the AC signal. It uses only a single diode. It only uses only positive part of
the AC signal to produce half-wave
varying DC and produce gaps
when the AC is negative.

Full-wave Rectifier: It is also called as Rectifier. A center tap rectifier can


be made using two individual diodes. It is called a full-wave rectifier
because it uses the total AC wave (both positive and negative sections).
SMOOTHING
Smoothing is performed by a large value electrolytic capacitor connected
across the DC supply to act as a reservoir, supplying current to the output
when the varying DC voltage from the rectifier is falling. The diagram
shows the unsmoothed varying DC (dotted line) and the smoothed DC
(solid line). The capacitor charges quickly near the peak of the varying DC,
and then discharges as it supplies current to the output. Here a capacitor
of 330uF is used as a smoothing circuit.

VOLTAGE REGULATION

Voltage regulators produce fixed DC output voltage from variable DC (a


small amount of AC on it). Normally we get fixed output by connecting the
voltage regulator at the output of the filtered DC. It can also used in
circuits to get a low DC voltage from a high DC voltage (for example we
use 7805 to get 5V from 12V). There are two types of voltage regulators

1. fixed voltage regulators (78xx,79xx)

2. Variable voltage regulators (LM317)

In fixed voltage regulators there is another classification

1. Positive voltage regulators

2. Negative voltage regulators

POSITIVE VOLTAGE REGULATORS:


This includes 78xx voltage regulators. The most commonly used ones are
7805 and 7812. 7805 gives fixed 5V DC voltage if input voltage is in (7.5V-
20). You may sometimes have questions like, what happens if input
voltage is <7.5 V or some 3V, the answer is that regulation won't be
proper. Suppose if input is 6V then output may be 5V or 4.8V, but there
are some parameters for the voltage regulators like maximum output
current capability, line regulation etc. won't be proper. Remember that
electronics components should be used in the proper voltage and current
ratings as specified in datasheet. You can work without following it, but
you won't be able to get some parameters of the component.

NEGATIVE VOLTAGE REGULATORS:


Mostly available negative voltage regulators are of 79xx family. The mainly
available 79xx IC's are 7905,7912 1.5A output current, short circuit
protection, ripple rejection are the other features of 79xx IC's.

Many of the fixed voltage regulators have 3 leads and look like power
transistors, such as the 7805 (+5V 1A) regulator shown on the above. If
adequate heat sinking is provided then it can deliver up to maximum 1A
current. For an output voltage of 5v-18v the maximum input voltage is 35v
and for an output voltage of 24V the maximum input voltage is 40V.For
7805 IC, for an input of 10v the minimum output voltage is 4.8V and the
maximum output voltage is 5.2V. The typical dropout voltage is 2V.

ELECTRONIC COMPONENTS
Electronics are the central nervous system of your robot and will be
responsible for passing information to and from peripheral functions as
well as processing inputs and turning them into the output functions the
robot performs. Any given hobby robot project might contain a dozen or
more electronic components of varying types, including resistors,
capacitors, integrated circuits, and light-emitting diodes. In this chapter,
you’ll read about the components commonly found in hobby robot
projects and their many specific varieties. You’ll also learn their functions
and how they are used.

1.Cram Course in Electrical Theory

Understanding basic electronics is a keystone to being able to design


and build your own robots. The knowledge required is not all that difficult
—in fact the basic theories with diagrams can fit on two sheets of paper
(following) which you are encouraged to photocopy and hang up as a quick
reference.

Electricity always travels in a circle, or circuit, like the one in Fig. 5-1.
If the circuit is broken, or opened, then the electricity flow stops and the
circuit stops working.

Electricity consists of electrons, which are easily moved from the


atoms of metal conductors. There are two components of electricity that
can be measured. Voltage is the pressure applied to the electrons to force
them to move through the metal wires as well as the
FIGURE 1-1 Electricity flows in a circle, or circuit, from positive (+) to
negative. If the circuit is broken (as when the switch is open), electricity
stops flowing and the circuit stops working.

FIGURE 1-2 A digital multimeter can be used to measure the voltage across
a component as well as the current through it.
FIGURE 5-4 When resistors are wired in series, the total resistance of the
circuit is proportional to the sum of the resistances.
different components in the circuit. As the electrons pass through a
component they lose some of the pressure, just as water loses pressure
due to friction when it moves through a pipe. The initial voltage applied to
the electrons is measured with a volt meter or a multimeter set to measure
voltage and is equal to the voltage drops through components in the
circuit. The label given to voltage is V.

The second measurement that can be applied to electricity is


current, which is the number of electrons passing by a point in a given
time. There are literally several billion, billion, billion, billion, billion, billion
electrons flowing past a point at a given time. For convenience, the unit
Coulomb (C) was specified, which is 6.25 × 1018 electrons and is the basis
for the ampere (A), which is the number of electrons moving past a point
every second. The label given to current is the non-intuitive i.

The voltage across a component and the current through it can be


measured using a digital multimeter as shown in Fig. 5-2. It is important to
remember that voltage is the pressure change across a component, so to
measure it you have to put a test lead on either side of the component.
Current is the volume of electrons moving past a certain point every
second, and to measure it, the circuit must be broken and the tester put in
line, or in series,with the component being measured.
The current flowing through a component can be calculated if the
voltage change, or drop, is known along with the resistance of the
component using Ohm’s law. This law states that the voltage drop across a
resistance is equal to the product of the resistance value and the current
flowing through it. Put mathematically, Ohm’s law is:

V=i×R

Where V is voltage across the component measured in volts, i is the


current through the component measured in amperes or amps, and R is
the resistance measured in ohms,which has the symbol Ω. Using algebra,
when any two of the three values are known, the third can be calculated. If
you are not comfortable using algebra to find the missing value, you can
use Ohm’s law triangle (Fig. 1-3). This tool is quite simple to use. Just place
your finger over the value you want to find, and the remaining two values
along with how they are located relative to one another shows you the
calculation that you must do to find the missing value. For the example in
Fig. 1-3, to find the formula to calculate current, put your finger over i and
the resulting two values V over R is the formula for finding i (divide the
voltage drop by the resistance of the component).

Resistances can be combined, which changes the electrical


parameters of the entire circuit. For example, in Fig. 1-4 a resistance is
shown placed in line or in series and the total resistance is the sum of the
resistances. Along with this, the voltage drop across each resistor is
proportional to the value of the individual resistors relative to the total
resistance of the circuit. The ratio of voltages in a series circuit can be used
to produce a fractional value of the total voltage applied to a circuit. Fig. 5-
5 shows a voltage divider, which is built from two series resistors and
outputs a lower voltage than was input into the circuit. It is important to
remember that this circuit cannot source (provide) any current—any
current draw will increase the voltage drop through the top resistor and
lower the voltage of the output. Finally, resistances can be wired parallel to
one another as in Fig. 5-6. In this case, the total resistance drops and the
voltage stays constant across each resistor (increasing the total amount of
current flowing through the circuit). It is important to remember that the
equivalent resistance will always be less than the value of the lowest
resistance. The general case formula given in Fig. 5-6 probably seems very
cumbersome but is quite elegant when applied to two resistors in parallel.
The equivalent resistance is calculated using:

Requivalent = (R1 × R2) / (R1 + R2)

Whew! This is all there is to it with regards to basic electronics. The


diagrams have all been placed in the following to allow you to photocopy
them, study while you have a free moment, and pin up over your
workbench so you always have them handy.

2.Fixed Resistors

A fixed resistor supplies a predetermined resistance to a circuit. The


standard unit of value of a resistor is the ohm (with units in volts per
ampere, according to Ohm’s law), represented by the symbol Ω. The higher
the ohm value, the more resistance the component provides to the circuit.
The value on most fixed resistors is identified by color coding, as shown in
Fig. 5-7. The color coding starts near the edge of the resistor and comprise
four, five, and sometimes six bands of different colors. Most off-the-shelf
resistors for hobby projects use standard four-band color coding. The
values of each band are listed in Table 5-2,and the formula for determining
the resistance from the bands is:
If you are not sure what the resistance is for a particular resistor, use a
digital multimeter to check it. Position the test leads on either end of the
resistor. If the meter is not auto ranging, start at a high range and work
down. Be sure you don’t touch the test leads or the leads of the resistor; if
you do, you’ll add the natural resistance of your own body to the reading.
Resistors are also rated by their wattage. The wattage of a resistor indicates
the amount of power it can safely dissipate. Resistors used in high-load
applications, like motor control, require higher wattages than those used in
low-current applications. The majority of resis tors you’ll use for hobby
electronics will be rated at
1⁄4 or even 1⁄8 of awatt. The wattage of a resistor is not marked on the body
of the component; instead, you must infer it from the size of the resistor.

3.Variable Resistors

Variable resistors let you dial in a specific resistance. The actual


range of resistance is determined by the upward value of the
potentiometer. Potentiometers are thus marked with this upward value,
such as 10K, 50K, 100K, 1M, and so forth. For example, a 50K
potentiometer will let you dial in any resistance from 0 to 50,000 ohms.
Note that the range is approximate only.

Potentiometers are of either the dial or slide type, as shown in Fig. 5-8. The
dial type is the most familiar and is used in such applications as television
volume controls and electric blanket thermostat controls. The rotation of
the dial is nearly 360°, depending on which potentiometer you use. In one
extreme, the resistance through the potentiometer (or pot) is zero; in the
other extreme, the resistance is the maximum value of the component.

Some projects require precision potentiometers. These are referred


to as multi-turn pots or trimmers. Instead of turning the dial one complete
rotation to change the resistance from, say, 0 to 10,000 ohms, a multi-turn
pot requires you to rotate the knob 3, 5, 10, even 15 times to span the
same range. Most are designed to be mounted directly on the printed
circuit board. If you have to adjust them, you will need a screwdriver or
plastic tool.

4.Capacitors

After resistors, capacitors are the second most common component


found in the averageelectronic project. Capacitors serve many purposes.
They can be used to remove traces of transient (changing) current ripple in
a power supply, to delay the action of some portion of the circuit, or to
perform an integration or differentiation of a repeating signal. All these
applications depend on the ability of the capacitor to hold an electrical
charge for a predetermined time.

Capacitors come in many more sizes, shapes, and varieties than


resistors, though only a small handful are truly common. However, most
capacitors are made of the same basic stuff: a pair of conductive elements
separated by an insulating dielectric (see Fig. 5-9). This dielectric can be
composed of many materials, including air (in the case of a variable
capacitor, as detailed in the next section), paper, epoxy, plastic, and even
oil. Most capacitors actually have

many layers of conducting elements and dielectric. When you select a


capacitor for a particular job, you must generally also indicate the type,
such as ceramic, mica, or Mylar.

Capacitors are rated by their capacitance, in farads, and by the


breakdown voltage of their dielectric. The farad is a rather large unit of
measurement, so the bulk of capacitors available today are rated in
microfarads, or a millionth of a farad. An even smaller rating is the Pico
farad, or a millionth of a millionth of a farad. The micro in the term
microfarad is most often represented by the Greek mu (µ) character, as in
10 µF. The Pico farad is simply shortened to pF. The voltage rating is the
highest voltage the capacitor can withstand before the dielectric layers in
the component are damaged.

For the most part, capacitors are classified by the dielectric material
they use. The most common dielectric materials are aluminum electrolytic,
tantalum electrolytic, ceramic, mica, polypropylene, polyester (or Mylar),
paper, and polystyrene. The dielectric material used in a capacitor partly
determines which applications it should be used for. The larger electrolytic
capacitors, which use an aluminum electrolyte, are suited for such chores
as power supply filtering, where large values are needed. The values for
many capacitors are printed directly on the component. This is especially
true with the larger aluminum electrolytic, where the large size of the
capacitor provides ample room for printing the capacitance and voltage.
Smaller capacitors, such as 0.1 or 0.01 µF mica disc capacitors, use a
common three-digit marking system to denote capacitance and tolerance.
The numbering system is easy to use, if you remember it’s based on Pico
farads, not microfarads. A number such as 104 means 10, followed by four
zeros, as in 100,000 or 100,000 Pico farads. Values over 1000 Pico farads
are most often stated in microfarads. To make the conversion, move the
decimal point to the left six spaces: 0.1 µF. Note that values under 1000
Pico farads do not use this numbering system. Instead, the actual value, in
Pico farads, is listed, such as 10 (for 10 pF).

One mark you will find almost exclusively on larger tantalum and
aluminum electrolytic is a polarity symbol, most often a minus (−) sign. The
polarity symbol indicates the positive and/or negative lead of a capacitor. If
a capacitor is polarized, it is extremely important that you follow the
proper orientation when you install the capacitor in the circuit. If you
reverse the leads to the capacitor—connecting the positive lead (called the
anode) to the ground rail instead of the negative lead (called the cathode),
for example—the capacitor may be ruined. Other components in the circuit
could also be damaged. Fig. 5-10 shows some different capacitor packages
along with their polarity markings.

5.Diodes

The diode is the simplest form of semiconductor. It is available in


two basic flavors, germanium and silicon, which indicates the material used
to manufacture the active junction within the diode. Diodes are used in a
variety of applications, and there are numerous subtypes. Here is a list of
the most common.

• Rectifier. The average diode, it rectifies AC current to provide DC


only.

• Zener. It limits voltage to a predetermined level. Zeners are used for low-
cost voltage regulation.

• Light-emitting. These diodes emit infrared of visible light when


current is applied.

• Silicon-controlled rectifier (SCR). This is a type of high-power switch used


to control AC or DC currents.

• Bridge rectifier. This is a collection of four diodes strung together in


sequence; it is used to rectify an incoming AC current.

Diodes carry two important ratings: peak inverse voltage (PIV) and
current. The PIV rating roughly indicates the maximum working voltage for
the diode. Similarly, the current rating is the maximum amount of current
the diode can withstand. Assuming a diode is rated for 3 amps, it cannot
safely conduct more than 3 amps without overheating and failing. All
diodes have positive and negative terminals (polarity). The positive
terminal is the anode, and the negative terminal is the cathode. You can
readily identify the cathode end of a diode by looking for a colored stripe
near one of the leads. Fig. 5-11 shows a diode that has a stripe at the
cathode end. Note how the stripe corresponds with the heavy line in the
schematic symbol for the diode.

All diodes emit light when current passes through them. This light is
generally only in the infrared region of the electromagnetic spectrum. The
light-emitting diode (LED) is a special type of semiconductor that is
expressly designed to emit light in human visible wavelengths. LEDs are
available to produce any of the basic colors (red, yellow, green, blue, or
white) oflight as well as infrared. The infrared LEDs are especially useful in
robots for a variety of different applications.

LEDs carry the same specifications as any other diode. The LED has a
PIV rating of about 100 to 150 V, with a maximum current rating of under
40 mA (usually only 5 to 10 mA is applied to the LED). Most LEDs are used
in low-power DC circuits and are powered with 12 V or less. Even though
this voltage is far below the PIV rating of the LED, the component can still
be ruthlessly damaged if you expose it to currents exceeding 40 or 50 mA.
A resistor is used to limit the current to the LED.

6.Transistors

Transistors were designed as an alternative to the old vacuum tube,


and they are used in similar applications, either to amplify a signal by
providing a current control or to switch a signal on and off. There are
several thousand different transistors available. Besides amplifying or
switching a current, transistors are divided into two broad categories:

• Signal. These transistors are used with relatively low-current circuits, like
radios, telephones, and most other hobby electronics projects.

• Power. These transistors are used with high-current circuits, like motor
drivers and power supplies.

You can usually tell the difference between the two merely by size.
The signal transistor is rarely larger than a pea and uses slender wire leads.
The power transistor uses a large metal case to help dissipate heat, and
heavy spoke like leads.

Transistors are identified by a unique code, such as 2N2222 or


MPS6519. Refer to a data book to ascertain the characteristics and ratings
of the particular transistor you are interested in. Transistors are rated by a
number of criteria, which are far too extensive for the scope of this book.
These ratings include collector-to-base voltage, collector-to-emitter
voltage, maximum collector current, maximum device dissipation, and
maximum operating frequency. None of these ratings are printed directly
on the transistor.

Signal transistors are available in either plastic or metal cases. The


plastic kind is suitable for most uses, but some precision applications
require the metal variety. Transistors that use metal cases (or cans) are less
susceptible to stray radio frequency interference and they also dissipate
heat more readily.

You will probably be using NPN (Fig. 5-12) and PNP (Fig. 5-13) bipolar
transistors. These transistors are turned on and off by a control current
passing through the base. The current that can pass through the collector
is the product of the base current and the constant hFE, which is unique to
each transistor.

Bipolar transistors can control the operation and direction of DC


motors using fairly simple circuits. Fig. 5-14 shows a simple circuit that will
turn a motor on and off using a single NPN bipolar transistor and a diode.
When the current passing through coils of a magnetic device changes, the
voltage across the device also changes, often in the form of a large spike
called kickback. These spikes can be a hundred volts or so and can very
easily damage the electronic devices they are connected to. By placing a
diode across the motor as shown in Fig. 5-15, the spikes produced when
the motor is shut off will be shunted through the diode and will not pass
along high voltages to the rest of the electronics in the circuit.

The circuit shown in Fig. 5-15 is known as an H-bridge because


without the shunt diodes the circuit looks like the letter H. This circuit
allows current to pass in either direction through a motor, allowing it to
turn in either direction. The motor turns when one of the two connections
is made to +V. Both connections can never be connected to +V as this will
turn on all the transistors, providing a very low resistance path for current
from +V, potentially burning out the driver transistors.

Along with bipolar transistors, which are controlled by current, there are a
number of other transistors, some of which are controlled by voltage. For
example, the MOSFET (for metal-oxide semiconductor field-effect
transistor) is often used in circuits that demand high current and high
tolerance. MOSFET transistors don’t use the standard base-emitter
collector connections. Instead, they call them gate, drain, and source. The
operational differences among the different transistors will become clearer
as you become more experienced in creating electronic circuits.
7.Grounding Circuitry

When wiring electronic circuits, it is useful to have a large common


negative voltage connection or ground built into the robot. This connection
is normally thought of as being an earth ground and is the basic reference
for all the components in the circuit. Having a common ground also
simplifies the task of drawing schematics; instead of wiring all the negative
connections to the negative power supply, all the negative connections are
wired to the three bars symbol shown in Fig. 5-16.

Positive voltages are normally indicated with an arrow pointing


upward and the label of the positive voltage to be used. These conventions
will be used throughout this book.

8.Integrated Circuits

The integrated circuit forms the backbone of the electronics


revolution. The typical integrated circuit comprises many transistors,
diodes, resistors, and even capacitors. As its name implies, the integrated
circuit, or IC, is a discrete and wholly functioning circuit in its own right. ICs
are the building blocks of larger circuits. By merely stringing them together
you can form just about any project you envision.

Integrated circuits are most often enclosed in dual in-line packages


(DIPs), like the one shown in Fig. 5-17. This type of component has a
number of pins that can be inserted into holes of a printed circuit board
and is also known as a pin through hole (PTH) component. There are
numerous types of packages and methods of attaching chips to PCBs but
beginners should be working with just PTH DIPs.

As with transistors, ICs are identified by a unique code, such as 7400


or 4017. This code indicates the type of device. You can use this code to
look up the specifications and parameters of the IC in a reference book.
Many ICs also contain other written information, including manufacturer
catalog number and date code. Do not confuse the date code or catalog
number with the code used to identify the device.

9.Schematics and Electronic Symbols

Electronics use a specialized road map to indicate what components


are in a device and how they are connected together. This pictorial road
map is the schematic, a kind of blueprint of everything you need to know
to build an electronic circuit. Schematics are composed of special symbols
that are connected with intersecting lines. The symbols represent
individual components, and the lines represent the wires that connect
these components together. The language of schematics, while far from
universal, is intended to enable most anyone to duplicate the construction
of a circuit with little more information than a picture.

The experienced electronics experimenter knows how to read a


schematic. This entails recognizing and understanding the symbols used to
represent electronic components and how these components are
connected. All in all, learning to read a schematic is not difficult. Fig. 5-18
shows many of the most common symbols.

MICROCONTROLLER

Microcontroller can be termed as a system on chip computer which includes number of


peripherals like RAM, EEPROM, Timers etc., required to perform some predefined task.
Does this mean that the microcontroller is another name for a computer…? The answer is
NO!
The computer on one hand is designed to perform all the general purpose tasks on a
single machine like you can use a computer to run a software to perform calculations or
you can use a computer to store some multimedia file or to access internet through the
browser, whereas the microcontrollers are meant to perform only the specific tasks, for
e.g., switching the AC off automatically when room temperature drops to a certain
defined limit and again turning it ON when temperature rises above the defined limit.
There are number of popular families of microcontrollers which are used in different
applications as per their capability and feasibility to perform the desired task, most
common of these are 8051, AVR and PIC microcontrollers. In this article we will
introduce you with AVR family of microcontrollers.
History of AVR
AVR was developed in the year 1996 by Atmel Corporation. The architecture of AVR was
developed by Alf-EgilBogen and VegardWollan. AVR derives its name from its
developers and stands for Alf-EgilBogen VegardWollan RISC microcontroller, also
known as Advanced Virtual RISC. The AT90S8515 was the first microcontroller which
was based on AVR architecture however the first microcontroller to hit the commercial
market was AT90S1200 in the year 1997.
AVR microcontrollers are available in three categories:
1. Tiny AVR – Less memory, small size, suitable only for simpler applications
2. Mega AVR – These are the most popular ones having good amount of memory (up to
256 KB), higher number of inbuilt peripherals and suitable for moderate to complex
applications.
3. Xmega AVR – Used commercially for complex applications, which require large
program memory and high speed.
The following table compares the above mentioned AVR series of microcontrollers:

Series Pins Flash Special


Name Memory Feature
TinyAVR 6-32 0.5-8 KB Small in
size
MegaAVR 28-100 4-256KB Extended
peripherals
XmegaAVR 44-100 16- DMA ,
384KB Event
System
included

What’s special about AVR?

They are fast: AVR microcontroller executes most of the instructions in single execution
cycle. AVRs are about 4 times faster than PICs; they consume less power and can be
operated in different power saving modes. Let’s do the comparison between the three
most commonly used families of microcontrollers.
8051 PIC AVR

SPEED Slow Moderate Fast


MEMORY Small Large Large
ARCHITECTURE CISC RISC RISC
ADC Not Inbuilt Inbuilt
Present
Timers Inbuilt Inbuilt Inbuilt
PWM Channels Not Inbuilt Inbuilt
Present

AVR is an 8-bit microcontroller belonging to the family of Reduced Instruction Set


Computer (RISC). In RISC architecture the instruction set of the computer are not only
fewer in number but also simpler and faster in operation. The other type of categorization
is CISC (Complex Instruction Set Computers). We will explore more on this when we
will learn about the architecture of AVR microcontrollers in following section.

Let’s see what this entire means. What is 8-bit? This means that the microcontroller is
capable of transmitting and receiving 8-bit data. The input/output registers available are
of 8-bits. The AVR families controllers have register based architecture which means that
both the operands for an operation are stored in a register and the result of the operation is
also stored in a register. Following figure shows a simple example performing OR
operation between two input registers and storing the value in Output Register.
The CPU takes values from two input registers INPUT-1 and INPUT-2, performs the
logical operation and stores the value into the OUTPUT register. All this happens in 1
execution cycle.

In our journey with the AVR we will be working on Atmega16 microcontroller, which is
a 40-pin IC and belongs to the mega AVR category of AVR family. Some of the features
of Atmega16 are:

· 16KB of Flash memory


· 1KB of SRAM
· 512 Bytes of EEPROM
· Available in 40-Pin DIP
· 8-Channel 10-bit ADC
· Two 8-bit Timers/Counters
· One 16-bit Timer/Counter
· 4 PWM Channels
· In System Programmer (ISP)
· Serial USART
· SPI Interface
· Digital to Analog Comparator.

Architecture of AVR

The AVR microcontrollers are based on the advanced RISC architecture and consist of 32
x 8-bit general purpose working registers. Within one single clock cycle, AVR can take
inputs from two general purpose registers and put them to ALU for carrying out the
requested operation, and transfer back the result to an arbitrary register. The ALU can
perform arithmetic as well as logical operations over the inputs from the register or
between the register and a constant. Single register operations like taking a complement
can also be executed in ALU. We can see that AVR does not have any register like
accumulator as in 8051 family of microcontrollers; the operations can be performed
between any of the registers and can be stored in either of them.

AVR follows Harvard Architecture format in which the processor is equipped with
separate memories and buses for Program and the Data information. Here while an
instruction is being executed, the next instruction is pre-fetched from the program
memory.

Since AVR can perform single cycle execution, it means that AVR can execute 1 million
instructions per second if cycle frequency is 1MHz. The higher is the operating frequency
of the controller, the higher will be its processing speed. We need to optimize the power
consumption with processing speed and hence need to select the operating frequency
accordingly.

There are two flavors for Atmega16 microcontroller:


1. Atmega16:- Operating frequency range is 0 – 16 MHz
2. Atmega16L:- Operating frequency range is 0 – 8 MHz
If we are using a crystal of 8 MHz = 8 x 106 Hertz = 8 Million cycles, then AVR can
execute 8 million instructions.

Naming Convention.!
The AT refers to Atmel the manufacturer, Mega means that the microcontroller belong to
Mega AVR category, 16 signifies the memory of the controller, which is 16KB.

Architecture Diagram: Atmega16


Following points explain the building blocks of Atmega16 architecture:
· I/O Ports: Atmega16 has four (PORTA, PORTB, PORTC and PORTD) 8-bit input-
output ports.

· Internal Calibrated Oscillator: Atmega16 is equipped with an internal oscillator for


driving its clock. By default Atmega16 is set to operate at internal calibrated oscillator of
1 MHz The maximum frequency of internal oscillator is 8Mhz. Alternatively, ATmega16
can be operated using an external crystal oscillator with a maximum frequency of
16MHz. In this case you need to modify the fuse bits. (Fuse Bits will be explained in a
separate tutorial).

. ADC Interface: Atmega16 is equipped with an 8 channel ADC (Analog to Digital


Converter) with a resolution of 10-bits. ADC reads the analog input for e.g., a sensor
input and converts it into digital information which is understandable by the
microcontroller.
·Timers/Counters: Atmega16 consists of two 8-bit and one 16-bit timer/counter. Timers
are useful for generating precision actions for e.g., creating time delays between two
operations.
·Watchdog Timer: Watchdog timer is present with internal oscillator. Watchdog timer
continuously monitors and resets the controller if the code gets stuck at any execution
action for more than a defined time interval.
· Interrupts: Atmega16 consists of 21 interrupt sources out of which four are external.
The remaining are internal interrupts which support the peripherals like USART, ADC,
and Timers etc.
.USART: Universal Synchronous and Asynchronous Receiver and Transmitter interface
is available for interfacing with external device capable of communicating serially (data
transmission bit by bit).
·General Purpose Registers: Atmega16 is equipped with 32 general purpose registers
which are coupled directly with the Arithmetic Logical Unit (ALU) of CPU.
· ISP: AVR family of controllers have In System Programmable Flash Memory which
can be programmed without removing the IC from the circuit, ISP allows to reprogram
the controller while it is in the application circuit.

.DAC: Atmega16 is also equipped with a Digital to Analog Converter (DAC) interface
which can be used for reverse action performed by ADC. DAC can be used when there is
a need of converting a digital signal to analog signal.

. Memory: Atmega16 consist of three different memory sections:


1. Flash EEPROM: Flash EEPROM or simple flash memory is used to store the
program dumped or burnt by the user on to the microcontroller. It can be easily erased
electrically as a single unit. Flash memory is non-volatile i.e., it retains the program even
if the power is cut-off. Atmega16 is available with 16KB of in system programmable
Flash EEPROM.
2. Byte Addressable EEPROM: This is also a nonvolatile memory used to store data
like values of certain variables. Atmega16 has 512 bytes of EEPROM; this memory can
be useful for storing the lock code if we are designing an application like electronic door
lock.
3. SRAM: Static Random Access Memory, this is the volatile memory of
microcontroller i.e., data is lost as soon as power is turned off. Atmega16 is equipped
with 1KB of internal SRAM. A small portion of SRAM is set aside for general purpose
registers used by CPU and some for the peripheral subsystems of the microcontroller.
· SPI: Serial Peripheral Interface, SPI port is used for serial communication between
two devices on a common clock source. The data transmission rate of SPI is more than
that of USART.

· TWI: Two Wire Interface (TWI) can be used to set up a network of devices, many
devices can be connected over TWI interface forming a network, the devices can
simultaneously transmit and receive and have their own unique address.

PIN DIAGRAM :

MOTOR DRIVER
Whenever we are talking about driving a motor through the outputs of our
microcontroller, it is not easy to do that work. This is so because our motors
specification tells to drive it on 12v dc but our microcontroller can give a max of 5v. So
to drive a motor we need some drivers which can amplify the 5v voltage to 12v. . These
days many IC manufacturers have H‐bridge motor driver available in the market like
L293D is most used H‐ Bridge driver IC. H‐bridge can also be made with the help of
transistors and MOSFETs etc. rather of being cheap, they only increase the size of the
design board, which is sometimes not required so using a small 16 pin IC is preferred
for this purpose. The driver which we are using here to drive the motor is an IC L293D.

WORKING THEORY OF H‐BRIDGE

The name "H‐Bridge" is derived from the actual shape of the switching circuit
which controls the motion of the motor. It is also known as "Full Bridge". Basically
there are four switching elements in the H‐Bridge as shown in the figure below.

As you can see in the figure above there are four


switching elements named as "High side left",
"High side right", "Low side right", "Low side
left". When these switches are turned on in pairs
motor changes its direction accordingly. Like, if
we switch on High side left and Low side right
then motor rotate in forward direction, as
current flows from P\power supply through the
motor coil goes to ground via switch low side
right. This is shown in the figure below.
Similarly, when you switch on low
side left and high side right, the
current flows in opposite direction
and motor rotates in backward
direction. This is the basic working
of H‐Bridge. We can also make a
small truth table according to the
switching of H‐Bridge explained
above.

Truth
High Left High Right Low Left Low Right Descriptio
On Off Off On Motor runs clockwise
Off On On Off Motor runs anti‐clockwise
On On Off Off Motor stops or decelerates
Off Off On On Motor stops or decelerates

As already said, H‐bridge can be made with the help of transistors as well as MOSFETs;
the only thing is the power handling capacity of the circuit. If motors are needed to
run with high current then lot of dissipation is there. So head sinks are needed to
cool the circuit.

Now you might be thinking why I did not discuss the cases like High side left on and
Low side left on or high side right on and low side right on. Clearly seen in the diagram,
you don't want to burn your power supply by shorting them. So that is why those
combinations are not discussed in the truth table.

So we have seen that using simple switching elements we can make our own H‐Bridge,
or other option we have is using an IC based H‐bridge driver.

►L293D Dual H‐Bridge Motor Driver

L293D is a dual H‐Bridge motor driver, so with one IC we can interface


two DC motors which can be controlled in both clockwise and counter clockwise
direction and if you have motor with fix direction of motion. You can make use of
all the four I/Os to connect up to four DC motors. L293D has output current of
600mA and peak output current of 1.2A per channel. Moreover for protection o f
c i r c u i t f r o m b a c k E M F, output diodes are included within the IC. The output
supply (VCC2) has a wide range from 4.5V to 36V, which has made L293D a best
choice for DC motor driver.

A simple schematic for interfacing a DC motor using L293D is shown below.


As you can see in the circuit, three pins are needed for interfacing a DC motor (A, B,
Enable). If you want the o/p to be enabled completely then you can connect Enable to
VCC and only 2 pins needed from controller to make the motor work.

As per the truth mentioned in the image above it’s fairly simple to program the
microcontroller. It’s also clear from the truth table of BJT circuit and L293D the
programming will be same for both of them, just keeping in mind the allowed
combinations of A and B.
RELAY

A relay is an electrically operated switch. Current flowing through


the coil of the relay creates a magnetic field which attracts a lever
and changes the switch contacts. The coil current can be on or off so
relays have two switch positions and they are double throw
(changeover) switches.

Relays allow one circuit to switch a second circuit which can be


completely separate from the first. For example a low voltage battery
circuit can use a relay to switch a 230V AC mains circuit. There is no
electrical connection inside the relay between the two circuits; the
link is magnetic and mechanical.

The coil of a relay passes a relatively large current, typically 30mA


for a 12V relay, but it can be as much as 100mA for relays designed
to operate from lower voltages. Most ICs (chips) cannot provide this
current and a transistor is usually used to amplify the small IC current
to the larger value required for the relay coil. The maximum output
current for the popular 555 timer IC is 200mA so these devices can
supply relay coils directly without amplification.

Relays are usually SPDT or DPDT but they can have many more sets
of switch contacts, for example relays with 4 sets of changeover
contacts are readily available. For further information about switch
contacts and the terms used to describe them please see the page on
switches.
Most relays are designed for PCB mounting but you can solder wires
directly to the pins providing you take care to avoid melting the
plastic case of the relay.

The supplier's catalogue should show you the relay's connections.


The coil will be obvious and it may be connected either way round.
Relay coils produce brief high voltage 'spikes' when they are
switched off and this can destroy transistors and ICs in the circuit. To
prevent damage you must connect a protection diode across the relay
coil.

The animated picture shows a working relay with its coil and switch
contacts. You can see a lever on the left being attracted by
magnetism when the coil is switched on. This lever moves the switch
contacts. There is one set of contacts (SPDT) in the foreground and
another behind them, making the relay DPDT.

The relay's switch connections are usually labeled COM, NC and


NO:

 COM = Common, always connect to this, it is the moving part


of the switch.
 NC = Normally Closed, COM is connected to this when the
relay coil is off.
 NO = Normally Open, COM is connected to this when the relay
coil is on.
 Connect to COM and NO if you want the switched circuit to be
on when the relay coil is on.
 Connect to COM and NC if you want the switched circuit to be
on when the relay coil is off.

Protection diodes for relays

Transistors and ICs must be protected from the brief high voltage
produced when a relay coil is switched off. The diagram shows how a
signal diode (e.g. 1N4148) is connected 'backwards' across the relay
coil to provide this protection.
Current flowing through a relay coil creates a magnetic field which
collapses suddenly when the current is switched off. The sudden
collapse of the magnetic field induces a brief high voltage across the
relay coil which is very likely to damage transistors and ICs. The
protection diode allows the induced voltage to drive a brief current
through the coil (and diode) so the magnetic field dies away quickly

rather than instantly. This prevents the induced voltage becoming


high enough to cause damage to transistors and ICs.
Relays and transistors compared

Like relays, transistors can be used as an electrically operated switch.


For switching small DC currents (< 1A) at low voltage they are
usually a better choice than a relay. However transistors cannot
switch AC or high voltages (such as mains electricity) and they are
not usually a good choice for switching large currents (> 5A). In
these cases a relay will be needed, but note that a low power
transistor may still be needed to switch the current for the relay's coil!
The main advantages and disadvantages of relays are listed below:

Advantages of relays:

 Relays can switch AC and DC, transistors can only switch DC.
 Relays can switch high voltages, transistors cannot.
 Relays are a better choice for switching large currents (> 5A).
 Relays can switch many contacts at once.

Disadvantages of relays:
 Relays are bulkier than transistors for switching small currents.
 Relays cannot switch rapidly (except reed relays), transistors
can switch many times per second.
 Relays use more power due to the current flowing through their
coil.
 Relays require more current than many ICs can provide, so a
low power transistor may be needed to switch the current for the
relay's coil.

CENTRIFUGAL PUMP
Centrifugal pumps are the most preferred hydraulic pumps used in
domestic and industrial world. In this video we will have a
conceptual overview of the working of centrifugal pumps.

Centrifugal pumps are used to induce flow or raise pressure of a


liquid. Its working is simple. At the heart of the system lies impeller.
It has a series of curved vanes fitted inside the shroud plates. The
impeller is always immersed in the water. When the impeller is made
to rotate, it makes the fluid surrounding it also rotate. This imparts
centrifugal force to the water particles, and water moves radially
out.

Since the rotational mechanical energy is transferred to the fluid, at


the discharge side of the impeller, both the pressure and kinetic
energy of the water will rise. At the suction side, water is getting
displaced, so a negative pressure will be induced at the eye. Such a
low pressure helps to suck fresh water stream into the system again,
and this process continues.

The negative pressure at the eye of the impeller helps to maintain


the flow in the system. If no water is present initially, the negative
pressure developed by the rotating air, at the eye will be negligibly
small to suck fresh stream of water. As a result the impeller will
rotate without sucking and discharging any water content. So the
pump should be initially filled with water before starting it. This
process is known as priming.

BLOCK DIAGRAM

POWER
SUPPLY

Bluetooth Atmega8 RELAY & Pump &


& Google Motor Motor
Voice Driver
Objectives of Agricultural Water Spraying Machine using IoT

 To reduce overall cycle time for the agricultural sprayer.


 To reduce human efforts in order to reduce the fatigue load on
farmers.
 Easy to assemble and disassemble.
 Easy to operate by unskilled workers.
 Highly durable.
 It must be affordable.
 Use of multi-nozzles in order to spray large areas at a faster rate.
 Can be operated using IoT

Advantages

1. Human effort in pumping is reduced.

2. Increased capacity of spraying.

3. Fatigue load reduced.

4. Cost-effective.

5. Increased rate of spraying thus reducing time in spraying

6. Less Manpower involvement as it can be operated by IoT

Applications

1. Agriculture.

2. Horticulture.
3. Floriculture.

4. Spraying of germicide.

Reference:

1. https://www.instructables.com/id/Getting-Started-With-

ESP8266LiLon- NodeMCU-V3Flashi/
2. https://www.c-sharpcorner.com/article/blinking-led-by-esp-12e-

nodemcu-v3- module-using-arduinoide/
3. https://www.cytron.io/p-nodemcu-v3

4. http://henrysbench.capnfatz.com/henrys-bench/arduino-

projects-tips-and- more/arduino-esp8266-lolin-nodemcu-
getting-started/
5. Relay-pumphttp://henrysbench.capnfatz.com/henrys-bench/

arduino-water sprinkling-tips-and- more/nodemcu-esp-12e-


use-cloudmtt-to-display-on-a-gauge-on-blogger/
6. http://henrysbench.capnfatz.com/henrys-bench/arduino-

projects-tips-and- more/arduino-ide-nodemcu-esp-12e-digital-
input-basics/
7. http://henrysbench.capnfatz.com/henrys-bench/arduino-

projects-tips-and- more/nodemcu-io-basics-pwm/
8. www.handsontec.com/pdf_learn/esp8266-V10.pdf

9. https://einstronic.com/wp-content/uploads/2017/06/NodeMCU-

ESP8266-ESP- 12E-Catalogue.pdf
10. https://airccj.org/CSCP/vol7/csit77405.pdf

11. R.Aravindhan, M.Ramanathan, D.SanjaiKumar, R.Kishore, “HOME

AUTOMATION USING Wi-Fi INTERCONNECTION”,Department of


Mechatronics engineering, Chennai Institute of Technology, Anna
University Chennai, Tamil Nadu, India- 600069, (IRJET) e-ISSN:
2395 -0056 Volume: 04 Issue: 03 | Mar -2017 ,www.irjet.net.2542-
2544pp.
12. https://www.researchgate.net/publication/

319253026_Counter_with_ESP8266
_NodeMcu_and_Blynk

13. https://www.elecrow.com/download/ESP8266%20NodeMCU

%20kit.pdf

You might also like