Академический Документы
Профессиональный Документы
Культура Документы
For continuously increasing demand of food necessities, its important to rapid improvement
in production of food technology. Agriculture in only the source to provide this. This is the
important factor in human societies to growing and dynamic demand in food production.
Agriculture plays an important role in economy and development. Agriculture plays the
important role in the economy and development, like India.
Indias major source of income is from agriculture sector and 70% of farmers and general
people depend on the agriculture. In India most of the irrigation systems are operated
manually. These outmoded techniques are replaced with semi-automated and automated
techniques.
The available traditional techniques are like ditch irrigation, terraced irrigation, drip
irrigation, sprinkler system. The global irrigation scenario is categorized by increased demand
for higher agricultural productivity, poor performance and decreased availability of water for
agriculture. These problems can be appropriately rectified if we use automated system for
irrigation.
This system is an attempt towards the smart irrigation system concept. An electronic device is
responsible for sensing the temperature and Moisture conditions. The sensor nodes are then
deployed in the irrigation field for sensing moisture value of soil and this sensed data is sent
to controller node. On receiving sensor value the controller node checks it with required soil
moisture value. When this moisture value is not upto the required level in irrigation field
then the motor is switched on to irrigate.
BLOCK DIAGRAM
Power
supply
Micro
controller
Fig 1.1: Block diagram of Sensor based automated smart irrigation system
DESCRIPTION:
The Sensor based automated smart irrigation system consists of the following blocks:
1. POWER SUPPLY:
Power supply is a reference to a source of electrical power. A device or system
that supplies electrical or other types of energy to an output load or group of loads is called a
power supply unit or PSU. The term is most commonly applied to electrical energy supplies,
less often to mechanical ones, and rarely to others.
2. MICRO CONTROLLER:
Different devices embedded on a single chip are called a Micro Controller.
The ATMEGA 328 is used as a micro controller which consists of an 32 kb of In-System
Programmable Flash Memory.
4. RELAY:
Relay is an electrical device, typically incorporating an electromagnet,
which is activated by a current or signal in one circuit can switch on and off a current in a
second circuit.
5. DC MOTOR:
Fig: Arduino UNO board used in sensor based automated smart irrigation system
DESCRIPTION:
Arduino/Genuino Uno is a microcontroller board based on the ATmega328P . It has 14 digital
input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz
quartz crystal, a USB connection, a power jack, an ICSP header and a reset button. It contains
everything needed to support the microcontroller; simply connect it to a computer with a
USB cable or power it with a AC-to-DC adapter or battery to get started. You can tinker with
your UNO without worrying too much about doing something wrong, worst case scenario
you can replace the chip for a few dollars and start over again.
"Uno" means one in Italian and was chosen to mark the release of Arduino Software (IDE)
1.0. The Uno board and version 1.0 of Arduino Software (IDE) were the reference versions of
Arduino, now evolved to newer releases. The Uno board is the first in a series of USB
Arduino boards, and the reference model for the Arduino platform.
2. MICROCONTROLLER
2.1 INTRODUCTION:
Microcontrollers are "embedded" inside some other device (often a consumer
product) so that they can control the features or actions of the product. Another name for a
microcontroller, therefore, is "embedded controller".
Microcontrollers are dedicated to one task and run one specific program. The program
is stored in ROM (read-only memory) and generally does not change. Microcontrollers are
often low-power devices and has a dedicated input device and often (but not always) has a
small LED or LCD display for output. A microcontroller also takes input from the device it is
controlling and controls the device by sending signals to different components in the device.
For example, the microcontroller inside a TV takes input from the remote control
and displays output on the TV screen. The controller controls the channel selector, the
speaker system and certain adjustments on the picture tube electronics such as tint and
brightness. The engine controller in a car takes input from sensors such as the oxygen and
knock sensors and controls things like fuel mix and spark plug timing. A microwave oven
controller takes input from a keypad, displays output on an LCD display and controls a relay
that turns the microwave generator on and off. A microcontroller is often small and low cost.
The components are chosen to minimize size and to be as inexpensive as possible.
ATMEGA 328:
FEATURES:
High Performance, Low Power AtmelAVR 8-Bit Microcontroller Family
Advanced RISC Architecture
131 Powerful Instructions
Most Single Clock Cycle Execution
32 x 8 General Purpose Working Registers
Fully Static Operation
Up to 20 MIPS Throughput at 20MHz
On-chip 2-cycle Multiplier
High Endurance Non-volatile Memory Segments
4/8/16/32Kbytes of In-System Self-Programmable Flash program memory
256/512/512/1KBytes EEPROM
512/1K/1K/2KBytes Internal SRAM
Write/Erase Cycles: 10,000 Flash/100,000 EEPROM
Data retention: 20 years at 85C/100 years at 25C
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
Atmel QTouch library support
Capacitive touch buttons, sliders and wheels
QTouch and QMatrix acquisition
Up to 64 sense channels
Peripheral Features
Two 8-bit Timer/Counters with Separate Prescaler and Compare Mode
One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and
Capture Mode
Real Time Counter with Separate Oscillator
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
Programmable Serial USART
Master/Slave SPI Serial Interface
Byte-oriented 2-wire Serial Interface (Philips I2 C compatible)
Programmable Watchdog Timer with Separate On-chip Oscillator
On-chip Analog Comparator
Interrupt and Wake-up on Pin Change
Special Microcontroller Features
Power-on Reset and Programmable Brown-out Detection
Internal Calibrated Oscillator External and Internal Interrupt Sources
Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down,
Standby, and Extended Standby
I/O and Packages
23 Programmable I/O Lines
28-pin PDIP, 32-lead TQFP, 28-pad QFN/MLF and 32-pad QFN/MLF
Operating Voltage:
1.8 - 5.5V
Temperature Range:
-40C to 85C
Speed Grade:
0 - 4MHz@1.8 - 5.5V, 0 - 10MHz@2.7 - 5.5.V, 0 - 20MHz @ 4.5 - 5.5V
Power Consumption at 1MHz, 1.8V, 25C
Active Mode: 0.2mA
Power-down Mode: 0.1A
Power-save Mode: 0.75A (Including 32kHz RTC)
PIN DIAGRAM:
PC5 1
(RESET)PC6 28
(RXD) 2 PC4
PD0
(TXD) 3 PC3 (ADC3)
PD1 26
(INT0) 4
PC2
PD2 25
(INT1) 5 PC1
PD3 24 (ADC1)
(XCK/T0) 6 PC0
PD4 23 (ADC0)
VCC 7 GND
GND 22
8 AREF
21
(XTAL1/TOSC1) 9 AVCC
PB6 20
10 PB5 (SCK)
(XTAL2/TOSC2)
19 PB7
(T1)11 PB4 MISO)
PD5 18
(AIN0) 12 PB3 (MOSI/OC2)
PD6 17
(AIN1) 13 PB2 (SS/OC1B)
PD7
(ICP1) PB1 (OC1A)
14
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 unprogrammed, 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.
Shorter pulses are not guaranteed to generate a Reset. The various special features of Port C
are elaborated in the Alternate Functions of Port C section.
AVCC:
AVCC is the supply voltage pin for the A/D Converter, PC [3:0], and PE [3:2]. 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 PC [6:4] use digital supply
voltage, VCC.
AREF:
AREF is the analog reference pin for the A/D Converter. 5.2.9. ADC [7:6] (TQFP and
VFQFN Package Only) In the TQFP and VFQFNpackage, ADC [7: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.
Application
Flash Section
Name: EEARL
Offset: 0x41
Reset: 0xXX
Property: When addressing as I/O Register: address offset is 0x21
Reset X X X X X X X X
Bits 7:0 EEARn:EEPROM Address:
The EEPROM Address Registers EEARH and EEARL specify the EEPROM address in
the 1K Bytes EEPROM space. The EEPROM data bytes are addressed linearly between 0 and
255/511/511. The initial value of EEAR is undefined. A proper value must be written before
the EEPROM may be accessed.
Bit 7 6 5 4 3 2 1 0
EEDR[7,0]
Access R/W R/W R/W R/W R/W R/W R/W R/W
Reset 0 0 0 0 0 0 0 0
Bits 7:0 EEDR[7:0]:EEPROM Data
For the EEPROM write operation, the EEDR Register contains the data to be written to the
EEPROM in the address given by the EEAR Register. For the EEPROM read operation, the
EEDR contains the data read out from the EEPROM at the address given by EEAR.
TIMER/COUNTER OSCILLATOR:
For AVR microcontrollers with Timer/Counter Oscillator pins (TOSC1 and TOSC2),
the crystal are connected directly between the pins. By programming the CKOPT Fuse, the
user can enable internal capacitors on XTAL1 and XTAL2, thereby removing the need for
external capacitors. The Oscillator is optimized for use with a 32.768kHz watch crystal.
Applying an external clock source to TOSC1 is not recommended.
SYSTEM CONTROL AND RESET:
Resetting the AVR:
During Reset, all I/O Registers are set to their initial values, and the program starts
execution from the Reset Vector. If the program never enables an interrupt source, the
Interrupt Vectors are not used, and regular program code can be placed at these locations.
This is also the case if the Reset Vector is in the Application section while the Interrupt
Vectors are in the boot section or vice versa.
The I/O ports of the AVR are immediately reset to their initial state when a reset
source goes active. This does not require any clock source to be running. After all reset
sources have gone inactive, a delay counter is invoked, stretching the internal reset. This
allows the power to reach a stable level before normal operation starts. The time-out period of
the delay counter is defined by the user through the CKSEL Fuses.
Reset Sources:
The device has the following sources of reset:
Power-on Reset. The MCU is reset when the supply voltage is less than the Power-
on Reset threshold (VPOT).
External Reset. The MCU is reset when a low level is present on the RESET pin for
longer than the minimum pulse length.
Watchdog System Reset. The MCU is reset when the Watchdog Timer period
expires and the Watchdog System Reset mode is enabled.
Brown-out Reset. The MCU is reset when the supply voltage VCC is less than the
Brown-out Reset threshold (VBOT) and the Brown-out Detector is enabled.
Features:
Clocked from separate On-chip Oscillator
Three operating modes: Interrupt System Reset Interrupt and System Reset
Selectable Time-out period from 16ms to 8s
Possible Hardware Fuse Watchdog always on (WDTON) for fail-safe mode
Overview:
The device has an Enhanced Watchdog Timer (WDT). The WDT is a timer counting
cycles of a separate on-chip 128kHz oscillator. The WDT gives an interrupt or a system reset
when the counter reaches a given time-out value. In normal operation mode, it is required that
the system uses the Watchdog Timer Reset (WDR) instruction to restart the counter before
the time-out value is reached. If the system doesn't restart the counter, an interrupt or system
reset will be issued.
Soil moisture sensors measure the volumetric water content in soil. Since the
direct gravimetric measurement of free soil moisture requires removing, drying, and
weighting of a sample, soil moisture sensors measure the volumetric water content indirectly
by using some other property of the soil, such as electrical resistance, dielectric constant, or
interaction with neutrons, as a proxy for the moisture content. The relation between the
measured property and soil moisture must be calibrated and may vary depending on
environmental factors such as soil type, temperature, or electric conductivity.
Reflected microwave radiation is affected by the soil moisture and is used for remote
sensing in hydrology and agriculture. Portable probe instruments can be used by farmers or
gardeners.
HISTORY:
Water held in soil plays an important role in the climate system. The dataset released by ESA
is the first remote-sensing soil moisture data record spanning the period 1978 to 2010 a
predecessor of the data now being provided by ESAs SMOS mission. The datasets are now
available to the science community for feedback analyses and climate model validation. The
amount of water held in global soils makes up only about 0.001% of the total water found on
Earth.
It is critical for plant growth, but is also linked to our weather and climate.
This is because soil moisture is a key variable controlling the exchange of water and energy
between the land and the atmosphere: dry soil emits little or no moisture to the atmosphere. A
recently detected decline in the global evaporation trend could, for example, directly be
explained by limited moisture supply.
The relationship between soil moisture and the climate system is not yet
fully understood, and global long-term soil moisture observations have so far not been
available. That means the evaluation of climate models with regard to the drying and wetting
trends and associated feedbacks with temperature is still difficult in many regions worldwide.
DESCRIPTION:
Insensitive to salinity.
Small size.
Precise measurement.
Probe is long and slender for wider use, including smaller potted plants.
APPLICATIONS:
Agriculture:
Measuring soil moisture is important for agricultural applications to help farmers manage
their irrigation systems more efficiently.
Knowing the exact soil moisture conditions on their fields, not only are farmers able to
generally use less water to grow a crop, they are also able to increase yields and the quality of
the crop by improved management of soil moisture during critical plant growth stages.
Landscape irrigation:
In urban and suburban areas, landscapes and residential lawns are using soil moisture sensors
to interface with an irrigation controller. Connecting a soil moisture sensor to a simple
irrigation clock will convert it into a "smart" irrigation controller that prevents irrigation
cycles when the soil is already wet, e.g. following a recent rainfall event.
Golf courses are using soil moisture sensors to increase the efficiency of their irrigation
systems to prevent over-watering and leaching of fertilizers and other chemicals into the
ground.
Research:
Soil moisture sensors are used in numerous research applications, e.g. in agricultural
science and horticulture including irrigation planning, climate research, or environmental
science including solute transport studies and as auxiliary sensors for soil
respiration measurements.
Relatively cheap and simple devices that do not require a power source are available for
checking whether plants have sufficient moisture to thrive. After inserting a probe into the
soil for approximately 60 seconds, a meter indicates if the soil is too dry, moist or wet for
plants.
SPECIFICATIONS:
Parameter Value
Operating voltage +5v dc regulated
Soil moisture Digital voltage is indicated by out pin
Rice 900-2500
Wheat 450-650
Maize 500-800
Sugarcane 1500-2500
Cotton 700-1300
Groundnut 500-700
Tobacco 400-600
Tomato 600-800
Potato 500-700
Onion 350-550
Banana 1200-2200
DO Unconnected
RELAY:
Relay is an electrical device, typically incorporating an electromagnet, which is activated by
a current or signal in one circuit can switch on and off a current in a second circuit.
Fig: Relay
WORKING:
The main operation of relay comes in places where only a low power signal can be used to
control a circuit. They were used to switch the signal coming from one source to another
destination.
The relay switch can be divided into two parts input and output. The input section has coil
which generates magnetic field, when a small voltage from an electric circuit is applied to it.
This voltage is called operating voltage. The output consists of contactors which connects 0v
and disconnects mechanically.
In a basic relay, there are three contactors:
1.Normally open(NO)
2.Normally close(NC)
3.Common
At no input state the common is connected to NC. When the operating voltage is
applied, the relay coil gets energized and the common changes contact to NO.
NO contact is also called a make contact. It closes the circuit when the relay is
activated.
NC contact is also known as break contact. This is opposite to NO contact.
TYPES OF RELAY:
1.Mercury relay
2.Time delay relay
3.Polarized relay
APPLICATIONS:
The first application of relays was in long telegraph lines, where the weak signal
received at an intermediate station could control a contact, regenerating the signal
for further transmission.
Early electro-mechanical computers such as the ARRA, Harvard Mark II, Zuse Z2,
and Zuse Z3 used relays for logic and working registers. However, electronic
devices proved faster and easier to use.
Relays are much more resistant than semiconductors to nuclear radiation, they are
widely used in safety-critical logic, such as the control panels of radioactive waste-
handling machinery. Electromechanical protective relays are used to detect overload
and other faults on electrical lines by opening and closing circuit breakers.
Relays can perform the basic operations of Boolean combinatorial logic. For
example, the boolean AND function is realised by connecting normally open relay
contacts in series, the OR function by connecting normally open contacts in parallel.
DC MOTOR:
INTRODUCTION:
Fig:DC Motor
TYPES OF DC MOTORS:
1. Brushed DC Motors
2. Brushless DC motors
3. Coreless DC motors
BRUSHED DC MOTORS:
The classic DC motor design generates an oscillating current in a wound rotor with a
split ring commentator, and either a wound or permanent magnet stator. A rotor consists of a
coil wound around a rotor which is then powered by any type of battery.
Many of the limitations of the classic commentator DC motor are due to the need for brushes
to press against the commentator. This creates friction. At higher speeds, brushes have
increasing difficulty in maintaining contact. Brushes may bounce off the irregularities in the
commentator surface, creating sparks. This limits the maximum speed of the machine. The
current density per unit area of the brushes limits the output of the motor. The imperfect
electric contact also causes electrical noise. Brushes eventually wear out and require
replacement, and the commentator itself is subject to wear and maintenance. The commutator
assembly on a large machine is a costly element, requiring precision assembly of many parts.
there are three types of dc motor 1. dc series motor 2. dc shunt motor 3. dc compound motor -
these are also two type a. cumulative compound b. differential compound
BRUSHLESS DC MOTORS:
Some of the problems of the brushed DC motor are eliminated in the brushless design. In this
motor, the mechanical "rotating switch" or commentator/brush gear assembly is replaced by
an external electronic switch synchronized to the rotor's position. Brushless motors are
typically 85-90% efficient, whereas DC motors with brush gear are typically 75-80%
efficient.
Midway between ordinary DC motors and stepper motors lies the realm of the brushless DC
motor. Built in a fashion very similar to stepper motors, these often use a permanent magnet
external rotor, three phases of driving coils, one or more Hall effect sensors to sense the
position of the rotor, and the associated drive electronics. The coils are activated, one phase
after the other, by the drive electronics as cued by the signals from the Hall effect sensors. In
effect, they act as three-phase synchronous motors containing their own variable-frequency
drive electronics. A specialized class of brushless DC motor controllers utilize EMF feedback
through the main phase connections instead of Hall effect sensors to determine position and
velocity. These motors are used extensively in electric radio-controlled vehicles. When
configured with the magnets on the outside, these are referred to by mode lists as out runner
motors.
Brushless DC motors are commonly used where precise speed control is necessary, as in
computer disk drives or in video cassette recorders, the spindles within CD, CD-ROM (etc.)
drives, and mechanisms within office products such as fans, laser printers and photocopiers.
They have several advantages over conventional motors:
Compared to AC fans using shaded-pole motors, they are very efficient, running
much cooler than the equivalent AC motors. This cool operation leads to much-
improved life of the fan's bearings.
Without a commentator to wear out, the life of a DC brushless motor can be
significantly longer compared to a DC motor using brushes and a commentator.
Commutation also tends to cause a great deal of electrical and RF noise; without a
commentator or brushes, a brushless motor may be used in electrically sensitive
devices like audio equipment or computers.
The same Hall Effect sensors that provide the commutation can also provide a
convenient tachometer signal for closed-loop control (servo-controlled)
applications. In fans, the tachometer signal can be used to derive a "fan OK"
signal.
Brushless motors have no chance of sparking, unlike brushed motors, making them
better suited to environments with volatile chemicals and fuels. Also, sparking
generates ozone which can accumulate in poorly ventilated buildings risking harm to
occupants' health.
Brushless motors are usually used in small equipment such as computers and are
generally used to get rid of unwanted heat.
They are also very quiet motors which is an advantage if being used in equipment that
is affected by vibrations.
Modern DC brushless motors range in power from a fraction of a watt to many kilowatts.
Larger brushless motors up to about 100 kW rating are used in electric vehicles. They also
find significant use in high-performance electric model aircraft.
CORELESS DC MOTORS:
Nothing in the design of any of the motors described above requires that the iron
(steel) portions of the rotor actually rotate; torque is exerted only on the windings of the
electromagnets. Taking advantage of this fact is the coreless DC motor, a specialized form of
a brush or brushless DC motor. Optimized for rapid acceleration, these motors have a rotor
that is constructed without any iron core. The rotor can take the form of a winding-filled
cylinder inside the stator magnets, a basket surrounding the stator magnets, or a flat pancake
(possibly formed on a printed wiring board) running between upper and lower stator magnets.
The windings are typically stabilized by being impregnated with Electrical epoxy potting
systems. Filled epoxies that have moderate mixed viscosity and a long gel time. These
systems are highlighted by low shrinkage and low exothermic. Typically UL 1446 recognized
as a potting compound for use up to 180C (Class H) Because the rotor is much lighter in
weight (mass) than a conventional rotor formed from copper windings on steel laminations,
the rotor can accelerate much more rapidly, often achieving a mechanical time constant under
1ms. This is especially true if the windings use aluminum rather than the heavier copper. But
because there is no metal mass in the rotor to act as a heat sink, even small coreless motors
must often be cooled by forced air.
8.POWER SUPPLY
8.1 INTRODUCTION:
Power supply is a reference to a source of electrical power. A device or system that supplies
electrical or other types of energy to an output load or group of loads is called a power supply
unit or PSU. The term is most commonly applied to electrical energy supplies, less often to
mechanical ones, and rarely to others
This power supply section is required to convert AC signal to DC signal and also to
reduce the amplitude of the signal. The available voltage signal from the mains is 230V/50Hz
which is an AC voltage, but the required is DC voltage(no frequency) with the amplitude of
+5V and +12V for various applications.
In this section we have Transformer, Bridge rectifier, are connected serially and
voltage regulators for +5V and +12V (7805 and 7812) via a capacitor (1000F) in parallel are
connected parallel as shown in the circuit diagram below. Each voltage regulator output is
again is connected to the capacitors of values (100F, 10F, 1 F, 0.1 F) are connected
parallel through which the corresponding output(+5V or +12V) are taken into consideration.
Fig: BASIC DIAGRAM POWER SUPPLY
CIRCUIT:
Transformer:
A transformer is a device that transfers electrical energy from one circuit to another
through inductively coupled electrical conductors. A changing current in the first circuit (the
primary) creates a changing magnetic field; in turn, this magnetic field induces a changing
voltage in the second circuit (the secondary). By adding a load to the secondary circuit, one
can make current flow in the transformer, thus transferring energy from one circuit to the
other.
The secondary induced voltage VS, of an ideal transformer, is scaled from the primary
VP by a factor equal to the ratio of the number of turns of wire in their respective windings:
Basic Principle:
The transformer is based on two principles: firstly, that an electric current can produce a
magnetic field (electromagnetism) and secondly that a changing magnetic field within a coil
of wire induces a voltage across the ends of the coil (electromagnetic induction). By changing
the current in the primary coil, it changes the strength of its magnetic field; since the
changing magnetic field extends into the secondary coil, a voltage is induced across the
secondary.
A simplified transformer design is shown below. A current passing through the
primary coil creates a magnetic field. The primary and secondary coils are wrapped
around a core of very high magnetic permeability, such as iron; this ensures that most
of the magnetic field lines produced by the primary current are within the iron and
pass through the secondary coil as well as the primary coil.
Fig : An ideal step-down transformer showing magnetic flux in the core
Basic Operation: When the input connected at the left corner of the diamond is
positive with respect to the one connected at the right hand corner, current flows to
the right along the upper colored path to the output, and returns to the input supply via
the lower one.
When the right hand corner is positive relative to the left hand corner, current
flows along the upper colored path and returns to the supply via the lower colored
path. Batteries are installed backwards or DC input-power supply wiring "has its
wires crossed" (and protects the circuitry it powers against damage that might occur
without this circuit in place).
FILTER:
78xx ICs have three terminals and are most commonly found in the TO220 form
factor, although smaller surface-mount and larger TrO3 packages are also available from
some manufacturers.
BASICS OF ARDUINO:
The first thing we will need to do in order to get things moving is to install
the Arduino IDE. This software is where you will write all of the code that will
control the micro controller and the attached circuit components. You can
download the IDE at the official Arduino download page. Once downloaded you
will need to unzip the folder into a convenient location. Then run the Arduino.EXE
file. Once you have done that, you should see the above window.
We will want to open the example sketch that can get us started.to do so
click file->Examples->baxics->bareminimum. This will open a new window with a
small amount of code. This code acts as framework for our program. The setup
method will be be run a single time right as the micro controller is turned on. You
should place code in here that you want to run once to configure the Arduino and
get it ready to run your program.
Let us consider a example, to blink an led
// the setup function runs once when you press reset or power the
board
void setup() {
pinMode(13, OUTPUT);
void loop() {
Firstly, we will notice that the words void and setup as well as void and
loop. void means empty, loop and setup are the keywords.
Void setup():
Just like we need a mouth to speak, the code to setup our program will
allow our Arduino to speak.
PinMode():
Void loop():
Our second command is the loop (). After creating a setup() function,
which initializes and sets the initial values, the loop() function does precisely
what its name suggests, and loops consecutively, allowing your program to
change and respond.
Write a high or low value to a digital pin. If the pin has been configured as
an output with pinmode (), its voltage will be set to the corresponding value 5v
for high,0v for low.
Digital write():
If the pin is configured as an input, digital write () will enable or disable the
internal pullup on the input pin. It is recommended to set the pin mode () to
input_ pullup to enable the internal pull-up resistor.
Delay():
Delay() pauses the program for the amount of time (in milliseconds)
specified as parameter.
Syntax:delay(ms);
Serial.begin:
The Arduino board can communicate at various baud (baud rates). A baud is a measure of
how many times the hardware can send 0s and 1s in a second. The baud rate must be set
properly for the board to convert incoming and outgoing information to useful data. If your
receiver is expecting to communicate at a baud rate of 2400, but your transmitter is
transmitting at a different rate (for example 9600), the data you get will not make sense. 9600
is a good baud rate to start with.
Syntax:
void setup() {
Serial.begin(9600);
}
If / else
if/else allows greater control over the flow of code than the basic if statement, by allowing
multiple tests to be grouped together. For example, an analog input could be tested and one
action taken if the input was less than 500, and another action taken if the input was 500 or
greater. The code would look like this:
// action A
else
// action B
else can proceed another if test, so that multiple, mutually exclusive tests can be run at the
same time.
EXISTING SYSTEM:
LIMITATIONS:
WORKING:
The main motivation and overall structure of this proposed system is to solve the problem of
irrigation and every sector of agriculture field by using latest technology and to show correct
values of sensor.
The sensors capture and provide values to the microcontroller. If the moisture level is found
to be below the desired level, it sends the signal to the microcontroller which triggers the
Water Pump to turn ON and supply the water to respective plants. When the desired moisture
level is reached, the system halts on its own and the Water Pump is turned OFF.
ADVANTAGES:
Step 4: If the level will be more than a fixed criteria, no need to irrigation.