A - Team 15 Smart Irrigation
A - Team 15 Smart Irrigation
Information from the sensors is transmitted to the arduino board. The arduino board
consists of microcontroller ATMEGA328P which is responsible for controlling the switching
on/off of the motor on which water sprinklers can be attached. Sensor values from arduino are
transmitted to the GSM-GPRS SIM900A modem. A sim with 3G data pack is inserted into this
modem which provide IOT features to the system. Values are further transmitted to the IOT
section through the modem.
The GSM modem is a highly flexible plug and play quad bandSIM900A GSM modem for
direct and easy integration to RS232 applications. It Supports features like Voice, SMS, Data/Fax,
GPRS and integrated TCP/IP stack. The tx and rx pins from the arduino are connected to the rx
and tx of GSM modem respectively.
1.3.IOT Section
This section comprises a web page which displays the current water sprinkler status i.e. on
or off and a button which redirects the user to a thing speak page which graphically depicts the
sensor values.
a) BLOCK DIAGRAM
b) Schematic Diagram
1. Arduino Microcontroller
2. LCD
3. Soil Moisture Sensor
4. Wi-Fi Module
5. Motor
6. Motor Driver
7. Thingspeak.com
2. LITARETURE SURVEY
In A Remote Measurement and Control System for Greenhouse Based on GSM-SMS [4] the
proposed system introduced a GSM-SMS remote measurement and control system for greenhouse
based on PC-based database system connected with base station. Base station is developed by
using a microcontroller, GSM module, sensors and actuators. In practical operation, the central
station receives and sends messages through GSM module. Criterion value of parameters to be
measured in every base station is set by central station, and then in base stations parameters
including the air temperature, the air humidity.Indu et al. (2013) [5] mainly focuses on reviews in
the field of remote monitoring and control, the technology used and their potential advantages.
The paper proposes an innovative GSM/Bluetooth based remote controlled embedded
system for irrigation. The system sets the irrigation time depending on the temperature and
humidity reading from sensors and type of crop and can automatically irrigate the field when
unattended. Information is exchanged between far end and designed system via SMS on GSM
network. A Bluetooth module is also interfaced with the main microcontroller chip which
eliminates the SMS charges when the user is within the limited range of few meters to the
designated system. The system informs users about many conditions like status of electricity, dry
running motor, increased temperature, water content in soil and smoke via SMS on GSM network
or by Bluetooth.
[6], R.Suresh et al. (2014) mentioned about using automatic microcontroller based rain gun
irrigation system in which the irrigation will take place only when there will be intense
requirement of water that save a large quantity of water. These systems bring a change to
management of field resource where they developed a software stack called Android is used for
devices that include an operating system, middleware and key applications. The Android SDK
provides the tools and APIs necessary to begin developing applications on the Android platform
using the Java programming language. Mobile phones have almost become an integral part of us
serving multiple needs of humans. This application makes use of the GPRS feature of mobile
phone as a solution for irrigation control system. These system covered lower range of agriculture
land and not economically affordable. In IOT SMS alarm system based on SIM900A
[7], an IOT alarm system based on SIM900A module of SIMCOM Company was designed
for greenhouse. The system can gather environmental parameters such as air temperature and air
humidity. Meanwhile, with the use of AT command, this system can also realize SMS automatic
sending and receiving, environmental parameters overrun alarm and insufficient balance alarm.
Through the system setting, the alarm message can be sent to the user-specified mobile phone
automatically no matter what the users' location is. This system as a typical application of IOT in
the agriculture has got some satisfactory results in the actual operation.
3.INTRODUCTION
Now, the details of the various building blocks of the hardware of an embedded system as shown
in fig 3.1 are
Central processing unit (CPU)
Memory (Read-only Memory and Random Access Memory)
Input Devices
Output Devices
Communication interfaces
Applications-specific circuitry
The Central Processing Unit (processor, in short) can be any of the following
microcontroller, microprocessor or Digital Signal Processor (DSP). A micro-controller is a low-
cost processor. Its main attraction is that on the chip itself, there will be many other components
such as memory, serial communication interface, analog-to digital converter etc. so, for small
applications, a micro-controller is the best choice as the number of external component
required will be very less. On the other hand, microprocessors are more powerful, but you need to
use many external components with them. DSP is used for many applications for signal processing
3.2.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 of 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.
condition of protection or responsible for the breach of security. The word “security” in general
usage is synonymous with “safety,” but as a technical “security” means that something not only is
secure but that it has be secured. One of the best options for providing good security is by using a
technology named EMBEDDED SYSTEM.
Labeled parts include microprocessor (4), RAM (6), flash memory (7).Embedded systems
programming is not like normal PC programming. In many ways, programming for an embedded
system is like programming PC 15 years ago. The hardware for the system is usually chosen to
make the device as cheap as possible. Spending an extra dollar a unit in order to make things
easier to program can cost millions. Hiring a programmer for an extra month is cheap in
comparison. This means the programmer must make do with slow processors and low memory,
while at the same time battling a need for efficiency not seen in most PC applications. Below is a
list of issues specific to the embedded field.
3.3.1 History
In the earliest years of computers in the 1930–40s, computers were sometimes dedicated to a
single task, but were far too large and expensive for most kinds of tasks performed by embedded
computers of today. Over time however, the concept of programmable controllers evolved from
traditional electromechanical sequencers, via solid state devices, to the use of computer
technology.
One of the first recognizably modern embedded systems was the Apollo Guidance Computer,
developed by Charles Stark Draper at the MIT Instrumentation Laboratory. At the project's
inception, the Apollo guidance computer was considered the riskiest item in the Apollo project as
it employed the then newly developed monolithic integrated circuits to reduce the size and weight.
An early mass-produced embedded system was the Automatics D-17 guidance computer for the
Minuteman missile, released in 1961. It was built from transistor logic and had a hard disk for
main memory. When the Minuteman II went into production in 1966, the D-17 was replaced with
a new computer that was the first high-volume use of integrated circuits.
3.3.2 Tools
Embedded development makes up a small fraction of total programming. There's also a large
number of embedded architectures, unlike the PC world where 1 instruction set rules, and the
UNIX world where there's only 3 or 4 major ones. This means that the tools are more expensive. It
also means that they're lowering featured, and less developed. On a major embedded project, at
some point you will almost always find a compiler bug of some sort.
Debugging tools are another issue. Since you can't always run general programs on your
embedded processor, you can't always run a debugger on it. This makes fixing your program
difficult. Special hardware such as JTAG ports can overcome this issue in part. However, if you
stop on a breakpoint when your system is controlling real world hardware (such as a motor),
permanent equipment damage can occur. As a result, people doing embedded programming
quickly become masters at using serial IO channels and error message style debugging.
3.3.3 Resources
To save costs, embedded systems frequently have the cheapest processors that can do the job.
This means your programs need to be written as efficiently as possible. When dealing with large
data sets, issues like memory cache misses that never matter in PC programming can hurt you.
Luckily, this won't happen too often- use reasonably efficient algorithms to start, and optimize
only when necessary. Of course, normal profilers won't work well, due to the same reason
debuggers don't work well.Memory is also an issue. For the same cost savings reasons, embedded
systems usually have the least memory they cZan get away with. That means their algorithms must
be memory efficient (unlike in PC programs, you will frequently sacrifice processor time for
memory, rather than the reverse). It also means you can't afford to leak memory It also means you
can't afford to leak memory. Embedded applications generally use deterministic memory
techniques and avoid the default "new" and "malloc" functions, so that leaks can be found and
eliminated more easily. Other resources programmers expect may not even exist. For example,
most embedded processors do not have hardware FPUs (Floating-Point Processing Unit). These
resources either need to be emulated in software, or avoided altogether.
3.3.4. Real Time Issues
Embedded systems frequently control hardware, and must be able to respond to them in real
time. Failure to do so could cause inaccuracy in measurements, or even damage hardware such as
motors. This is made even more difficult by the lack of resources available. Almost all embedded
systems need to be able to prioritize some tasks over others, and to be able to put off/skip low
priority tasks such as UI in favor of high priority tasks like hardware control
3.4 NEED FOR AN EMBEDDED SYSTEMS
The uses of embedded systems are virtually limitless, because every day new products are
introduced to the market that utilizes embedded computers in novel ways. In recent years,
hardware such as microprocessors, microcontrollers, and FPGA chips have become much cheaper.
So when implementing a new form of control, it's wiser to just buy the generic chip and write your
own custom software for it. Producing a custom-made chip to handle a particular task or set of
tasks costs far more time and money. Many embedded computers even come with extensive
libraries, so that "writing your own software" becomes a very trivial task indeed. From an
implementation viewpoint, there is a major difference between a computer and an embedded
system. Embedded systems are often required to provide Real-Time response. The main elements
that make embedded systems unique are its reliability and ease in debugging.
3.4.1 Debugging
Embedded debugging may be performed at different levels, depending on the facilities
available. From simplest to most sophisticate they can be roughly grouped into the following
areas:
Interactive resident debugging, using the simple shell provided by the embedded operating
system (e.g. Forth and Basic)
External debugging using logging or serial port output to trace operation using either a
monitor in flash or using a debug server like the Remedy Debugger which even works for
heterogeneous multi core systems.
An in-circuit debugger (ICD), a hardware device that connects to the microprocessor via a
JTAG or Nexus interface. This allows the operation of the microprocessor to be controlled
externally, but is typically restricted to specific debugging capabilities in the processor.
An in-circuit emulator replaces the microprocessor with a simulated equivalent, providing
full control over all aspects of the microprocessor.
A complete emulator provides a simulation of all aspects of the hardware, allowing all of it
to be controlled and modified and allowing debugging on a normal PC.
Unless restricted to external debugging, the programmer can typically load and run software
through the tools, view the code running in the processor, and start or stop its operation.
The view of the code may be as assembly code or source-code.
Because an embedded system is often composed of a wide variety of elements, the debugging
strategy may vary. For instance, debugging a software (and microprocessor) centric embedded
system is different from debugging an embedded system where most of the processing is
performed by peripherals (DSP, FPGA, co-processor). An increasing number of embedded
systems today use more than one single processor core. A common problem with multi-core
development is the proper synchronization of software execution. In such a case, the embedded
system design may wish to check the data traffic on the busses between the processor cores, which
requires very low-level debugging, at signal/bus level, with a logic analyzer, for instance.
3.4.2 Reliability
Embedded systems often reside in machines that are expected to run continuously for years
without errors and in some cases recover by them if an error occurs. Therefore the software is
usually developed and tested more carefully than that for personal computers, and unreliable
mechanical moving parts such as disk drives, switches or buttons are avoided.
Specific reliability issues may include:
The system cannot safely be shut down for repair, or it is too inaccessible to repair.
Examples include space systems, undersea cables, navigational beacons, bore-hole
systems, and automobiles.
The system must be kept running for safety reasons. "Limp modes" are less tolerable. Often
backups are selected by an operator. Examples include aircraft navigation, reactor control
systems, safety-critical chemical factory controls, train signals, engines on single-engine
aircraft.
The system will lose large amounts of money when shut down: Telephone switches, factory
controls, bridge and elevator controls, funds transfer and market making, automated sales
and service.
A variety of techniques are used, sometimes in combination, to recover from errors both
software bugs such as memory leaks, and also soft errors in the hardware:
Watchdog timer that resets the computer unless the software periodically notifies the
watchdog
Subsystems with redundant spares that can be switched over to
software "limp modes" that provide partial function
Designing with a Trusted Computing Base (TCB) architecture[6] ensures a highly secure &
reliable system environment
An Embedded Hypervisor is able to provide secure encapsulation for any subsystem
component, so that a compromised software component cannot interfere with other
subsystems, or privileged-level system software. This encapsulation keeps faults from
propagating from one subsystem to another, improving reliability. This may also allow a
subsystem to be automatically shut down and restarted on fault detection.
Immunity Aware Programming
3.5 EMBEDDED SOFTWARE
Various software’s can be for various purposes. ALP i.e. Assembly Language program can
be used as the back end the other software like C, VB, etc. can be in front end.
3.6 EMBEDDED SOFTWARE ARCHITECTURE
There are several different types of software architecture in common use.
In this design, the software has a loop. The loop calls the subroutines, each of which
manages a part of the hardware or software.
3.6.2 Interupt controlled loop
Some embedded systems are predominantly interrupt controlled. This means that tasks
performed by the system are triggered by different kinds of events. An interrupt could be
generated for example by a timer in a pre-defined frequency, or by a serial port controller
receiving a byte.
These kinds of the systems run a simple task in a main loop also, but this task is not
sensitive to expected delays. The tasks performed in the interrupt handlers should be kept short the
interrupt latency to a minimum. Some times longer tasks are added to a queue structure in the
interrupt handlers to be processed in the main loop lar.
3.6.3 Peripherals
Peripherals are the various devices that are connected to the CPU, for performing various
functions. Embedded systems talk with the outside world via peripherals, such as
Serial communication interfaces (SCI) RS-232, RS-422, RS-458 etc.
Synchronous serial communication interfaces (SSCI) 12C, JTAG, SPI, SSC and ESSI
Universal serial bus (USB)\
Network Controller area Network, etc.
Timer PLL(s), Capture/Compare and processing units.
Discrete I/O General Purpose Input/output(GPIO).
3.6.4 Processors
Processors are the key elements in any embedded system. They interact with the memory,
where the various instructions of useful functions into a single IC package.
The ability to execute a stored set of instructions to carry out user defined tasks .The ability to be
able to access external memory chips to both read and writes data from and to the memory.
3.6.5 Micro controller
Basically, a microcontroller is a device which integrates a number of the components of a
microprocessor system on to a single chip. So a microcontroller combines onto the same
microchip CPU core Memory) Most microcontrollers will also combine other devices such as
A Timer module to allow the microcontroller to perform tasks for certain periods.
A serial I/O port to allow data to flow between the microcontroller and other devices such as a PC
or another microcontroller.
An ADC to allow the microcontroller to accept analogue input data for processing.
3.6.6 DSP
It is the study of the signals in digital representation and processing methods of these
signals. It is used where large mathematical and scientific calculations are required.
3.6.7 ASIC
It is an IC designed for a specific application. This IC designed for specific application
can’t be used for other application.
Cooperative Multitasking:
A non-preemptive multitasking system is very similar to the simple control loop scheme,
except that the loop is hidden in an API. The programmer defines a series of tasks, and each task
gets its own environment to “run” in. When a task is idle, it calls an idle routine, usually called
“pause”, “wait”, “yield”, “nop” (stands for no operation), etc. The advantages and disadvantages
are very similar to the control loop, except that adding new software is easier, by simply writing a
new task, or adding to the queue-interpreter.
Primitive Multitasking:
In this type of system, a low-level piece of code switches between tasks or threads based
on a timer (connected to an interrupt). This is the level at which the system is generally considered
to have an "operating system" kernel. Depending on how much functionality is required, it
introduces more or less of the complexities of managing multiple tasks running conceptually in
parallel.
As any code can potentially damage the data of another task (except in larger systems
using an MMU) programs must be carefully designed and tested, and access to shared data must
be controlled by some synchronization strategy, such as message queues, semaphores or a non-
blocking synchronization scheme.
Because of these complexities, it is common for organizations to buy a real-time
operating system, allowing the application programmers to concentrate on device functionality
rather than operating system services, at least for large systems; smaller systems often cannot
afford the overhead associated with a generic real time system, due to limitations regarding
memory size, performance, and/or battery life.
Microkernels and Exokernels:
A microkernel is a logical step up from a real-time OS. The usual arrangement is that the
operating system kernel allocates memory and switches the CPU to different threads of execution.
User mode processes implement major functions such as file systems, network interfaces, etc.
In general, microkernels succeed when the task switching and intertask communication
is fast, and fail when they are slow. Exokernels communicate efficiently by normal subroutine
calls. The hardware and all the software in the system are available to, and extensible by
application programmers. Based on performance, functionality, requirement the embedded
systems are divided into three categories.
Whenever a person comes near the door, it captures the image of a person and sends to
the desktop of your computer which is connected to internet. This gives an alerting message with
image on to the desktop of your computer, and then you can open the door lock just by clicking
the mouse. Fig: 2.2 show the network communications in embedded systems.
The central processing unit (c.p.u) can be any one of the following microprocessor,
microcontroller, digital signal processing.
Among these Microcontroller is of low cost processor and one of the main advantage of
microcontrollers is, the components such as memory, serial communication interfaces,
analog to digital converters etc.., all these are built on a single chip. The numbers of
external components that are connected to it are very less according to the application.
Microprocessors are more powerful than microcontrollers. They are used in major
applications with a number of tasking requirements. But the microprocessor requires many
external components like memory, serial communication, hard disk, input output ports
etc.., so the power consumption is also very high when compared to microcontrollers.
Digital signal processing is used mainly for the applications that particularly involved with
processing of signals.
3.8 FEATURES
The main feature of an embedded systems are its reliability and the scope for debugging.
3.8.1 Debugging
Debugging may be performed at different levels, depending on the facilities available,
ranging from assembly or source level debugging with an in circuit emulator or in circuit
debugger, to outputs from serial debug ports to an emulated environment running on a PC. As the
complexity of embedded systems grows, higher level tools and operating systems or migrating into
machinery where it makes sense.
3.8.2 Reliability
Embedded systems often reside in machines that are expected to run continuously for years
without errors and in some cases recover by themselves if any error occurs. Therefore the software
is usually developed and tested more carefully than that for PC, and unreliable mechanical moving
parts such as disk drivers, switches or buttons are avoided.
Specific reliable issues may include the system cannot safely be shut down for repair, or it
is too inaccessible to repair. Solutions may involve subsystems with redundant spares that can be
switched over to, or software “limp modes” that provide partial function “Limp modes” are less
tolerable. Often backups are selected by an operator. Examples include aircraft, navigation, reactor
control systems, safely critical chemical factory controls, train signals and engines on single-
engine aircraft.
Today a lot of industries are using embedded systems for process control. In industries we
design the embedded systems to perform a specific operation like monitoring temperature,
pressure,
humidity ,voltage, current etc.., and basing on these monitored In critical industries where human
presence is avoided there we can use robots which are programmed to do aspecific operation.
4. HARDWARE DESCRIPTION
4.1 ARDUINO
pinout: added SDA and SCL pins that are near to the AREF pin and two other new pins
placed near to the RESET pin, the IOREF that allow the shields to adapt to the voltage
provided from the board. In future, shields will be compatible both with the board that use
the AVR, which operate with 5V and with the Arduino Due that operate with 3.3V. The
second one is a not connected pin, that is reserved for future purposes.
Stronger RESET circuit.
Atmega 16U2 replace the 8U2.
"Uno" means one in Italian and is named to mark the upcoming release of Arduino 1.0. The Uno
and version 1.0 will be the reference versions of Arduino, moving forward. The Uno is the latest in
a series of USB Arduino boards, and the reference model for the Arduino platform; for a
comparison with previous versions, see the index of Arduino boards.
Summary
Microcontroller ATmega328
Operating Voltage 5V
InputVoltage
7-12V
(recommended)
Input Voltage (limits) 6-20V
Digital I/O Pins 14 (of which 6 provide PWM output)
Analog Input Pins 6
DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 32 KB (ATmega328) of which 0.5 KB used by bootloader
SRAM 2 KB (ATmega328)
EEPROM 1 KB (ATmega328)
Clock Speed 16 MHz
Note: The Arduino reference design can use an Atmega8, 168, or 328, Current models use
an ATmega328, but an Atmega8 is shown in the schematic for reference. The pin configuration is
identical on all three processors.
Power
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 (wall-wart) or
battery. 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.
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:The regulated power supply used to power the microcontroller and other components
on the board. This can come either from VIN via an on-board regulator, or be supplied by
USB or another regulated 5V supply.
3V3: A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50
mA.
GND: Ground pins.
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).
Serial: 0 (RX) and 1 (TX): 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.
External Interrupts: 2 and 3: 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 attach Interrupt() function
for details.
PWM: 3, 5, 6, 9, 10, and 11:Provide 8-bit PWM output with the analog Write() function.
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK): These pins support SPI communication
using the SPI library.
LED: 13:There is a built-in LED connected to digital pin 13. When the pin is HIGH value,
TWI: A4 or SDA pin and A5 or SCL pin: Support TWI communication using the Wire
library.
There are a couple of other pins on the board:
AREF: Reference voltage for the analog inputs. Used with analog Reference().
Reset: Bring this line LOW to reset the microcontroller. 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.
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 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 Software Serial library allows for serial communication on any of the Uno's digital
pins.The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino software
includes a Wire library to simplify use of the I2C bus; see the documentation for details. For SPI
communication, use the SPI library.
Programming
The Arduino Uno can be programmed with the Arduino software (download). Select
"Arduino Uno from the Tools > Board menu (according to the microcontroller on your board).
For details, see the reference and tutorials.
The ATmega328 on the Arduino Uno comes preburned with a boot loader that allows you to
upload new code to it without the use of an external hardware programmer. It communicates using
the original STK500 protocol (reference, C header files).
You can also bypass the bootloader and program the microcontroller through the ICSP (In-Circuit
Serial Programming) header; see these instructions for details.
The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is available .
The ATmega16U2/8U2 is loaded with a DFU boot loader, which can be activated by:
On Rev1 boards: connecting the solder jumper on the back of the board (near the map of
Italy) and then resetting the 8U2.
On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line to ground,
making it easier to put into DFU mode.
You can then use Atmel's FLIP software (Windows) or the DFU programmer (Mac OS X
and Linux) to load a new firmware. Or you can use the ISP header with an external programmer
(overwriting the DFU boot loader). See this user-contributed tutorial for more information.
the following half-second or so, the boot loader is running on the Uno. While it is programmed to
ignore malformed data (i.e. anything besides an upload of new code), it will intercept the first few
bytes of data sent to the board after a connection is opened. If a sketch running on the board
receives one-time configuration or other data when it first starts, make sure that the software with
which it communicates waits a second after opening the connection and before sending this data.
The Uno contains a trace that can be cut to disable the auto-reset. The pads on either side of
the trace can be soldered together to re-enable it. It's labeled "RESET-EN". You may also be able
to disable the auto-reset by connecting a 110 ohm resistor from 5V to the reset line; see this forum
thread for details.
a) LCD
To display any character on LCD micro controller has to send its ASCII value to the data
bus of LCD. For e.g. to display 'AB' microcontroller has to send two hex bytes 41h and 42h
respectively.LCD display used here is having 16x2 size. It means 2 lines each with 16 characters.
There are pins along one side of the small printed board used for connection to the
microcontroller. There are total of 14 pins marked with numbers (16 in case the background light
is built in).
The soil moisture sensor is a device to measure volumetric water content in the soil. The
sensor measures volumetric water content indirectly, without removing moisture, by using other
parameters of soil like electrical resistance or conductance, dielectric constant and interaction with
other neutrons. The result may vary depending on environmental factors like soil type,
temperature, and conductivity, so it must be calibrated.
Specification
Voltage supply: 3.3-5V
Output mode: dual-mode, Analog (more accurate) and digital
Comparator IC: LM393
Indicator type:
o Red: power indicator
o Digital switching output indicator
Pin Description
1. Vcc
2. GND
3. DO: Digital output
4. AO: Analog output
Application
Agriculture
Gardening
c) Wi-Fi Module
The ESP-01S ESP8266 WiFi Module is a self-contained SOC with integrated TCP/IP
protocol stack that can give any microcontroller access to your WiFi network. The ESP8266 is
capable of either hosting an application or offloading all Wi-Fi networking functions from another
application processor. Each ESP-01S ESP8266 module comes pre-programmed with an AT
command set firmware, meaning, you can simply hook this up to your Arduino device and get
about as much WiFi-ability as a WiFi Shield offers (and that’s just out of the box)! The ESP-01S
ESP8266 module is an extremely cost-effective board with a huge, and ever-growing, community.
This module has a powerful enough on-board processing and storage capability that allows 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, including the front-end module, is designed to occupy
minimal PCB area. The ESP8266 supports APSD for VoIP applications and Bluetooth co-
existence interfaces, it contains a self-calibrated RF allowing it to work under all operating
conditions and requires no external RF parts.
Features:
This easy-to-mount GA25-370 DC Gear motor is great for building robots and it comes in
a variety of configurations that suit even the most exigent designs. The motor comes in a Small
cylinder shape with a diameter of 25 mm and a 4mm diameter shaft and 2 Terminal connectors.
These motors are designed to produce high torque at very low current consumptions. It is a
Great replacement for the rusty or damaged DC geared speed reduce motor on the
machine. Benefiting from high torque and low noise, this motor is solidly constructed and ready to
install in numerous applications
This is 12V DC motor which has a gearbox of 25mm diameter same as the motor base
body. The 25GA-370 Gear Motor’s gearbox has metal gears and a centre shaft. The D-Shape Shaft
of the motor is loaded with Metal bush for wear resistance and smooth operation.
We highly suggest you this motor for the general purpose automation projects requiring
considerable torque range.
Applications :
Robotics (Robocon Events), Electric Controlled Valve, Wending Machine, Automatic
Actuator, Automatic Doors, Coin Refund Devices, Money Detector, Soft Napkin Machine,
Infusion Pumps etc
Features:
Main Difference between Good Quality SG90 and Standard Quality Sg90 is
They are compatible with all the applications that use the genuine TowerPro SG90 9g Mini Servo
because of their same size, comparable quality, and optimized performance.
It equips Carbon Fiber Gears which makes the servo motor much lighter than same metal
gear motor. For small load applications using the metal gear servo motor adds on unnecessary
weight, so we suggest using this lightweight plastic gear servo motors.
The TowerPro SG90 1.2kgCm 180 Degree Rotation Servo Motor rotates 90° in each direction
making it 180° servo motor. It is a Digital Servo Motor which receives and processes PWM signal
faster and better. It equips sophisticated internal circuitry that provides good torque, holding
power, and faster updates in response to external forces.
They are packed within a tight sturdy plastic case which makes them water and dust resistant
which is a very useful feature in RC planes, Boats, and RC Monster Trucks etc. It equips 3-wire
JR servo plug which is compatible with Futaba connectors too.
Wire Description
RED – Positive
Brown – Negative
Orange – Signal
We are selling the wide range of Servo Motors with variable specs and quality material, Check
them now
Features :
The L293D Motor Driver/Servo Shield for Arduino is probably one of the most versatile on the
market and features 2 servo and 4 motor connectors for DC or stepper motors. That makes it a
great shield for any robotic project.
This Arduino compatible motor Driver shield is a full-featured product that it can be used to drive
4 DC motor or two 4-wire steppers and two 5v servos. It drives the DC motor and stepper with the
L293D, and it drives the servo with Arduino pin9 and pin10.
The shield contains two L293D motor drivers and one 74HC595 shift register. The shift register
expands 3 pins of the Arduino to 8 pins to control the direction of the motor drivers. The output
enables the L293D is directly connected to the PWM outputs of the Arduino.
Firmware
Features :
6. Big terminal block connectors to easily hook up wires (18-26AWG) and power
7. Arduino reset button brought up top
8. 2-pin terminal block and jumper to connect external power, for separate logic/motor
supplies
9. Tested compatible with Arduino Mega 1280 & 2560, Diecimila, Duemilanove, and UNO
10. Download the easy-to-use Arduino software library, check out the examples and you’re
ready to go!
5. SOFTWARE DEVELOPMENT
Requirements:
A computer (Windows, Mac, or Linux).
An Arduino-compatible microcontroller (anything from this guide should work).
A USB A-to-B cable, or another appropriate way to connect your Arduino-compatible
microcontroller to your computer (check out this USB buying guide if you’re not sure which cable
to get).
5.1.1Arduino:
Arduino is an open-source electronics platform based on easy-to-use hardware and
software. Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a
Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing
something online. You can tell your board what to do by sending a set of instructions to the
microcontroller on the board. To do so you use the Arduino programming language (based
on Wiring), and the Arduino Software (IDE), based on Processing.
Over the years Arduino has been the brain of thousands of projects, from everyday objects
to complex scientific instruments. A worldwide community of makers - students, hobbyists, artists,
programmers, and professionals - has gathered around this open-source platform, their
contributions have added up to an incredible amount of accessible knowledge that can be of great
help to novices and experts alike.
Arduino was born at the Ivrea Interaction Design Institute as an easy tool for fast
prototyping, aimed at students without a background in electronics and programming. As soon as
it reached a wider community, the Arduino board started changing to adapt to new needs and
challenges, differentiating its offer from simple 8-bit boards to products for IOT applications,
wearable, 3D printing, and embedded environments
.
Fig: 5.2 Arduino
All Arduino boards are completely open-source, empowering users to build them
independently and eventually adapt them to their particular needs. The software, too, is open-
source, and it is growing through the contributions of users worldwide.
Thanks to its simple and accessible user experience, Arduino has been used in thousands of
different projects and applications. The Arduino software is easy-to-use for beginners, yet flexible
enough for advanced users. It runs on Mac, Windows, and Linux. Teachers and students use it to
build low cost scientific instruments, to prove chemistry and physics principles, or to get started
with programming and robotics.
Designers and architects build interactive prototypes, musicians and artists use it for
installations and to experiment with new musical instruments. Makers, of course, use it to build
many of the projects exhibited at the Maker Faire, for example. Arduino is a key tool to learn new
things. Anyone - children, hobbyists, artists, programmers - can start tinkering just following the
step by step instructions of a kit, or sharing ideas online with other members of the Arduino
community.
5.2 TROUBLESHOOTING
This guide from Arduino has some more details and troubleshooting tips if you get
stuck.Mac
This page will show you how to install and test the Arduino software on a Mac computer
running OSX.
Go to the Arduino download page and download the latest version of the Arduino software
for Mac.
When the download is finished, un-zip it and open up the Arduino folder to confirm that
yes, there are indeed some files and sub-folders inside. The file structure is important so
don’t be moving any files around unless you really know what you’re doing.
Power up your Arduino by connecting your Arduino board to your computer with a USB
cable (or FTDI connector if you’re using an Arduino pro). You should see the LED labed
‘ON’ light up. (This diagram shows the placement of the power LED on the UNO).
Move the Arduino application into your Applications folder.
For other boards, you will need to install drivers for the FTDI chip on your Arduino.
Go to the FTDI website and download the latest version of the drivers.
Once you’re done downloading, double click the package and follow the instructions from
the installer.
After following the appropriate steps for your software install, we are now ready to test your
first program with your Arduino board!
Launch the Arduino application
If you disconnected your board, plug it back in
Open the Blink example sketch by going to: File > Examples > 1.Basics > Blink
Select the serial port that your Arduino is attached to: Tools > Port > xxxxxx (it’ll probably look
something like “/dev/tty.usbmodemfd131” or “/dev/tty.usbserial-131” but probable with a
different number).
If you’re not sure which serial device is your Arduino, take a look at the available ports,
then unplug your Arduino and look again. The one that disappeared is your Arduino.
With your Arduino board connected and the Blink sketch open, press the ‘Upload’ button
After a second, you should see some LEDs flashing on your Arduino, followed by the
message ‘Done Uploading’ in the status bar of the Blink sketch.
If everything worked, the onboard LED on your Arduino should now be blinking! You just
programmed your first Arduino!
Sketch
A sketch is a program written with the Arduino IDE. Sketches are saved on the
development computer as text files with the file extension .ino. Arduino Software (IDE) pre-1.0
saved sketches with the extension .pde.
setup( ): This function is called once when a sketch starts after power-up or reset. It is
used to initialize variables, input and output pin modes, and other libraries needed in the sketch. It
is analogous to the function main( ).
loop( ): After setup( ) function exits (ends), the loop( ) function is executed repeatedly in
the main program. It controls the board until the board is powered off or is reset. It is analogous to
the function while( ).
5.3 HACK AN ARDUINO:
Steps For Hacking An Arduino:
Step1: Arduino microcontrollers come in a variety of types. The most common is the Arduino
UNO, but there are specialized variations. Before you begin building, do a little research to figure
out which version will be the most appropriate for your project.
Step2: To begin, you'll need to install the Arduino Programmer, aka the integrated development
environment (IDE).
Step3: Connect your Arduino to the USB port of your computer. This may require a specific USB
cable. Every Arduino has a different virtual serial-port address, so you’ll need to reconfigure the
port if you're using different Arduinos.
Step4: Set the board type and the serial port in the Arduino Programmer.
Step5: Test the microcontroller by using one of the preloaded programs, called sketches, in the
Arduino Programmer. Open one of the example sketches, and press the upload button to load it.
The Arduino should begin responding to the program: If you've set it to blink an LED light, for
example, the light should start blinking.
Step6: To upload new code to the Arduino, either you'll need to have access to code you can paste
into the programmer, or you'll have to write it yourself, using the Arduino programming language
to create your own sketch. An Arduino sketch usually has five parts: a header describing the
sketch and its author; a section defining variables; a setup routine that sets the initial conditions of
variables and runs preliminary code; a loop routine, which is where you add the main code that
will execute repeatedly until you stop running the sketch; and a section where you can list other
functions that activate during the setup and loop routines. All sketches must include the setup and
loop routines.
Step7: Once you've uploaded the new sketch to your Arduino, disconnect it from your computer
and integrate it into your project as directed
#include
Servo myservo;
int m=0;
int n=0;
int pos = 0;
void setup() {
// put your setup code here, to run once:
pinMode(A0, INPUT_PULLUP);
pinMode(A1, INPUT_PULLUP);
pinMode(8,OUTPUT);
Serial.begin(9600);
myservo.attach(9);
}
void loop() {
// put your main code here, to run repeatedly:
int m= analogRead(A0);
int n= analogRead(A1);
Serial.println(m);
delay(10);
Serial.println(n);
delay(200);
if (m>=980)
{
myservo.write(90); // tell servo to go to position in variable 'pos'
digitalWrite(8, HIGH);
delay(1000);
}
digitalWrite(8, HIGH);
delay(1000);
}
else if(n<=970)
{
digitalWrite(8, LOW);
}
else
{
digitalWrite(8, LOW)
The values obtained through sensors enable the system to switch the sprinkler on and off.
A farmer can remotely monitor the irrigation process on the farm. Hence, the system contributed
in making a smart farm. Table 2 depicts the readings of the two YL-69 soil moisture sensors taken
over a period of one hour
Table 2 depicts readings from two YL-69 soil moisture sensors one of which was inserted
in over irrigated soil and the other in soil with initial moisture content 79% . The readings were
taken over a period of one hour to observe the rate at which moisture content in soil is reducing
when the sprinklers are off. These readings are transmitted to the website and thingspeak channel.
Figure 5 and 6 display the graphs plotted. It can be observed from the graphs that moisture content
of over irrigated soil takes longer period to reduce by 10% as compared to the moisture content of
soil which is initially 79% moist. Thus, the curve for sensor A is a continuously decreasing curve
as the moisture reduces as time passes. For sensor B the moisture value initially is 100%. The
readings depict that sensor was in an over irrigated soil at the beginning. In our system possibility
of over irrigation is avoided by turning the water sprinklers off as soon as the sensor reading is
100%.
15:53:21 79 100
16:00:22 74 100
16:11:23 70 100
16:16:44 69 100
16:30:05 67 100
16:34:45 66 100
16:43:06 65 98
16:48:07 65 97
16:56:08 64 95
16:59:48 63 93
17:00:08 63 93
17:05:49 62 92
6.1 ADVANTAGES
Increase in productivity
reduced water consumption
Safe
No manpower required
Reduce soil erosion and nutrient leaching
Require smaller water sources
6.2 CONCLUSION
A system to monitor moisture levels in the soil was designed and the project provided an
opportunity to study the existing systems, along with their features and drawbacks. The proposed
system can be used to switch on/off the water sprinkler according to soil moisture levels thereby
automating the process of irrigation which is one of the most time consuming activities in farming.
Agriculture is one of the most water-consuming activities. The system uses information from soil
moisture sensors to irrigate soil which helps to prevent over irrigation or under irrigation of soil
thereby avoiding crop damage. The farm owner can monitor the process online through a website.
Through this project it can be concluded that there can be considerable development in farming
with the use of IOT and automation. Thus, the system is a potential solution to the problems faced
in the existing manual and cumbersome process of irrigation by enabling efficient utilization of
water resources.
other activities in farming such as cattle management, fire detection and climate control. This
would minimalize human intervention in farming activities.
6.4 REFERENCES
1. Sankar, P., Norman, S.R,(2009) “Embedded System for Monitoring Atmosphere is Weather
Conditions Using Weather Balloon”, International Conference on Control and Automation.
2. L.L.Pfitscher, (2011) “An automated irrigation system for rise cropping with remote supervision”-
proceeding of international conference on power engineering.
3. Joaquín Gutiérrez, Juan Francisco Villa-Medina, Alejandra NietoGaribay, and Miguel Ángel
5. Bircher, S., Skou, N., Jensen, K.H., Walker, J.P., & Rasmussen, L. (2011). A soil moisture and
temperature network for SMOS validation in Western Denmark.
6. Samy Sadeky, Ayoub Al-Hamadiy, Bernd Michaelisy, Usama Sayedz,“ An Acoustic Method for
Soil Moisture Measurement”,IEEE2004
7. Dr. Narayan G. Hegde, “Water Scarcity and Security in India”, BAIF Development
ReseachFoundation, Pune.
8. Marvin T. Batte, “Changing computer use in agriculture: evidence from Ohio”, Computers and
Electronics in Agriculture, Elsevier science publishers, vol. 47, 1–13, 2005
9. Csótó, Magyar, “Information flow in agriculture – through new channels for improved
effectiveness”,Journal of Agricultural Informatics 1 (2), 25–34, 2010
10. Jin Shen, Song Jingling, Han Qiuyan and Yang Yan, “A Remote Measurement and Control
System for Greenhouse Based on GSM-SMS”, Electronic Measurement andInstruments, 2007.
ICEMI '07. 8th International Conference
11. Indu Gautam and S.R.N Reddy, “Innovative GSM based Remote Controlled Embedded System
for Irrigation”, International Journal of Computer Applications Vol. 47 – No.13, June 2012
13. Karan Kansara, Vishal Zaveri, Shreyans Shah, Sandip Delwadkar, and Kaushal Jani “Sensor
based Automated IrrigationSystemwithIOT:ATechnical Review”,(IJCSIT) International Journal
of Computer Science and Information Technologies, Vol. 6 (6) , 2015, 5331-5333
14. Sumeet. S. Bedekar, Monoj. A. Mechkul, and Sonali. R. Deshpande “IoT based Automated
Irrigation System”, IJSRD - International Journal for Scientific Research& Development| Vol. 3,
Issue 04, 2015 | ISSN (online): 2321-0613
15. K.S.S. Prasad, Nitesh Kumar, Nitish Kumar Sinha and Palash Kumar Saha “Water-Saving
Irrigation System Based on Automatic Control by Using GSM Technology”, Middle-East
Journal of Scientific Research 12 (12): 1824-1827, 2012ISSN 1990-9233 c IDOSI
Publications, 2012DOI: 10.5829/idosi.mejsr.2012.12.12.1258
16. Remote Sensing and Control of an Irrigation System Using a Distributed Wireless Sensor Network
by Yunseop (James) Kim, Member, IEEE, Robert G. Evans, and William M. Iversen, IEEE
Transaction on Instrumentation and Measurement, VOL.57
17. Thingspeak : https:// thingspeak.com/
18. Alexandros Kaloxylos, Robert Eigenmann, Frederick Teye, Zoi Politopoulou, Sjaak Wolfert,
Claudia Shrank, Markus Dillinger, Ioanna Lampropoulou, Eleni Antoniou, Liisa Pesonen, Huether
Nicole, Floerchinger