0% found this document useful (0 votes)
39 views

B2 Report

The document describes a project report on the real time implementation of an automatic irrigation system using solar energy and GSM. The system uses sensors like soil moisture, temperature and humidity sensors to measure the field conditions. When the sensor values go below a threshold, a motor will be automatically switched on using a relay driver to irrigate the field. Status updates will be sent to a registered mobile number using GSM.

Uploaded by

Kumar Velusamy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

B2 Report

The document describes a project report on the real time implementation of an automatic irrigation system using solar energy and GSM. The system uses sensors like soil moisture, temperature and humidity sensors to measure the field conditions. When the sensor values go below a threshold, a motor will be automatically switched on using a relay driver to irrigate the field. Status updates will be sent to a registered mobile number using GSM.

Uploaded by

Kumar Velusamy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 60

REAL TIME IMPLEMENTATION OF AUTOMATIC

IRRIGATION SYSTEM WITH SOLAR ENERGY


OPERATED MOTOR USING GSM
A PROJECT REPORT

Submitted by

DHARANYA.A (730316106014)

INDHU.S (730316106026)

PONVIVEK.R (730316106040)

in partial fulfillment for the award of the degree

of

BACHELOR OF ENGINEERING

IN
ELECTRONICS AND COMMUNICATION ENGINEERING

BUILDERS ENGINEERING COLLEGE

KANGAYAM - 638108

ANNA UNIVERSITY: CHENNAI – 600 025

APRIL 2020
ANNA UNIVERSITY: CHENNAI 600 025
BONAFIDE CERTIFICATE
Certificated that this project report “REAL TIME IMPLEMENTATION OF
AUTOMATIC IRRIGATION SYSTEM WITH SOLAR ENERGY
OPERATED MOTOR USING GSM” is the bonafide work of
“DHARANYA.A (730316106014), INDHU.S (730316106026), PONVIVEK.R
(730316106040)” who carried out the project work under my supervision.

SIGNATURE SIGNATURE
Mr. S. D.VIJAYAKUMAR, ME., Mr.U.RAJASEKARAN, ME.,
HEAD OF THE DEPARTMENT SUPERVISOR
Department of ECE, Assistant professor,
Builders Engineering College, Department of ECE,
Kangayam - 638108. Builders Engineering College,
Kangayam - 638108.

Submitted for the Anna University, Chennai – Project Viva Voice


held on ………………

Internal Examiner External Examiner

i
ACKNOWLEDGEMET

We would like to express our gratitude to our respected Correspondent,


Mr. P. BALASIVAKUMAR, M.A., of Builders Engineering College at this high
time for providing us all facilities to complete our project successfully.

We take it a privilege to express our gratefulness and thanks to our


respected Principal, Dr. S. GOPALAKRISHNAN, M.E., Ph.D., who has been a
bastion of moral strength and a source thanks of incense encouragement to us.

We express our sincere thanks to Mr. S.D.VIJAYAKUMAR, M.E., Head


of the Department, Electronics and Communication Engineering for his inspiring
support and management.

We dedicate our sincere thanks to our guide Mr. U. RAJASEKARAN,


M.E., Assistant Professor, Department of ECE, whose enterprise and guidance
has been a source of inspiration for us throughout this project work.

We also thank all Faculty members and Non-teaching staff members of


the Electronics and Communication Engineering Department and all our fellow
students who stood with us to do our project work successfully. We also extend
our warm thanks to our beloved Parents.

ii
ABSTRACT

Indian economy is mainly based on agriculture. Water is the main resources


for agriculture. The continuously increasing population in India demands for the
rapid improvement in food production technology. India is a country where
most of the people are depend on agricultural activities. Irrigation plays an
important role in agriculture. The cultivated lands are not able to use properly due
to water scarcity because most of the lands have to depend on monsoon rain.
There are many plants are very sensitive to water levels and they required specific
level of water supply for their proper growth. It is impossible that every farmer
must possess the perfect knowledge about growing specifications of plants in case
of water supply.
This paper proposes the “Real time automatic irrigation system with solar
energy operated motor using GSM. It consists of sensors like soil moisture,
temperature and humidity sensor. The soil moisture sensor is used to measure the
moisture content of the soil. Humidity and temperature sensor is used to measure
the moisture content in the surroundings. The Solar Panel is used to operate the
three phase motor. GSM module is available in the motor control unit. Information
from the field controller unit such as soil moisture, humidity and temperature is
send to the motor controller unit. With the help of sensor values the motor will
automatically switched ON/OFF to irrigate the field. From motor controller unit
the information is send to the register mobile number through GSM module.

iii
TABLE OF CONTENTS

CHAPTER TITLE PAGE


NO NO
ABSTRACT iii
TABLE OF CONTENTS iv
LIST OF TABLES vii
LIST OF FIGURES viii
LIST OF ABBREVIATIONS ix
1 INTRODUCTION 1
1.1 INTRODUCTION 1
1.2 OBJECTIVE 1
1.3 METHODOLOGY 2
1.4 ORGANIZATION OF REPORT 2

2 LITEATURE SURVEY 3
2.1 INTRODUCTION 3
2.2 REFERRED DETAILS 3

3 EXISTING METHOD 6
3.1 INTRODUCTION 6
3.2 WORKING 6
3.3 ADVANTAGES 6
3.4 DISADVANTAGES 6
3.5 BLOCK DIAGRAM 7

4 PROPOSED METHOD 8
4.1 INTRODUCTION 8
4.2 WORKING 8

iv
4.3 BLOCK DIAGRAM 9

4.4 ADVANTAGES 10

5 SOFTWARE REQUIREMENTS 11
5.1 INTRODUTION 11
5.2 EMBEDDED C 11
5.2.1 CROSS COMPLIERS 12
5.2.2 CROSS ASSEMBLERS 12
5.2.3 LINEAR/LOCATER 12

5.3 ARDUINO IDE 12

6 HARDWARE DESCRIPTION 14

6.1 INTRODUCTION
6.2 EMBEDDED SYSTEM AND 14
MICROCONTROLLER
6.2.1 INTRODUCTION TO 14
MICROCONTROLLER
6.2.2 APPLICATIONS OF EMBEDDED 15
SYSTEM
6.2.3 ROLE OF EMBEDDED SYSTEM 15
6.3 ARDUINO UNO ATMEGA328 15
6.3.1 ARDUINO UNO 15
6.3.2 DIFFER FROM OTHER BOARD 16
6.3.3 PIN DESCRIPTION –ARDUINO UNO 16
6.3.4 ATMEGA328 PIN OUT 19
6.4 POWER SUPPLY UNIT 21
6.4.1 TRANSFORMER 22

v
6.4.2 BRIDGE RECTIFIER 22
6.4.3 FILTERING UNIT 23
6.4.4 IC VOLTAGE REGULATOR 23
6.5 SOIL MOISTURE SENSOR 25
6.6 TEMPERATURE SENSOR 26
6.6.1 FEATURES OF DHT11 SENSOR 26
6.7 LCD DISPLAY 27
6.7.1 PIN DESCRIPTION 27
6.8 RELAY DRIVER 28
6.9 SOLAR PANEL 30
6.10 AC MOTOR 30
6.10.1 SHUNT AND SERIES MOTOR 30
6.10.2 SEPARATELY EXICTED MOTOR 30
6.11 GSM 31
6.11.1 GSM SIM800 FEATURES 31
6.11.2 PIN SPECIFICATION 32
6.11.3 WORKING OF GSM 32
6.11.4 AT COMMAND 33
7 RESULTS AND DISCUSSION 35
7.1 HARDWAREKIT OF AN AUTOMATIC 35
IRRIGATION SYSTEM
7.2 SENDING MESSAGE TO THR USERS MOBILE 36
7.3 DISPLAING THE OUTPUT COMMAND 37
8 CONCLUTION AND FUTURE WORK 38

APPENDIX 39

REFERENCE 50

vi
LIST OF TABLES

TABLE TITLE PAGE


NO. NO.
6.1 Pin details of ATMEGA328 20
6.2 AT Commands 34

vii
LIST OF FIGURES

FIGURE TITLE PAGE


NO. NO.

3.1 Block diagram of Existing system 7


4.1 Block diagram of proposed system 9
6.1 Circuit diagram of Arduino uno 19
6.2 Pin description of Atmega328 20
6.3 Block diagram of Power Supply 22
6.4 Soil Moisture Sensor 25
6.5 DHT11 Sensor 26
6.6 Circuit Diagram of LCD Display 28
6.7 Circuit diagram of relay 28
6.8 Pin diagram of relay 29
6.9 Circuit Diagram of GSM 32
7.1 Snap shot of an Automatic Irrigation System 35
7.2 Mobile notification to the User 36
7.3 Displaying the output when the soil is Dry 36

viii
LIST OF ABBREVIATION

ACRONYMS ABBREVIATIONS

GSM Global System for Mobile Communication


IDE Integrated Development Environment
LCD Liquid Crystal Display
PWM Pulse Width Modulation
SMS Short Message Service
USB Universal Serial Bus
SIM Subscriber Identity Module
ISCP In Circuit Serial Programming
AREF Analog Reference

ix
CHAPTER 1

INTRODUCTION

1.1 INTRODUCTION

An Embedded System is a combination of computer hardware and software


and perhaps additional mechanical part designed to perform a specific function. An
embedded system is a microcontroller-based, software driven, reliable, real-time
control system, autonomous or human or network interactive, operating on diverse
physical variables and in diverse environments and sold into a competitive and cost
conscious market.
The program instructions are written from embedded systems are referred to
as firmware, and are stored in read only memory or flash memory chips. It runs
with limited computer hardware resources like little memory, small or non- existent
keyboard or screen.
Typically, most embedded control systems are control system, that are
designed around an MCU, which integrates on-chip program memory, data memory
(RAM) and various peripheral functions, such as timer and serial communication.
In addition, these systems usually require analog/interface devices, serial EEPROM
display driver’s keypads or small displays.
1.2 OBJECTIVE

At the present era, the farmers have been using irrigation technique in India
through the manual method in which the farmers irrigate the land at the regular
intervals. In our proposed system we design the automatic irrigation system with
solar energy operated motor using GSM. It is a sensor based automatic irrigation
method to agricultural lands using arduino controller.

1
1.3 METHODOLOGY
Details about the design of automatic irrigation is done through assistance of
soil moisture sensors, temperature and humidity sensor. The design also has the
features of GSM which makes this system wireless. The electricity required by
components is provided through solar panels hence this liberates us from
interrupted power supply due to load shedding. The water content is constantly
judged and whenever moisture level of soil gets low, the system sends a signal to
motors asking them to turn on. The motors automatically stop after soil reaches its
maximum threshold value which is decided by user. Every time the motor starts or
stops automatically, the user will get a SMS about the status of operation. The
major advantages of the project includes avoidance from water wastage, growth of
plants to their maximum potential, less chances of error due to less labor and
uninterrupted supply of water due to solar energy.
1.4 ORGANIZATION OF THESIS

Chapter 1 discusses the main objective of the project and the reason for the
documentation of the project. Chapter 2 discusses the literature survey which gives
details about the Reference papers studied for the project work. Chapter 3 provides
the existing method. Chapter 4 provides the proposed method. Chapter 5 provides
the software description. Chapter 6 provides the hardware description. Chapter 7
describes the results and discussions obtained from the project. Chapter 8 includes
conclusion and future work.

2
CHAPTER 2

LITERATURE SURVEY

2.1 INTRODUCTION

The detailed survey of various literals for the successful execution of


the project is presented in this chapter.
2.2 REFERRED LITERALS

[1] G. Nisha , J. Megala (2014) Wireless sensor Network based automated


irrigation and crop field monitoring system . The system consists of distributed
wireless sensor network of soli-moisture, and temperature sensors placed in the crop
field. To handle the sensor information Zigbee protocol used and control the water
quantity programming using an algorithm with threshold values of the sensors to a
microcontroller for irrigation system. The system has powered by solar panel and
Cellular-internet interface for data inspection. A wireless camera is fixed in crop
field to monitor the disease area using image processing technique. The system is
low cost and energy autonomy useful in water limited geographically isolated areas.

[2] S. R. Prathibha , Anupama Hongal , M. P. Jyothi (2017) Iot Based


Monitoring System in Smart Agriculture. Internet of Things (IoT) plays a crucial
role in smart agriculture. Smart farming is an emerging concept, because IoT
sensors capable of providing information about their agriculture fields. The paper
aims making use of evolving technology i.e. IoT and smart agriculture using
automation. Monitoring environmental factors is the major factor to improve the
yield of the efficient crops. The feature of this paper includes monitoring
temperature and humidity in agricultural field through sensors using CC3200 single

3
chip. Camera is interfaced with CC3200 to capture images and send that pictures
through MMS to farmers mobile using Wi-Fi.
[3] R. Nageswara Rao , B. Sridhar (2018) IOT based smart crop field
monitoring and automation irrigation system. In this paper purposes, Raspberry
Pi based automatic irrigation IOT system is proposed to modernization and
improves productivity of the crop. The proposed system developed on the
information sent from the sensors and estimate the quantity of water needed. Two
sensors are used to get the data to the base station the humidity and the temperature
of the soil, the humidity, the temperature, and the duration of sunshine per day. The
proposed systems based on these values and calculate the water quantity for
irrigation is required. The major advantage the system is implementing of Precision
Agriculture (PA) with cloud computing, that will optimize the usage of water
fertilizers while maximizing the yield of the crops and also will help in analyzing
the weather conditions of the field.

[4] Dipanjan Bhattacharjee ; Om Prakash ; Hashinur Islam (2018) Smart


Fertilizer Dispensary System for Automated Drip Irrigation. This paper
presents work on the design and development of prototype models for wireless
smart fertilizer dispensary systems with the help of ZigBee and GSM
technology. The field station prototype is developed with the help of ATMEGA
328 based embedded platforms, four solenoid valves to control three different
fertilizers and water with their associated driver circuit, ZigBee and GSM module.
A MATLAB based GUI platform is designed to interact with a field station
wirelessly using 2.4 GHz ZigBee transceiver from the remote monitor unit. To
optimize the power level solar panel and DC to DC converters is used. The system
can be operated automatic and manual mode.

4
[5] Md. Munirul Islam Tusher , Md. Zahirul Haque , Mohammad Jalal
Uddin , Arif Mainuddin ,Mohammad Ehsanul Hoque , Md. Mohin Uddin Talukder
(2019) Solar based Automatic irrigation method with GSM module. This paper
purpose, the traditional irrigation system has been modernized using recent
technology for the betterment of rural farmers. ATmega 2560 microcontroller,
Sensors, GSM module, LCD, and Solenoid valve has been used as a prime
component. Temperature, humidity, and water level corresponding to a particular
field has been measured. That information has been sent to its user through a short
message service. Finally, the pump has been controlled based on the water
requirement. As a result, a certain amount of water and electricity can be saved,
which has been calculated. Manual and automatic operation mode also
substantiated.

5
CHAPTER 3

EXISTING METHOD

3.1 INTRODUCTION
In the existing system, human resources are needed to irrigate the field.
Improper use of water leads to wastage of significant amount of water. It is not
applicable for large field coverage. The Motor is run with the help of regulated
power supply.
3.2 WORKING

In the existing system irrigation is done through assistance of soil moisture


sensors. The PIC microcontroller is used to monitor the agricultural field. The soil
moisture sensor is used to monitor the moisture content of the soil and depending
upon these values, the system is turned ON/OFF automatically to irrigate the field
using PC. Temperature sensors are used to know the temperature level in the
atmosphere. Then the data is sent to the microcontroller unit. The PC responds
appropriately by watering the soil with exact required amount of water and then
shut down the water supply when the required level of soil moisture is achieved. It
is not applicable for larger coverage area. The status of the soil is displayed through
the LCD and transmitted to the user. The cost of the system will be high due to the
development of website. It is difficult to upgrade existing conventional control
systems with remote control capabilities.
3.3. ADVANTAGES
• It is a convenient method small area.
• Prevent plant diseases.

6
3.4 DISADVANTAGES

• High cost.
• Wastage of water and power.

3.5 BLOCK DIAGRAM

POWER
SUPPLY

SOIL LCD
MOISTURE
SENSOR
PIC
MICRO
TEMPERA CONTRO
TURE LLER RELAY MOTOR
SENSOR

PC

Figure 3.1 Block diagram of Existing system

7
CHAPTER 4

PROPOSED SYSTEM

4.1 INTRODUCTION

In this proposed system consists of a sensor module along with the


GSM module for data communication. The sensing unit consists of soil moisture, a
temperature sensor and a humidity sensor is used to sense the information about the
agricultural lands. Observing the information from these sensors the motor will
automatically switched ON /OFF to irrigate the field.
4.2 WORKING

To overcome the drawbacks in the existing system we are proposing the Real
time implementation of automatic irrigation system using solar energy operated
motor. The motor pump will ON/OFF automatically to irrigate the field by sensing
the moisture content of the soil, humidity and temperature of the atmosphere.
Arduino UNO is programmed in such a way, so that it can receive the input signal of
varying moisture condition of the soil through the sensing arrangement.
Basically, the code is being fed into Arduino will judge the moisture
condition of soil and decides if motors need to be turned on or off. The code is
written on Arduino software and transferred to the device using USB cable. C
language is used in code and threshold values for upper and lower points are
defined in the code.
DC power generates when the sun rays fall on the solar panel. After passing
the charge controller it is stored in the batteries. Then it goes to the inverter, which
converts the DC supply to the AC. A transformer helps to step down the voltages. A
relay is connected to the microcontroller and the water pump. An LCD display
which is connected to the Arduino shows the output command. The information about
8
the sensor values will sent to the another Arduino board using GSM. Here, Arduino is the
decision-making device which controls the whole circuit. The motor turns on when
the soil moisture sensor finds the soil dry and thus the irrigation process starts. SMS
is sent to the mobile that the motor is ON. The system is running successfully after
sensing the soil moisture level. On the other hand, the motor should be turned OFF
when the soil becomes wet by getting sufficient water. It does the same when the
motor turns OFF by sending the status then the motor is OFF. That depending on
both motor and soil condition, GSM sends a message to the users mobile phone.
4.3 BLOCK DIAGRAM

POWER POWER
SUPPLY SUPPLY

SOLAR
PANEL
GSM GSM
SOIL
MOISTURE
SENSOR
ARDUINO ARDUINO MOTOR
UNO UNO
TEMPERA LCD
DISPLAY
TURE &
HUMIDITY
SENSOR RELAY

Figure 4.1 Block diagram of proposed system

4.4 ADVANTAGES
• To reduce the number of workers.

9
• To reduce the time required to water the plants.
• Preserves soil structure and nutrients.

10
CHAPTER 5

SOFTWARE REQUIREMENTS
5.1 INTRODUCTION
This chapter explains the Embedded C and Arduino IDE.
5.2 EMBEDDED C
Basically, Embedded C doesn’t exist as a language. It is simply C with some
libraries built in C around this type of hardware is using for the development
purpose. Embedded C programming is the soul of the processor inside each
and every Embedded system we come across in our daily life such as
mobile phones, washing machines, digital camera. Each processor is associated
with an embedded software. Embedded C language is most frequently used to
program the microcontroller.
Program is done using Embedded C and it has some following
advantages. Knowledge of the processor instruction set is not required. Programs
get a formal structure and can be divided into separate function. This
contributes to source code reusability as well as better overall application
structure. The keywords and operational functions that are more resemble the
human thought process may be used. If Embedded C is used, the
programming and program test time is drastically reduced. Because the details
like register allocation and addressing modes of the various memory types
and data types are managed by compiler.
The C run-time library contains many standard routines such as:
formatted output, numeric conversion and the floating point arithmetic. The C
language is very portable language that enjoys wide popular support and it is
easily obtained for more systems.

11
The Embedded system software comprise of building program that will run on the
host. These tools are called Native tools. Some of them are:
5.2.1 CROSS-COMPILIERS
The compiler that runs on the host system and produces the binary instructions
that will be understood by the target microprocessor is called Cross-Compiler.
5.2.2 CROSS-ASSEMBLER
A Cross assembler is the assembler that run on the host and produces binary
instructions appropriate for the target system.
5.2.3 LINKER/LOCATOR
Linker/Locator links all the object files produced by the cross compiler and
assembler. The loader finds memory into load the program from the disk into the
memory and may then do various other processing before starting the program.
5.3 ARDUINO IDE

Arduino is an open-source project founded by Massimo Banzi, David


Cuartielles, Tom Igoe, Gianluca Martino and David Mellis. It builds on the work
of many people, projects, and institutions. This page attempts to summarize those
contributions. Arduino was initially developed at the Interaction Design
Institute Ivrea, in northern Italy. It derives from writing, a platform built by
Hernando Barragan as his master’s thesis at Interaction-Ivrea. Hernando was
advised by Masimo and Casey Reas. Wiring and in turn, Arduino build on
previous work by both Massimo and Casey – Massimo’s Program2003
electronics prototyping platform nad the processing platform by Casey and
Ben Fry. Early version versions of both wiring and arduino also relied upon
Pascal Stang’s avrlib libraries. The initial arduino boards were designed by
Massimo Banzi and David Curartielles. David Arduino Mellis developed the
initial arduino software based on wiring, with many contributions by
12
Nicholas Zambetti.
The Arduino development environment is derived is derived from
processing and implemented in Java. Arduino initially targeted AVR
microcontroller from Atmel, making use of open-source including avr-gcc
and avrdude. Atmel supported porting of the Arduino software to ARM-based
microcontrollers, including the Cortex M3 on the Arduino DUE and the
Cortex M0 on the Arduino ZERO.
The Arduino Fio was developed by Shigeru Kobayashi with spark fun.
Intel was the initial partner for the Arduino certified program. The Arduino brand
identity, packaging and graphic design were created for Arduino by TODO.

13
CHAPTER 6

HARDWARE RQUIREMENTS

6.1 INTRODUCTION
This chapter gives the brief description of hardware components used
in this project.
6.2 EMBEDDED SYSTEM AND MICROCONTROLLER

6.2.1 Introduction to microcontroller


Microcontroller is a general purpose device, which integrates the number of
the components of a microprocessor system in to single chip. It has inbuilt CPU,
memory and peripherals to make it as a mini computer. A small computer designed
in a single chip is called a single chip microcomputer. A microcontroller combines
on to same microchip.
• The CPU core and memory
• Some parallel digital input output
Microcontrollers will combine other devices such as:
• A timer module to allow the microcontroller to perform tasks for used
certain time periods.
• A serial I/O port to allow data to flow between the controller and other
devices such as a PIC or another microcontroller.
An ADC to allow the microcontroller to accept analogue input data for processing.
These microcontrollers are used f or variety of applications where it replaces
the computer. The usage of this microcomputer for a specific application, in
which the microcontroller is a part of application is called embedded systems.
Embedded systems are used for the real time application with high
reliability, accuracy and precision.

14
6.2.2 Application of Embedded Systems
• Robotics
• Aviation
• Telecommunication and Broadcasting
• Satellite communication
• Military Application
• Home Appliances etc

6.2.3 Role of Embedded Systems


Embedded systems are compact, smart, efficient, economical and user
friendly. It is a closed systems and respond to the real world situation very
fast. A few years ago, embedded technology existed in standalone devices such as
vending machines and copiers that did their jobs with little regards for what went on
around them. But as technology advance to connect devices to the internet and to
each other, the potential of embedded technology has increased. Home appliances,
mobile phones, cars, avionics etc.., are all using embedded technology.

6.3. ARDUINO UNO ATMEGA328

6.3.1. ARDUINO UNO


"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 board.
The Arduino Uno is a microcontroller board based on the ATmega328
(datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM

15
outputs), 6 analog inputs, a 16 MHz ceramic resonator, 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.
6.3.2 Differ from other boards

The Uno differs from all preceding boards in that it does not use the FTDI
USB-to-serial driver chip. Instead, it features the Atmega16U2 (Atmega8U2 up to
version R2) programmed as a USB-to-serial converter.
Revision 2 of the Uno board has a resistor pulling the 8U2 HWB line to ground,
making it easier to put into DFU mode.
Revision 3 of the board has the following new features:
• 1.0 pin out: 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 uses the AVR, which operate with 5V
and with the Arduino due that operate with 3.3V. The second one is a not
connected pin, which is reserved for future purposes.
• Stronger RESET circuit.
• Atmega 16U2 replace the 8U2.

6.3.3 Pin Description - Arduino uno

1 - Power USB

Arduino board can be powered by using the USB cable from your computer.
All you need to do is connect the USB cable to the USB connection.

2 - Power (Barrel Jack)

16
Arduino boards can be powered directly from the AC mains power supply by
connecting it to the Barrel Jack (2).
3 - Voltage Regulator

The function of the voltage regulator is to control the voltage given to the
Arduino board and stabilize the DC voltages used by the processor and other
elements.
5,17 - Arduino Reset

Reset the Arduino board, i.e., start the program from the beginning. You can
reset the UNO board in two ways. First, by using the reset button (17) on the board.
Second, you can connect an external reset button to the Arduino pin labeled RESET
(5).
6,7,8,9 - Pins (3.3, 5, GND, Vin)

• 3.3V (6) − Supply 3.3 output volt.


• 5V (7) − Supply 5 output volt.
• Most of the components used with Arduino board works fine with 3.3 volt
and 5 volt.
• GND (8) (Ground) − There are several GND pins on the Arduino, any of
which can be used to ground your circuit.
• Vin (9) − This pin also can be used to power the Arduino board from an
external power source, like AC mains power supply.

10 - Analog pins

The Arduino UNO board has five analog input pins A0 through A5. These
pins can read the signal from an analog sensor like the humidity sensor or
temperature sensor and convert it into a digital value that can be read by the
microprocessor.
17
11 - Main microcontroller

Arduino board has its own microcontroller. Assume that it is the brain of the
board. The main IC (integrated circuit) on the Arduino is slightly different from
board to board. The microcontrollers are usually of the ATMEL Company. We
must know what IC your board has before loading up a new program from the
Arduino IDE. This information is available on the top of the IC. For more details
about the IC construction and functions, you can refer to the data sheet.

12 - ICSP pin

Mostly, ICSP (12) is an AVR, a tiny programming header for the Arduino
consisting of MOSI, MISO, SCK, RESET, VCC, and GND. It is often referred to as
an SPI (Serial Peripheral Interface), which could be considered as an "expansion" of
the output.
13 - Power LED indicator

This LED should light up while plug the Arduino into a power source to
indicate that your board is powered up correctly. If this light does not turn on, then
there is something wrong with the connection.
14 - TX and RX LEDs

There are two labels: TX (transmit) and RX (receive). They appear in two
places on the Arduino UNO board. First, at the digital pins 0 and 1, to indicate the
pins responsible for serial communication. Second, the TX and RX led (13). The
TX led flashes with different speed while sending the serial data. The speed of
flashing depends on the baud rate used by the board. RX flashes during the
receiving process.

18
Figure 6.1 Circuit diagram of Arduino uno

16 – AREF
AREF stands for Analog Reference. It is sometimes, used to set an external
reference voltage (between 0 and 5 Volts) as the upper limit for the analog input
pins.
6.3.4 ATMEGA328 PINOUT
Various microcontrollers offer different kinds of memories
EEPROM,EPROM, FLASH, etc., are some of the memories of which FLASH
is the most recently developed.
The ATmega328 has 32 KB (with 0.5 KB occupied by the boot loader). It
also has 2KB of SRAM and 1 KB of EEPROM (which can be read and
write with the EEPROM library).
The Atmega328 is one of the microcontroller chips that are used with the
popular Arduino Duemilanove boards. The Arduino Duemilanove board comes
with either 1 of 2 microcontroller chips, the Atmega168 or the Atmega328. Of these
2, the Atmega328 is the upgraded, more advanced chip. Unlike the Atmega168
which has 16K of flash program memory and 512 bytes of internal SRAM, the
Atmega328 has 32K of flash program memory and 2K of Internal SRAM. The

19
Atmega328 has 28 pins.

Figure 6.2 Pin description of Atmega328

It has 14 digital I/O pins, of which 6 can be used as PWM outputs and 6
analog input pins. These I/O pins account for 20 of the pins.

Table 6.1 Pin details of ATMEGA328

Pin
Description Function
Number
1 PC6 Reset
2 PD0 Digital Pin (RX)
3 PD1 Digital Pin (TX)
4 PD2 Digital Pin
5 PD3 Digital Pin (PWM)
6 PD4 Digital Pin
7 Vcc Positive Voltage (Power)

20
8 GND Ground
9 XTAL 1 Crystal Oscillator
10 XTAL 2 Crystal Oscillator
11 PD5 Digital Pin (PWM)
12 PD6 Digital Pin (PWM)
13 PD7 Digital Pin
14 PB0 Digital Pin
15 PB1 Digital Pin (PWM)
16 PB2 Digital Pin (PWM)
17 PB3 Digital Pin (PWM)
18 PB4 Digital Pin
19 PB5 Digital Pin

20 AVCC Positive voltage for ADC (power)

21 AREF Reference Voltage


22 GND Ground
23 PC0 Analog Input
24 PC1 Analog Input
25 PC2 Analog Input
26 PC3 Analog Input
27 PC4 Analog Input
28 PC5 Analog Input
6.4 POWER SUPPLY UNIT

Ac voltage, typically 220V, is connected to a transformer, which steps that ac


voltage down to the level of the desired dc output. A diode rectifier then provides a
full-wave rectified voltage that is initially filtered by a simple capacitor filter to
produce a dc voltage. This resulting dc voltage usually has some ripple or ac
voltage variation.
21
230V AC

Transformer Rectifier Filter Regulator

DC

Figure: 6.3 Block diagram of power supply

A regulator circuit removes the ripples and also remains the same dc value
even if the input dc voltage varies, or the load connected to the output dc voltage
changes. This voltage regulation is usually obtained using one of the popular
voltage regulator IC units.
6.4.1 TRANSFORMER

The potential transformer will step down the power supply voltage (0-230V)
to (0-6V) level. Then the secondary of the potential transformer will be connected
to the precision rectifier, which is constructed with the help of op–amp. The
advantages of using precision rectifier are it will give peak voltage output as DC,
rest of the circuits will give only RMS output.
6.4.2 BRIDGE RECTIFIER

When four diodes are connected as shown in figure, the circuit is called as
bridge rectifier. The input to the circuit is applied to the diagonally opposite corners
of the network, and the output is taken from the remaining two corners. Let us
assume that the transformer is working properly and there is a positive potential, at
point A and a negative potential at point B. The positive potential at point A will
forward bias D3 and reverse bias D4.
The negative potential at point B will forward bias D1 and reverse D2. At this
22
time D3 and D1 are forward biased and will allow current flow to pass through
them; D4 and D2 are reverse biased and will block current flow.
The path for current flow is from point B through D1, up through RL,
through D3, through the secondary of the transformer back to point B. this path is
indicated by the solid arrows. Waveforms (1) and (2) can be observed across D1
and D3.
One-half cycle later the polarity across the secondary of the transformer
reverse, forward biasing D2 and D4 and reverse biasing D1 and D3. Current flow
will now be from point A through D4, up through RL, through D2, through the
secondary of T1, and back to point A. This path is indicated by the broken arrows.
Waveforms (3) and (4) can be observed across D2 and D4. The current flow
through RL is always in the same direction. In flowing through RL this current
develops a voltage corresponding to that shown waveform (5). Since current flows
through the load (RL) during both half cycles of the applied voltage, this bridge
rectifier is a full-wave rectifier.
6.4.3 FILTERING UNIT

Filter circuits which are usually capacitors acting as a surge arrester always
follow the rectifier unit. This capacitor is also called as a decoupling capacitor or a
bypassing capacitor, is used not only to ‘short’ the ripple with frequency of 120Hz
to ground but also to leave the frequency of the DC to appear at the output. A load
resistor R1is connected so that a reference to the ground is maintained. C1R1 is for
bypassing ripples. C2R2 is used as a low pass filter, it passes only low frequency
signals and bypassing high frequency signals. The load resistor should be 1% to
2.5% of the load.
6.4.4 IC VOLTAGE REGULATORS

For most no critical applications the best choice for a voltage regulator is the
23
simple terminal type. It has only three connections (input, output, and ground) and
is factory-trimmed to provide a fixed output. Typical of this type is the 78xx. The
voltage is specified by the last two digits of the part number and can be any of the
following: 05, 08, 10, 12, 15, 18, or 24. It is to make a +5 volt regulator, for
instance, with one of these regulators. The capacitor across the output improves
transient response and keeps the impedance low at high frequencies (an input
capacitor of at least 0.33F should be used in addition if the regulator is located a
considerable distance from the filter capacitors).
The 7800 series is available in plastic or metal power packages (same as
power transistors). A low-power version, the 78Lxx, comes in the same plastic and
metal packages as small-signal transistors. The 7900 series of negative regulators
works the same way (with negative input voltage, of course). The 7800 series can
provide up to 1 amp load current and has on-chip circuitry to prevent damage in the
event of overheating or excessive load current; the chip simply shuts down, rather
than blowing out.
The LM78xx series of three terminal regulators is available with several fixed
output voltages making them useful in a wide range of applications. One of these is
local on card regulation, eliminating the distribution problems associated with
single point regulation. The voltages available allow these regulators to be used in
logic systems, instrumentation, HiFi, and other solid-state electronic equipment.
Although designed primarily as fixed voltage regulators these devices can be used
with external components to obtain adjustable voltages and currents.

The LM78XX series is available in an aluminium TO-3 package which will


allow over 1.0A load current if adequate heat sinking is provided. Current limiting
is included to limit the peak output current to a safe value. Safe area protection for
the output transistor is provided to limit internal power dissipation. If internal power
24
dissipation becomes too high for the heat sinking provided, the thermal shutdown
circuit takes over preventing the IC from overheating.

Features and Description of Regulators

• Output current up to 1A
• Output voltages of 12V
• Short circuit protection
• Output transistor safe operating area protection.

6.5 SOIL MOISTURE SENSOR


The soil moisture senses the moisture content in the soil. By this value the
motor can be controlled through arduino. The water content is constantly judged
and whenever moisture level of soil gets low, the system sends a signal to motors
asking them to turn on. The motors automatically stop after soil reaches its
maximum upper threshold value which is decided by user.

Figure 6.4 Soil moisture sensor


6.6 TEMPERATURE AND HUMIDITY SENSOR
DHT11 digital temperature and humidity sensor is a composite Sensor
contains a calibrated digital signal output of the temperature and humidity.The
temperature and humidity sensing technology is to ensure that the product has high
reliability and excellent long-term stability. The sensor includes a resistive sense of
wet components and an NTC temperature measurement devices, and connected

25
with a high-performance 8-bit microcontroller.
They consist of a humidity sensing component, a NTC temperature sensor (or
thermistor) and an IC on the back side of the sensor. For measuring humidity they
use the humidity sensing component which has two electrodes with moisture
holding substrate between them. So as the humidity changes, the conductivity of the
substrate changes or the resistance between these electrodes changes. This change
in resistance is measured and processed by the IC which makes it ready to be read
by a microcontroller.
FEATURES OF DHT11 SENSOR
• It measures both air temperature and moisture.
• Relative humidity expressed as a percentage.
• HS1100 is used for sensing humidity.
• The output in terms of frequency range 5khz to 10khz.

Figure 6.5 DHT11 sensor

6.7 LCD DISPLAY:

We have so many kinds of LCD today and our application requires a LCD
with 2 lines and 16 characters per line, this gets data from the microcontroller and
displays the same. It has 8 data lines, 3 control line, a supply voltage Vcc (+5v and
a GND. This makes the whole device user friendly by showing the balance left in
the card. This also shoes the card that is currently being used.
26
PIN DESCRIPTION:
• VCC, VSS and VEE

While VCC and VSS provide +5v and ground respectively, VEE is used for
controlling LCD contrast.
• RS, REGISTER SELEC

There are two very important registers inside the LCD. The RS pin used for
their selection as follows. If RS=0, the instruction command code register is
selected, allowing the user to send a command such as clear display, cursor at home
,etc .If RS=1 the data register is selected, allowing the user to send data to be
displayed on the LCD.
• R/W READ/WRITE

R/W input allows the user to write information to the LCD or read
information from it. R/W=1 when reading; R/W=0 when writing.
• E, ENABLE

The enable pin is used by the LCD to latch information present to its data
pins. When data is supplied to data pins, a high to low pulse must be applied to this
pin in order for the LCD to latch in the data present at the data pins. This pulse must
be a minimum of 450ns wide.

• D0-D7

The 8-bit data pins, D0-D7, are used to send information to LCD or read the
contents of the LCD’s internal registers.
The LCD commands codes are as shown in table.4. To display letters and
numbers, we send ASCII codes for the letters A-Z, a-z, and numbers 0-9 to these
pins while making RS=1.

27
Figure 6.6 Circuit diagram of LCD Display

6.8 RELAY DRIVER

Figure6.7 Circuit diagram of Relay

The coil of a relay passes a relatively large current, typically 30mA for a 12V
relay, but it can be as much as 100mA for relays designed to operate from lower
voltages. Most ICs (chips) cannot provide this current and a transistor is usually
used to amplify the small IC current to the larger value required for the relay coil.
The maximum output current for the popular 555 timer IC is 200mA so these
devices can supply relay coils directly without amplification.
Relays are usually SPDT or DPDT but they can have many more sets of switch
contacts, for example relays with 4 sets of changeover contacts are readily

28
available. Most relays are designed for PCB mounting but you can solder wires
directly to the pins providing you take care to avoid melting the plastic case of the
relay.

Figure 6.8 Pin diagram of relay


The relay's switch connections are usually labeled COM, NC and NO:
• COM = Common, always connect to this, it is the moving part of the switch.
• NC = Normally Closed, COM is connected to this when the relay coil is off.
• NO = Normally Open, COM is connected to this when the relay coil is on.

Generally the relay circuit is designed to control the load. The load may be
motor or any other load. The load is turned ON and OFF through relay. The relay
ON and OFF is controlled by the pair of switching transistors (BC 547). The relay is
connected in the Q2 transistor collector terminal. A Relay is nothing but
electromagnetic switching device which consists of three pins. They are Common,
Normally close (NC) and normally open (NO).

6.9 SOLAR POWER


Solar power is the conversion of sun radiation into electricity through the
use of solar photovoltaic cells. This conversion takes place in the solar cell by
photovoltaic effect. Solar cells produce Direct Current (DC) electricity from
light, which can be used to power equipment or to recharge a battery. Cells
require protection from the environment and are usually packaged tightly behind
a glass sheet. When more power is required than a single cell can deliver, cells
29
are electrically connected together to form photovoltaic modules, or solar panels.
A photovoltaic module is a packaged, interconnected assembly of photovoltaic
cells, which converts sunlight into electrical power. The cells are hermitically
sealed between glass and back cover to protect them from harsh environment.
There are a few solar panels available that are exceeding 19% efficiency. A single
solar module can produce only a limited amount of power; most installations
contain multiple modules. A photovoltaic system typically includes a panel or an
array of solar modules, an inverter, and sometimes a battery and/or solar tracker and
interconnection wiring.
6.10 MOTORS
6.10.1. Shunt motor and Series motor
The rotor and stator windings are connected in parallel are called shunt
motor. The stator and rotor windings are connected in series. Thus the torque is
proportional to I2 so it gives the highest torque per current ratio over all other
motors. It is used in starter motors of cars and elevator motors are called shunt
motor.
6.10.2. Separately excited motor
The rotor and stator are connected from a different power supply, this gives
another degree of freedom for controlling the motor over the shunt.

6.11 GSM

GSM stands for Global System for Mobile Communication. The GSM
modem used for this system is SIM 800. SIM800 is a quad-band GSM/GPRS
module that works on frequencies 850MHz GSM, 900MHz EGSM, 1800MHz
DCS, and 1900MHz PCS It also features GPRS multi-slot class 12/class 10
(optional), and supports CS-1, CS-2, CS-3, and CS-4 GPRS coding schemes. With
a tiny configuration of 24*24*3mm, SIM800 can meet almost all the space
30
requirements in users’ applications, such as M2M, smart phone, PDA and other
mobile devices. SIM800 has 68 SMT pads, and provides all hardware interfaces
between the module and customers’ boards. SIM800 is designed with power saving
technique so that the current consumption is as low as 1.2mA in sleep mode.

It has one UART port. It also has one USB port that can be used for updating
firmware and for debugging. Audio channels are also there, which include a
microphone input and a receiver output.SIM800 has one SIM card interface. It
integrates TCP/IP protocol.

SIM800 can be controlled/configured using simple AT commands. A host


microcontroller can send AT commands over the UART interface and control the
SIM800.

6.11.1 GSM SIM 800 Features

• Supply voltage range 3.4 - 4.5V


• Operation temperature -30 0c to +80 0C
• Operating voltage +12V.
• Support up to 5*5*2 Keypads.
• One SIM card interface.
• Support Bluetooth function.
• Serial Port: Can be used for AT commands for data stream
• USB Port: Can be used as debugging and firmware upgrading

SIM800 Dimensions:

• Size:24 x 24 x 3mm

6.11.2 Pin specifications

31
Figure 6.9 Circuit diagram of GSM

6.11.3 Working of GSM

Unlike mobile phones, a GSM modem doesn’t have a keypad and display to
interact with. It just accepts certain commands through a serial interface and
acknowledges for those. These commands are called as AT commands. There is a
list of AT commands to instruct the modem to perform its functions.
Every command starts with "AT". That’s why they are called as AT
commands. AT stands for attention. In our simple project, the program waits for the
mobile number to be entered through the keyboard. When a ten digit mobile number
is provided, the program instructs the modem to send the text message using a
sequence of AT commands.

6.11.4 AT COMMANDS

AT commands are instructions used to control a modem. AT is the


abbreviation of ATtention. Every command line starts with "AT" or "at".That's why
modem commands are called AT commands. Many of the commands that are used

32
to control wired dial-up modems, such as ATD (Dial), ATA (Answer), ATH (Hook
control) and ATO (Return to online data state), are also supported by GSM/GPRS
modems and mobile phones.

Besides this common AT command set, GSM/GPRS modems and mobile


phones support an AT command set that is specific to the GSM technology, which
includes SMS-related commands like AT+CMGS (Send SMS message),
AT+CMSS (Send SMS message from storage), AT+CMGL (List SMS messages)
and AT+CMGR (Read SMS messages).

Note that the starting "AT" is the prefix that informs the modem about the
start of a command line. It is not part of the AT command name. For example, D is
the actual AT command name in ATD and +CMGS is the actual AT command
name in AT+CMGS. However, some books and web sites use them interchangeably
as the name of an AT command.

One way to send AT commands to a mobile phone or GSM/GPRS modem is


to use a terminal program. A terminal program's function is like this: It sends the
characters you typed to the mobile phone or GSM/GPRS modem. It then displays
the response it receives from the mobile phone or GSM/GPRS modem on the
screen. The terminal program on Microsoft Windows is called HyperTerminal.
Below shows a simple example that demonstrates how to use AT commands and
the HyperTerminal program of Microsoft Windows to send an SMS text message.
The lines in bold type are the command lines that should be entered in
HyperTerminal. The other lines are responses returned from the GSM / GPRS
modem or mobile phone.

The following table lists the AT commands that are related to the writing and
33
sending of SMS messages:
Table6.2 AT Commands

AT command Meaning

+CMGS Send message

+CMSS Send message from storage

+CMGW Write message to memory

+CMGD Delete message

+CMGC Send command

+CMMS More messages to send

34
CHAPTER 7

RESULT AND DISCUSSION

This proposed system can be implemented in our college. It will eliminates


the manual switching mechanism used by the human to ON/OFF the motor to
irrigate the field. The switching mechanism can be done automatically with the help
of microcontroller using relay. Moisture sensors are submersed into soil and
connected to the GSM Module. The sensors shows the values of moisture content in
the soil and these values can be seen on LCD. Another circuit with the GSM
module is connected to motor. This is also connected with Arduino and is
responsible for sending information of every operation taking place to the user.

7.1. Hardware kit of an Automated Irrigation System

Figure7.1 Snap shot of an automatic irrigation system

35
7.2. Sending message to the owner’s mobile phone using GSM Technology

Figue7.2 mobile notification to the user

7.3. Displaying the output command

Figure7.3 Displaying the output when the soil is dry (Motor is ON)

36
Figure7.4Humidity and Temperature of the atmosphere

37
CHAPTER 8

CONCLUSION AND FUTURE WORK

Automatic Irrigation System with solar energy operated motor using GSM has
been designed and tested successfully. It has been developed by integrated features of all
the hardware components used. This system provides with more benefits and can
operate with less manpower. The water supply is mainly based on the moisture and
temperature content in the soil. The use of automatic irrigation method would allow
us to save the excess water which may be wasted during manual methods. When
the soil moisture in irrigation field will fall below the threshold value then the motor
will automatically switched on to irrigate the field and message is send to the
registered mobile phone. So this method will saves the water, energy, and
manpower.
In future, with some modification in this system can also supply agricultural
chemicals like sodium, ammonium, zinc, calcium to the field along with fertilizer
by adding new sensors and vales. This project is developed to monitor the farms
using concept of Internet of Things (IOT) and Image processing. In Image
processing technique the condition of the crop is intimated to the user with the help
of Raspberry pi and webcam. The Raspberry pi captures the image of the crops and
checks the images of the crops to detect its condition whether it is infected or in
health condition. And the condition of the crop is intimated to the user by sending
its images and the condition of the crop by the notification.

38
APPENDIX

ARDUINO IDE

#include <LiquidCrystal.h>
#include <SoftwareSerial.h>
#include <dht.h>
//ebet
dht DHT;
char data=0;
int i=0;
unsigned int c,d,e,f;
const int rs = 8, en = 7, d4 = 6, d5 = 5, d6 = 4, d7 = 3;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
#define dht_apin
// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
SoftwareSerial mySerial(9, 10);
#define soilsensor1 A0
int sensorsoilValue1 = 0;
float sensorsoil1 =0;
void soilchecking1() // GAS
{
sensorsoilValue1 = analogRead(soilsensor1);
int soil1 = sensorsoilValue1*0.09775;
lcd.setCursor(0,1);
lcd.print("soil=");
39
lcd.print(soil1);
lcd.print("%");
if (soil1 > 60)
{
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("SOIL IS DRY");
lcd.setCursor(0, 1);
lcd.print("PUMP ON ");
lcd.setCursor(10, 1);
lcd.print(soil1);
lcd.print( i);
delay(1000);
if(i==0)
{
SendMessage();
delay(1500);
SendMessage2();
lcd.clear();
i=1;
}
Serial.print(i);
delay(1000);
}
else
{

40
lcd.setCursor(0,0);
lcd.print("soil=");
lcd.print(soil1);
lcd.print("%");
if(i==1)
{
SendMessage1();
i= 0;
}
Serial.print(i);
}
}
void humchecking()
{
DHT.read11(dht_apin);
lcd.setCursor(0,1);
lcd.print("HUM=");
lcd.print(DHT.humidity);
lcd.print("% ");
lcd.setCursor(6,1);
lcd.print("TEM=");
lcd.print(DHT.temperature);
lcd.print("C ");
delay(2000);//Wait 5 seconds before accessing sensor again.
}// end loop
void setup()

41
{
Serial.begin(9600);
// put your setup code here, to run once:
mySerial.begin(9600);
pinMode(2, INPUT);
pinMode(13, OUTPUT);
lcd.begin(16,2);
lcd.clear();
lcd.print("SMART IRRIGATION");
digitalWrite(13,LOW);
SendMessage2(); delay(500);
Serial.println("setup ok");
lcd.clear();
}
void loop()
{
soilchecking1();
delay(500);
humchecking();
delay(500);
}
void SendMessage()
{
mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second
mySerial.println("AT+CMGS=\"+919443872742\"\r"); // Replace 99421 with

42
mobile number
delay(1000);
mySerial.println("*ON#");// The SMS text you want to send
delay(100);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);
Serial.println("SMS SENT1");
}
void SendMessage2()
{
mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second
mySerial.println("AT+CMGS=\"+917010972622\"\r"); // Replace 99421 with
mobile number
delay(1000);
mySerial.println("*ON#");// The SMS text you want to send
delay(100);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);
Serial.println("SMS SENT2");
}
void SendMessage1()
{
mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second
mySerial.println("AT+CMGS=\"+919443872742\"\r"); // Replace 99421 with

43
mobile number
delay(1000);
mySerial.println("*OFF#");// The SMS text you want to send
delay(100);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);
Serial.println("SMS SENT3");
}

44
Program for displaying status of the soil on the LCD
#include <LiquidCrystal.h>
#include <SoftwareSerial.h>
#define bulb_1Pin A0
#define bulb_2Pin A1
#define bulb_3Pin A2
#define fanPin A3
#define buzzerPin A4
LiquidCrystal lcd(13,12,5,4,3,2);
SoftwareSerial gsm(9,10);
int i=0;
String incomingString="", device="";
char character,buf[100]="";
boolean bulb_1Status = false, bulb_2Status = false, bulb_3Status = false, fanStatus
= false;
long previous_millis=0;
void setup()
{
Serial.begin(9600);
lcd.begin(16,2);
gsm.begin(9600);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" GSM BASED ");
lcd.setCursor(0,1);

45
lcd.print(" HOME AUTOMATION");
delay(2000);
}
void send_deviceStatus()
{
gsm.println("AT+CMGF=1");
buzzer(2);
gsm.println("AT+CMGS=\"+917010972622\"\r");
buzzer(2);
gsm.print("tested ok");
gsm.println((char)26);
buzzer(2);
gsm.println("AT+CNMI=2,2,0,0,0");
buzzer(2);
}
void buzzer(int k)
{
int j;
for(j=0;j<k;j++){
digitalWrite(buzzerPin,HIGH);
delay(500);
digitalWrite(buzzerPin,LOW);
delay(500);}
}
void loop()
{

46
top:
lcd.begin(16,2);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" DEVICE STATUS ");
send_deviceStatus();delay(200);
gsm.println("AT+CNMI=2,2,0,0,0");
delay(200);
while(1)
{
incomingString="";
i=0;
while(i<4){
if(millis()-previous_millis > 2000)
{
previous_millis = millis();
if(i==0){
if(bulb_1Status==true)
lcd.print("ON ");
if(bulb_1Status==false)
lcd.print("OFF ");}
if(i==1){
if(bulb_2Status==true)
lcd.print("ON ");
if(bulb_2Status==false)
lcd.print("OFF ");}

47
if(i==2){
if(bulb_3Status==true)
lcd.print("ON ");
if(bulb_3Status==false)
lcd.print("OFF ");}
if(i==3){
if(fanStatus==true)
lcd.print("ON ");
if(fanStatus==false)
lcd.print("OFF ");}
i++;
}
if(gsm.available())
{
if(gsm.read()=='*')
{
while(!gsm.available()){}
incomingString += gsm.readStringUntil('#');
// Serial.println(incomingString);
}
}
if(incomingString.equals("ON")) { lcd.setCursor(0,0);
lcd.print(" SMS RECEIVED ");
lcd.setCursor(0,1);
lcd.print(" PUMP ON ");

48
buzzer(5);
bulb_1Status = true; goto top;
}
if(incomingString.equals("OFF"))
{ lcd.setCursor(0,0);
lcd.print(" SMS RECEIVED ");
lcd.setCursor(0,1);
lcd.print("PUMP OFF ");
buzzer(5);
bulb_1Status = false; goto top;}
if(incomingString.equals("STATUS"))
{
lcd.setCursor(0,0);
lcd.print(" SMS RECEIVED ");
lcd.setCursor(0,1);
lcd.print(" SENDING STATUS ");
send_deviceStatus();
goto top;
}
} }}

49
REFERENCES

[1] G. Nisha , J. Megala , “Wireless Sensor Network Based Automated


Irrigation And Crop Field Monitoring System” , Sixth International Conference On
Advanced Computing (Icoac), (2014).
[2] S. R. Prathibha , Anupama Hongal , M. P. Jyothi, “Iot Based Monitoring
System in Smart Agriculture”, International Conference on Recent Advances in
Electronics and Communication Technology (ICRAECT) , (2017).
[3] R. Nageswara Rao , B. Sridhar , “IOT Based Smart Crop field
Monitoring and Automation Irrigation System” , 2nd International Conference on
Inventive Systems and Control (ICISC) ,(2018).
[4] Dipanjan Bhattacharjee , Om Prakash , Hashinur Islam , “Smart Fertilizer
Dispensary System for Automated Drip Irrigation”, 3rd IEEE International
Conference on Recent Trends in Electronics, Information & Communication
Technology (RTEICT) (2018).
[5] Md AshifuddinMondal , Zeenat Rehena, “IOT Based Intelligent
Agriculture Field Monitoring System”. 8th International Conference on Cloud
Computing, Data Science & Engineering (Conference), (2018).
[6] Md. Munirul Islam Tusher , Md. Zahirul Haque , Mohammad Jalal
Uddin , Arif Mainuddin ,Mohammad Ehsanul Hoque , Md. Mohin Uddin Talukder
“Solar based Automatic irrigation method with GSM module”, International
Conference on Sustainable Technologies for Industry 4.0 (STI) (2019)

50

You might also like