You are on page 1of 73

1

ABSTRACT

Pollution has rocked the world with skyrocketing pollution levels. Though the
long-term solution to the pollution problem lies in finding and minimizing
pollution sources, we need to bring the current pollution levels under control by the
time. The best way of controlling pollution is by using air and water purifiers. But
regular indoor air purifiers are small low power devices that don’t possess enough
purifying capability needed for outdoor spaces. Along with this there is also an
issue of power supply in outdoor machines. So here we design a heavy duty
outdoor air purifier that is made for outdoor purification along and powered by
solar panels so it is energy independent. Our solar air purifier consists of a heavy-
duty suction fan that pulls air from the bottom of the purifier through a layer of
HEPA and Carbon filters for elimination of PM 10 PM 2.5 pollutants as well as
gases. The purifier uses 2 layer purification, the first one being HEPA layer and
second and active carbon filter. The combination of these 2 filters leads to dual
filtration using a centrifugal air force to suck large amount of air and purify it of
dust particles. Now this suction fan is used to suck out air using high power
centrifugal force and blowing out fresh air from the top. The system also includes
an air quality sensor and display to display the current air quality. And also we
implemented water purifier system to purify water from environment so that we
add water pump with carbon filters. We now use a solar panel for the power
supply. The panel is used to supply electricity to battery which in turn powers the
motor to run the suction fan. The machine is mounted with 4 castor wheels and a
handle for easy movement. This makes the air purifier portable so it can be easily
moved to school play areas, parks, residential areas, public places for efficient and
instant pollution control.
.
2

TABLE OF CONTENTS
CHAPTER TITLE PAGE
NO NO
ABSTRACT IV
LIST OF FIGURES VII
LIST OF TABLES IX
ABBREVIATIONS X
1 INTRODUCTION 1
1.1 EMBEDDED SYSTEMS 1
1.2 EMBEDDED SYSTEM BASICS 2
1.2.1 Embedded system hardware 3
1.2.2 Embedded system software 3
1.2.3 Real time operating system 3
1.2.4 Memory 4
1.3 APPLICATIONS 4
2 LITERATURE SURVEY 6
3 SYSTEM ANALYSIS 17
3.1 EXISTING SYSTEM 17
3.1.1 Applications of GSM in Green House 17
3.1.2 Global System for Mobile 18
Communication
3.2 PROPOSED METHOD 20
3.2.1 Automatic soil parameter monitoring and 20
analysis of green house system in Green House
using iot
3.2.2 Theory of Operation 21
3

3.2.3 Circuit Diagram 22

4 PROJECT DESCRIPTION 25
4.1 HARDWARE DESCRIPTION 25
4.1.1 Atmega8 microcontroller 25
4.1.2 Power Supply 29
4.1.3 Transformer 30
4.1.4 Rectifier 31
4.1.5 Filter 31
4.1.6 IC Voltage Regulators 31
4.1.7 Liquid-crystal display 32
4.1.8 RELAY 34
4.1.9 ESP8266 35
4.1.10 Internet of Things (IoT) 35
4.2 SOFTWARE DESCRIPTION 45
5 RESULT 49
6 CONCLUSION & FUTURE WORK 50
6.1 CONCLUSION 50
6.2 FUTURE WORK 50
REFERENCES 51
4

ABBREVIATIONS

ACRONYMS ABBREVIATIONS
LCD - Liquid Crystal Display
IoT - Internet of Things
CPU - Central Processing Unit
ABS - Anti-lock Breaking System
ESC - Electronic Stability Control
GSM - Global System for Mobile communication
HWM - Household Waste Management
SWM - Smart Waste Management
GA - Genetic Algorithm
SGMS - Smart Garbage Management System
SGBs - Smart Garbage Bins
IoT - Internet of Things
BANs - Body Area Networks
ITS - Intelligent Transportation System
ETSI - European Telecommunications Standards
Institute
SIM - Subscriber Identity Module
GPS - Global Positioning System
IC - Integrated Circuit
LED - Light Emitting Diode
GSI - Global Standard Initiative
IDE - Integrated Development Environment
5

CHAPTER 1
INTRODUCTION
1.1 INTRODUCTION
• Simple and easy to install and configure. Saving energy and resources, so
that it can be utilized in proper way and amount
• green houseers would be able to smear the proper quantity of water at the
proper time by automating green house or nursery green house.
• Avoiding green house at the wrong time of day, reduce runoff from
overwatering saturated soils which will improve crop
performance.
Automated green house system uses valves to turn motor ON and OFF.
Motors can be automated easily by using controllers and no need of labour to
message display on liquid crystal display screen, At the end, when the gas leakage
is successfully stopped then with the help of reset button the whole system reached
to the initial stage
An embedded system is a computer system with a dedicated function within
a larger mechanical or electrical system, often with real-time
computing constraints. It is embedded as part of a complete device often including
hardware and mechanical parts. Embedded systems control many devices in
common use today. Ninety-eight percent of all microprocessors are manufactured
as components of embedded systems as shown in Figure 1.1.
6

Figure 1.1 Embedded System


Examples of properties of typical embedded computers when compared with
general-purpose counterparts are low power consumption, small size, rugged
operating ranges, and low per-unit cost. This comes at the price of limited
processing resources, which make them significantly more difficult to program and
to interact with. However, by building intelligence mechanisms on top of the
hardware, taking advantage of possible existing sensors and the existence of a
network of embedded units, one can both optimally manage available resources at
the unit and network levels as well as provide augmented functions, well beyond
those available. For example, intelligent techniques can be designed to manage
power consumption of embedded systems.
Modern embedded systems are often based on microcontrollers (i.e. CPU's
with integrated memory or peripheral interfaces), but ordinary microprocessors
(using external chips for memory and peripheral interface circuits) are also
common, especially in more-complex systems. In either case, the processor(s) used
may be types ranging from general purpose to those specialized in certain class of
computations or even custom designed for the application at hand. A common
standard class of dedicated processors is the digital signal processor (DSP).
Since the embedded system is dedicated to specific tasks, design engineers
can optimize it to reduce the size and cost of the product and increase the reliability
7

and performance. Some embedded systems are mass-produced, benefiting


from economies of scale.
Embedded systems range from portable devices such as digital
watches and MP3 players, to large stationary installations like traffic lights, factory
controllers, and largely complex systems like hybrid vehicles, MRI, and avionics.
Complexity varies from low, with a single microcontroller chip, to very high with
multiple units, peripherals and networks mounted inside a large chassis or
enclosure.
1.2 EMBEDDED SYSTEM BASICS
The embedded systems basics include the components of embedded system
hardware, embedded system types and several characteristics as shown in Figure
1.2. An embedded system has three main components: Embedded system
hardware, Embedded system software and Operating system.

Figure 1.2 Embedded System Block Diagram


1.2.1 Embedded System Hardware
As with any electronic system, an embedded system requires a hardware
platform on which it performs the operation. Embedded system hardware is built
with a microprocessor or microcontroller. The embedded system hardware has
8

elements like input output (I/O) interfaces, user interface, memory and the display.
Usually, an embedded system consists of:
 Power Supply
 Processor
 Memory
 Timers
 Serial communication ports
 Output/Output circuits
 System application specific circuits
1.2.2 Embedded System Software
The embedded system software is written to perform a specific function. It is
typically written in a high level format and then compiled down to provide code
that can be lodged within a non-volatile memory within the hardware. Embedded
system software is designed to keep in view of the three limits:
 Availability of system memory
 Availability of processor’s speed
 When the system runs continuously, there is a need to limit power
dissipation for events like stop, run and wake up.
1.2.3 Real Time Operating System
A system is said to be real time, if it is essential to complete its work and
deliver its service on time. Real time operating system manages the application
software and affords a mechanism to let the processor run. The Real Time
operating system is responsible for handling the hardware resources of a computer
and host applications which run on the computer.
An RTOS is specially designed to run applications with very precise timing
and a high amount of reliability. Especially, this can be important in measurement
9

and industrial automation systems wherein downtime is costly or a program delay


could cause a safety hazard.
1.2.4 Memory
In an embedded system, there are different types of memories. The various
forms of memories are presented in the below Figure 1.3.

Figure 1.3 Various Forms of System Memory


1.3 APPLICATIONS
Embedded systems are commonly found in consumer, cooking, industrial,
automotive, medical, commercial and military applications.
Telecommunications systems employ numerous embedded systems
from telephone switches for the network to cell phones at the end user. Computer
networking uses dedicated routers and network bridges to route data.
Consumer electronics include MP3 players, mobile phones, videogame
consoles, digital cameras, GPS receivers, and printers. Household appliances, such
as microwave ovens, washing machines and dishwashers, include embedded
systems to provide flexibility, efficiency and features. Advanced HVAC systems
use networked thermostats to more accurately and efficiently control temperature
that can change by time of day and season. Home automation uses wired- and
wireless-networking that can be used to control lights, climate, security,
audio/visual, surveillance, etc., all of which use embedded devices for sensing and
controlling.
10

Transportation systems from flight to automobiles increasingly use


embedded systems. New airplanes contain advanced avionics such as inertial
guidance systems and GPS receivers that also have considerable safety
requirements. Various electric motors — brushless DC motors, induction
motors and DC motors — use electric/electronic motor
controllers. Automobiles, electric vehicles, and hybrid vehicles increasingly use
embedded systems to maximize efficiency and reduce pollution. Other automotive
safety systems include anti-lock braking system (ABS), Electronic Stability
Control (ESC/ESP), traction control (TCS) and automatic four-wheel drive.
Medical equipment uses embedded systems for vital
signs monitoring, electronic stethoscopes for amplifying sounds, and
various medical imaging (PET, SPECT, CT, and MRI) for non-invasive internal
inspections. Embedded systems within medical equipment are often powered by
industrial computers.
11

CHAPTER 2

LITERATURE SURVEY

2.1 The study and application of the IOT technology in Green House
Ji-chun Zhao ; Jun-feng Zhang ; Yu Feng ; Jian-xin Guo
2010 3rd International Conference on Computer Science and Information
Technology
Year: 2010 | Volume: 2 | Conference Paper | Publisher: IEEE

In recent years, greenhouse technology in Green House is to automation,


information technology direction with the IOT (internet of things) technology rapid
development and wide application. In the paper, control networks and information
networks integration of IOT technology has been studied based on the actual
situation of agricultural production. Remote monitoring system with internet and
wireless communications combined is proposed. At the same time, taking into
account the system, information management system is designed. The collected
data by the system provided for agricultural research facilities.
2.1.1 Advantages
 Instant monitoring of parameters
 Increase in production
 Autonomous
2.1.2 Disadvantages
 A person has to be online to control
 Cannot monitor crop health
12

2.2 Internet of Things (IoT) for Precision Green House Application


Manishkumar Dholu ; K.A. Ghodinde
2018 2nd International Conference on Trends in Electronics and Informatics
(ICOEI)
Year: 2018 | Conference Paper | Publisher: IEEE

Internet is experiencing a very explosive growth nowadays with the amount of the
devices connecting to it. Earlier we had only personal computers (pCs) and Mobile
handset connected to internet but now with Internet of Things i.e. IoT concept of
connecting things with internet, millions of device are connecting with it. This
development of IoT leads to the idea of machine to machine communication which
means that two machines can communicate to each other and also all the data
which was previously with private server can now is available on internet so the
user can access it remotely. Application of IoT is feasible in almost all industries
particularly where speed of communication is not an issue. This paper proposes the
application of cloud based IoT in the Green House domain. Precision Green House
is basically a concept which insists to provide right amount of resources at and for
exact duration of time. These resources can be any things such as water, light,
pesticides etc. To implement precision Green House the benefits of IOT has been
utilized in the proposed paper. The fundamental idea is to sense all the required
parameter from the Green House field and take required decision to control the
actuator. These Green House parameters are Soil TDS, Temperature & Relative
Humidity around plant, Light intensity. Based on the reading sensed by the sensor
suitable action is taken i.e. green house valve is actuated based on soil TDS
readings, valve for fogger (for spraying water droplet) is actuated based on the
Relative humidity(RH) readings etc. This paper proposed the development of the
sensor node capable of measuring all these parameter and creating the actuation
13

signal for all the actuator. On top of that sensor nodes are also capable of sending
this data to cloud. An Android application is also developed in order to access all
these agricultural parameter.

2.2.1 Advantages
 Decision making can be done remotely
 Reduces human labour
 Online monitoring
 No need of testing in labs
2.2.2 Disadvantages
 Constant linking with internet is needed
 Not suitable for all type of Temperatures
14

CHAPTER 3
SYSTEM ANALYSIS

3.1 EXISTING SYSTEM


3.1.1 Applications of GSM in Green House
The current methods use gsm for precision Green House. The paper
discusses possible solution in reduction of transport cost for agricultural products,
also predicts the prices of crop based on past information and present market
scenario. It also gives a solution of reducing middle mans who normally tends to
get more profit share than producers and consumers. This solution helps to bridge a
communication gap between farmers and agricultural product buyer.
The author explains the need of wireless sensor network in the agricultural
field so as to increase the productivity. Author also explains the need of precision
Green House in current scenario of Green House particularly in India. This paper
shows the architecture for analyzing and monitoring of the environment
parameters.

3.1.2 Global System for Mobile Communication


GSM (Global System for Mobile Communications, originally Group
Special Mobile) is a standard developed by the European Telecommunications
Standards Institute (ETSI) to describe the protocols for second-generation
digital cellular networks used by mobile devices such as tablets, first deployed in
Finland in December 1991. As of 2014, it has become the global standard for
mobile communications – with over 90% market share, operating in over 193
countries and territories
15

One of the key features of GSM is the Subscriber Identity Module,


commonly known as a SIM card. The SIM is a detachable smart card containing
the user's subscription information and phone book. This allows the user to retain
his or her information after switching handsets. Alternatively, the user can also
change operators while retaining the handset simply by changing the SIM. Some
operators will block this by allowing the phone to use only a single SIM, or only a
SIM issued by them; this practice is known as SIM locking.
Patents remain a problem for any open-source GSM implementation,
because it is not possible for GNU or any other free software distributor to
guarantee immunity from all lawsuits by the patent holders against the users.
Furthermore, new features are being added to the standard all the time which
means they have patent protection for a number of years.
The original GSM implementations from 1991 may now be entirely free of
patent encumbrances, however patent freedom is not certain due to the United
States' "first to invent" system that was in place until 2012. The "first to invent"
system, coupled with "patent term adjustment" can extend the life of a U.S. patent
far beyond 20 years from its priority date. It is unclear at this time whether Open
BTS will be able to implement features of that initial specification without limit.
As patents subsequently expire, however, those features can be added into the
open-source version. By this everyone can get accessed there is no security.
The garbage filling level is only get monitored through the GSM Modem.
Sensors are used to identify the garbage level and it does not take any action by
itself. The manual operations can get delayed sometimes due to the absence of the
monitor. It creates unhygienic condition for the people and creates bad smell
around the surroundings this leads in spreading some deadly diseases & human
illness. Due to this environment become unhygienic. Lot of diseases can get
spread over the environment because of unhygienic environment.
16

3.1.3 Advantages
 Getting an sms alert about the Temperature level
 Switching the motors through mobile
 Remote monitoring
3.1.4 Disadvantages
 Online monitoring of corresponding parameter is not available
 Minimal user interface
 Instant measuring cannot be done

3.2 PROPOSED METHOD


In this work low cost soil TDS sensors and Temperature sensors are used. They
continuously monitor the field and send it to the web server using ESP8266
transmitter and receiver and Ethernet connection at receiver ends. The sensor data
are stored in database. The web application is designed in such a way to analyze
the data received and to check with the threshold values of TDS and magensium.
The decision making is done at server to automate green house. If soil TDS is less
than the threshold value the motor is switched ON and if the soil TDS exceeds the
threshold value the motor is switched Off. This method can also be used in green
houses where in addition solar water distillation control can also be controlled and
automated. The system design is represented in Fig. 3.1
17

BLOCK DIAGRAM

3.2.2 Theory of Operation


The sensors monitor the level of TDS and Temperature. The microcontroller
processes the data from the sensor and it sends information to the authorized
person via IoT .In this system, automatically opens and closes the motors
containing the water and Temperature. The LCD displays the parameters such as
the TDS level and Temperature level. The power supply block gives a regulated dc
supply to the sensors and the microcontroller. Here we have used the atmel
microcontroller Atmega8. The lcd s data pins and the control are connected to the
microcontroller. The relays are used to switch on / off the motors. The switching of
the relays is done with the help of the transistors,
18

3.2.3 Circuit diagram


The Figure 3.2 circuit shows which consists of sensor network such as TDS
sensor, Temperature sensor, microcontroller atmega8, IoT module, relay, LCD [1].

Figure 3.2 Purifier System In Green House Using Iot – Circuit Diagram

CHAPTER 4
19

PROJECT DESCRIPTION

4.1 HARDWARE DESCRIPTION


4.1.1 ATMEGA8 MICROCONTROLLER
MICROCONTROLLER – ATMEGA 8
Features
• High-performance, Low-power AVR®
- 8-bit Microcontroller
• Advanced RISC Architecture
– 130 Powerful Instructions – Most Single-clock Cycle Execution
– 32 x 8 General Purpose Working Registers
– Fully Static Operation
– Up to 16 MIPS Throughput at 16 MHz
– On-chip 2-cycle Multiplier
• High Endurance Non-volatile Memory segments
– 8K Bytes of In-System Self-programmable Flash program memory
– 512 Bytes EEPROM
– 1K Byte Internal SRAM
– Write/Erase Cycles: 10,000 Flash/100,000 EEPROM
– Data retention: 20 years at 85°C/100 years at 25°C (1)
– Optional Boot Code Section with Independent Lock Bits
• In-System Programming by On-chip Boot Program
– True Read-While-Write Operation
– Programming Lock for Software Security
• Peripheral Features
– Two 8-bit Timer/Counters with Separate Prescaler, one compare
•Six Channels 10-bit Accuracy
20

– Byte-oriented Two-wire Serial Interface


– Programmable Serial USART
– Master/Slave SPI Serial Interface
– Programmable Watchdog Timer with Separate On-chip
•Oscillator
– On-chip Analog Comparator
•Special Microcontroller Features
– Power-on Reset and Programmable Brown-out Detection
– Internal Calibrated RC Oscillator
– External and Internal Interrupt Sources
– Five Sleep Modes: Idle, ADC Noise Reduction, Power-save
•I/O and Packages
– 23 Programmable I/O Lines
– 28-lead PDIP, 32-lead TQFP, and 32-pad QFN/MLF
•Operating Voltages
– 2.7 - 5.5V (ATmega8L)
– 4.5 - 5.5V (ATmega8)
•Power Consumption at 4 Mhz, 3V, 25°C
– Active: 3.6 mA
– Idle Mode: 1.0 mA
– Power-down Mode: 0.5 µA
21

Pin Configurations
22

The ATmega8 is a low-power CMOS 8-bit microcontroller based on the AVR


RISC architecture.
By executing powerful instructions in a single clock cycle, the ATmega8 achieves
throughputs approaching 1 MIPS per MHz, allowing the system designer to
optimize power consumption versus processing speed.
BLOCK DIAGRAM
23

Pin Descriptions
VCC :-Digital supply voltage.
GND:- Ground.
Port B(PC7..PB0) :- is an 8-bit bi-directional I/O port with internal pull-up
resistors (selected for each bit). The Port B output buffers have symmetrical drive
24

characteristics with both high sink and source capability. As inputs, Port B pins
that are externally pulled low will source current if the pull-up resistors are
activated. The Port B pins are tri-stated when a reset condition becomes
active,even if the clock is not running.
Port C (PC5..PC0) :- Port C is an 7-bit bi-directional I/O port with internal pull-
up resistors (selected for each bit). The Port C output buffers have symmetrical
drive characteristics with both high sink and source capability. As inputs, Port C
pins that are externally pulled low will source current if the pull-up resistors are
activated. The Port C pins are tri-stated when a reset condition becomes active,
even if the clock is not running.
Port D (PD7..PD0) :- Port D is an 8-bit bi-directional I/O port with internal pull-
up resistors (selected for each bit). The Port D output buffers have symmetrical
drive characteristics with both high sink and source capability. As inputs, Port D
pins that are externally pulled low will source current if the pull-up resistors are
activated. The Port D pins are tri-stated when a reset condition becomes
active,even if the clock is not running.
RESET (Reset input):- A low level on this pin for longer than the minimum pulse
length will generate a reset, even if the clock is not running. The Shorter pulses are
not guaranteed to generate a reset.
AVCC:- AVCC is the supply voltage pin for the A/D Converter, Port C (3..0), and
ADC (7..6). It should be externally connected to VCC, even if the ADC is not
used. If the ADC is used, it should be connected to VCC through a low-pass filter.
AREF:- AREF is the analog reference pin for the A/D Converter.These pins are
powered from the analog supply and serve as 10-bit ADC channels.
Basic Function:- The main function of the CPU core is to ensure correct program
execution. The CPU must therefore be able to access memories,
perform calculations, control peripherals, and handle interrupts.
25

Interfacing Of Data Bus With Different Units


26

In order to maximize performance and parallelism, the AVR uses a Harvard


architecture with separate memories and buses for program and data.

Instructions in the Program memory are executed with a single level pipelining.
While one instruction is being executed, the next instruction is pre-fetched from
the Program memory. This concept enables instructions to be executed in every
clock cycle.

The Program memory is In-System Reprogrammable Flash memory.The fast-


access Register File contains 32 x 8-bit general purpose working registers with a
single clock cycle access time. This allows single-cycle Arithmetic Logic Unit
(ALU) operation. In a typical ALU operation, two operands are output from the
Register File, the operation is executed, and the result is stored back in the Register
File in one clock cycle.

Six of the 32 registers can be used as three 16-bit indirect address register pointers
for Data Space addressing enabling efficient address calculations. One of the these
address pointers can also be used as an address pointer for look up tables in Flash
Program memory. These added function registers are the 16-bit X, Y and Z-
register.The ALU supports arithmetic and logic operations between registers or
between a constant and a register. Single register operations can also be executed
in the ALU.After an arithmetic operation, the Status Register is updated to reflect
information about the result of the operation.The Program flow is provided by
conditional and unconditional jump and call instructions, able to directly address
the whole address space. Most AVR instructions have a single 16-bit word format.
Every Program memory address contains a 16- or 32-bit instruction.
27

Program Flash memory space is divided in two sections, the Boot program section
and the Application program section. Both sections have dedicated Lock Bits for
write and read/write protection. The SPM instruction that writes into the
Application Flash memory section must reside in the Boot program section.During
interrupts and subroutine calls, the return address Program Counter (PC) is stored
on the Stack. The Stack is effectively allocated in the general data SRAM, and
consequently the Stack size is only limited by the total SRAM size and the usage
of the SRAM. All user programs must initialize the SP in the reset routine (before
subroutines or interrupts are executed). The Stack Pointer SP is read/write
accessible in the I/O space.The data SRAM can easily be accessed through the five
different addressing modes supported in the AVR architecture.The memory spaces
in the AVR architecture are all linear and regular memory maps.
A flexible interrupt module has its control registers in the I/O space with an
additional global interrupt enable bit in the Status Register. All interrupts have a
separate Interrupt Vector in the Interrupt Vector table. The interrupts have priority
in accordance with their Interrupt Vector position. The lower the Interrupt Vector
address, the higher the priority.The I/O memory space contains 64 addresses for
CPU peripheral functions as Control Registers, SPI, and other I/O functions. The
I/O Memory can be accessed directly, or as the Data Space locations following
those of the Register File, 0x20 - 0x5F.

4.1.2 Power supply


The power supply circuits built using filters, rectifiers, and then voltage
regulators.
28

Figure 4.3 Block Diagram of Power Supply


Starting with an ac voltage, a steady dc voltage is obtained by rectifying the ac
voltage, then filtering to a dc level, and finally, regulating to obtain a desired fixed
dc voltage. The regulation is usually obtained from an IC voltage regulator unit,
which takes a dc voltage and provides a somewhat lower dc voltage, which
remains the same even if the input dc voltage varies, or the output load connected
to the dc voltage changes. The block diagram of power supply is shown in Figure
4.3.
4.1.3 Transformer
A transformer is a device which transforms high voltage AC into low voltage
AC or vice versa. So there is absolutely no reason to use step-up transformer. The
transformer that is used in power supply is step-down transformer, which steps
down the input AC voltage. The magnitude by which transformer steps down the
voltage depends on the turn’s ratio of primary and secondary winding shown in
Figure 4.4.

Figure 4.4 Transformer


Specifications of transformer
 Input voltage : 230 v
 Frequency : 50 Hz
 voltage: 12V
 current: 1000mA
29

 rated power: 24VA


 temperature : up to 45 o C
 insulation : E

4.1.4 Rectifier
A rectifier is an electrical device that converts alternating current (AC),
which periodically reverses direction, to direct current (DC), which flows in only
one direction. The process is known as rectification.
Bridge rectifier
Bridge rectifier is used to maintain the proper DC polarity at the input to the
circuit, irrespective of telephone line polarity. It comprises of four diodes
connected to form a bridge. It uses the entire AC wave (both positive and negative
sections). 1.4V is used up in the bridge rectifier because each diode uses 0.7V
when conducting and there are always two diodes conducting.
4.1.5 Filter
The output after being processed by full wave rectifier is not a pure DC. The
output is a pulsating DC. The output contains large fluctuations in voltages. This is
quite apparent from the block of full wave rectifier shown above. The power
supply that we intend to design must not have any variation in output voltage. The
voltage that we get from full wave rectifier fluctuates between 0 V and V peak, and
hence it contains AC components. These AC components needs to be filtered
out so as to obtain DC voltage. This is where filters come into picture. Filters, as
the name suggests, filters out any AC component present and provides DC as the
output. However, the output from the filter is still not a pure DC but filter removes
the AC component in the voltage to a considerable extent. This increases the
average DC value of the output voltage. Now a question must arise as to how we
30

can make a filter and which components are required to make a filter. Although it
not the goal of this section to study filters in detail, it must suffice to know that
filters used in power supplies can be made simply by using capacitors.
4.1.6 IC Voltage Regulators
Voltage regulators comprise a class of widely used ICs shown in Figure 4.5.
Regulator IC units contain the circuitry for reference source, comparator amplifier,
control device, and overload protection all in a single IC. Although the internal
construction of the IC is somewhat different from that described for discrete
voltage regulator circuits, the external operation is much the same. IC units provide
regulation of either a fixed positive voltage, a fixed negative voltage, or an
adjustably set voltage.

Figure 4.5 Voltage Regulator IC


Features of Voltage Regulator IC
 Output Current up to 1A
 Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V
 Thermal Overload Protection
 Short Circuit Protection
 Output Transistor Safe Operating Area Protection
31

4.1.7 Liquid-crystal display

Fig 4.5 Pin Diagram of LCD


A liquid-crystal display (LCD) is a flat-panel display or other electronically
modulated optical device that uses the light-modulating properties of liquid
crystals. Liquid crystals do not emit light directly, instead using a backlight or
reflector to produce images in color or monochrome.. LCDs are available to
display arbitrary images (as in a general-purpose computer display) or fixed
images with low information content, which can be displayed or hidden, such as
preset words, digits, and 7-segment displays, as in a digital clock. They use the
same basic technology, except that arbitrary images are made up of a large number
of small pixels, while other displays have larger elements.
LCDs are used in a wide range of applications including computer monitors,
televisions, instrument panels, aircraft cockpit displays, and indoor and outdoor
signage. Small LCD screens are common in portable consumer devices such as
digital cameras, watches, calculators, and mobile telephones, including
smartphones. LCD screens are also used on consumer electronics products such as
DVD players, video game devices and clocks. LCD screens have replaced heavy,
bulky cathode ray tube (CRT) displays in nearly all applications. LCD screens are
available in a wider range of screen sizes than CRT and plasma displays, with LCD
32

screens available in sizes ranging from tiny digital watches to huge, big-screen
television set.
Since LCD screens do not use phosphors, they do not suffer image burn-in when a
static image is displayed on a screen for a long time (e.g., the table frame for an
aircraft schedule on an indoor sign). LCDs are, however, susceptible to image
persistence.. The LCD screen is more energy-efficient and can be disposed of more
safely than a CRT can. Its low electrical power consumption enables it to be used
in battery-powered electronic equipment more efficiently than CRTs can be. By
2008, annual sales of televisions with LCD screens exceeded sales of CRT units
worldwide, and the CRT became obsolete for most purposes.
Each pixel of an LCD typically consists of a layer of molecules aligned between
two transparentelectrodes, and two polarizingfilters (parallel and perpendicular),
the axes of transmission of which are (in most of the cases) perpendicular to each
other. Without the liquid crystal between the polarizing filters, light passing
through the first filter would be blocked by the second (crossed) polarizer. Before
an electric field is applied, the orientation of the liquid-crystal molecules is
determined by the alignment at the surfaces of electrodes. In a twisted nematic
(TN) device, the surface alignment directions at the two electrodes are
perpendicular to each other, and so the molecules arrange themselves in a helical
structure, or twist. This induces the rotation of the polarization of the incident light,
and the device appears gray. If the applied voltage is large enough, the liquid
crystal molecules in the center of the layer are almost completely untwisted and the
polarization of the incident light is not rotated as it passes through the liquid crystal
layer. This light will then be mainly polarized perpendicular to the second filter,
and thus be blocked and the pixel will appear black. By controlling the voltage
applied across the liquid crystal layer in each pixel, light can be allowed to pass
through in varying amounts thus constituting different levels of gray. Color LCD
33

systems use the same technique, with color filters used to generate red, green, and
blue pixelsThe optical effect of a TN device in the voltage-on state is far less
dependent on variations in the device thickness than that in the voltage-off state.
Because of this, TN displays with low information content and no backlighting are
usually operated between crossed polarizers such that they appear bright with no
voltage (the eye is much more sensitive to variations in the dark state than the
bright state). As most of 2010-era LCDs are used in television sets, monitors and
smartphones, they have high-resolution matrix arrays of pixels to display arbitrary
images using backlighting with a dark background. When no image is displayed,
different arrangements are used. For this purpose, TN LCDs are operated between
parallel polarizers, whereas IPS LCDs feature crossed polarizers. In many
applications IPS LCDs have replaced TN LCDs, in particular in smartphones such
as iPhones. Both the liquid crystal material and the alignment layer material
contain ionic compounds. If an electric field of one particular polarity is applied
for a long period of time, this ionic material is attracted to the surfaces and
degrades the device performance. This is avoided either by applying an alternating
current or by reversing the polarity of the electric field as the device is addressed
(the response of the liquid crystal layer is identical, regardless of the polarity of the
applied field).
Displays for a small number of individual digits or fixed symbols (as in digital
watches and pocket calculators) can be implemented with independent electrodes
for each segment. In contrast, full alphanumeric or variable graphics displays are
usually implemented with pixels arranged as a matrix consisting of electrically
connected rows on one side of the LC layer and columns on the other side, which
makes it possible to address each pixel at the intersections. The general method of
matrix addressing consists of sequentially addressing one side of the matrix, for
example by selecting the rows one-by-one and applying the picture information on
34

the other side at the columns row-by-row. For details on the various matrix
addressing schemes seePassive-matrix and active-matrix addressed LCDs

Reflective twisted nematic liquid crystal display.


1. Polarizing filter film with a vertical axis to polarize light as it enters.
2. Glass substrate with ITOelectrodes. The shapes of these electrodes will
determine the shapes that will appear when the LCD is switched ON.
Vertical ridges etched on the surface are smooth.
3. Twisted nematic liquid crystal.
4. Glass substrate with common electrode film (ITO) with horizontal ridges to
line up with the horizontal filter.
5. Polarizing filter film with a horizontal axis to block/pass light.
6. Reflective surface to send light back to viewer. (In a backlit LCD, this layer
is replaced with a light source.)

Illumination
Since LCD panels produce no light of their own, they require external light to
produce a visible image. In a "transmissive" type of LCD, this light is provided at
the back of the glass "stack" and is called the backlight. While passive-matrix
displays are usually not backlit (e.g. calculators, wristwatches), active-matrix
displays almost always are.[30][31]
The common implementations of LCD backlight technology are:
35

CCFL: The LCD panel is lit either by two cold cathodefluorescent lamps placed at
opposite edges of the display or an array of parallel CCFLs behind larger displays.
A diffuser then spreads the light out evenly across the whole display. For many
years, this technology had been used almost exclusively. Unlike white LEDs, most
CCFLs have an even-white spectral output resulting in better color gamut for the
display. However, CCFLs are less energy efficient than LEDs and require a
somewhat costly inverter to convert whatever DC voltage the device uses (usually
5 or 12 V) to ~1000 V needed to light a CCFL. [32] The thickness of the inverter
transformers also limit how thin the display can be made.
 EL-WLED: The LCD panel is lit by a row of white LEDs placed at one or more
edges of the screen. A light diffuser is then used to spread the light evenly across
the whole display. As of 2012, this design is the most popular one in desktop
computer monitors. It allows for the thinnest displays. Some LCD monitors using
this technology have a feature called "Dynamic Contrast" where the backlight is
dimmed to the brightest color that appears on the screen, allowing the 1000:1
contrast ratio of the LCD panel to be scaled to different light intensities, resulting
in the "30000:1" contrast ratios seen in the advertising on some of these monitors.
Since computer screen images usually have full white somewhere in the image, the
backlight will usually be at full intensity, making this "feature" mostly a marketing
gimmick.
 WLED array: The LCD panel is lit by a full array of white LEDs placed behind
a diffuser behind the panel. LCDs that use this implementation will usually have
the ability to dim the LEDs in the dark areas of the image being displayed,
effectively increasing the contrast ratio of the display. As of 2012, this design gets
most of its use from upscale, larger-screen LCD televisions.
 RGB-LED: Similar to the WLED array, except the panel is lit by a full array of
RGB LEDs. While displays lit with white LEDs usually have a poorer color gamut
36

than CCFL lit displays, panels lit with RGB LEDs have very wide color gamuts.
This implementation is most popular on professional graphics editing LCDs. As of
2012, LCDs in this category usually cost more than $1000.

4.1.8 RELAY

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


to operate a switching mechanism mechanically, but other operating principles are
also used. 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, repeating the signal coming in from one
circuit and re-transmitting it to another.

A relay will switch one or more poles, each of whose contacts can be thrown by
energizing the coil in one of three ways:
37

 Normally-open (NO) contacts connect the circuit when the relay is


activated; the circuit is disconnected when the relay is inactive. It is also
called a Form A contact or "make" contact. NO contacts can also be
distinguished as "early-make" or NOEM, which means that the contacts will
close before the button or switch is fully engaged.
 Normally-closed (NC) contacts disconnect the circuit when the relay is
activated; the circuit is connected when the relay is inactive. It is also called
a Form B contact or "break" contact. NC contacts can also be distinguished
as "late-break" or NCLB, which means that the contacts will stay closed
until the button or switch is fully disengaged.
 Change-over (CO), or double-throw (DT), contacts control two circuits: one
normally-open contact and one normally-closed contact with a common
terminal. It is also called a Form C contact or "transfer" contact ("break
before make"). If this type of contact utilizes”make before break"
functionality, then it is called a Form D contact.

SPDT – Single Pole Double Throw. A common terminal connects to either of two
others. Including two for the coil, such a relay has five terminals in total.
38

4.1.9 This is WiFi serial transceiver module, based on ESP8266 SoC., The
SOC has Integrated TCP/IP protocol stack. ESP8266 is a highly integrated chip
designed for the needs of a new connected world. It offers a complete and self-
contained Wi-Fi networking solution, allowing it to either host the application or to
offload all Wi-Fi networking functions from another application processor.
ESP8266 has powerful on-board processing and storage capabilities that
allow it to be integrated with the sensors and other application specific devices
through its GPIOs with minimal development up-front and minimal loading during
runtime. Its high degree of on-chip integration allows for minimal external
circuitry, and the entire solution, including front-end module, is designed to
occupy minimal PCB area.
Corresponding Interface:

• SDIO 2.0, SPI, UART


• 32-pin QFN package
• Integrated RF switch, balun, 24dBm PA, DCXO, and PMU
• Integrated RISC processor, on-chip memory and external memory interfaces
• Integrated MAC/baseband processors
• Quality of Service management
• I2S interface for high fidelity audio applications
• On-chip low-dropout linear regulators for all internal supplies
• Proprietary spurious-free clock generation architecture
• Integrated WEP, TKIP, AES, and WAPI engines

Specification:
39

• 802.11 b/g/n
• Wi-Fi Direct (P2P), soft-AP
• Integrated TCP/IP protocol stack
• Integrated TR switch, balun, LNA, power amplifier and matching network
• Integrated PLLs, regulators, DCXO and power management units
• +19.5dBm output power in 802.11b mode
• Power down leakage current of <10uA
• Integrated low power 32-bit CPU could be used as application processor
• SDIO 1.1/2.0, SPI, UART
• STBC, 1×1 MIMO, 2×1 MIMO
• A-MPDU & A-MSDU aggregation & 0.4ms guard interval
• Wake up and transmit packets in < 2ms
• Standby power consumption of < 1.0mW (DTIM3)

4.1.10 Internet of Things (IoT)


The internet of things (IoT) is the network of physical devices, vehicles,
buildings and other items—embedded with electronics, software, sensors,
actuators, and network connectivity that enable these objects to collect and
exchange data as shown in the Figure 4.24. In 2013 the Global Standards Initiative
on Internet of Things (IoT-GSI) defined the IoT as "the infrastructure of the
information society."
The IoT allows objects to be sensed and controlled remotely across existing
network infrastructure, creating opportunities for more direct integration of the
physical world into computer-based systems, and resulting in improved efficiency,
accuracy and economic benefit. When IoT is augmented with sensors and
actuators, the technology becomes an instance of the more general class of cyber-
40

physical systems, which also encompasses technologies such as smart grids, smart
homes, intelligent transportation and smart cities.
Each thing is uniquely identifiable through its embedded computing system
but is able to interoperate within the existing Internet infrastructure. As well as the
expansion of Internet-connected automation into a plethora of new application
areas, IoT is also expected to generate large amounts of data from diverse
locations, with the consequent necessity for quick aggregation of the data, and an
increase in the need to index, store, and process such data more effectively. IoT is
one of the platforms of today's Smart City, and Smart Energy Management
Systems. IoT module is shown in the Figure 4.25.

Figure 4.24 Block Diagram of IoT


Applications
 Environmental monitoring
 Infrastructure management
 Manufacturing
 Energy management
 Medical and healthcare systems
 Building and home automation
41

 Transportation
 Large scale deployments

Figure 4.25 IoT Module


Hardware Features
 Based on ESP-12F ESP8266 Wi-Fi Board
 This relay board use one AC input, and supports two relay AC output.
Please note the output AC power comes/connected from/with input AC
power. Relay only play as on/off switch for AC power. Will be
dangerous to use in any other cases.
 Use mature AC-DC power module, input voltage 85 – 265VAC
 Relay Specification: Single Relay, 125VAC 10A, 250VAC 10A, 10A
30VDC, 10A 28VDC
 Two Lead out buttons BTN1 and BTN2
 Two relay indication LEDs
 One status LED, indicating connecting status in demo code
 A few lead out pins, from top (left) to bottom (right)

4.3.4 TEMPERATURE SENSOR


The most commonly measured physical parameter is temperature whether in
process industry applications or in laboratory settings. Exact measurements are
critical part of success. Exact measurements are needed for many applications such
as medical applications, materials research in labs, studies of electronic or
electrical components, biological research, and geological studies. Most
42

commonly, temperature sensors are used to measure temperature in circuits which


control a variety of equipment’s. There are different types of temperature sensors
used in the market today including resistance temperature detectors (RTDs),
thermocouples, thermistors, infrared sensor , and semiconductor sensors. Each of
them has a particular operating parameters. These sensors come in different
varieties, but have one common thing: they all measure temperature by sensing a
change in the physical characteristic.
What Is a Temperature Sensor?
A temperature sensor is a device, usually an RTD (resistance temperature detector)
or a thermocouple, that collects the data about temperature from a particular source
and converts the data into understandable form for a device or an observer.
Temperature sensors are used in many applications like HVand AC system
environmental controls, food processing units, medical devices, chemical handling
and automotive under the hood monitoring and controlling systems, etc.
43

What is a temperature sensor?


An analog temperature sensor is pretty easy to explain, its a chip that tells you
what the ambient temperature is!

In order to understand the working principle of LM35 temperature sensor we have


to understand the linear scale factor. In the features of LM35 it is given to be +10
44

mills volt per degree centigrade. It means that with increase in output of 10 mills
volt by the sensor vout pin the temperature value increases by one. For example, if
the sensor is outputting 100 mills volt at vout pin the temperature in centigrade will
be 10-degree centigrade. The same goes for the negative temperature reading. If
the sensor is outputting -100 mills volt the temperature will be -10 degrees Celsius.
These sensors use a solid-state technique to determine the temperature. That is to
say, they dont use mercury (like old thermometers), bimetalic strips (like in some
Lab thermometers or stoves), nor do they use thermistors (temperature sensitive
resistors). Instead, they use the fact as temperature increases, the votage across a
diode increases at a known rate. (Technically, this is actually the voltage drop
between the base and emitter - the Vbe - of a transistor. By precisely amplifying
the voltage change, it is easy to genereate an analog signal that is directly
proportional to temperature. There have been some improvements on the technique
but, essentially that is how temperature is measured.
Because these sensors have no moving pa ts, they are precise, never wear out,
don't need calibration, work under many environmental conditions, and are
consistant between sensors and readings. Moreover they are very inexpensive and
quite easy to use
Some basic stats
These stats are for the temperature sensor in the Adafruit shop, the Analog Devices
TMP36 (-40 to 150C). Its very similar to the LM35/TMP35 (celsius output) and
LM34/TMP34 (farenheit output). The reason we went with the '36 instead of the
'35 or '34 is that this sensor has a very wide range and doensn't require a negative
voltage to read sub-zero temperatures. Otherwise, the functionality is basically the
same.
Size: TO-92 package (about 0.2" x 0.2" x 0.2") with three leads
Temperature range: -40°C to 150°C / -40°F to 302°F
45

Output range: 0.1V (-40°C) to 2.0V (150°C) but accuracy decreases after 125°C
Power supply: 2.7V to 5.5V only, 0.05 mA current draw

4.3.5 TDS Sensor

The TDS sensor is used to measure the water content(TDS) of soil. when
the soil is having water shortage, the module output is at high level, else the output
is at low level. This sensor reminds the user to water their plants and also monitors
the TDS content of soil. It has been widely used in agriculture, land green house
and botanical gardening.

Working Principle of TDS Sensor


The Soil TDS Sensor uses capacitance to measure dielectric permittivity of
the surrounding medium. In soil, dielectric permittivity is a function of the water
content. The sensor creates a voltage proportional to the dielectric permittivity, and
therefore the water content of the soil. The sensor averages the water content over
the entire length of the sensor. There is a 2 cm zone of influence with respect to the
flat surface of the sensor, but it has little or no sensitivity at the extreme edges. The
46

Soil TDS Sensor is used to measure the loss of TDS over time due to evaporation
and plant uptake, evaluate optimum soil TDS contents for various species of
plants, monitor soil TDS content to control green house in greenhouses and
enhance bottle biology experiments.

TEMPERATURE SENSOR

Soil Temperature Sensors that use the Time Domain Reflectometry


(TDR) function in a somewhat similar way to FDR probes, but the mechanics
behind the measurement system are different. TDR sensors propagate a pulse down
a line into the soil, which is terminated at the end by a probe with wave guides.
47

TDR systems measure the determine the water content of the soil by measuring
how long it takes the pulse to come back.
TDR soil Temperature measurement devices require a device to generate the
electronic pulse and need to be carefully calibrated in order to precisely measure
the amount of time it takes for the pulse to propagate down the line and back again.
They are also sensitive to the saline content of salt and relatively expensive
compared to some measurement methods. However, TDR devices do respond
quickly to varying soil Temperature.
Frequency Domain Reflectometry (FDR) Sensors
There are many soil Temperature probes on the market today that use
the Frequency Domain Reflectometry method (FDR) of soil measurement. This
method of measurement also uses an oscillator to propagate an electromagnetic
signal through a metal tine or other wave guide, but with this method, the
difference between the output wave and the return wave frequency is measured to
determine soil Temperature.
Frequency Domain Reflectometry (FDR) probes are considered accurate but must
be calibrated for the type of soil they will be buried in. They offer a faster response
time compared to Time Domain Reflectometer (TDR) probes and can be connected
to a standard data logger to collect readings.
Coaxial Impedance Dielectric Reflectometry Sensors
Soil Misture Probes that use the Coaxial Impedance Dielectric
Reflectometry method of soil Temperature measurement employ an oscillator to
generate an electromagnetic signal that is propagated through the unit (usually by
metal tines or other wave guide) and into the soil.
Part of this signal will be reflected back to the unit by the soil, and the sensor will
measure the amplitude of this reflected signal and the incident signal in volts . The
ratio of these raw voltages is used in a mathematical numerical solution
48

to Maxwell’s equations to first calculate the impedance, then


both real and imaginary dielectric permittivities which in turn is used to accurately
estimate soil water content.
The Stevens Hydra Probe is the only commercially available sensor to use
the Coaxial Impedance Dielectric Reflectometry method along with complex
computations in soil measurement, resulting in the Hydra Probe’s high
measurement accuracy. The soil measurement computations are performed by
a microcontroller inside the Hydra Probe, making it easy to use as the probe can
output results in standard engineering units.
Gypsum Blocks
Gypsum blocks Soil Temperature probes use two electrodes placed into a small
block of gypsum to measure soil water tension. Wires connected to the electrodes
are connected to either a portable hand-held reader or a data logger. The amount of
water in the soil is determined by the electrical resistance between the two
electrodes within the gypsum block. More water present in the soil will reduce the
resistance, while less water will increase it.
While gypsum blocks can be relatively inexpensive and easy to install compared to
other types of soil sensors, they have to be replaced periodically as the gypsum
disintegrates. Gypsum blocks are also more sensitive to having readings throwing
off by soil with high salinity (salt content).
Neutron Probes
Neutron probes are another way to measure soil Temperature content. A probe
inserted in the ground emits low-level radiation in the form of neutrons. These
collide with the hydrogen atoms contained in water, which is detected by the
probe. The more water content in the soil, the more neutrons are scattered back at
the device.
49

Neutron Soil Temperature probes are very accurate measurement devices when
used properly but are expensive compared to most other measurement methods and
generally have to be registered with the federal government due to radioactive
elements used to emit the neutrons.
Gravimetric Probes
Gravimetric soil Temperature measurement involves taking a sample of the soil
from the site, weighing the sample, drying it in an oven for 24 hours and then re-
weighing it to determine how much water was lost.
This soil measurement technique is inexpensive and easy to execute, but the long
wait time from sample to result and the process cannot be automated. It is also
difficult to obtain data from moderate soil depths as digging a new sample each
time is necessary.
When using a soil Temperature sensor, it’s important to know what type of soil
you’re dealing with in order to ensure the most accurate results possible. The
following video will help you to understand what type of soil you have.
50

4.2 SOFTWARE DESCRIPTION


4.2.1 SOFTWARE
Code Vision AVR

Atmel ATmega8 in 28-pin narrow DIP


The AVR is a modified Harvard architecture8-bitRISC single chip microcontroller
which was developed by Atmel in 1996. The AVR was one of the first
microcontroller families to use on-chip flash memory for program storage, as
opposed to one-time programmable ROM, EPROM, or EEPROM used by other
microcontrollers at the time.


Device overview
The AVR is a modified Harvard architecture machine where program and data are
stored in separate physical memory systems that appear in different address spaces,
but having the ability to read data items from program memory using special
instructions.
Basic families
AVRs are generally classified into five broad groups:
 tinyAVR — the ATtiny series
 0.5–8 kB program memory
 6–32-pin package
 Limited peripheral set
51

 megaAVR — the ATmega series


 4–256 kB program memory
 28–100-pin package
 Extended instruction set (Multiply instructions and instructions for handling
larger program memories)
 Extensive peripheral set
 XMEGA — the ATxmega series
 16–384 kB program memory
 44–64–100-pin package (A4, A3, A1)
 Extended performance features, such as DMA, "Event System", and
cryptography support.
 Extensive peripheral set with DACs
 Application-specific AVR
 megaAVRs with special features not found on the other members of the
AVR family, such as LCD controller, USB controller, advanced PWM,
CAN etc.
 FPSLIC™ (AVR with FPGA)
 FPGA 5K to 40K gates
 SRAM for the AVR program code, unlike all other AVRs
 AVR core can run at up to 50 MHz
 32-bit AVRs
Main article: AVR32
In 2006 Atmel released microcontrollers based on the new, 32-bit, AVR32
architecture. They include SIMD and DSP instructions, along with other
audio and video processing features. This 32-bit family of devices is
intended to compete with the ARM based processors. The instruction set is
52

similar to other RISC cores, but is not compatible with the original AVR or
any of the various ARM cores.

Device architecture
Flash, EEPROM, and SRAM are all integrated onto a single chip, removing the
need for external memory in most applications. Some devices have a parallel
external bus option to allow adding additional data memory or memory-mapped
devices. Almost all devices (except the smallest TinyAVR chips) have serial
interfaces, which can be used to connect larger serial EEPROMs or flash chips.
Program memory
Program instructions are stored in non-volatileflash memory. Although the MCUs
are 8-bit, each instruction takes one or two 16-bit words.
The size of the program memory is usually indicated in the naming of the device
itself (e.g., the ATmega64x line has 64 kB of flash while the ATmega32x line has
32 kB).
There is no provision for off-chip program memory; all code executed by the AVR
core must reside in the on-chip flash. However, this limitation does not apply to the
AT94 FPSLIC AVR/FPGA chips.
Internal data memory
The data address space consists of the register file, I/O registers, and SRAM.
Internal registers
53

Atmel ATxmega128A1 in 100-pin TQFP package


The AVRs have 32 single-byteregisters and are classified as 8-bit RISC devices.
In most variants of the AVR architecture, the working registers are mapped in as
the first 32 memory addresses (0000 16–001F16) followed by the 64 I/O registers
(002016–005F16).
Actual SRAM starts after these register sections (address 0060 16). (Note that the
I/O register space may be larger on some more extensive devices, in which case the
memory mapped I/O registers will occupy a portion of the SRAM address space.)
Even though there are separate addressing schemes and optimized opcodes for
register file and I/O register access, all can still be addressed and manipulated as if
they were in SRAM.
In the XMEGA variant, the working register file is not mapped into the data
address space; as such, it is not possible to treat any of the XMEGA's working
registers as though they were SRAM. Instead, the I/O registers are mapped into the
data address space starting at the very beginning of the address space.
Additionally, the amount of data address space dedicated to I/O registers has
grown substantially to 4096 bytes (000016–0FFF16). As with previous generations,
however, the fast I/O manipulation instructions can only reach the first 64 I/O
register locations (the first 32 locations for bitwise instructions). Following the I/O
registers, the XMEGA series sets aside a 4096 byte range of the data address space
54

which can be used optionally for mapping the internal EEPROM to the data
address space (100016–1FFF16). The actual SRAM is located after these ranges,
starting at 200016.
EEPROM
Almost all AVR microcontrollers have internal EEPROM for semi-permanent data
storage. Like flash memory, EEPROM can maintain its contents when electrical
power is removed.
In most variants of the AVR architecture, this internal EEPROM memory is not
mapped into the MCU's addressable memory space. It can only be accessed the
same way an external peripheral device is, using special pointer registers and
read/write instructions which makes EEPROM access much slower than other
internal RAM.
However, some devices in the SecureAVR (AT90SC) family use a special
EEPROM mapping to the data or program memory depending on the
configuration. The XMEGA family also allows the EEPROM to be mapped into
the data address space.
Since the number of writes to EEPROM is not unlimited — Atmel specifies
100,000 write cycles in their datasheets — a well designed EEPROM write routine
should compare the contents of an EEPROM address with desired contents and
only perform an actual write if contents need to be changed.
Program execution
Atmel's AVRs have a two stage, single level pipeline design. This means the next
machine instruction is fetched as the current one is executing. Most instructions
take just one or two clock cycles, making AVRs relatively fast among the eight-bit
microcontrollers.
The AVR family of processors were designed with the efficient execution of
compiledC code in mind and has several built-in pointers for the task.
55

Instruction set
Main article: Atmel AVR instruction set
The AVR Instruction Set is more orthogonal than those of most eight-bit
microcontrollers, in particular the 8051 clones and PIC microcontrollers with
which AVR competes today. However, it is not completely regular:
 Pointer registers X, Y, and Z have addressing capabilities that are different
from each other.
 Register locations R0 to R15 have different addressing capabilities than
register locations R16 to R31.
 I/O ports 0 to 31 have different addressing capabilities than I/O ports 32 to
63.
 CLR affects flags, while SER does not, even though they are complementary
instructions. CLR set all bits to zero and SER sets them to one. (Note that
CLR is pseudo-op for EOR R, R; and SER is short for LDI R,$FF. Math
operations such as EOR modify flags while moves/loads/stores/branches
such as LDI do not.)
 Accessing read-only data stored in the program memory (flash) requires
special LPM instructions; the flash bus is otherwise reserved for instruction
memory.
Additionally, some chip-specific differences affect code generation. Code pointers
(including return addresses on the stack) are two bytes long on chips with up to
128 kBytes of flash memory, but three bytes long on larger chips; not all chips
have hardware multipliers; chips with over 8 kBytes of flash have branch and call
instructions with longer ranges; and so forth.
The mostly-regular instruction set makes programming it using C (or even Ada)
compilers fairly straightforward. GCC has included AVR support for quite some
56

time, and that support is widely used. In fact, Atmel solicited input from major
developers of compilers for small microcontrollers, to determine the instruction set
features that were most useful in a compiler for high-level languages.
MCU speed
The AVR line can normally support clock speeds from 0-20 MHz, with some
devices reaching 32 MHz. Lower powered operation usually requires a reduced
clock speed. All recent (Tiny, Mega, and Xmega, but not 90S) AVRs feature an
on-chip oscillator, removing the need for external clocks or resonator circuitry.
Some AVRs also have a system clock prescaler that can divide down the system
clock by up to 1024. This prescaler can be reconfigured by software during run-
time, allowing the clock speed to be optimized.
Since all operations (excluding literals) on registers R0 - R31 are single cycle, the
AVR can achieve up to 1 MIPS per MHz, i.e. an 8 MHz processor can achieve up
to 8 MIPS. Loads and stores to/from memory take 2 cycles, branching takes 2
cycles. Branches in the latest "3-byte PC" parts such as ATmega2560 are one cycle
slower than on previous devices.
Development
AVRs have a large following due to the free and inexpensive development tools
available, including reasonably priced development boards and free development
software. The AVRs are sold under various names that share the same basic core
but with different peripheral and memory combinations. Compatibility between
chips in each family is fairly good, although I/O controller features may vary.
Features
Current AVRs offer a wide range of features:
 Multifunction, bi-directional general-purpose I/O ports with configurable,
built-in pull-up resistors
 Multiple internal oscillators, including RC oscillator without external parts
57

 Internal, self-programmable instruction flash memory up to 256 kB (384 kB


on XMega)
 In-system programmable using serial/parallel low-voltage proprietary
interfaces or JTAG
 Optional boot code section with independent lock bits for protection
 On-chip debugging (OCD) support through JTAG or debugWIRE on most
devices
 The JTAG signals (TMS, TDI, TDO, and TCK) are multiplexed on GPIOs.
These pins can be configured to function as JTAG or GPIO depending on
the setting of a fuse bit, which can be programmed via ISP or HVSP. By
default, AVRs with JTAG come with the JTAG interface enabled.
 debugWIRE uses the /RESET pin as a bi-directional communication channel
to access on-chip debug circuitry. It is present on devices with lower pin
counts, as it only requires one pin.
 Internal data EEPROM up to 4 kB
 Internal SRAM up to 16 kB (32 kB on XMega)
 External 64 kB little endian data space on certain models, including the
Mega8515 and Mega162.
 The external data space is overlaid with the internal data space, such that the
full 64 kB address space does not appear on the external bus. An accesses to
e.g. address 010016 will access internal RAM, not the external bus.
 In certain members of the XMega series, the external data space has been
enhanced to support both SRAM and SDRAM. As well, the data addressing
modes have been expanded to allow up to 16 MB of data memory to be
directly addressed.
58

 AVRs generally do not support executing code from external memory. Some
ASSPs using the AVR core do support external program memory.
 8-bit and 16-bit timers
 PWM output (some devices have an enhanced PWM peripheral which
includes a dead-time generator)
 Input capture
 Analog comparator
 10 or 12-bit A/D converters, with multiplex of up to 16 channels
 12-bit D/A converters
 A variety of serial interfaces, including
 I²C compatible Two-Wire Interface (TWI)
 Synchronous/asynchronous serial peripherals (UART/USART) (used with
RS-232, RS-485, and more)
 Serial Peripheral Interface Bus (SPI)
 Universal Serial Interface (USI) for two or three-wire synchronous data
transfer
 Brownout detection
 Watchdog timer (WDT)
 Multiple power-saving sleep modes
 Lighting and motor control (PWM-specific) controller models
 CAN controller support
 USB controller support
 Proper full-speed (12 Mbit/s) hardware & Hub controller with embedded
AVR.
 Also freely available low-speed (1.5 Mbit/s) (HID) bitbanging software
emulations
59

 Ethernet controller support


 LCD controller support
 Low-voltage devices operating down to 1.8 V (to 0.7 V for parts with built-
in DC–DC upconverter)
 picoPower devices
 DMA controllers and "event system" peripheral communication.
 Fast cryptography support for AES and DES
Programming interfaces
There are many means to load program code into an AVR chip. The methods to
program AVR chips varies from AVR family to family.
ISP
The In-system programming (ISP) programming method is functionally performed
through SPI, plus some twiddling of the Reset line. As long as the SPI pins of the
AVR aren't connected to anything disruptive, the AVR chip can stay soldered on a
PCB while reprogramming. All that's needed is a 6-pin connector and
programming adapter. This is the most common way to develop with an AVR.
The Atmel AVR ISP mkII device connects to a computer's USB port and performs
in-system programming using Atmel's software.
AVRDUDE (AVR Downloder UploaDEr) runs on Linux, FreeBSD, Windows, and
Mac OS X, and supports a variety of in-system programming hardware, including
Atmel AVR ISP mkII, Atmel JTAG ICE, older Atmel serial-port based
programmers, and various third-party and "do-it-yourself" programmers.
PDI
The Program and Debug Interface (PDI) is an Atmel proprietary interface for
external programming and on-chip debugging of XMEGA devices. The PDI
supports high-speed programming of all non-volatile memory (NVM) spaces;
60

flash, EEPROM, fuses, lock-bits and the User Signature Row. This is done by
accessing the XMEGA NVM controller through the PDI interface, and executing
NVM controller commands. The PDI is a 2-pin interface using the Reset pin for
clock input (PDI_CLK) and a dedicated data pin (PDI_DATA) for input and
output.
High voltage
High-voltage serial programming (hvsp) is mostly the backup mode on smaller
AVRs. An 8-pin AVR package doesn't leave many unique signal combinations to
place the AVR into a programming mode. A 12 volt signal, however, is something
the AVR should only see during programming and never during normal operation.
Parallel
Parallel programming is considered the "final resort" and may be the only way to
fix AVR chips with bad fuse settings. Parallel programming may be faster and
beneficial when programming many AVR devices for production use.
Bootloader
Most AVR models can reserve a bootloader region, 256 B to 4 KB, where re-
programming code can reside. At reset, the bootloader runs first, and does some
user-programmed determination whether to re-program, or jump to the main
application. The code can re-program through any interface available, it could read
an encrypted binary through an Ethernet adapter like PXE. Atmel has application
notes and code pertaining to many bus interfaces.[10]
ROM
The AT90SC series of AVRs are available with a factory mask-ROM rather than
flash for program memory. Because of the large up-front cost and minimum order
quantity, a mask-ROM is only cost-effective for high production runs.
aWire
61

aWire is a new one-wire debug interface available on the new UC3L AVR32
devices.
Atmel AVR Atmega328 28-pin DIP on a Arduino Duemilanove board

Atmel AVR Atmega8 28-pin DIP on a


custom designed development board
AVRs have been used in various automotive applications such as security, safety,
powertrain and entertainment systems. Atmel has recently launched a new
publication "Atmel Automotive Compilation" to help developers with automotive
applications. Some current usages are in BMW, Daimler-Chrysler and TRW.
The Arduinophysical computing platform is based on an ATmega328
microcontroller (ATmega168 or ATmega8 in older board versions than the
Diecimila). The ATmega1280 and ATmega2560, with more pinout and memory
capabilities, have also been employed to develop the Arduino Mega platform.
Arduino boards can be used with its language and IDE, or with more conventional
programming environments (C, assembler, etc.) as just standardized and widely
available AVR platforms.
62

USB-based AVRs have been used in the Microsoft Xbox hand controllers. The link
between the controllers and Xbox is USB.
Numerous companies produce AVR-based microcontroller boards intended for use
by hobbyists, robot builders, experimenters and small system developers including:
Cubloc, gnusb, BasicX, Oak Micros, ZX Microcontrollers, and myAVR. There is
also a large community of Arduino-compatible boards supporting similar users.
Few hobbyists prefer making their own version of board from scratch.
Schneider Electric produces the M3000 Motor and Motion Control Chip,
incorporating an Atmel AVR Core and an Advanced Motion Controller for use in a
variety of motion applications.
FPGA clones
With the growing popularity of FPGAs among the open source community, people
have started developing open source processors compatible with the AVR
instruction set. The OpenCores website lists the following major AVR clone
projects:
 pAVR, written in VHDL, is aimed at creating the fastest and maximally
featured AVR processor, by implementing techniques not found in the
original AVR processor such as deeper pipelining.
 avr_core, written in VHDL, is a clone aimed at being as close as possible to
the ATmega103.
 Navré, written in Verilog, implements all Classic Core instructions and is
aimed at high performance and low resource usage. It does not support
interrupts.
63

Fig 6.1: Window for choosing target device.

Next, Micro Vision must be instructed to generate a HEX file upon program
compilation. A HEX file is a standard file format for storing executable code that is
to be loaded onto the microcontroller. In the “Project Workspace” pane at the left,
right–click on “Target 1” and select “Options for ‘Target 1’ ”.Under the “Output”
tab of the resulting options dialog, ensure that both the “Create Executable” and
“Create HEX File” options are checked. Then click “OK”.
64

Fig 6.2: Project Options Dialog

Next, a file must be added to the project that will contain the project code.
To do this, expand the “Target 1” heading, right–click on the “Source Group 1”
folder, and select “Add files…” Create a new blank file (the file name should end
in “.asm”), select it, and click “Add.” The new file should now appear in the
“Project Workspace” pane under the “Source Group 1” folder. Double-click on the
newly created file to open it in the editor. All code for this lab will go in this file.
To compile the program, first save all source files by clicking on the “Save All”
button, and then click on the “Rebuild All Target Files” to compile the program as
shown in the figure below. If any errors or warnings occur during compilation,
they will be displayed in the output window at the bottom of the screen. All errors
and warnings will reference the line and column number in which they occur along
with a description of the problem so that they can be easily located. Note that only
errors indicate that the compilation failed, warnings do not (though it is generally a
good idea to look into them anyway).
65

Fig 6.3: Project Workspace Pane

Fig 6.4: “Save All” and “Build All Target Files” Buttons

At the left side of the debugger window, a table is displayed containing


several key parameters about the simulated microcontroller, most notably the
elapsed time (circled in the figure below). Just above that, there are several buttons
that control code execution. The “Run” button will cause the program to run
continuously until a breakpoint is reached, whereas the “Step Into” button will
execute the next line of code and then pause (the current position in the program is
indicated by a yellow arrow to the left of the code).
66

Fig 6.5: μVision3 Debugger window


67

5.2 AVRDUDE AVR PROGRAMMER

USBasp - USB programmer for Atmel AVR controllers

USBasp is a USB in-circuit programmer for Atmel AVR controllers. It simply


consists of an ATMega8 and a couple of passive components. The programmer
uses a firmware-only USB driver

Features
 Flash Burner for AVR Series from ATMEL
 Communication - USB
 Auto Erase before writing and Auto Verify after writing
 Freeware AVR GCC C Compiler
 ISP Programming FRC Socket
 Connects through AVR DUDE
 Device Support
68

CHAPTER 5
RESULT
Hardware kit of Automatic Soil Parameter Monitoring And Analysis Of
Green house System In Green House Using Iot is shown in Figure 5.1.

Figure 5.1 Hardware Kit


69

CHAPTER 6
CONCLUSION & FUTURE WORK
6.1 CONCLUSION
Precision Green House can be made more accurate and efficient with IOT
enabled technologies. IOT can be applied in different domains of Green House.
With the help of IOT, use of effective energy for pumps, boosters, lighting and
other purposes also done the second one is the crop monitoring. By deploying
sensors in the crop field which is connected to the internet for an appropriate
decision can be taken with IOT. Efficient use of fertilizers can be made with IOT.
Finally conclude that need to develop on optimal Agri-IoT architecture which is
enclosed with low cost, low power consumption of devices, better decision making
process, QoS service, optimal performance and it is easy to understand the farmer
without knowledge.

6.2 FUTURE WORK


In future, this idea can be implemented with more sensors and applications
like seed sowing and weed removing. Green House can be automated in all
aspects. A web server is also been set up through which the other farmers also get
information about the crops in their area. This project came in comfortable which a
worthy elucidation for maintaining farming environment. This model is providing
lot of opportunity in improvement and future development. All the components
and controlling units can be precised.
70
71

REFERENCES
[1] https://en.wikipedia.org/wiki/Precision _Green House.
[2] Zhao Liqiang, Yin Shouyi, Liu Leibo, Zhang Zhen, Wei Shaojun, ʊ A crop
Monitoring System Based on Wireless Sensor Network‫ۅ‬ELSEVIER,Procedia
Environmental Sciences-2011.
[3] Yingli Zhua*, Jingjiang Songa , Fuzhou Donga, ʊApplications of Wireless
sensor network in the Green House environment monitoring‫ ۅ‬ELSEVIER,Procedia
Engineering Sciences-2011.
[4] Shruti A Jaishetty, Rekha Patil, ʊIoT sensor network based approach for
agricultural field monitoring and control‫ ۅ‬.IJRET: International Journal of
Research in Engineering and Technology, Volume: 05 Issue: 06 | Jun-2016.
[5] Keerthi.v , Dr.G.N.Kodandaramaiah, ʊ cloud IoT Based greenhouse
Monitoring System‫ ۅ‬Int. Journal of Engineering Research and Applications ,ISSN:
2248-9622, Vol. 5, Issue 10, (Part - 3) October 2015, pp.35-41.
[6] Rajalakshmi.P, S.Devi Mahalakshmi , ʊIOT Based Crop-Field Monitoring and
Green house Automation system‫ۅ‬ .
ieeexplore.ieee.org/iel7/7589934/7726872/07726900.
[7] Baltej Kaur , Danish Inamdar, Vishal Raut,Akash Patil,Nayan Patil, ʊ A Survey
On Smart Drip Green house System‫ ۅ‬International Research Journal of
Engineering and Technology (IRJET) Volume: 03 Issue: 02 | Feb-2016.
[8] G. Parameswaran, K.Sivaprasath, ʊ Arduino Based Smart Drip Green house
System Using Internet of Things‫ ۅ‬DOI 10.4010/2016.1348 ,ISSN 2321 3361 ©
2016 IJESC.
[9] Bouzekri Amel, Chabane Mohamed, Benahmed Tarek, ʊ smart green house
system using Internet of Things‫ ۅ‬The Fourth International Conference on Future
Generation Communication Technologies (FGCT 2015).
72

[10] S.Reshma, B.A.Sarath Manohar Babu, ʊInternet of Things (IOT) based


Automatic Green house System using Wireless Sensor Network (WSN)
‫ۅ‬,International Journal & Magazine of Engineering ,Technology,Management and
Research,Volume No.3(2016),Issue No:9
[11] R.Hemalatha,G.Deepika,D.Dhanalakshmi, .Dharanipriya, M.Divya, ʊ Internet
Of Things (Iot) Based Smart Green house‫ ۅ‬, International Journal of Advanced
Research in Biology Engineering Science and Technology (IJARBEST) Vol. 2,
Issue 2, February 2016
[12] Miloš Brajoviü, Stefan Vujoviü, Slobodan Ĉukanoviü , ĴAn overview of
Smart Green house Software4, ‫ۅ‬th Mediterranean Conference on Embedded
Computing, MECO – 2015.
[13] Nikesh Gondchawar, Prof. Dr. R. S. Kawitkar, ʊIoT based Smart Green
House‫ ۅ‬,International Journal of Advanced Research in Computer and
Communication Engineering Vol. 5, Issue 6, June 2016
[14] Gayathri.R, Saranya.B, Binu., Lavanya, Devi, ʊ Optimized Equipment for
measurement of Soil Parameters and Conservation of Water in Agricultural Fields
‫ۅ‬.,International Journal of Innovative Research in Computer and communication
Engineering,Vol.4,Issue 6,June 2016.
[15] Srisruthi.S, N.Swarna, G.M.Susmitha Ros, Edna Elizabeth ,‫ۅ‬Sustainable
Green House using Eco-friendly and Energy Efficient Sensor Technology‫ۅ‬,IEEE
International Conference On Recent Trends In Electronics Information
Communication Technology,May 2016
[16] C.Thulasi Priya, K.Praveen, A.Srividya , ʊ proposed a system for monitoring
Pest Insect Traps Using Image Sensors & Dspic‫ ۅ‬, International Journal Of
Engineering Trends And TechnologyVolume 4 Issue 9-September2013
[17] Shalini D V , ʊ Automatic Pesticide Sprayer for Green House Purpose‫ۅ‬
,IJSART - Volume 2 Issue 7 –JULY 2016.
73

[18] Aravind R, Daman M, Kariyappa B S,‫ ۅ‬Design and Development of


Automatic Weed Detection and Smart Herbicide Sprayer Robot 2015, ‫ ۅ‬IEEE
Recent Advances in Intelligent Computational Systems (RAICS) | 10-12 December
2015 | Trivandrum
[19] Fiona Edwards Murphy_, Michele Magnoz, P´adraig Whelany, and Emanuel
Popovici, ʊb+WSN: Smart Beehive for Green House, Environmental, and Honey
Bee Health Monitoring -Preliminary Results and Analysis -6117-4799-1-978 , ‫ۅ‬
2015© 31.00$/7/15 IEEE.
[20] A.G.N. Bandara, B.M.A.N. Balasooriya, H.G.I.W. Bandara, K.S. Buddhasiri,
M.A.V.J. Muthugala, A.G.B.P. Jayasekara and D.P. Chandima Smart Green house
Controlling System for Green Roofs Based on Predicted Evapotranspiration, 978-
1-5090-5395- 7/16/$31.00 c 2016 IEEE.
[21] Sinung Suakanto#1, Ventje J. L. Engel#2, Maclaurin Hutagalung#3, Dina
Angela ʊSensor Networks Data acquisition and Task Management for Decision
Support of Smart Farming‫ ۅ‬, International Conference on Information Technology
Systems and Innovation (ICITSI)-2016.
[22] Joaquín Gutiérrez, Juan Francisco Villa-Medina, Aracely LópezGuzmán, and
Miguel Ángel Porta-Gándara ʊ Smartphone Green house Sensor 437-1530 ‫ۅ‬X (c)
2015 IEEE.
[23] Tanmay Baranwal , Nitika , Pushpendra Kumar Pateriya ʊ Development of
IoT based Smart Security and Monitoring Devices for Green House -4673-1-978, ‫ۅ‬
31.00$/8/16-8203_c 2016 IEEE.
[24] Ayush Kapoor, Suchetha I Bhat, Sushila Shidnal, Akshay Mehra ʊ
Implementation of And Image Processing In Smart Green House 2016. ‫ۅ‬
International Conference on Computational Systems an

You might also like