Professional Documents
Culture Documents
PROJECT
PROJECT
PROJECT
CHAPTER 1
INTRODUCTION
1.1 OBJECTIVE OF THE PROJECT:
Agribusiness makes utilization of eighty five percentage of to be had freshwater assets
worldwide, and this percent will keep on being overwhelming in water allow because of populace
increment and duplicated nourishment request. There is a squeezing need to make systems construct
absolutely with respect to innovation for maintainable utilization of water,comprehensive of
specialized, agronomic, administrative, and institutional updates.
There are numerous frameworks to procure water investment funds in differing plants,
from central ones to additional mechanically propelled ones. For instance, in a solitary gadget plant
water notoriety changed into checked and water system planned in light of shade temperature
dispersion of the plant, which end up noticeably gotten with warm imaging .moreover, unique
structures have been advanced to time table water system of yields and streamline water use by
utilizing a harvest water strain file (CWSI). This contraption utilizes sensors like stickiness, soil
dampness.
These sensors send qualities to small scale controller. Microcontroller sends qualities to
PC utilizing serial discussion. As indicated by constant sensors esteems relentless diagram is show
on PC and Android Based portable utilizing Internet and Android application. Here edge expense is
keep, if sensor esteems pass the edge charge at that point drip Irrigation segments can be control
mechanically through microcontroller.
1.2 INTRODUCTION TO EMBEDDED SYSTEMS:
An embedded system can be defined as a computing device that does a specific focused
job. Appliances such as the air-conditioner, VCD player, DVD player, printer, fax machine, mobile
phone etc. are examples of embedded systems. Each of these appliances will have a processor and
special hardware to meet the specific requirement of the application along with the embedded
software that is executed by the processor for meeting that specific requirement. The embedded
software is also called “firm ware”. The desktop/laptop computer is a general purpose computer. You
can use it for a variety of applications such as playing games, word processing, accounting, software
development and so on. In contrast, the software in the embedded systems is always fixed listed
below:
IP phone, IP gateway, IP gatekeeper etc. are the latest embedded systems that provide very low-cost
voice communication over the Internet.
1.3.7 Wireless technologies:
Advances in mobile communications are paving way for many interesting applications using
embedded systems. The mobile phone is one of the marvels of the last decade of the 20’th century. It
is a very powerful embedded system that provides voice communication while we are on the move.
The Personal Digital Assistants and the palmtops can now be used to access multimedia services
over the Internet.
1.3.8 Insemination:
Testing and measurement are the fundamental requirements in all scientific and engineering
activities. The measuring equipment we use in laboratories to measure parameters such as weight,
temperature, pressure, humidity, voltage, current etc. are all embedded systems. Test equipment such
as oscilloscope, spectrum analyzer, logic analyzer, protocol analyzer, radio communication test set
etc. are embedded systems built around powerful processors. Thank to miniaturization, the test and
measuring equipment are now becoming portable facilitating easy testing and measurement in the
field by field-personnel.
1.3.9 Security:
Security of persons and information has always been a major issue. We need to protect our
homes and offices and also the information we transmit and store. Developing embedded systems for
security applications is one of the most lucrative businesses nowadays. Security devices at homes,
offices, airports etc. for authentication and verification are embedded systems. Encryption devices
are nearly 99% of the processors that are manufactured end up in embedded systems. Embedded
systems find applications in biometric systems using fingerprint and face recognition are now being
extensively used for user authentication in banking applications as well as for access control in high
security buildings.
1.3.10 Finance:
Financial dealing through cash and cheques are now slowly paving way for transactions using
smart cards and ATM (Automatic Teller Machine, also expanded as Any Time Money) machines.
Smart card of the size of a credit card has a small micro-controller and memory and it interacts with
the smart card reader ATM machine and acts as an electronic wallet. Smart card technology has the
capability of ushering in a cashless society. Well, the list goes on. It is no exaggeration to say that
eyes wherever you go, you can see, or at least feel, the work of an embedded system
1.4 OVERVIEW OF EMBEDDED SYSTEM ARCHITECTURE:
Every embedded system consists of custom-built hardware built around a Central Processing
Unit (CPU). This hardware also contains memory chips onto which the software is loaded. The
software residing on the memory chip is also called the ‘firmware’. The embedded system
architecture can be represented as a layered architecture as shown in Fig.
Application Software
Operating
System
H/W
The operating system runs above the hardware and the application software runs above the
operating system. The same architecture is applicable to any computer including a desktop computer.
However, there are significant differences. It is not compulsory to have an operating system in every
embedded system. For small appliances such as remote control units, air conditioners, toys etc., there
is no need for an operating system and you can write only the software specific to that application.
For applications involving complex processing, it is advisable to have an operating system. In such a
case, you need to integrate the application software with the operating system and then transfer the
entire software on to the memory chip. Once the software is transferred to the memory chip, the
software will continue to run for a long time you don’t need to reload new software.
Communication
Application-Specific Security Interfaces
1.4.2 Memory:
The memory is categorized as Random Access Memory (RAM) and Read Only Memory
(ROM). The contents of the RAM will be erased if power is switched off to the chip, whereas ROM
retains the contents even if the power is switched off. So, the firmware is stored in the ROM. When
power is switched on, the processor reads the ROM, The program is executed.
1.4.3 Input devices:
Unlike the desktops, the input devices to an embedded system have very limited capability.
There will be no keyboard or a mouse, and hence interacting with the embedded system is no easy
task. Many embedded systems will have a small keypad-you press one key to give a specific
command. A keypad may be used to input only the digits. Many embedded systems used in process
control do not have any input device for user interaction, they take inputs from sensors or transducers
find produce electrical signals that are in turn fed to other systems.
1.4.4 Output devices:
The output devices of the embedded systems also have very limited capability. Some
embedded systems will have a few Light Emitting Diodes (LEDs) to indicate the health status of the
system modules, or for visual indication of alarms. A small Liquid Crystal Display (LCD) may also
be used to display some important parameters.
1.4.5 Communication interfaces:
The embedded systems may need to, interact with other embedded systems at they may have
to transmit data to a desktop. To facilitate this, the embedded systems are provided with one or a few
communication interfaces such as RS232, RS422, RS485, Universal Serial Bus (USB), and IEEE
1394, Ethernet etc.
1.4.6Application-specific circuitry:
Sensors, transducers, special processing and control circuitry may be required fat an
embedded system, depending on its application. This circuitry interacts with the processor to carry
out the necessary work. The entire hardware has to be given power supply either through the 230
volts main supply or through a battery. The hardware has to design in such a way that the power
consumption is minimized.
CHAPTER 2
EXISTING SYSTEM
In some of the water system contraption water system booking is done by means of following
soil, water prevalence with tension meters underneath trickle water system through the
computerization controller device in sandy soil.
It is exceptionally vital for the rancher to save the substance inside the subject. It is extremely
hard to gauge the substance material of the division. Presently a day there is no framework like this
to quantify.
CHAPTER 3
PROPOSED SYSTEM
The proposed gadget has exceptional sensors, a small scale controller, GPRS and quality
assets. A few WSUs might be conveyed in-zone to design a dispensed sensor group for the
programmed water system gadget. Every unit relies upon on the miniaturized scale controller that
controls the radio modem GPRS and tactics statistics from the dirt dampness sensor, temperature
sensor and water degree sensor. In this remote sensor unit or transmission unit the sensor information
from various sensors (Soil dampness, temperature, moistness and water degree) are amassed within
the primary controller. This fact is shown on transmission section LCD. Arduino controller is
changed to some restrict estimations of temperature and soil dampness
BLOCK DIAGRAM:
Power supply
DHT11 sensor
GPRS
Pumping motor
WORKING:
By using DHT11 we can find the temperature and humidity and soil moisture sensor is used
to detect the condition of the soil. If soil moisture sensor is in dry condition the pumping motor will
on. Here LCD is used to display the temperature and humidity values. By using GPRS we can
transmit the data.
The AC mains are fed to the transformer, which steps down the 230 Volts to the desired
voltage. The bridge rectifier follows the transformer thus converting AC voltage into a DC output
and through a filtering capacitor feeds it directly into the input (Pin 1) of the voltage regulator. The
common pin (Pin 2) of the voltage regulator is grounded. The output (Pin 3) of the voltage regulator
is first filtered by a capacitor, and then the output is taken. Make the circuit on a general purpose
PCB and use a 2 Pin (5A) plug to connect the transformer input to the AC mains via insulated copper
wires.
CHAPTER 4
HARDWARE DESCRIPTION
A power supply is a device which delivers an exact voltage to another device as per its needs.
There are many power supplies available today in the market like regulated, unregulated, variable
etc, and the decision to pick the correct one depends entirely on what device you are trying to operate
with the power supply.
Power supplies, often called power adapters, or simply adapters, are available in various
voltages, with varying current capacities, which is nothing but the maximum capacity of a power
supply to deliver current to a load (Load is the device you are trying to supply power to).
Optional:
LED (for indication)
Resistor (Value explained later)
Heat Sink for The Voltage Regulator (For higher current outputs)
SPST Switch
4.1.2 Transformers:
Transformers are devices which step down a relatively higher AC input Voltage into a lower AC
output voltage. To find the input and output terminals of a transformer is very tricky. Refer to the
following illustration or the internet to understand where what is.
Basically, there are two sides in a transformer where the coil winding inside the transformer
ends. Both ends have two wires each (unless you are using a center-tapped transformer for full wave
rectification).
On the transformer, one side will have three terminals and the other will have two. The one with
the three terminals is the stepped down output of the transformer, and the one with the two terminals
is where the input voltage is to be provided.
The78XX series of voltage regulators is a widely used range of regulators all over the world.
The XX denotes the voltage that the regulator will regulate as output, from the input voltage. For
instance, 7805 will regulate the voltage to 5V.
Similarly, 7812 will regulate the voltage to 12V. The thing to remember with these voltage
regulators is that they need at least 2 volts more than their output voltage as input. For instance, 7805
will need at least 7V, and 7812, at least 14 volts as inputs. This excess voltage which needs to be
given to voltage regulators is called Dropout Voltage.
4. 1. 4 Diode Bridge:
A bridge rectifier consists of an assembly of four ordinary diodes, by means of which we can
convert AC Voltage into DC conversion, over Full wave and half wave rectifiers. You can use any
model you want, but I use this for the sake of high efficiency (If you are using the full wave rectifier
model, you’ll need a center-tapped transformer, and you will only be able to use half of the
transformer voltage).One thing to note about diodes is that they drop about 0.7V each when operated
in forward bias. So, in bridge rectification we will drop 1.4V because at one instant two diodes are
conducting and each will drop 0.7V. In case of Full wave rectifier, only 0.7V will be dropped.
So how does this drop affect us? Well, this comes handy while choosing the correct step down
voltage for the transformer. See, our voltage regulator needs 2 Volts more than its output voltage.
For the sake of explanation, let’s assume that we are making a 12V adapter. So the voltage regulator
needs at least 14 Volts as input.
So the output of the diodes (which goes into the voltage regulator) will have to be more than or equal
to 14 Volts. Now for the diodes input voltage. They’ll drop 1.4 Volts in total, so the input to them
has to be greater than or equal to 14.0 + 1.4 = 15.4 Volts. So I would probably use a 220 to 18 Volt
step down transformer for that. So basically, the transformer step down voltage should be at least 3.4
V more than the desired Power Supply output.
DIODE
We filter, both the input and output of the voltage regulator in order to get the smoothest DC
Voltage as possible, from our adapter, for which we use capacitors. Capacitors are the simplest
current filters available, they let AC current pass through and block DC, so they are used in parallel
to the output. Furthermore, if there is a ripple in the input or output, a capacitor rectifies it by
discharging the charge stored in it
4.1.6 Rectifier:
A rectifier is a circuit which converts AC to DC. It is made up of diodes. There are three types
of rectifier circuits.
Half Wave
Full Wave
Bridge Rectifier
A rectifier is generally followed by a filter circuit to improve the quality of output. Rectifiers
play an important part of the power supplies for electronic appliances operating at DC voltages. The
half wave rectifier uses only one diode whereas the full wave and bridge uses two and four diodes
respectively.
AC
voltage
Load
source
Fig 4.8: Bridge Wave Rectifiers
Working of Rectifiers:
The AC mains are fed to the transformer, which steps down the 230 Volts to the desired voltage.
The bridge rectifier follows the transformer thus converting AC voltage into a DC output and
through a filtering capacitor feeds it directly into the input (Pin 1) of the voltage regulator.
The common pin (Pin2) of the voltage regulator is grounded. The output (Pin3) of the voltage
regulator is first filtered by a capacitor, and then the output is taken. Make the circuit on a general
purpose PCB and use 2 Pin (5A) plug to connect the transformer input to the Ac mains via insulated
copper wires.
4. 1. 7 Circuit Diagram for the Power Supply:
4. 2 ARDUINO:
The Arduino microcontroller is an easy to use yet powerful single board computer that has
gained considerable traction in the hobby and professional market. The Arduino is open-source,
which means hardware is reasonably priced and development software is free. This guide is for
students in ME 2011, or students anywhere who are confronting the Arduino for the first time. For
advanced Arduino users, prowl the web; there are lots of resources.
This is what the Arduino board looks like.
4. 2. 1 Arduino Hardware:
The power of the Arduino is not its ability to crunch code, but rather its ability to interact with
the outside world through its input-output (I/O) pins. The Arduino has 14 digital I/O pins labeled 0 to
13 that can be used to turn motors and lights on and off and read the state of switches.
Each digital pin can sink or source about 40mA of current. This is more than adequate for interfacing
to most devices, but does mean that interface circuits are needed to control devices other than simple
LED's. In other words, you cannot run a motor directly using the current available from an Arduino
pin, but rather must have the pin drive an interface circuit that in turn drives the motor. A later
section of this document shows how to interface to a small motor.
To interact with the outside world, the program sets digital pins to a high or low value using C code
instructions, which corresponds to +5 V or 0 V at the pin. The pin is connected to external interface
electronics and then to the device being switched on and off. The sequence of events is shown in this
figure.
To determine the state of switches and other sensors, the Arduino is able to read the voltage
value applied to its pins as a binary number. The interface circuitry translates the sensor signal into a
0 or +5 V signal applied to the digital I/O pin. Through a program command, the Arduino
interrogates the state of the pin. If the pin is at 0 V, the program will read it as a 0 or LOW. If it is at
+5 V, the program will read it as a 1 or HIGH. If more than +5 V is applied, you may blow out your
board, so be careful. The sequence of events to read a pin is shown in this figure.
Interacting with the world has two sides. First, the designer must create electronic interface circuits
that allow motors and other devices to be controlled by a low (1-10 mA) current signal that switches
between 0 and 5 V, and other circuits that convert sensor readings into a switched 0 or 5 V signal.
Second, the designer must write a program using the set of Arduino commands that set and
read the I/O pins. Examples of both can be found in the Arduino resources section of the ME2011
web site.
4. 2. 2 Physical Characteristics:
The Arduino Uno can be powered via the USB connection or with an external power supply. The
power source is selected automatically. External (non-USB) power can come either from an AC-to-
DC adapter or battery.
4.2.3 POWER:
The adapter can be connected by plugging a 2.1mm center-positive plug into the board's
power jack. Leads from a battery can be inserted in the Gnd and Vin pin headers of the POWER
connector. The board can operate on an external supply of 6 to 20 volts. If supplied with less than
7V, however, the 5V pin may supply less than five volts and the board may be unstable. If using
more than 12V, the voltage regulator may overheat and damage the board. The recommended range
is 7 to 12 volts. The power pins are as follows:
VIN:
The input voltage to the Arduino board when it's using an external power source (as opposed
to 5 volts from the USB connection or other regulated power source). You can supply voltage
through this pin or if supplying voltage via the power jack, access it through this pin.
5V:
This pin outputs a regulated 5V from the regulator on the board. The board can be supplied
with power either from the DC power jack (7 - 12V), the USB connector (5V), or the VIN pin of the
board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and can damage
your board. We don't advise it.
3V:
A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA.
GND:
Ground pins.
Each of the 14 digital pins on the Uno can be used as an input or output, using pinMode (),
digitalWrite (), and digitalRead () functions. They operate at 5 volts. Each pin can provide or receive
a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-50 kOhms.
In addition, some pins have specialized functions:
Used to receive (RX) and transmit (TX) TTL serial data. These pins are connected to the
corresponding pins of the ATmega8U2 USB-to-TTL Serial chip.
These pins can be configured to trigger an interrupt on a low value, a rising or falling edge,
or a change in value. See the attachInterrupt() function for details.
LED: 13:
There is a built-in LED connected to digital pin 13. When the pin is HIGH value, the LED is
on, when the pin is LOW, it's off.
The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of
resolution (i.e. 1024 different values).
TWI:
A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire library.
AREF:
Reset:
Typically used to add a reset button to shields which block the one on the board.
See also the mapping between Arduino pins and ATmega328 ports. The mapping for the Atmega8,
168, and 328 is identical.
4. 2. 5 Communication:
The Arduino Uno has a number of facilities for communicating with a computer, another
Arduino, or other microcontrollers.
The ATmega328 provides UART TTL (5V) serial communication, which is available on digital
pins 0 (RX) and 1 (TX).
An ATmega16U2 on the board channels this serial communication over USB and appears as a
virtual com port to software on the computer.
The '16U2 firmware uses the standard USB COM drivers, and no external driver is needed.
However, on Windows, a.inf file is required.
The Arduino software includes a serial monitor which allows simple textual data to be sent to
and from the Arduino board.
The RX and TX LEDs on the board will flash when data is being transmitted via the USB-to-
serial chip and USB connection to the computer (but not for serial communication on pins 0 and
1).
A SoftwareSerial library allows for serial communication on any of the UNO's digital pins. The
ATmega328 also supports I2C (TWI) and SPI communication
4. 3. 1 Features:
– Optional Boot Code Section with Independent Lock Bits In-System Programming by
On-chip Boot Program True Read-While-Write Operation
Peripheral Features
– One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture
Mode
– Six PWM Channels – 8-channel 10-bit ADC in TQFP and QFN/MLF package
Temperature Measurement – 6-channel 10-bit ADC in PDIP Package
Temperature Measurement
– Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, Standby,
and Extended Standby
4.3.2PinDiagram:
4. 3. 3 Pin Descriptions:
VCC:
GND:
Ground.
Port B 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 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.
Depending on the clock selection fuse settings, PB6 can be used as input to the inverting
Oscillator amplifier and input to the internal clock operating circuit. Depending on the clock
selection fuse settings, PB7 can be used as output from the inverting Oscillator amplifier.
(If the Internal Calibrated RC Oscillator is used as chip clock source, PB7..6 is used as
TOSC2.1 input for the Asynchronous Timer/Counter2 if the AS2 bit in ASSR is set. The various
special features of Port B are elaborated in “Alternate Functions of Port B” and ”System Clock and
Clock Options” .
Port C (PC5:0):
Port C is a 7-bit bi-directional I/O port with internal pull-up resistors (selected for each bit).
The PC5..0 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.
PC6/RESET:
If the RSTDISBL Fuse is programmed, PC6 is used as an I/O pin. Note that the electrical
characteristics of PC6 differ from those of the other pins of Port C. If the RSTDISBL Fuse is un
programmed, PC6 is used as a 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 minimum pulse length is
given in Table 28-3 on page 308. Shorter pulses are not guaranteed to generate a Reset. The various
special features of Port C are elaborated in”Alternate Functions of Port C” .
Port D (PD7:0):
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. The various special features of Port D are elaborated in”Alternate Functions
of Port D”.
AVCC:
AVCC is the supply voltage pin for the A/D Converter, PC3:0, and ADC7: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. Note that PC6.4 use digital supply voltage, VCC.
AREF:
AREF is the analog reference pin for the A/D Converter
ADC7:6 (TQFP and QFN/MLF Package Only):
In the TQFP and QFN/MLF package, ADC7:6 serve as analog inputs to the A/D converter.
These pins are powered from the analog supply and serve as 10-bit ADC channels.
4. 3. 4 BLOCK DIAGRAM:
4. 3. 5 DESCRIPTION:
The ATmega328P provides the following features: 4/8/16/32K bytes of In System
Programmable Flash with Read-While-Write capabilities, 256/512/512/1K bytes EEPROM,
512/1K/1K/2K bytes SRAM, 23 general purpose I/O lines, 32 general purpose working registers,
three flexible Timer/Counters with compare modes, internal and external interrupts, a serial
programmable USART, a byte-oriented 2-wire Serial Interface, an SPI serial port, a 6-channel 10-bit
ADC (8 channels in TQFP and QFN/MLF packages), a programmable Watchdog Timer with internal
Oscillator, and five software selectable power saving modes. The Idle mode stops the CPU while
allowing the SRAM, Timer/Counters, USART, 2-wire Serial Interface, SPI port, and interrupt
system to continue functioning. The Power-down mode saves the register contents but freezes the
Oscillator, disabling all other chip functions until the next interrupt or hardware reset.
In Power-save mode, the asynchronous timer continues to run, allowing the user to maintain a
timer base while the rest of the device is sleeping. The ADC Noise Reduction mode stops the CPU
and all I/O modules except asynchronous timer and ADC, to minimize switching noise during ADC
conversions.
In Standby mode, the crystal/resonator Oscillator is running while the rest of the device is
sleeping. This allows very fast start-up combined with low power consumption.
The device is manufactured using Atmel’s high density non-volatile memory technology. The
On-chip ISP Flash allows the program memory to be reprogrammed In-System through an SPI serial
interface, by a conventional non-volatile memory programmer, or by an On-chip Boot program
running on the AVR core.
The Boot program can use any interface to download the application program in the
Application Flash memory. Software in the Boot Flash section will continue to run while the
Application Flash section is updated, providing true Read-While-Write operation. By combining an
8-bit RISC CPU with In-System Self-Programmable Flash on a monolithic chip, the Atmel
ATmega48PA/88PA/168PA/328P is a powerful microcontroller that provides a highly flexible and
cost effective solution to many embedded control applications.
4. 3. 6 Memory:
The ATmega328 has 32 KB (with 0.5 KB used for the boot loader). It also has 2 KB of
SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM library).
4. 3. 7 Register File:
32 8-bit GP registers
Part of SRAM memory space
4. 3. 8 AVR Memory:
4
.
F
i
g
4.14: Data Memory of AVR
4. 3. 9 Addressing Modes:
The AVR Enhanced RISC microcontroller supports powerful and efficient addressing modes for
access to the program memory (Flash) and data memory (SRAM,Register file, I/O memory, and
extended I/O memory).
Types:
Direct register addressing
Direct I/O addressing
Direct data memory addressing
Direct data memory with displacement addressing
Direct Register Adressing:
The operand is contained in register d (Rd).
Operand are contained in register r (Rr) and d (Rd). The result is stored in register d (Rd).
A 16-bit Data Address is contained in the 16 LSBs of a two-word instruction.Rd/Rr specifies the
destination or source register.
Operand addressing is the result of the Y- or Z-register contents added to the address contained
in six bits of the instruction word. Rd/Rr specifies the destination or source register.
LCD (Liquid Crystal Display) screen is an electronic display module and find a wide
range of applications. A 16x2 LCD display is very basic module and is very commonly used in
various devices and circuits. These modules are preferred over seven segments and other multi
segment LEDs.
LCDs are economical; easily programmable; have no limitation of displaying special &
even custom characters (unlike in seven segments), animations and so on.
A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this
LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers, namely, Command
and Data.
The command register stores the command instructions given to the LCD. A command is
an instruction given to LCD to do a predefined task like initializing it, clearing its screen, setting the
cursor position, controlling display etc. The data register stores the data to be displayed on the LCD.
The data is the ASCII value of the character to be displayed on the LCD. Click to learn more about
internal structure of a LCD.
4. 4. 1 Pin Diagram:
4. 4. 2 Pin Description:
Pin
Function Name
No
1 Ground (0V) Ground
2 Supply voltage; 5V (4.7V – 5.3V) Vcc
3 Contrast adjustment; through a variable resistor VEE
Register
4 Selects command register when low; and data register when high
Select
5 Low to write to the register; High to read from the register Read/write
6 Sends data to data pins when a high to low pulse is given Enable
7 DB0
8 DB1
9 DB2
10 DB3
8-bit data pins
11 DB4
12 DB5
13 DB6
14 DB7
15 Backlight VCC (5V) Led+
16 Backlight Ground (0V) Led-
of address
counter in
bits AC6-
AC0.
Set 0 0 1 A A A A A A A Set 39
DDR C C C C C C C DDRAM µs
AM 6 5 4 3 2 1 0 address in
Addr address
ess counter.
Set 0 0 0 1 A A A A A A Set 39
CGR C C C C C C CGRAM µs
AM 5 4 3 2 1 0 Address in
Addr address
ess counter.
Func 0 0 0 0 1 D N F X X Set 39
tion L interface µs
Set data
length
(DL:
4bit/8bit),
Numbers
of display
line (N: 1-
line/2-
line)
display
font type
(F:0→
5×8 dots,
F:1→
5×11 dots)
Curs 0 0 0 0 0 1 S R X X Set cursor 39
or or / / moving µs
Disp C L and
lay display
Shift shift
control bit,
and the
direction
without
changing
DDRAM
data
Disp 0 0 0 0 0 0 1 D C B Set 39
lay Display(D µs
& ),Cursor(C
Curs ) and
or cursor
On/ blink(b)
Off on/off
control
Entr 0 0 0 0 0 0 0 1 I S Assign 0µs
y / H cursor
Mod D moving
e Set direction
and enable
shift entire
display.
Retu 0 0 0 0 0 0 0 0 1 X Set 43µ
rn DDRAM s
Hom Address to
e “00H”
from AC
and return
cursor to
its original
position if
shifted.
Clea 0 0 0 0 0 0 0 0 0 1 Write 43µ
r “20H” to s
Disp DDRAM
lay and set
DDRAM
Address to
“00H”
from AC
AC –ADDRESS COUNTER:
Outline
1 1 D7 D6 D5 D4 D3 D2 D1 D0
The correct RAM data from the second, but the first data would be incorrect, as there is no time
to transfer RAM data. In case of DDRAM read operation, cursor shift instruction plays the same role
as DDRAM address set instruction; it also transfers RAM data to the output data registers.
After read operation, the data address counter is automatically increased or decreased by 1
according to the entry mode. After CGRAM read operation, display shift may not be executed
properly.
In case of RAM write operation, AC is increased or decreased by 1 like that of the read
operation. In this time AC indicates the next address position, but the previous data can only by the
read instruction.
1 0 D7 D6 D5 D4 D3 D2 D1 D0
Write binary 8bit data to DDRAM/CGRAM. The selection of CGRAM or DRAM is set by
the previous address set instruction; DDRAM address set, CGRAM address set. RAM set instruction
can also determine the AC direction to RAM.
After write operation, the address is automatically increased or decreased by 1 according to the entry
mode.
By making this read out operation, it can be determined if the LCD is performing some
internal operation or not. If Busy Flag (BF) is high, some internal operation is going inside the LCD
at that particular moment. To perform further operation the data source (e.g. micro controller) must
wait for the BF to go low. Here, the address counter value can also be read.
Set DDRAM address to AC, this instruction makes DDRAM data available from MPU. In 1-
line display mode, DDRAM address rangers from “00H” to “4FH”. In 2-line display mode, DDRAM
address in the first line ranges from “00H” to “27H”, and DDRAM address in the 2 nd line is from
“40H” to “67H”.
Set CGRAM address to AC. This instruction makes CGRAM data available from MPU.
6) Function Set:
0 0 0 0 1 DL N F X X
0 0 0 0 0 1 S/C R/L X X
Without writing or reading the display data, shifting right/left cursor position or display. This
instruction is made to correct or search or display data. During 2-line display mode, cursor moves to
the 2nd line after the 40th digit of the 1st line. When displayed data is shifted repeatedly, each line
shifts individually. When display shift is performed, the contents of the address counter are not
changed.
0 0 0 0 0 0 1 D C B
0 0 0 0 0 0 0 1 I/D SH
0 0 0 0 0 0 0 0 1 X
This instruction sets the address counter to ‘00H’, and returns the cursor to the first column of
first line. And if display is shifted previously, this instruction shifts this too. The DDRAM contents
don’t change in this instruction.
0 0 0 0 0 0 0 0 0 1
Clear all the display data by writing “20H” (ASCII code of ‘space’ character) to all DDRAM
address, AND set value DDRAM address counter (AC) to “00H”. It returns the cursor to the first
column of first line and sets the entry mode to increment mode (I/D=’1’).
4 BIT MODE
8 BIT MODE
4. 4. 7 8 BIT MODE:
There is lot of stuff that can be done with the LCDs, to start with we will simple display a
couple of strings on the 2 lines of the LCD as shown in the image.
Schematic description
Data Lines:
In this mode, all of the 8 data lines DB0 to DB7 are connected from the microcontroller to a LCD
module as shown the schematic.
Control Lines:
The RS, RW and E are control lines, as discussed earlier.
Power & contrast: Apart from that the LCD should be powered with 5V between PIN 2(VCC) and
PIN 1(gnd). PIN 3 is the contrast pin and is output of center terminal of potentiometer (voltage
divider) which varies voltage between 0 to 5v to vary the contrast.
Back-light:
The PIN 15 and 16 are used as backlight. The led backlight can be powered through a simple
current limiting resistor as we do with normal leds
.
4. 4. 8 4 BIT MODE:
Schematic
In code, we need to send the command to select 4 bit mode as shown in the instruction set
above.
4. 4. 9 LCD Display Interfacing – Flowchart:-
RS pin of the LCD module is connected to digital pin12 of the Arduino .R/W pin of the
LCD is grounded .Enable pin of the LCD module is connected to digital pin 11 of the Arduino .In
this project, the LCD module and Arduino are interfaced in the 4-bit mode. This means only four of
the digital input lines of the LCD are used. This method is very simple, requires less connections and
you can almost utilize the full potential of the LCD module .Digital lines DB4, DB5, DB6 and DB7
are interfaced to digital pins 5, 4, 3 and 2 of the Arduino. The 10k potentiometer is used for adjusting
the contrast of the display.560 ohm resistor R1limits the current through the LED. The Arduino can
be powered through the external power jack provided on the board.+5v required in some other parts
of the circuit can be tapped from the 5v source on the Arduino board. The Arduino can be also
powered from the PC through the USB port.
This DHT11 Temperature and Humidity Sensor include an adjusted advanced flag yield with
the temperature and mugginess sensor complex. Its innovation guarantees the high dependability and
magnificent long haul solidness. An elite 8-bit microcontroller is associated. This sensor incorporates
a resistive component and a feeling of wet NTC temperature measuring gadgets. It has superb
quality, quick reaction, hostile to impedance capacity and high cost execution points of interest.
Each DHT11 sensors highlights to a great degree exact adjustment of dampness alignment
chamber. The adjustment coefficients put away in the OTP program memory, inner sensors identify
motions all the while, we should call these alignment coefficients. The single-wire serial interface
framework is coordinated to end up noticeably snappy and simple. Little size, low power, flag
transmission remove up to 20 meters, making it an assortment of utilizations and even the most
requesting applications. The item is 4-stick single column stick bundle. Advantageous association,
uncommon bundles can be given by clients require.
Specification
Supply Voltage: +5 V
Temperature range :0-50 °C error of ± 2 °C
Humidity :20-90% RH ± 5% RH error
Interface: Digital
4.7 GPRS:
It is a standard set created by the European Telecommunications Standards Institute (ETSI) to
portray conventions for second era (2G) computerized cell systems utilized by cell phones. A
Modem is a gadget which tweaks and demodulates motions as required to meet the correspondence
necessities. It regulates a simple transporter flag to encode computerized info, and furthermore
demodulates such a bearer flag to interpret the transmitted data.
A GPRS Modem is a device that modulates and demodulates the GPRS signals and in this
particular case 2.5G signals. The modem we are using is SIMCOM SIM900. It is a Tri-band GPRS
Modem as it can detect and operate at three frequencies (EGPRS 900 MHz DCS1800 MHz and PCSI
1900 MHz). Default operating frequencies are EGPRS 1900 MHz DCS1800 MHz
Sim900 is a widely used in many projects and hence many variants of development boards for
this have been developed. These development boards are equipped with various features to make it
easy to communicate with the SIM900 module. Some boards provide only TTL interface while some
boards include an RS232 interface and some others include an USB interface. If your PC has an
serial port (DB9) you can buy a GPRS Modem that has both TTL and RS232 interfacing in
economy.
Sim900 GPRS module used here, consists of a TTL interface and an RS232 interface. The TTL
interface allows us to directly interface with a micro controller while the RS232 interface includes a
MAX232 IC to enable communication with the PC. It also consists of a buzzer, antenna and SIM
slot. Sim300 in this application is used as a D0CE(Data Circuit-terminating Equipment) and PC has
a DTE(Data Terminal Equipment).
The GPRS core network is the central part of the general packet radio service (GPRS) which allows
2G, 3G and WCDMA mobile networks to transmit IP packets to external networks such as the Internet.
The GPRS system is an integrated part of the GSM network switching subsystem.
GPRS Technology has frown so much, that literally there isn’t a place on earth where there is
known a GPRS signal. In such a scenario ‘GPRS provides us wide scope in controlling things
remotely from any place just with our finger tips. GPRS also provides ease to easily communicate in
a more robust way.
A GPRS module has an RS232 interface for serial communication with an external peripheral.
In this case , the transmit pin(TX) of a computer’s Serial port is connected with the receive pin(RX)
of the GPRS modules RS-232 interface. The transmit pin(TX) of the RS-232 of GPRS module is
connected to receive pin(RX) of microcontroller serial transmission pin. And the serial transmit pin
of the microcontroller is connected to the receive pin of the computer’s Serial port. Therefore the
commands and their results are transmitted and received in a triangular fashion as depicted below.
In subsequent projects (see MC075 and MC076), the HyperTerminal will be replaced by the
microcontroller itself; thus avoiding the need of using a Computer to establish an interface. This
would lead to an independent GPRS based system
The microcontroller is programmed to receive and transmit data at a baud rate of 9600. For
more details on setting the baud rate of microcontroller, refer serial communication with 8051.
The controller can receive data signals either by polling or by making use of serial
interrupt(ES). Serial interrupt has been explained in interrupt programming. In polling, the controller
continuously scans serial port for incoming data from the GPRS module.
4.8.1 UART:
UART (Universal Asynchronous Receiver Transmitter) or USART (Universal Synchronous
Asynchronous Receiver Transmitter) are one of the basic interfaces which you will find in almost all
the controllers available in the market till date. This interface provides a cost effective simple and
reliable communication between one controller to another controller or between a controller and PC.
4.8.2 RS- 232 BASICS:
RS-232 (Recommended Standard 232) is a standard for serial binary data signals connecting
between a DTE (Data terminal equipment) and a DCE (Data Circuit-terminating Equipment).
Voltage levels:
The RS-232 standard defines the voltage levels that correspond to logical one and logical zero levels.
Valid signals are plus or minus 3 to 25 volts. The range near zero volts is not a valid RS-232 level; logic
one is defined as a negative voltage, the signal condition is called marking, and has the functional
significance of OFF. Logic zero is positive; the signal condition is spacing, and has the function ON. So
a Logic Zero represented as +3V to +25V and Logic One represented as -3V to -25V.
It also includes two receiver and two transmitters and is capable of full-duplex UART/USART
communication.
CHAPTER 5
SOFTWARE DESCRIPTION
5.1Arduino IDE:
The Arduino IDE software is a open source software, where we can have the example codes
for the beginners. In the Present world there are lot of version in the Arduino IDE in which present
usage is Version1.0.5. It is very easy to connect the PC with Arduino Board.
First we have to install the Arduino IDE software according to the below instructions:
Insert the CD-ROM or PENDRIVE which contains the software and then Copy the Setup File
to your desired location.
After Copying, now click on the setup you will see an window shown below
Click On NO, not this time. Then after NEXT
Another Window opens –select Install from a list of specific location and NEXT
Select “include this location in the search” and then click Browse option available in it
Now it will Automatically check the USB driver and the software is installed click Finish
5.3 UPLOADING:
Before Connecting we have to select which Board is used by the user, Basically UNO. By selecting
TOOLSBoardARDUINO UNO
Now to dump the in the board Connect the Arduino to the PC through the USB port available in it.
Like this TOOLSSERIAL PORTCOMM4,COMM8 etc;
#include <dht.h>
#include <String.h>
#include<LiquidCrystal.h>
dht DHT;
int v;
int x=0;
#define DHT11_PIN 7
int gas,f1,f3;
void setup()
pinMode(8,OUTPUT);
pinMode(A0,INPUT);
lcd.begin(16,2);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("SMART IRRIGATION");
lcd.setCursor(0,1);
delay(2000);
//ShowSerialData()
//ShowSerialData();
void loop()
// delay(10);
lcd.clear();
x=analogRead(A0);
v=map(x,340,1023,100,0);
f1= DHT.temperature;
f3= DHT.humidity;
lcd.setCursor(0,0);
lcd.print("T:");
lcd.print(f1);
lcd.setCursor(4,0);
lcd.print((char)223);
lcd.print("H:");
lcd.print(f3);
lcd.setCursor(9,0);
lcd.print("%");
lcd.setCursor(10,0);
lcd.print("S:");
lcd.setCursor(12,0);
lcd.print(v);
delay(2000);
if(v<30)
lcd.setCursor(0,1);
lcd.print("Motor ON");
delay(1000);
digitalWrite(8,HIGH);
Send2Pachube();
if(v>80)
lcd.setCursor(0,1);
lcd.print("Motor OFF");
delay(1000);
digitalWrite(8,LOW);
Send2Pachube();
// Send2Pachube();
void Send2Pachube()
Serial.println("AT");
delay(1000);
Serial.println("AT+CPIN?");
delay(1000);
Serial.println("AT+CREG?");
delay(1000);
Serial.println("AT+CGATT?");
delay(1000);
Serial.println("AT+CIPSHUT");
delay(1000);
Serial.println("AT+CIPSTATUS");
delay(2000);
Serial.println("AT+CIPMUX=0");
delay(2000);
delay(1000);
delay(6000);
delay(1000);
Serial.println("AT+CIPSPRT=0");
delay(3000);
Serial.println("AT+CIPSTART=\"TCP\",\"api.thingspeak.com\",\"80\"");//start up the
connection
lcd.clear();
lcd.setCursor(0,0);
lcd.print("data sending...");
lcd.setCursor(0,1);
lcd.print("to servar");
delay(10000);
delay(10000);
Stringstr="GET
https://api.thingspeak.com/update?api_key=PNCJVQ2DGVI7QOWJ&field1=" +
String(f1)+ "&field2="+ String(f3)+ "&field3="+ String(v);
delay(6000);
Serial.write(26);//sending
lcd.clear();
lcd.setCursor(0,0);
lcd.print("data sent");
lcd.setCursor(0,1);
lcd.print("to servar");
Serial.println ();
delay (1000); }
CHAPTER 6
MERITS AND DEMERITS
MERITS:
DEMERITS:
CHAPTER 7
APPLICATIONS
Applications:
In Fields we use this to prevent the water wastage and human intervention.
In Gardens we use this as sprinklers.
In Nurseries we use this for proper growth in plants.
CHAPTER 8
EXPERIMENTAL RESULTS
FUTURE SCOPE:
Our project can be improvised by using a sensor to note the soil PH value such that usage of
unnecessary fertilizers can be reduced. A water meter can be installed to estimate the amount of
water for irrigation and thus giving cost estimation. Further, it also reduces the investment of our
farmers.