B2 Report
B2 Report
Submitted by
DHARANYA.A (730316106014)
INDHU.S (730316106026)
PONVIVEK.R (730316106040)
of
BACHELOR OF ENGINEERING
IN
ELECTRONICS AND COMMUNICATION ENGINEERING
KANGAYAM - 638108
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.
i
ACKNOWLEDGEMET
ii
ABSTRACT
iii
TABLE OF CONTENTS
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
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
vii
LIST OF FIGURES
viii
LIST OF ABBREVIATION
ACRONYMS ABBREVIATIONS
ix
CHAPTER 1
INTRODUCTION
1.1 INTRODUCTION
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
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
[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
6
3.4 DISADVANTAGES
• High cost.
• Wastage of water and power.
POWER
SUPPLY
SOIL LCD
MOISTURE
SENSOR
PIC
MICRO
TEMPERA CONTRO
TURE LLER RELAY MOTOR
SENSOR
PC
7
CHAPTER 4
PROPOSED SYSTEM
4.1 INTRODUCTION
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
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
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
14
6.2.2 Application of Embedded Systems
• Robotics
• Aviation
• Telecommunication and Broadcasting
• Satellite communication
• Military Application
• Home Appliances etc
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.
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.
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)
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.
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.
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
DC
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.33F 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.
• Output current up to 1A
• Output voltages of 12V
• Short circuit protection
• Output transistor safe operating area protection.
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.
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
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.
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.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 Dimensions:
• Size:24 x 24 x 3mm
31
Figure 6.9 Circuit diagram 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
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.
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.
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
34
CHAPTER 7
35
7.2. Sending message to the owner’s mobile phone using GSM Technology
Figure7.3 Displaying the output when the soil is dry (Motor is ON)
36
Figure7.4Humidity and Temperature of the atmosphere
37
CHAPTER 8
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
50