Design Development of Water Monitoring Systems by Using Arduino and Sensors

59
Design Development of Water Monitoring Systems by Using Sensors A Project Report

description

Design Development of Water Monitoring Systems by Using Arduino and Sensors

Transcript of Design Development of Water Monitoring Systems by Using Arduino and Sensors

Page 1: Design Development of Water Monitoring Systems by Using Arduino and Sensors

Design Development of Water Monitoring Systems by Using SensorsA Project Report

Page 2: Design Development of Water Monitoring Systems by Using Arduino and Sensors

ACKNOWLEDGMENT

We wish to express our deep sense of gratitude from the bottom of

our heart to our guide Dr. N. Sai Bhaskar Reddy, Coordinator,

ClimaAdapt Project, WALAMTARI for his motivating discussions,

overwhelming suggestions, ingenious encouragement and advice,

invaluable supervision, exemplary guidance throughout this project work

at WALAMTARI.

We would like to extend our heartfelt thanks to Sri L. Narayana

Reddy Garu, Director General, WALAMTARI & Engineer-in-Chief, I

& CAD Dept., for giving us this great opportunity of taking internship at

WALAMTARI.

We are immensely grateful to our Vice Chancellor Prof. R V Raja

Kumar Garu for his encouragement and supporting in undertaking

internship in I & CAD Department.

We are also thankful to Miss. A. Sravanthi Garu, Water

Manager and Mr. Pranith Garu, Office Assistant, WALAMTARI for

their constant backing in all aspects of this project.

We are also grateful to M/S ROLAND ELECTRONICS, Hyderabad for

their timely help in getting the required components within the right time

at reasonable price.

We express our sincere thanks to all of our friends and our parents

who have patiently extended all sorts of help for accomplishing this

undertaking without whom it could not have been achieved.

Page 3: Design Development of Water Monitoring Systems by Using Arduino and Sensors

ABSTRACT

Achieving effective and efficient management of water as the key to

human survival and development has emerged as an urgent global

concern. The realization of the limited availability of water in space and

time under conditions of ever-increasing pressures has caused designing

of ‘Modern’ Water Management initiatives that are globally manufactured

but implementable in local communities.

As ‘Water’ is a precious resource on the planet earth, proper Water

Management is necessary. For effective management of the water

monitoring should be done properly. Rapid advancement in the electronic

technologies will opens door for this purpose. The designed system

broadly consists of three blocks. In first part, we use sensor to detect the

desired parameter, next we process the signal obtained from the sensor

by Arduino, an electronic prototype platform, then required command will

be sent to gsm module to send the appropriate message to the concerned

mobile number at regular intervals of time. Project mainly focuses on

measuring water depth, measuring the soil moisture and measuring the

Humidity & Temperature.The total system will be installed in the given

field and results will be tabulated,

Page 4: Design Development of Water Monitoring Systems by Using Arduino and Sensors

GLOSSARYTable of Contents

1. Introduction2. Sensors

2.1. Sensors 2.2. Types of sensors

2.2.1 Contact sensors2.2.1(a)Soil moisture sensor2.2.1(b)Temperature and humidity sensor

2.2.2 Non contact sensors2.2.2.(a) Ultrasonic sensor

3. Processing Platforms3.1. Microcontrollers3.2. Arduino Mega 25603.3. Why Arduino over Microcontrollers

4. Transferring Mechanisms4.1. GSM-SIM 9004.2. LCD display

5. Water depth measurement system by using ultrasonic sensor 5.1. Interfacing ultrasonic sensor with Arduino5.2. Ultrasonic sensor with LCD

5.2.1.Circuit diagram5.2.2.Arduino program

5.3.Ultrasonic sensor with GSM-SIM 9005.3.1.Circuit diagram5.3.2.Arduino Program

Page 5: Design Development of Water Monitoring Systems by Using Arduino and Sensors

5.4.Outputs of the system6. Soil moisture measurement by using contact sensor XXXX

6.1.Interfacing soil moisture sensor with Arduino6.2.Soil moisture sensor with LCD

6.2.1.Circuit diagram6.2.2.Arduino Program

6.3.Soil moisture sensor with GSM-SIM 9006.3.1.Circuit diagram6.3.2.Arduino program

6.4.Soil moisture sensor with LED’s6.4.1.Interfacing leds with Arduino6.4.2.Circuit diagram6.4.3.Arduino program

6.5.Outputs of the system7.Temperature and humidity of air measurement by using DHT11 sensor

7.1. Interfacing temperature and humidity sensor with Arduino7.2. DHT11 sensor with LCD

7.2.1.Circuit diagram7.2.2.Arduino program

7.3.DHT11 sensor with GSM-SIM 9007.3.1.Circuit diagram7.3.2.Arduino program

7.4.Outputs of the System8.Visual9. Installation / Implementation10. Conclusions and Future work11. Bibliography12. Appendix

Page 6: Design Development of Water Monitoring Systems by Using Arduino and Sensors

1. INTRODUCTION

Water is an essential resource for all life on the planet Water is the

key to development and sustenance of all communities. Under conditions

of increasing stress on this essential renewable but scarce natural

resource, effective and efficient management of water is emerging as an

urgent contemporary issue. The realization of its limited availability in

space and time has necessitated the designing of new globally viable

water management regimes aiming at striking a balance between the use

of water as a basis for livelihood and its protection to help ensure its

sustainability through present to future generations.

If water is a basic resource necessary for sustaining all human

activities, its provision in the desired quantity and quality and at the right

time and place through a workable local water management system must

be regarded as an omnipresent phenomenon.

Much effort in water resource management is directed at optimizing

the use of water and in minimizing the environmental impact of water use

on the natural environment.

Page 7: Design Development of Water Monitoring Systems by Using Arduino and Sensors

Successful management of any resources requires accurate

knowledge of the resource available, the uses to which it may be put, the

competing demands for the resource, measures to and processes to

evaluate the significance and worth of competing demands and

mechanisms to translate policy decisions into actions on the ground.

Purpose of monitoring

Monitoring has several possible uses:

As a system of early warning;

To inform decision, focus and orient political and policy reforms, and

to channel financial resources in the most effective way;

To track progress toward given objectives.

2. SENSORS

2.1. What is a sensor?

A sensor is a converter that measures a physical quantity and

converts it into a signal which can be read by an observer or by an (today

mostly electronic) instrument.

A sensor is a device, which responds to an input quantity by

generating a functionally related output usually in the form of an electrical

or optical signal. A sensor's sensitivity indicates how much the sensor's

output changes when the measured quantity changes.

Sensors are used in everyday objects such as touch-sensitive

elevator buttons (tactile sensor ) and lamps which dim or brighten by

touching the base. There are also innumerable applications for sensors of

which most people are never aware. Applications include cars, machines,

aerospace,agriculture, medicine, manufacturing and robotics.

Technological progress allows more and more sensors to be

manufactured on a microscopic scale as microsensors using MEMS

Page 8: Design Development of Water Monitoring Systems by Using Arduino and Sensors

technology. In most cases, a microsensor reaches a significantly higher

speed and sensitivity compared with macroscopic approaches.

2.2. Types of sensors:

Water monitoring sensors can be divided into 2 types. They are

Contact sensors, Non contact sensors.

2.2.1. Contact sensors:

Contact sensors are electromechanical devices that detect change

through direct physical contact with the target object. Contact sensors,

Typically do not require power;

Can handle more current and better tolerate power line

disturbances;

Are generally easier to understand and diagnose.

Examples are Pressure sensor, Capacitance sensor, Shaft Encoders,

Bubbler

2.2.1(a). Soil moisture sensor:

Working Principle

Soil moisture sensors measure the water content in soil. All plants

need water to grow and survive. Soil moisture sensors used to determine

how much water are needed to irrigate the plants.

Types of soil moisture sensors

There are two types of soil moisture sensor.One is frequency

domain sensor, which has an oscillating circuit. It measures the soil water

content by measuring the soil's dielectric constant, which determines the

velocity of an electromagnetic wave or pulse through the soil. When the

soil's water content increases, the dielectric also increases, which can be

used to estimate how much water the soil holds.The other one is neutron

moisture gauge, which utilise the moderator properties of water for

Page 9: Design Development of Water Monitoring Systems by Using Arduino and Sensors

neutrons. The principle is that fast neutrons are emitted from a decaying

radioactive source, and when they collide with particles having the same

mass as a neutron (i.e., protons, H+), they slow down dramatically.

Because the main source of hydrogen in soils is water, measuring the

density of slowed-down neutrons around the probe can estimate the

volume fraction of water content the soil holds.

Soil moisture sensor and pin description

Pin Definition

Vcc 5V

GND GND

D0 Digital output interface (0 and 1)

A0 Analog output interface

LM393 Driver

LM393 device consist of two independent low voltage comparators

designed specifically to operate from a single supply over a wide range of

voltages. Operation from split power supplies is also possible.These

comparators also have a unique characteristic in that the input common-

mode voltage range includes ground even though operated from a single

power supply voltage.

Page 10: Design Development of Water Monitoring Systems by Using Arduino and Sensors

Features of LM393

Wide single-supply voltage range or dual supplies: +2 V to +36 V or

±1 V to ±18 V;

Very low supply current (0.45 mA) independent of supply voltage (1

mW/comparator at +5 V);

Low input bias current: 20 nA typ;

Low input offset current: ±3 nA typ;

Low input offset voltage: ±1 mV typ;

Input common-mode voltage range includes ground;

Low output saturation voltage: 80 mV typ. (Isink= 4 mA);

Differential input voltage range equal to the supply voltage;

TTL, DTL, ECL, MOS, CMOS compatible outputs;

Available in DIP8, SO-8, TSSOP8, MiniSO-8, and DFN8 2 x 2 mm

packages.

2.2.1(b) Humidity and Temperature Sensor(DHT11)

Humidity is the amount of water vapor in the air. Water vapor is the

gaseous state of water and is invisible. Humidity indicates the likelihood of

precipitation, dew, or fog.

DHT11 digital temperature and humidity sensor is a composite

Sensor contains a calibrated digital signal output of the temperature and

humidity. Application of a dedicated digital modules collection technology

and the temperature and humidity sensing technology, 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 with a high-performance 8-bit

microcontroller.

DHT11 sensor and pin description

Page 11: Design Development of Water Monitoring Systems by Using Arduino and Sensors

Features

Low cost, long-term stability, relative humidity and temperature

measurement, excellent quality, fast response, strong anti-interference

ability, long distance signal transmission, digital signal output, and precise

calibration.

Product parameters

Relative Humidity

Resolution 16 Bit

Repeatability ±1% RH

Accuracy At 25°C ±5% RH

Interchangeability Fully interchangeability

Response time 1 / e (63%) of 25°C 6s 1m / s air 6s

Hysteresis <± 0.3% RH

Long-term stability <± 0.5% RH / yr in

Temperature

Resolution 16 Bit

Repeatability ±1% RH

Range At 25°C ±2°C

Page 12: Design Development of Water Monitoring Systems by Using Arduino and Sensors

Response time 1 / e (63%) 10S

Electrical Characteristics

Power supply DC 3.5~5.5V

Supply Current measurement 0.3mA standby 60μ A

Sampling period more than 2 seconds

Applications

HVAC, dehumidifier, testing and inspection equipment, consumer

goods, automotive, automatic control, data loggers, weather stations,

home appliances, humidity regulator, medical and other humidity

measurement and control.

2.2.2. Non Contact sensors

Non-contact sensors are solid-state electronic devices that create an

energy field or beam and react to a disturbance in that field. Some

characteristics of non-contact sensors:

No physical contact is required;

No moving parts to jam, wear, or break (therefore less

maintenance);

Generally operate faster;

Greater application flexibility.

Examples are Ultrasonic sensor,Radar sensor, XXXXX

2.2.2(a). Ultrasonic sensor

Because of the advantages of directional ultrasonic transmitter,

direction, strength and easy to control, and no touch with the object being

measured etc., it is widely used in liquid level measurement. In the

measurement, ultrasonic pulse from the sensor (transducer) to issue,

Page 13: Design Development of Water Monitoring Systems by Using Arduino and Sensors

reflected by the surface acoustic wave sensor to receive the same after

the conversion into electrical signals, then, through the time of

transmitting and receiving sound waves to calculate the distance from the

sensor to the measured object.

The

principles of ultrasonic liquid Level measurement

Ultrasonic level meter works by ultrasonic pulse from the sensor

(transducer) is reflected by the surface acoustic wave sensor to receive

the same after the conversion into electrical signals, then, through the

time of transmitting and receiving sound waves to calculate the distance

from the sensor to the measured object. The relationship between the

distance up to the object. L and the reflecting time T is expressed by the

following formula :

L=C x T/2

Where,

C is the velocity of sound;

L is the measured distance;

T is the time of transmitting and receiving soundwaves.

Page 14: Design Development of Water Monitoring Systems by Using Arduino and Sensors

Ultrasonic Sensor

Specifications:

Working voltage 5V DC

Working current max 15 ma

Working frequency 40HZ

Temperature 0º to 60º Ambient room temperature

Output signal 0-5V (Output high when obstacle in range)

Sentry Angle max 15 degree

Sentry Distance 2 cm - 500 cm

High-accuracy 0.3cm

Page 15: Design Development of Water Monitoring Systems by Using Arduino and Sensors

Input trigger signal 10us TTL impulse

Echo signal output TTL PWL signal

Size 45*20*15 mm

Weight

Applications

Distance measurement.

Distance Ranging.

Robotics for mapping.

Colored Line sensing

Object/obstacle detection

Module Working Principle:

1) Supply IO trigger through supplying at least 10us sequence of high

level signal to start the ranging;

2) The module automatically send eight 40khz square wave and

automatically detect whether receive the returning pulse signal;

3) If there is signals returning, echo pin will raise to certain duration

which is equal to the time taken by wave to reach the object and to

coming back.

Test distance = High level time x Sound Velocity (340M/S) / 2

Page 16: Design Development of Water Monitoring Systems by Using Arduino and Sensors

Note:-

The module is not suggested to connect directly to live supply, if

connected, the GND terminal should be connected to the module

first, otherwise, it will affect the normal work of the module;

When testing objects, the range of area should not be less than 0.5

square meters and the surface plane as smooth as possible,

otherwise, it will affect the results of measuring.

3. PROCESSING PLATFORMS

3.1 MicroControllers

A microcontroller (sometimes abbreviated µC, uC or MCU) is a

small computer on a single integrated circuit containing a processor core,

memory, and programmable input/output peripherals. Program memory in

the form of NOR flash or OTP ROM is also often included on chip, as well

as a typically small amount of RAM. Microcontrollers are designed for

embedded applications, in contrast to the microprocessors used in

personal computers or other general purpose applications.

Microcontrollers are used in automatically controlled products and

devices, such as automobile engine control systems, implantable medical

devices, remote controls, office machines, appliances, power tools, toys

and other embedded systems. By reducing the size and cost compared to

a design that uses a separate microprocessor, memory, and input/output

Page 17: Design Development of Water Monitoring Systems by Using Arduino and Sensors

devices, microcontrollers make it economical to digitally control even

more devices and processes. Mixed signal microcontrollers are common,

integrating analog components needed to control non-digital electronic

systems.

3.2. Arduino Mega 2560

Arduino is an open-source electronics prototyping platform based on

flexible, easy-to-use hardware and software. It’s intended for engineers,

artists, designers, hobbyists and anyone interested in creating interactive

objects or environments.

What Arduino can do ?

Arduino can sense the environment by receiving input from a

variety of sensors and can affect its surroundings by controlling lights,

motors, and other actuators. The microcontroller on the board is

programmed using the Arduino programming language (based on Wiring)

and the Arduino development environment (based on Processing). Arduino

projects can be stand-alone or they can communicate with software

running on a computer (e.g. Flash, Processing,MaxMSP).

The boards can be built by hand or purchased pre assembled; the

software can be downloaded for free. The hardware reference designs

(CAD files) are available under an open-source license, you are free to

adapt them to your needs.

Arduino received an Honorary Mention in the Digital Communities

section of the 2006 Ars Electronica Prix.

The Arduino founders are: Massimo Banzi , David Cuartielles ,Tom

Igoe, Gianluca Martino , and David Mellis .

Arduino Mega 2560 Circuit:

Page 18: Design Development of Water Monitoring Systems by Using Arduino and Sensors

Overview

The Arduino Mega 2560 is a microcontroller board based on the

ATmega2560 (datasheet). It has 54 digital input/output pins (of which 15

can be used as PWM outputs), 16 analog inputs, 4 UARTs (hardware serial

ports), a 16 MHz crystal

Oscillator, 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. The Mega is compatible with most

shields designed for the Arduino Duemilanove or Diecimila.

The Mega 2560 is an update to the Arduino Mega , which it replaces.

The Mega2560 differs from all preceding boards in that it does not

use the FTDI USB-to-serial driver chip. Instead, it features the

ATmega16U2 (ATmega8U2 in the revision 1 and revision 2 boards)

programmed as a USB-to-serial converter.

Revision 2 of the Mega 2560 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) Pinout: added SDA and SCL pins that are near to the AREF pin and

two other new pins placed near to the RESET pin, the IOREF that

allow the shields to adapt to the voltage provided from the board. In

future, shields will be compatible both with the board that use the

AVR, which operate with 5V and with the Arduino Due that operate

with 3.3V. The second one is a not connected pin, that is reserved

for future purposes.

2) Stronger RESET circuit.

Page 19: Design Development of Water Monitoring Systems by Using Arduino and Sensors

3) Atmega 16U2 replace the 8U2.

Summary

Microcontroller ATmega2560

Operating Voltage 5V

Input Voltage (recommended)

7-12V

Input Voltage (limits) 6-20V

Digital I/O Pins 54 (of which 15 provide PWM output)

Analog Input Pins 16

DC Current per I/O Pin 40 mA

DC Current for 3.3V Pin 50 mA

Flash Memory 256 KB of which 8 KB used by bootloader

SRAM 8 KB

EEPROM 4 KB

Clock Speed 16 MHz

Power

The Arduino Mega can be powered via the USB connection or with

an external power supply. The power source is selected automatically.

External (non-USB) power can come either from an AC-to-DC

adapter (wall-wart) or battery. The adapter can be connected by plugging

a 2.1mm center-positive plug into the board's power jack. Leads from a

battery can be inserted in the Gnd and Vin pin headers of the POWER

connector.

The board can operate on an external supply of 6 to 20 volts. If

supplied with less than 7V, however, the 5V pin may supply less than five

volts and the board may be unstable. If using more than 12V, the voltage

Page 20: Design Development of Water Monitoring Systems by Using Arduino and Sensors

regulator may overheat and damage the board. The recommended range

is 7 to 12 volts.

The power pins are as follows:

1) VIN: The input voltage to the Arduino board when it's using an

external power source (as opposed to 5 volts from the USB

connection or other regulated power source). You can supply

voltage through this pin, or, if supplying voltage via the power jack,

access it through this pin.

2) 5V: This pin outputs a regulated 5V from the regulator on the

board. The board can be supplied with power either from the DC

power jack (7 - 12V), the USB connector (5V), or the VIN pin of the

board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses

the regulator, and can damage your board. We don't advise it.

3) 3.3V: A 3.3 volt supply generated by the on-board regulator.

Maximum current draw is 50 mA.

4) GND: Ground pins.

5) IOREF: This pin on the Arduino board provides the voltage reference

with which the microcontroller operates. A properly configured

shield can read the IOREF pin voltage and select the appropriate

power source or enable voltage translators on the outputs for

working with the 5V or 3.3V.

Memory:

The ATmega2560 has 256 KB of flash memory for storing code (of

which 8 KB is used for the bootloader), 8 KB of SRAM and 4 KB of EEPROM

(which can be read and written with the EEPROM library).

Input and Output:

Each of the 54 digital pins on the Mega can be used as an input or

output, using pinMode () , digitalWrite () , and digitalRead () functions. They

operate at 5 volts. Each pin can provide or receive a maximum of 40 mA

and has an internal pull-up resistor (disconnected by default) of 20-50

kOhms. In addition, some pins have specialized functions:

Page 21: Design Development of Water Monitoring Systems by Using Arduino and Sensors

Serial: 0 (RX) and 1 (TX); Serial 1: 19 (RX) and 18 (TX); Serial 2: 17 (RX)

and 16 (TX); Serial 3: 15 (RX) and 14 (TX). Used to receive (RX) and

transmit (TX) TTL serial data. Pins 0 and 1 are also connected to the

corresponding pins of the ATmega16U2 USB-to-TTL Serial chip.

External Interrupts: 2 (interrupt 0), 3 (interrupt 1), 18 (interrupt 5), 19

(interrupt 4), 20 (interrupt 3), and 21 (interrupt 2). These pins can be

configured to trigger an interrupt on a low value, a rising or falling edge,

or a change in value.

PWM: 2 to 13 and 44 to 46. Provide 8-bit PWM output with the

analogWrite () function.

SPI: 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS). These pins support SPI

communication using the SPI library. The SPI pins are also broken out on

the ICSP header, which is physically compatible with the Uno,

Duemilanove and Diecimila.

LED: 13. There is a built-in LED connected to digital pin 13. When the pin

is HIGH value, the LED is on, when the pin is LOW, it's off.

TWI: 20 (SDA) and 21 (SCL). Support TWI communication using the Wire library.

Analog Inputs:

The Mega2560 has 16 analog inputs, each of which provide 10 bits

of resolution (i.e. 1024 different values). By default they measure from

ground to 5 volts, though is it possible to change the upper end of their

range using the AREF pin and analogReference() function.

There are a couple of other pins on the board:

1) AREF: Reference voltage for the analog inputs. Used with

analogReference().

Page 22: Design Development of Water Monitoring Systems by Using Arduino and Sensors

2) Reset: Bring this line LOW to reset the microcontroller. Typically

used to add a reset button to shields which block the one on the

board.

Communication

The Arduino Mega2560 has a number of facilities for communicating

with a computer, another Arduino, or other microcontrollers. The

ATmega2560 provides four hardware UARTs for TTL (5V) serial

communication. An ATmega16U2(ATmega 8U2 on the revision 1 and

revision 2 boards) on the board channels one of these over USB and

provides a virtual com port to software on the computer (Windows

machines will need a .inf file, but OSX and Linux machines will recognize

the board as a COM port automatically. The Arduino software includes a

serial monitor which allows simple textual data to be sent to and from the

board. The RX and TX LEDs on the board will flash when data is being

transmitted via the ATmega8U2/ATmega16U2 chip and USB connection to

the computer (but not for serial communication on pins 0 and 1).

A SoftwareSerial library allows for serial communication on any of

the Mega2560's digital pins.

The ATmega2560 also supports TWI and SPI communication. The

Arduino software includes a Wire library to simplify use of the TWI bus;

see the documentation for details. For SPI communication, use the SPI

library.

Programming:

The Arduino Mega can be programmed with the Arduino software

(download). For details, see the reference and tutorials.

The ATmega2560 on the Arduino Mega comes pre burned with a

bootloader that allows you to upload new code to it without the use of an

external hardware programmer. It communicates using the original

STK500 protocol (reference, C header files ).

Page 23: Design Development of Water Monitoring Systems by Using Arduino and Sensors

You can also bypass the bootloader and program the microcontroller

through the ICSP (In-Circuit Serial Programming) header; see these

instructions for details.

USB Overcurrent Protection

The Arduino Mega2560 has a resettable polyfuse that protects your

computer's USB ports from shorts and overcurrent. Although most

computers provide their own internal protection, the fuse provides an

extra layer of protection. If more than 500 mA is applied to the USB port,

the fuse will automatically break the connection until the short or overload

is removed.

Physical Characteristics and Shield Compatibility

The maximum length and width of the Mega2560 PCB are 4 and 2.1

inches respectively, with the USB connector and power jack extending

beyond the former dimension. Three screw holes allow the board to be

attached to a surface or case. Note that the distance between digital pins

7 and 8 is 160 mil (0.16"), not an even multiple of the 100 mil spacing of

the other pins.

The Mega2560 is designed to be compatible with most shields

designed for the Uno, Diecimila or Duemilanove.

3.3. Why Arduino over Microcontrollers?

There are many other microcontrollers and microcontroller

platforms available for physical computing. Parallax Basic Stamp,

Netmedia's BX-24, Phidgets, MIT's Handyboard, and many others offer

similar functionality. All of these tools take the messy details of

microcontroller programming and wrap it up in an easy-to-use package.

Arduino also simplifies the process of working with microcontrollers, but it

offers some advantage for teachers, students, engineers and interested

amateurs over other systems:

Page 24: Design Development of Water Monitoring Systems by Using Arduino and Sensors

1) Inexpensive - Arduino boards are relatively inexpensive compared

to other microcontroller platforms. The least expensive version of

the Arduino module can be assembled by hand, and even the pre-

assembled Arduino modules cost less than $50;

2) Cross-platform - The Arduino software runs on Windows,

Macintosh OSX, and Linux operating systems. Most microcontroller

systems are limited to Windows;

3) Simple, clear programming environment - The Arduino

programming environment is easy-to-use for beginners, yet flexible

enough for advanced users to take advantage of as well. For

teachers, it's conveniently based on the Processing programming

environment, so students learning to program in that environment

will be familiar with the look and feel of Arduino.

4) Open source and extensible software- The Arduino software is

published as open source tools, available for extension by

experienced programmers. The language can be expanded through

C++ libraries, and people wanting to understand the technical

details can make the leap from Arduino to the AVR C programming

language on which it's based. Similarly, you can add AVR-C code

directly into your Arduino programs if you want to.

5) Open source and extensible hardware - The Arduino is based on

Atmel's ATMEGA8 and ATMEGA168 microcontrollers. The plans for

the modules are published under a Creative Commons license, so

experienced circuit designers can make their own version of the

module, extending it and improving it. Even relatively inexperienced

users can build the breadboard version of the module in order to

understand how it works and save money.

Page 25: Design Development of Water Monitoring Systems by Using Arduino and Sensors

4. TRANSFERRING MECHANISMS

4.1. GSM-SIM 900

GSM stands for Global System for Mobile Communication.The

SIM900 is a complete Quad-band GSM/GPRS solution in a SMT module

which can be embedded in the customer applications.Featuring an

industry-standard interface, the SIM900 delivers GSM/GPRS

850/900/1800/1900MHz performance for voice, SMS, Data, and Fax in a

small form factor and with low power consumption. With a tiny

configuration of 24mm x 24mm x 3 mm, SIM900 can fit almost all the

space requirements in your M2M application, especially for slim and

compact demand of desig

GSM (Global System for Mobile) / GPRS (General Packet Radio

Service) TTL –Modem is SIM900 Quad-band GSM / GPRS device, works on

frequencies 850 MHZ, 900 MHZ, 1800 MHZ and 1900 MHZ. It is very

compact in size and easy to use as plug in GSM Modem. The Modem is

designed with 3V3 and 5V DC TTL interfacing circuitry, which allows User

to directly interface with 5V Microcontrollers (PIC, AVR, Arduino, 8051,

etc.) as well as 3V3 Microcontrollers (ARM, ARM Cortex XX, etc.). The baud

rate can be configurable from 9600-115200 bps through AT (Attention)

commands. This GSM/GPRS TTL Modem has internal TCP/IP stack to

enable User to connect with internet through GPRS feature. It is suitable

Page 26: Design Development of Water Monitoring Systems by Using Arduino and Sensors

for SMS as well as DATA transfer application in mobile phone to mobile

phone interface.

SIM900 key features :

Feature Implementation

Power supply Single supply voltage 3.4V – 4.5V

Power saving Typical power consumption in SLEEP mode is 1.5mA ( BS-PA-MFRMS=5 )

Frequency Bands SIM900 quad-band: GSM 850,EGSM 900, DCS 1800, PCS 1900. The SIM900 can search the 4 frequency bands automatically. The frequency bands also can be set by AT command.

Temperature range Normal operation: -30°C to +80°CRestricted operation: -40°C to -30°C and +80 °C to +85°C(1)Storage temperature -45°C to +90°C

SMS MT, MO, CB, Text and PDU modeSMS storage: SIM card

SIM interface Support SIM card: 1.8V, 3V

Timer function Programmable via AT command

Physical characteristics

Size: 24mm x 24mm x 3mm Weight: 3.4g

SIM900 Functional Diagram

(To be updated ****)

SIM900 Pin Description:

Serial/Power port pins:

PIN NAME I/O

DESCRIPTION DC CHARACTERISTICS

COMMENT

VBAT I The power supply ofSIM900 has to be a

Vmax= 4.5VVmin=3.4V

Page 27: Design Development of Water Monitoring Systems by Using Arduino and Sensors

singlevoltage source of VBAT=3.4V...4.5V. It must be ableto provide sufficient currentin a transmit burst whichtypically rises to 2A

Vnorm=4.0V

GND

Ground

RXD I Receive data

TXD O Transmit data

RTS I Request to send

CTS O Clear to send

DSR O

DTR I

Operating modes:

Mode Function

Normal operation

GSM/GPRSSLEEP

Module will automatically go into SLEEP mode if DTR is set to high leveland there is no on air and no hardware interrupt (such as GPIO interrupt ordata on serial port).In this case, the current consumption of module will reduce to the minimallevel.In SLEEP mode, the module can still receive paging message and SMSfrom the system normally.

GSM IDLE Software is active. Module has registered to the GSM network, and the module is ready to send

Page 28: Design Development of Water Monitoring Systems by Using Arduino and Sensors

and receive.

GSM TALK Connection between two subscribers is in progress. In this case, the powerconsumption depends on network settings such as DTX off/on,FR/EFR/HR, hopping sequences, antenna.

POWERDOWN

Normal shutdown by sending the “AT+CPOWD=1” command or using the PWRKEY. The power management ASIC disconnects the power supply from the baseband part of the module, and only the power supply for the RTC is remained. Software is not active. The serial port is not accessible. Operating voltage (connected to VBAT) remains applied.

Antenna Interface:

SIM900 provides RF antenna interface. And customer’s antenna

should be located in the customer’s main board and connect to module’s

antenna pad through microstrip line or other type RF trace which

impedance must be controlled in 50Ω. To help you to ground the antenna,

SIM900 comes with a grounding plane located close to the antenna pad.

The Pin 60 is the RF antenna pad.

SIM900 material properties:

SIM900 PCB Material: FR4

Antenna pad: Gold plated pad

Interfacing GSM-SIM 900 with Arduino

GSM-SIM 900 pin Arduino pin

5V 5V

Gnd Gnd

Page 29: Design Development of Water Monitoring Systems by Using Arduino and Sensors

RxD Tx0

TxD Rx0

4.2. LCD display

LCD stands for liquid crystal display. They come in many sizes 8x1 ,

8x2 , 10x2 , 16x1 , 16x2 , 16x4 , 20x2 , 20x4 ,24x2 , 30x2 , 32x2 , 40x2

etc.

Page 30: Design Development of Water Monitoring Systems by Using Arduino and Sensors

ALL LCDs will have :

Eight(8) Data pins

VCC (Apply 5v here)

GND (Ground this pin)

RS (Register select)

RW (read - write)

EN (Enable)

VEE (Set Lcd contrast)

The 8 data pins takes 8-bit data or command from an external unit

such as microcontroller or Arduino.

V0 (Set Lcd contrast)

The best way to Set LCD contrast is to use potentiometer. The

output of the potentiometer is connected to this pin. Rotate the

potentiometer knob forward and backward to adjust the lcd contrast.

RS(Register select)

There are two registers in every lcd.

Page 31: Design Development of Water Monitoring Systems by Using Arduino and Sensors

1. Command Register

2. Data Register

Command Register

When we send commands to lcd these commands go to Command

register and are processed there.

Data Register

When we send Data to lcd it goes to data register and is processed

there.

When RS=1 Data Register is selected.

When RS=0 Command Register is Selected.

RW(Read / Write)

When RW=1 We want to read data from lcd.

When RW=0 We want to write to lcd.

EN(Enable signal)

When you select the register(Command and Data) and set RW(read

- write) now its time to execute the instruction. By instruction the 8-bit

data or 8-bit command present on Data lines of lcd.This requires an extra

voltage push to execute the instruction and EN (enable) signal is used for

this purpose. Usually we make it en=0 and when we want to execute the

instruction we make it high en=1 for some milliseconds. After this we

again make it ground en=0.

The data which we send to our lcd can be any alphabet(small

or big) , digit or ASCII character.

Page 32: Design Development of Water Monitoring Systems by Using Arduino and Sensors

Interfacing LCD with Arduino

LCD pin Arduino pin

1 Gnd

2 5V

3 10kΩ

4 12

5 gnd

6 11

7 NC

8 NC

9 NC

10 NC

11 2

12 3

13 4

14 5

15 5V

16 Gnd

Page 33: Design Development of Water Monitoring Systems by Using Arduino and Sensors

NOTE:

1. We can not send an integer,float,long,double type data to lcd

because lcd is designed to display a character only.

2. The 8 data pins on lcd carries only ASCII 8-bit code of the character

to lcd.

3. How ever we can convert our data in character type array and send

one by one our data to lcd.

4. Data can be sent using lcd in 8-bit 0r 4-bit mode. If 4-bit mode is

used, two nibbles of data (First high four bits and then low four bits)

are sent to complete a full eight-bit transfer. 8-bit mode is best used

when speed is required in an application and at least ten I/O pins

are available. 4-bit mode requires a minimum of seven bits. In 4-bit

mode, only the top 4 data pins (4-7) are used.

5. WATER DEPTH MEASUREMENT BY ULTRASONIC SENSOR

5.1.Interfacing ultrasonic sensor with Arduino

Vcc pin of the Ultrasonic Sensor is connected to the 5V pin of

Arduino, GND

pin is connected to the GND pin, Trig pin is connected to digital pin 8 of

Arduino and Echo pin is connected to digital pin 7 of Arduino.

Ultrasonic sensor Arduino

Vcc 5V

Gnd Gnd

Trig pin 7

Echo pin 8

5.2. Ultrasonic sensor with LCD

Page 34: Design Development of Water Monitoring Systems by Using Arduino and Sensors

5.2.1 Circuit diagram:

5.2.2 Arduino Program:

#include <LiquidCrystal.h>LiquidCrystal lcd(12, 11, 5, 4, 3, 2);const int trig=7 ;const int echo=8;

void setup()

Serial.begin(9600); lcd.begin(16,2);

void loop() lcd.clear();

Page 35: Design Development of Water Monitoring Systems by Using Arduino and Sensors

long timeDuration,cm;pinMode(trig,OUTPUT);digitalWrite(trig,LOW);delayMicroseconds(4);digitalWrite(trig,HIGH);delayMicroseconds(10);digitalWrite(trig,LOW);pinMode(echo, INPUT);

timeDuration = pulseIn(echo, HIGH);cm= microTocms(timeDuration); //conversion of microseconds to

centimetersSerial.print(cm);

Serial.print("cm"); Serial.println(); lcd.print(cm); lcd.print(" cm"); delay(1000);

long microTocms(long microseconds) // The speed of sound is 340 m/s or 29 microseconds per centimeter. // The ping travels out and back, so to find the distance of the // object we take half of the distance travelled. return microseconds / (29 * 2);

5.3. Ultrasonic sensor with GSM

Following system will use ultrasonic sensor to measure the water

depth, then measured distance will be sent to given mobile number.

5.3.1.Circuit diagram:

Page 36: Design Development of Water Monitoring Systems by Using Arduino and Sensors

5.3.2.Arduino Program:

const int trig=7 ;const int echo=8;

void setup()

Serial.begin(9600); Serial1.begin(9600); //Baud rate of the GSM/GPRS Module Serial1.print("\r");

void loop()

long timeDuration,cm;

pinMode(trig,OUTPUT);digitalWrite(trig,LOW);delayMicroseconds(2);digitalWrite(trig,HIGH);delayMicroseconds(10);digitalWrite(trig,LOW);

pinMode(echo, INPUT); timeDuration = pulseIn(echo, HIGH);

cm= microTocms(timeDuration);

Serial.print(cm); Serial.print("cm"); Serial.println();

// delay(2000);

Serial1.print("AT+CMGF=1\r"); delay(1000); Serial1.print("AT+CMGS=\"+919542081456\"\r"); //Number

to which you delay(1000); Serial1.print(cm); //The text of the message to be sent Serial1.print("cm"); delay(1000); Serial1.write(0x1A); delay(20000);

long microTocms(long microseconds)

Page 37: Design Development of Water Monitoring Systems by Using Arduino and Sensors

return microseconds / (29 * 2);

5.4.Outputs of the system

6. SOIL MOISTURE MEASUREMENT SYSTEM

6.1. Interfacing soil moisture sensor with Arduino

In order to receive the sensed data from the soil moisture sensor to

arduino, power supply of 5V is provided from arduino by connecting Vcc of

sensor to 5V of arduino and GND of sensor to GND of arduino.Readings

are retrieved at analog pin of arduino by connecting A0 of soil moisture

Page 38: Design Development of Water Monitoring Systems by Using Arduino and Sensors

sensor to any analog pin of arduino.Those retrieved values are displayed

via LCD display or sent as SMS using GSM-SIM 900.

Soil moisture sensor

Arduino

Vcc 5V

Gnd Gnd

A0 A0

D0 NC

6.2. Soil moisture sensor with LCD

6.2.1.Circuit diagram:

Page 39: Design Development of Water Monitoring Systems by Using Arduino and Sensors

6.2.2.Arduino program:

#include <LiquidCrystal.h>LiquidCrystal lcd(12, 11, 2, 3, 4, 5);int soil=0;// the setup routine runs once when you press reset:void setup() // initialize serial communication at 9600 bits per second: Serial.begin(9600); lcd.begin(16,2);

// the loop routine runs over and over again forever:void loop() lcd.clear(); // read the input on analog pin 0: int sensorValue = analogRead(A0); sensorValue = constrain(sensorValue, 485, 1023); // print out the value you read: //Serial.println(sensorValue);

//map the value to a percentage soil = map(sensorValue, 485, 1023, 100, 0); // print out the soil water percentage you calculated: Serial.print(soil); Serial.println("%"); lcd.print("Soil Moisture"); lcd.setCursor(0, 1); lcd.print(soil); lcd.print(" %");

delay(1000); // delay in between reads for stability

6.3.Soil moisture sensor with GSM-SIM 900

Page 40: Design Development of Water Monitoring Systems by Using Arduino and Sensors

6.3.1.Circuit diagram:

Page 41: Design Development of Water Monitoring Systems by Using Arduino and Sensors

6.3.2.Arduino program:

int soil=0;

// the setup routine runs once when you press reset:void setup() // initialize serial communication at 9600 bits per second: Serial.begin(9600); Serial1.begin(9600); //Baud rate of the GSM/GPRS Module Serial1.print("\r");

// the loop routine runs over and over again forever:void loop() // read the input on analog pin 0: int sensorValue = analogRead(A0); sensorValue = constrain(sensorValue, 485, 1023); // print out the value you read: //Serial.println(sensorValue);

//map the value to a percentage soil = map(sensorValue, 485, 1023, 100, 0);

// print out the soil water percentage you calculated: Serial.print(soil); Serial.println("%");

delay(1000); // delay in between reads for stability Serial1.print("AT+CMGF=1\r"); delay(1000); Serial1.print("AT+CMGS=\"+919542081456\"\r"); //Number to which you delay(1000); Serial1.print(soil); //The text of the message to be sent Serial1.print("%"); delay(1000); Serial1.write(0x1A); delay(20000);

6.4.Soil moisture sensor with LEDs

6.4.1.Interfacing LEDs with Arduino:

Page 42: Design Development of Water Monitoring Systems by Using Arduino and Sensors

LED’s are connected to the digital pins of the Arduino.To avoid the

damage of LED’s resistors are connected in between the digital pins and

LED’s.Positive terminal of LED is connected to the resistor and negative

terminal is connected to the Gnd of Arduino.

6.4.2.Circuit diagram:

6.4.3.Arduino Program:

int soil=0;int led1=11;int led2=12;int led3=13;

void setup() pinMode(led1,OUTPUT); pinMode(led2,OUTPUT);

Page 43: Design Development of Water Monitoring Systems by Using Arduino and Sensors

pinMode(led3,OUTPUT); Serial.begin(9600);

void loop() int sensorvalue=analogRead(A0); sensorvalue=constrain(sensorvalue,485,1023); soil=map(sensorvalue,485,1023,100,0); Serial.print(soil); Serial.println("%"); digitalWrite(led1,LOW); digitalWrite(led2,LOW); digitalWrite(led3,LOW);

if(soil<33) digitalWrite(led1,HIGH);

else if(soil>=33 && soil<=66) digitalWrite(led2,HIGH);

else if(soil>66) digitalWrite(led1,HIGH);

delay(1000);

7. TEMPERATURE AND HUMIDITY MEASUREMENT BY DHT11

SENSOR

7.1. Interfacing Temperature and humidity sensor with Arduino

Vcc pin of DHT11 sensor is connected to 5V pin of Arduino,DATA pin

of sensor is connected to A0 of Arduino and Gnd pin of DHT11 is

connected to Gnd pin of Arduino.

DHT11 Sensor Arduino

Page 44: Design Development of Water Monitoring Systems by Using Arduino and Sensors

Vcc 5V

DATA A0

Gnd Gnd

7.2.DHT11 sensor with LCD

7.2.1.Circuit:

7.2.2.Arduino program:

#include <dht.h>#include <LiquidCrystal.h>#define dht_dpin A0LiquidCrystal lcd(12, 11, 2, 3, 4, 5);dht DHT;

void setup() Serial.begin(9600); lcd.begin(16,2);

Page 45: Design Development of Water Monitoring Systems by Using Arduino and Sensors

void loop() DHT.read11(dht_dpin); Serial.print("Current humidity = "); Serial.print(DHT.humidity); Serial.print("% "); Serial.print("temperature = "); Serial.print(DHT.temperature); Serial.println("C "); lcd.clear() lcd.print("Humidity: "); lcd.setCursor(0,1); lcd.print(DHT.humidity); lcd.print(" %"); delay(1000); lcd.clear(); lcd.print("Temperature:"); lcd.setCursor(0,1); lcd.print(DHT.temperature); lcd.print(" C"); delay(1000);

7.3.DHT11 sensor with GSM-SIM 900

7.3.1.Circuit Diagram:

7.3.2.Arduino Program:

#include <dht.h>#define dht_dpin A1

Page 46: Design Development of Water Monitoring Systems by Using Arduino and Sensors

dht DHT;

void setup()

Serial.begin(9600); Serial.print(“\r”);void loop() DHT.read11(dht_dpin); Serial.print("AT+CMGF=1\r"); delay(1000); Serial.print("AT+CMGS=\"+918500659564\"\r"); //Number to which you delay(1000); Serial.print("Temperature: "); Serial.print(DHT.temperature); //The text of the message to be sent Serial.print(" C "); Serial.print("Humidity: "); Serial.print(DHT.humidity); Serial.print(" %"); delay(1000); Serial.write(0x1A); delay(1000);

7.4.Outputs of the system

Page 47: Design Development of Water Monitoring Systems by Using Arduino and Sensors

10. Observations & Conclusions

Robust covering should be provided.

Lining should be given around the device for heat proof and

shockproof.

Ultrasonic sensor should not be installed near the bank, as the water

near to the bank may not be stable all the time.

Graphical data transmission such as MMS is not possible with

Arduino, Arduino compatible cameras are not adequately available

in the market.

In the areas where the signal strength is less, power consumption

by the system is more, to overcome this one should go for other

networks, which are having high signal strength.

Power analysis:

9V 12V

Ultrasonic+A+gsm + display

Continuous 1 hr,

Continuous 6 hrs.30min/ sms

Ultrasonic + A+ display

TWEET 1.0

TWEET 2.0

CLICK 1.0

CLICK 2.0

CLICK 3.0 Limitations:

Range of the ultrasonic sensor used is 3mtrs only.

Page 48: Design Development of Water Monitoring Systems by Using Arduino and Sensors

Ultrasonic sensor can not be used, if it is to be implemented in the

stilling well because of the reason that Sentry angle is 15 degrees

only.

While using the ultrasonic sensor make sure that, the range area

should not be less than 0.5 sq. mtrs and surface plane should be as

smooth as possible.

Canal depth may not be uniform. *****

If flow is not smooth, (laminar flow), measurement may not be

accurate.

11. Future Work

As device is going to install in the field, It is better to go for solar

energy instead of depending on the batteries, So that device will

work without interruption.

Use advanced sensors to increase the range of the device to install

it for reservoirs.

To find alternative for jumper wires.

Make the system to be idle in normal times, activate only when the

measurement is needed, Thus reducing the power consumption.

To compute the volume of the water in the canal, considering the

cross section of the canal and moving the sensor in deterministic

way.

Automation of the gates if device installed at the reservoirs,

Automation of the motors if the device installed in the farming

fields.

Incorporate the exhaust fan in the device as heat sink, to protect

the device from heat.

Replace ultrasonic sensor with pressure sensor if device to be

installed in the stilling well.

Page 49: Design Development of Water Monitoring Systems by Using Arduino and Sensors

Miscellaneous:

1. camera + arduino ---- not compatible so go for raspberry pi.

BIBLIOGRAPHY

1. Programming http :// arduino . cc / en / Reference / HomePage

2. mega 2560 pin mapping diagram - (img1)

http :// arduino . cc / en / Hacking / PinMapping 2560

3. (arduino-mega2560_R3-sch.pdf)- schematic diagram

http :// arduino . cc / en / uploads / Main / arduino - mega 2560_ R 3- sch . pdf

4. lcd display image http :// www . engineersgarage . com / electronic -

components /16 x 2- lcd - module - datasheet