chapter 1 introduction - · pdf fileapplications of wsns range from distributed monitoring...

40
1 CHAPTER 1 INTRODUCTION Agriculture is an important sector for each country. It is the major source of income for every population. Besides providing foods and raw materials for manufacturing industries, it is a predominant occupation of working population. One important part of agriculture system is the irrigation system. Today, crop irrigation uses more than 70% of the world’s water. The use of water for irrigation is expected to be increasing in future because of the effects of climate change and the necessity to maintain a high quality of crop yield in despite of unpredictable drought periods. Different factors can determine the effectiveness of the irrigation system such as the type of delivery system used and the climatic conditions. So, to have an effective irrigation system you need to get as much water to the plants, or into the soil, as possible. It may seem easy to do, but in fact, water loss from these systems can be up to 50% due to the evaporation cycle. On hot and sunny days, a good portion of water may never make it to the ground. So, the irrigation system should be able to detect when the plants are in need for water to open valves for irrigation. 1.1WIRELESS SENSOR NETWORK FOR IRRIGATION Wireless Sensor Networks consist a crucial part of the Future Internet. Thus, they will play an important role in our everyday life in years to come. The applications of WSNs range from distributed monitoring systems to smart embedded managing systems. As water supplies become scarce and polluted, there is a dire need to irrigate more efficiently in order to optimize water use.

Upload: buidiep

Post on 17-Mar-2018

219 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

1

CHAPTER 1

INTRODUCTION

Agriculture is an important sector for each country. It is the major source of

income for every population. Besides providing foods and raw materials for

manufacturing industries, it is a predominant occupation of working population.

One important part of agriculture system is the irrigation system. Today, crop

irrigation uses more than 70% of the world’s water. The use of water for irrigation

is expected to be increasing in future because of the effects of climate change and

the necessity to maintain a high quality of crop yield in despite of unpredictable

drought periods. Different factors can determine the effectiveness of the irrigation

system such as the type of delivery system used and the climatic conditions. So, to

have an effective irrigation system you need to get as much water to the plants, or

into the soil, as possible. It may seem easy to do, but in fact, water loss from these

systems can be up to 50% due to the evaporation cycle. On hot and sunny days, a

good portion of water may never make it to the ground. So, the irrigation system

should be able to detect when the plants are in need for water to open valves for

irrigation.

1.1 WIRELESS SENSOR NETWORK FOR IRRIGATION

Wireless Sensor Networks consist a crucial part of the Future Internet.

Thus, they will play an important role in our everyday life in years to come. The

applications of WSNs range from distributed monitoring systems to smart

embedded managing systems. As water supplies become scarce and polluted,

there is a dire need to irrigate more efficiently in order to optimize water use.

Page 2: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

2

Recent advances in soil water monitoring combined with the growing

popularity of Wireless Sensor Networks make the commercial use of such systems

applicable not only to agriculture and industry but to homes as well. To date,

typical irrigation automations include electromechanical programmers that can

control the watering procedure. These systems are programmed to irrigate at

regular time intervals for predefined periods of time; e.g. once a day for half an

hour. The programming of these automated systems is heuristically based on

experience and is poorly adaptable to changes in weather conditions, as well as the

existence of different water needs by different kind of plants. As a result, water

resources are poorly used, plantation is over- or under-irrigated and increased costs

of garden maintenance are introduced.

1.2 COMPONENTS OF SENSOR NETWORKS

Sensing unit

Sensing units are usually composed of two subunits: sensor and analog to

digital convertors (ADC). The analog signals produced by the sensors are

converted to digital signals by ADC and fed into the processing unit.

Processing unit

The processing unit which is generally associated with a small storage

unit managers the procedures that make the sensor node collaborate with the

other nodes to carry out the assigned sensing tasks.

Transceiver

A transceiver is a device comprising both a transmitter and a receiver

which are combined and share common circuitry or a single housing. When no

circuitry is common between transmit and receive functions, the device is a

transmitter-receiver.

Page 3: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

3

Power unit

Every sensor node is equipped with the battery that supplies power to

remain in active mode.

1.3 ISSUES AND CHALLENGES IN DESIGNING A SENSOR

NETWORK

• The quantity of nodes is large, which may be of several thousands.

• The nodes often breakdown, so the network is too difficult to maintain.

• Communication capacity of the node is restricted,.

• The nodes are usually located densely and the distance between two

adjacent nodes may be very short.

• The bandwidth is narrow and changes frequently.

Furthermore, the use of Wireless Sensor Networks gives watering systems

monitoring as well as remote management capabilities. With sensor motes being

IPv6 capable, they can be represented as resources in a RESTful architecture,

thus allowing remote access and control to the system (e.g. via Android devices).

Page 4: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

4

CHAPTER 2

LITERTURE REVIEW

2.1 A WiFi based Smart Wireless Sensor Network for an

Agricultural Environment

The main objective of the present work is to develop a smart

wirelesssensor network (WSN) for an agricultural environment. Monitoring

ofenvironmental factors has increased in importance over the last decade.

Inparticular monitoring agricultural environments for various factors such

astemperature and humidity along with other factors can be of significance.

Thispaper investigates a remote monitoring system using WiFi, where the

wirelesssensor nodes are based on WSN802G modules. These nodes send

datawirelessly to a central server, which collects the data, stores it and will

allow itto be analyzed then displayed as needed. Wireless distinct sensor nodes

canreduce time and effort required for monitoring an environment. The logging

ofdata allows for reduction of data being lost or misplaced. Wireless

distinctsensor nodes can reduce time and effort required for monitoring

anenvironment. The logging of data allows for reduction of data being lost

ormisplaced.The present paper describes the development of a wireless

agriculturalenvironment measuring temperature, humidity, atmospheric

pressure, soilmoisture; water level and light detection. Where the wireless

connection isimplemented to acquire data from the various sensors, in addition

to allow setup difficulty to be as reduced.

Page 5: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

5

2.2 Wireless Sensor Networking for Rain-fed Farming Decision

Support

Wireless Sensor Networks (WSNs) can be a valuable decision-support tool

for farmers. This motivated our deployment of a WSN sys- tem to support rain-

fed agriculture in India, the deployment of WSN technology in developing

regions is more likely to be effective if it targets scientists and technical

personnel as users, rather than the farmers themselves. Most of all, agriculture

comes as a natural application, given the importance that climatic and physical

parameters have throughout the development of the crop. Indeed, developing

countries often have to cope with a large farming population who has seen their

situation deteriorate in recent years due to the instability of market prices and the

perceived effects of climate change. As a typical example, the share of

agriculture for employment in India is about 67%, with a majority of small land

holdings. In Karnataka (Southern India), 87% of the farms have less than 4 ha

and account for more than 50% of the total cultivated land, while 39% of the

total are very small farms (less than 1 ha). These resource- poor farmers usually

lack access to irrigation facilities and depend on rain-fed farming for their

livelihood [3]. Their crop yields are highly unreliable, due to the variability in

both the total rainfall and its distribution. Unlike industrial farming companies,

they face daunting challenges, as is illustrated by the current wave of suicides

throughout the country. The goal of the experiment was to assess the use that

agriculture scientists would make of the data that are collected by the

COMMON-Sense Net system.

Page 6: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

6

CHAPTER 3

PROJECT OVERVIEW

3.1 INTRODUCTION

The project aims at using WSN for automated irrigation of fields. Instead of

using multiple sensors , wireless sensor network has inbuilt sensors which reduces

the complexity of the overall system. This system makes irrigation water efficient.

It has been designed in such a way that it can be controlled both manually and

automatically.

3.2 WORKING PRINCIPLE

There are two transformers namely, current and potentio transformer.

Potentio transformer is used to step down 230V AC power supply to 12V AC.

Bridge rectifier is used to convert the AC voltage to DC. An Electrolyte capacitor

and a Ceramic capacitor are used to remove the ripples. The 12V supply is directly

given to the driver circuit and solenoid valve. The regulator is used to step down

12V to 5V which is required to operate the PIC,LCD and Telosb Mote.

Page 7: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

7

FIG 3.1 :BLOCK DIAGRAM

The current transformer is used to provide 12V AC to the GSM module and AC

motor.The motor is driven as per the instructions from the GSM module.Two

solenoid valves are present namely, S1 and S2. S1 is used for automatic operation

and S2 is for manual operation.Three relay units are used, two for solenoid valves

and one for the motor. S1 is always ON and S2 can be ON/OFF using GSM.

There are four parameters in the LCD namely, irrigation percentage, status

of the solenoid valves 1 and 2 and the motor. The irrigation percentage indicates

the amount of water in the soil. The same details are sent via SMS to the user’s

mobile.

Solenoid valve 1

Solenoid valve 2

Power supply

Current sensor

GSM

LCD

PIC

Motor driver

Motor

Telosb Mote

sensor network

Page 8: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

8

FIG 3.2 : CIRCUIT DIAGRAM

The Telosb Mote is the module which has been used to implement the concept of

WSN. It has an inbuilt Irrigation sensor and a Current sensor. The irrigation sensor

senses the amount of water in the soil. The current sensor detects the availability of

water in the well. The PIC Microcontroller has been programmed using Embedded

C in the MPLab software. LCD is connected to Port D of the PIC. It uses 3 control

pins, namely RS,RW and EN and 4 data pins namely, D4, D5,D6,D7. Telosb mote

is connected to Port C namely, C3 and C4. Driver circuit is connected to Port E

via 3 pins.

Page 9: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

9

3.3 CONCLUSION

Measuring soil moisture is important in agriculture to help farmersmanage

their irrigation systems more efficiently. Not only are farmers able to generally use

less water to grow a crop, they are able to increase yields and the quality of the

crop by better management of soil moisture during critical plant growth

stages.Besides agriculture, there are many other disciplines using soil moisture

sensors. Golf courses are now using sensors to increase the efficiencies of their

irrigation systems to prevent over watering and leaching of fertilizers and other

chemicals offsite.

Page 10: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

10

CHAPTER 4

HARDWARE DESCRIPTION

4.1 INTRODUCTION

The hardware part consists of Telosb Mote as transmitter, GSM module as

Transceiver and output devices like Motor, Motor driver, LCD and Solenoid

valves. The microcontroller operates the solenoid valve depending on threshold

level of moisture content in the soil.

4.2 TELOSB MOTE

For our implementation, we used a TelosB mote which it is an ultra-low

power wireless module for monitoring applications, eco-friendly product and rapid

application prototyping. [6] It is also a low power consumption device which it

uses from only 2.1V to 3.6V. Moreover, it is Zigbee compliant, small, and

lightweight and when using energy saving protocols can be powered with two AA

batteries for several weeks, even months. These characteristics make it ideal for

our watering system as it can easily be deployed everywhere while being

independent of power installations.

BASE STATION

A TelosB mote will be collected to the farmer computer. It will collect data

from different other nodes plugged in field.

Page 11: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

11

SOIL NODE

We try to measures two parameters: Soil moisture and soil temperature.

Measuring soil moisture is important to estimate the exact quantity of water

needed for each plant in each field. So farmer can control water’s supply properly

avoiding wastes. Measuring temperature help farmer to know when he should

open the water container to reduce it which is very important in hot and dry

seasons. The VH400 soil moisture sensor by Vegetronix was used for soil

monitoring. Because it measures the dielectric constant of the soil using

transmission line techniques, it is insensitive to water salinity, and will not corrode

over time. This sensor is small, rugged, and low power. Compared to other low

cost sensor such as gypsum block sensors, VH400 offer a rapid response time.

For the supply voltage it needs at minimum 3.3 V which we can connect

directly to the TelosB mote without any other external supply. It consists of a

cable, which on one end has one prong and on the other end has 3 wires. The

prongs are pushed inside the potting soil and the three wires of the other end are

connected to the TelosB motes. The black wire is connected to the ADC channel

pin as an output, the red wire is connected to the VCC pin and the bare wire is

connected to the ground pin.

For the soil temperature, we used the DS18B20. It is a digital temperature

sensor by Maxim integrated. It provides 9-bit to 12-bit Celsius temperature

measurements. It requires Only One Port Pin for communication. It can be

powered with 3 V. It consists of three wires. The black wire is connected to the

ground, the red is connected to the VCC and finally the white is connected to DAC

channel pin.

Page 12: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

12

The DS18B20 can be powered by an external supply on the VDD pin, or it

can operate in “parasite power” mode, which allows the DS18B20 to function

without a local external supply. When the DS18B20 is used in parasite power mode,

the VDD pin must be connected to ground. The DS18B20 output temperature data

is calibrated in degrees centigrade. The temperature data is stored as a 16-bit sign-

extended two’s complement number in the temperature register. The sign bits (S)

indicate if the temperature is positive or negative: for positive numbers S = 0 and

for negative numbers S = 1.

If the DS18B20 is configured for 12-bit resolution, all bits in the temperature

register will contain valid data. For 11- bit resolution, bit 0 is undefined. For 10-bit

resolution, bits 1 and 0 are undefined, and for 9- bitresolution bits 2, 1 and 0 are

undefined. Table 2 gives examples of digital output data and the corresponding

temperature reading for 12-bit resolution conversions.

Page 13: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

13

WEATHER NODE

This part is composed from specific TelosB mote which contain internal

sensors for external weather. The mote can detect the temperature, solar radiation

and air humidity. So to get more precision about weather changes that affect plant

growth the mote is accomplished with a wind speed sensor. Using this sensor is

helpful to detect if irrigation is good for this period or not because when the wind

‘speed is quiet high water will not persist in the soil. For tis node we used the

VORTEX anemometer wind speed sensor. It is a rugged wind sensor which can

handle speeds from 5 to over 125 mph. Reed switch/magnet provides one pulse per

rotation.

FIG 4.1 : TELOSB MOTE

CONTAINER NODE

This part is the most important one in our system. It contains a TelosB mote

with an actuator which will be used to open or close the water container in need. It

a low power consumption device and it is powered with 24V for 50/60 Hz. So we

need to use with it a relay to connect to the TelosB mote because this mote support

Page 14: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

14

6V maximum. The relay is used for switching the amount of power with a small

operating power.

We used four types of nodes: x one node contains the code of the base

station ; which will collect data from other nodes, x second node contains the code

of soil node which will calculate the soil temperature and soil moisture values data,

x third node contains the code of the weather node which will send the weather

parameters, x The last node is used to activate or not the actuator depending on all

collected data from previous nodes.

FIG 4.2 : SYSTEM DESIGN OF TELOSB MOTE

Page 15: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

15

4.3PIC MICROCONTROLLER

FIG 4.3 : PIC MICROCONTROLLER

The PIC16F887 having 40pins and 5 ports. In this PIC microcontroller the

first pin is connected with the master clear circuit, it is used for the clear purpose.

For this circuit we will provide +5v supply. For this project we won’t use port A

and port E. 11th and 12th pin for the purpose of VSS and VDD. 13th and 14th pin

connected with the crystal oscillator. For PIC16F887 we can use 4MHz to 20MHz

crystal oscillator frequency here we are using 4MHz. It will provide clock pulse for

digital circuit. In port C 17th pin is connected with buzzer circuit. In D port

19,20,21,27,28,29,30 pins are connected with the LCD. For LCD we will provide

+5v supply. For RF communication TX and RX C port 25th and 26th pins are

used. For RF we will provide +5v supply. In power supply circuit first the step

down transformer will provide 12v AC supply. Then this alternating current

converted into direct current with the help of bridge rectifier. At last with the help

of particular rectified IC we can get particular voltage level.

Page 16: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

16

High-Performance RISC CPU:

• Only 35 Instructions to Learn:

- All single-cycle instructions except branches

• Operating Speed:

- DC – 20 MHz oscillator/clock input

- DC – 200 ns instruction cycle

• Interrupt Capability

• 8-Level Deep Hardware Stack

• Direct, Indirect and Relative Addressing modes

Special Microcontroller Features:

• Precision Internal Oscillator:

- Factory calibrated to ±1%

- Software selectable frequency range of

• 8 MHz to 31 kHz

- Software tunable

- Two-Speed Start-up mode

- Crystal fail detect for critical applications

- Clock mode switching during operation for power savings

• Power-Saving Sleep mode

• Wide Operating Voltage Range (2.0V-5.5V)

• Industrial and Extended Temperature Range

• Power-on Reset (POR)

• Power-up Timer (PWRT) and Oscillator Start-up Timer (OST)

Page 17: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

17

• Brown-out Reset (BOR) with Software Control Option

• Enhanced Low-Current Watchdog Timer (WDT) with On-Chip Oscillator

(software selectable nominal 268 seconds with full prescaler) with software

enable

• Multiplexed Master Clear with Pull-up/Input Pin

• Programmable Code Protection

• High Endurance Flash/EEPROM Cell:

- 100,000 write Flash endurance

- 1,000,000 write EEPROM endurance

- Flash/Data EEPROM retention: > 40 years

• Program Memory Read/Write during run time

• In-Circuit Debugger (on board)

Low-Power Features:

• Standby Current:

- 50 nA @ 2.0V, typical

• Operating Current:

- 11μA @ 32 kHz, 2.0V, typical

- 220μA @ 4 MHz, 2.0V, typical

• Watchdog Timer Current:

- 1μA @ 2.0V, typical

Page 18: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

18

FIG 4.4 :PIN DIAGRAM OF PIC 16F877A

Peripheral Features:

• 24/35 I/O Pins with Individual Direction Control:

- High current source/sink for direct LED drive

- Interrupt-on-Change pin

Page 19: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

19

- Individually programmable weak pull-ups

- Ultra Low-Power Wake-up (ULPWU)

• Analog Comparator Module with:

- Two analog comparators

- Programmable on-chip voltage reference

• (CVREF) module (% of VDD)

- Fixed voltage reference (0.6V)

- Comparator inputs and outputs externally accessible

- SR Latch mode

- External Timer1 Gate (count enable)

• A/D Converter:

- 10-bit resolution and 11/14 channels

• Timer0: 8-bit Timer/Counter with 8-bit Programmable Prescaler

• Enhanced Timer1:

- 16-bit timer/counter with prescaler

- External Gate Input mode

- Dedicated low-power 32 kHz oscillator

• Timer2: 8-bit Timer/Counter with 8-bit Period Register, Prescaler and

Postscaler

• Enhanced Capture, Compare, PWM+ Module:

- 16-bit Capture, max. resolution 12.5 ns

- Compare, max. resolution 200 ns

- 10-bit PWM with 1, 2 or 4 output channels, programmable “dead

time”, max. frequency 20 Hz

- PWM output steering control

• Capture, Compare, PWM Module:

Page 20: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

20

- 16-bit Capture, max. resolution 12.5 ns

- 16-bit Compare, max. resolution 200 ns

- 10-bit PWM, max. frequency 20 kHz

• Enhanced USART Module:

- Supports RS-485, RS-232, and LIN 2.0

- Auto-Baud Detect

• In-Circuit Serial ProgrammingTM (ICSPTM) via Two Pins

• Master Synchronous Serial Port (MSSP) Module supporting 3-wire SPI (all 4

modes) and I2C™ Master and Slave Modes with I2C Address Mask

I/O PORTS

There are as many as thirty-five general purpose I/O pins available. Depending on

which peripherals are enabled, some or all of the pins may not be available as

general purpose I/O. In general, when a peripheral is enabled, the associated pin

may not be used as a general purpose I/O pin.

Enhanced Capture/Compare/PWM (CCP1)

The Enhanced Capture/Compare/PWM module is a peripheral which allows the

user to time and control different events. In Capture mode, the peripheral allows

the timing of the duration of an event. The Compare mode allows the user to

trigger an external event when a predetermined amount of time has expired. The

PWM mode can generate a Pulse-Width Modulated signal of varying frequency

and duty cycle.

Page 21: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

21

ENHANCED UNIVERSAL SYNCHRONOUS ASYNCHRONOUS

RECEIVER TRANSMITTER (EUSART)

The Enhanced Universal Synchronous Asynchronous Receiver Transmitter

(EUSART) module is a serial I/O communications peripheral. It contains all the

clock generators, shift registers and data buffers necessary to perform an input or

output serial data transfer independent of device program execution. The

EUSART, also known as a Serial Communications Interface (SCI), can be

configured as a full-duplex asynchronous system or half-duplex synchronous

system. Full-Duplex mode is useful for communications with peripheral systems,

such as CRT terminals and personal computers. Half-Duplex Synchronous mode is

intended for communications with peripheral devices, such as A/D or D/A

integrated circuits, serial EEPROMs or other microcontrollers. These devices

typically do not have internal clocks for baud rate generation and require the

external clock signal provided by a master synchronous device.

MASTER SYNCHRONOUS SERIAL PORT (MSSP) MODULE

The Master Synchronous Serial Port (MSSP) module is a serial interface useful for

communicating with other peripheral or microcontroller devices. These peripheral

devices may be Serial EEPROMs, shift registers, display drivers, A/D converters,

etc. The MSSP module can operate in one of two modes:

• Serial Peripheral Interface (SPI)

• Inter-Integrated Circuit TM (I2CTM)

- Full Master mode

- Slave mode (with general address call).

Page 22: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

22

The I2C interface supports the following modes in hardware:

• Master mode

• Multi-Master mode

• Slave mode

TABLE 4.1: PIC PIN DESCRIPTION

Page 23: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

23

Page 24: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

24

4.4GSM SIM-900

SIM Com offers this information as a service to its customers, to support

application and engineering efforts that use the products designed by SIM Com.

the information provided is based upon requirements specifically provided to SIM

Com by the customers. SIM Com has not undertaken any independent search for

additional relevant information, including any information that may be in the

customer’s possession. Furthermore, system validation of this product designed by

SIM Com within a larger electronic system remains the responsibility of the

customer or the customer’s system integrator. All specifications supplied herein are

subject to change

POWER SUPPLY DESIGN

The power supply of SIM900 is from a single voltage source of VBAT

which normal operating range is form 3.4V to 4.5V. The peak working current can

rise up to 2A in maximum power transmitting period, which will cause a voltage

drop. So the power supply must be able to provide sufficient peak current, if not,

the voltage may drop lower than 3.4V, and the module will auto power down.

Typically, VBAT can be set to 4V. SIM900 can be used in a wide range of

application; the power supply design is deeply depending on the power source.

When the input is a 5V/2A adapter, a LDO linear regulator can be used in the

design because the drop out between input and output is not so big. Figure 1 is the

recommended circuit with MIC29302. Please also pay attention to the heat

dissipation of the LDO. Usually, pouring a copper plane on the PCB is an effective

way to the heat sink problem of the power IC.

Page 25: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

25

UART INTERFACE DESIGN

SIM900 integrates two UART port, one is Serial Port, and the other is

Debug Port. Serial port is for AT command with the MCU while Debug port is for

firmware update and bug trace. It is suggested to connect Debug port to an external

connector for module debug consideration. If hardware flow control is not used,

DCD DSR can be left floating. Please refer to the following figure. DTR can be

used to wake up the module from sleep mode and RI can be used to detect a

coming call or SMS. These two should connect to GPIO of the MCU.

ANTENNA MATCHING CIRCUIT DESIGN:

Because the module is working under 50ohm system in RF part, so, to get

the best RF performance, the SMT module’s load impedance should be tuned to

50ohm. But in fact, the most antenna’s port impedance is not a purely 50ohm,

so, to meet the 50ohm requirement, an additional antenna matching circuit

should be needed. Furthermore, to facilitate the antenna debugging and

certification testing of RF performance, we suggested the customer add a RF test

connector in series between the module’s RF port and the antenna matching

circuit.

Page 26: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

26

SIM CARD INTERFACE

The SIM interface is powered from an internal regulator in the module. Both

1.8V and 3.0V SIM Cards are supported. You can select the 8-pin SIM card

holder. The reference circuit with 8-pin SIM card holder illustrates as following

figure. The 22Ω resistor showed in the following figure should be added in series

on the IO line between the module and the SIM card for matching the impedance.

The SIM peripheral circuit should close to the SIM card socket. The

SIM_PRESENCE pin is used for detecting the SIM card. There is a 100k pull

down resistor in SIM900 module. So the R110 should not be bigger than 10K. If

you don’t use the SIM card detection function, you can let the SIM_PRESENCE

pin open or connect to the GND.

4.5 LCD

FIG 4.5 : 16*2 CHARACTERS LCD

FEATURES

• 5 x 8 dots with cursor

• Built-in controller (KS 0066 or Equivalent)

• + 5V power supply (Also available for + 3V)

Page 27: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

27

• 1/16 duty cycle

• B/L to be driven by pin 1, pin 2 or pin 15, pin 16 or A.K (LED)

• N.V. optional for + 3V power supply

TABLE 4.2: LCD SPECIFICATIONS

Page 28: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

28

4.6 SOLENOID VALVE

When the operation of your system or process requires the remote control of

liquid, air, gases or vacuum, the proper selection of a solenoid valve can make a

significant difference in the final performance of the machine or process. KIP

solenoid valves, operators and manifolds have the versatility and design features to

fulfill all types of applications. Some consideration should be given to the following

design parameters to help you with the selection process:

• Valve Type

• Media

- Temperature

- Lubrication

- Cleanliness

- Isolation

• Flow Rate

• Pressure

• Power Consumption

• Duty Cycle

• Material of Construction

• Electrical Termination

Page 29: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

29

• Porting

• Mounting

4.7 POWER SUPPLY

The ac voltage, typically 220V rms, 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.

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.

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.

Page 30: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

30

BRIDGE RECTIFIER

When four diodes are connected as shown in figure 9, 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 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

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. The current flow through RL is always in

the same direction. In flowing through RL this current develops a voltage. Since

current flows through the load (RL) during both half cycles of the applied voltage,

this bridge rectifier is a full-wave rectifier.

One advantage of a bridge rectifier over a conventional full-wave rectifier is

that with a given transformer the bridge rectifier produces a voltage output that is

nearly twice that of the conventional full-wave circuit.

Page 31: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

31

The maximum voltage that appears across the load resistor is nearly-but

never exceeds-500 v0lts, as result of the small voltage drop across the diode. In the

bridge rectifier shown in view B, the maximum voltage that can be rectified is the

full secondary voltage, which is 1000 volts. Therefore, the peak output voltage

across the load resistor is nearly 1000 volts. With both circuits using the same

transformer, the bridge rectifier circuit produces a higher output voltage than the

conventional full-wave rectifier circuit.

IC VOLTAGE REGULATORS

Voltage regulators comprise a class of widely used ICs. Regulator IC units

contain the circuitry for reference source, comparator amplifier, control device, and

overload protection all in a single IC. IC units provide regulation of either a fixed

positive voltage, a fixed negative voltage, or an adjustably set voltage. The

regulators can be selected for operation with load currents from hundreds of milli

amperes to tens of amperes, corresponding to power ratings from milli watts to

tens of watts.

Two transformers namely, current and potentio transformer. Potentio

transformer is used to step down 230V AC power supply to 12V AC. Bridge

rectifier is used to convert the AC voltage to DC. An Electrolyte capacitor and a

Ceramic capacitor are used to remove the ripples. The 12V supply is directly given

to the driver circuit and solenoid valve. The regulator is used to step down 12V to

5V which is required to operate the PIC,LCD and Telosb Mote.

Page 32: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

32

FIG 4.6 : POWER SUPPLY CIRCUIT DIAGRAM

Page 33: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

33

A fixed three-terminal voltage regulator has an unregulated dc input voltage,

Vi, applied to one input terminal, a regulated dc output voltage, Vo, from a second

terminal, with the third terminal connected to ground.

The series 78 regulators provide fixed positive regulated voltages from 5 to

24 volts. Similarly, the series 79 regulators provide fixed negative regulated

voltages from 5 to 24 volts.

For ICs, microcontroller, LCD --------- 5 volts

For alarm circuit, op-amp, relay circuits ---------- 12 volts

4.8 RELAY

It is used to drive the motor and solenoid valves 1 and 2. It is designed using

npn transistor whose emitter is supplied with 5V and collector is supplied with

12V.The transistor works in common base configuration.The 12V from the

transistor is fed to the relay for its operation.

4.9 CONCLUSION

Thus the hardware circuit met the design requirements that gave the dynamic

range of moisture level in the given soil sample. This circuit operates with the

low operating voltage(5V). The hardware is assisted with the help of Embedded

C using MPLAB software which is programmed in PIC controller for practical

implementation.

Page 34: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

34

CHAPTER 5

SOFTWARE DESCRIPTION

5.1 INTRODUCTION

The software was programmed in Embedded C which is preferred because

of its wide popularity, ease of use compared to assembly language, good

programming constructs and high reference sources. It ensures high performance

and offers very good hardware integration due to its close relationship with

assembly language programming and other high level language programming by

providing raw programming power of assembly language and the understandable

programming style of high level languages.

5.2 Development support

MPLAB is a compiler for the Microchip Technology incorporated

PIC 12/16/17 Microcontroller families. The MPLAB IDE offers a full featured

Macro assembler, a ‘C’ compiler and its simulator. A latest version of HI-tech

PIC C v8 01PL3 compiler is also used to compile the source code written in

Embedded C.

Program was initially done and tested in assembly language using MPLAB

version 5.11 before converting into ‘Embedded C’. This gave the basic

understanding of the initialization of the microcontroller ports and registers.

Page 35: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

35

5.3 ALGORITHM

Step 1: Start the program

Step 2: Initialize the bits for solenoid valve 1 and 2 and motor

Step 3: Store the number used by GSM for receiving messages using

a 3*11 array.

Step 4: Initialize the irrigation and current sensor values to zero.

Step 5: Set the Global Interrupt Enable(GIE) bit to 1.

Step 6: Initially the LCD displays the title of the project.

Step 7: After a short delay of 1000ms as programmed, the irrigation

percentage, the status of solenoid valves and the motor are

displayed as 00% and OFF.

Step 8: If the irrigation percentage goes below 20% after observation

through the Telosb Mote, S1 and M1 gets automatically ON.

Step 9: If the irrigation percentage goes above 20%, both solenoid

valves and the motor gets OFF.

Step 10: A variable msg is initialized to represent the motor overload

or normal condition.

Step 11: Now, Solenoid 1=1,Solenoid 2=0 and Motor =1 with a delay

of 1000ms. If these conditions are true, msg is assigned the

value 2 .

Step 12: In this case the irrigation percentage, status of the solenoid

valves and the motor is displayed.

Step 13: If msg=1, the LCD displays as OVERLOAD with the status

of the solenoid valves and the motor as OFF.

Page 36: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

36

Step 14: In case of motor overload the message is displayed using

LCD and the working stops.

Step 15: In case of normal condition, if manual assistance is required,

message through GSM turns S2 ON.

Step 16: If overload occurs, the motor can be turned OFFmanually.

Step 17: End the program.

5.4 CONCLUSION

Thus the software module was developed for the automated irrigation

system and tested successfully. Manual test mode was entirely implemented by

software; hence the system continues to work in an alternative mode even if there

is any hardware failure until it is rectified. By suitably making changes in the

compiler option, the same program can be easily ported to different

microcontrollers by making little or no changes to the source code is an added

feature of using Embedded C.

Page 37: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

37

CHAPTER 6

CONCLUSION

The automated irrigation system implemented was found to be feasible and

cost effective for optimizing water resources for agricultural production. This

irrigation system allows cultivation in places with water scarcity thereby

improving sustainability. The automated irrigation system developed proves that

the use of water can be diminished for a given amount of fresh biomass production.

The use of solar power in this irrigation system is pertinent and significantly

important for organic crops and other agricultural products that are geographically

isolated, where the investment in electric power supply would be expensive. The

irrigation system can be adjusted to a variety of specific crop needs and requires

minimum maintenance.

The modular configuration of the automated irrigation system allows it to be

scaled up for larger greenhouses or open fields. In addition, other applications such

as temperature monitoring in compost production can be easily implemented. The

Internet controlled duplex communication system provides a powerful

decisionmaking device concept for adaptation to several cultivation scenarios.

Furthermore, the Internet link allows the supervision through mobile

telecommunication devices, such as a smartphone. Besides the monetary savings in

water use, the importance of the preservation of this natural resource justify the use

of this kind of irrigation systems. Thus wireless sensor network has overcome the

shortcomings of the existing irrigation system.

Page 38: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

38

APPENDIX

TELOSB MOTE SPECIFICATIONS:

Page 39: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

39

REFERENCES

Paper on Automatic irrigation based on soil mositure, EDIS University of

Florida

Walker, W.R. and Skogerboe, G.V. 2007. Surface Irrigation: Theory and

Practice. Prentice-Hall, Englewood Cliffs, New Jersey. 386p

Stringham, G.E. and Keller, J. 2010. Surge flow for automatic irrigation.

Proc. ASCE Irrigation and Drainage Specialty Conference, Albuquerque,

New Mexico.

G. López, V. Custodio, and J. I. Moreno, “LOBIN: E-textile and wireless-

sensor-network-based platform for healthcare monitoring in future hospital

environments,” IEEE Trans. Inf. Technol. Biomed., vol. 14, no. 6, pp. 1446–

1458, Nov. 2010.

] I. F. Akyildiz, W. Su, Y. Sankarasubramaniam, and E. Cayirci, “A survey

on sensor networks,” IEEE Commun. Mag., vol. 40, no. 8, pp. 104–112,

Aug. 2008.

W. K. G. Seah, Z. A. Eu, and H.-P. Tan, “Wireless sensor networks powered

by ambient energy harvesting (WSN-HEAP)—Survey and challenges,” in

Proc. 1st Int. Conf. Wireless VITAE, May 2009, pp. 1–5.

D. D. Chaudhary, S. P. Nayse, and L. M. Waghmare, “Application of

wireless sensor networks for green house parameters control in precision

agriculture,” Int. J. Wireless Mobile Netw., vol. 3, no. 1, pp. 140–149, Feb.

2011.

Page 40: CHAPTER 1 INTRODUCTION - · PDF fileapplications of WSNs range from distributed monitoring systems to smart ... BLOCK DIAGRAM ... our watering system as it can easily be deployed everywhere

40