Sei sulla pagina 1di 46

AUTOMATIC WEED DETECTION

SYSTEM AND SMART HERBICIDE


SPRAYER ROBOT FOR CORN
FIELDS

A PROJECT REPORT

Submitted By

B.VIJAY ANAND 1010104129

G.VIJAY PRAKASH 1010104127

R.VIJAYA RAJA 1010104722

C.SENTHIL KUMAR 1010104713

in partial fulfilment for the award of the degree


of
BACHELOR OF ENGINEERING
IN
ELECTRICAL AND ELECTRONICS ENGINEERING

SONA COLLEGE OF TECHNOLOGY, SALEM


(AUTONOMOUS)
ANNA UNIVERSITY::CHENNAI 600 025

MAY 2014

I
SONA COLLEGE OF TECHNOLOGY, SALEM
(AUTONOMOUS)

BONAFIDE CERTIFICATE

Certified that this project report “AUTOMATIC WEED DETECTION

SYSTEM AND SMART HERBICIDE SPRAYER ROBOT FOR CORN

FIELDS” is the bonafide work of “B.VIJAYANAND, G.VIJAY PRAKASH,

R.VIJAYA RAJA, C.SENTHIL KUMAR” who carried out the project work

under my supervision.

SIGNATURE OF HOD SIGNATURE

OF SUPERVISOR

Dr.C.Easwarlal B.E., M.Sc.(Engg), Ph.D. Mr.G.Suresh M.E., (Ph.D)

Professor & Head Assistant Professor

Department of EEE Department of EEE

Sona College of Technology Sona College of Technology

Salem-636 005 Salem-636 005

Submitted for the Project Viva-Voce Examination held on

INTERNAL EXAMINER EXTERNAL EXAMINER


ACKNOWLEDGEMENT

The satisfaction and euphoria that accompany the successful completion

of any task would be incomplete without the mentioning of the people whose

constant guidance and encouragement made it possible. We take pleasure in

presenting before you, our project, which is result of studied blend of both

research and knowledge.

We are extremely greatful to Dr.V.Jayaprakash Ph.D. Principal, Sona

College of Technology for having given us a golden opportunity to embark on

this project.

We are deeply obliged to Dr.C.Easwarlal B.E., M.Sc.(Engg), Ph.D.

Head of the Department of Electrical & Electronics Engineering for his concern

and implication during the project course.

We express our earnest gratitude to our internal guide, Assistant

Professor Mr.G.Suresh M.E., (Ph.D) Department of EEE, our project guide,

for his constant support, encouragement and guidance. We are greatful for his

cooperation and his valuable suggestions.

We are also thankful to the Teaching and Non-teaching staffs of our

department for providing us the technical support for our project.

Finally, we express our gratitude to all other members who are involved

either directly or indirectly for the completion of our project.


ABSTRACT

Farmer needs alternatives for weed control due to the desire to reduce

chemicals used in farming. However, conventional mechanical cultivation

cannot selectively remove weeds and there are no selective herbicides for some

weed situation. Since hand labour is costly, an automated weed control system

could be feasible. A robotic weed control system can also reduce or eliminate

the need for chemicals. Many attempts have been made to develop efficient

algorithms for recognition and classification. Currently research is going on for

developing new machinevision algorithms for automatic recognition and

classification of many divers object groups. In this paper an algorithm is

developed for automatic spray control system. The algorithm is based on

erosion followed by dilation segmentation algorithm. This algorithm can detect

weeds and also classify it. Currently the algorithm is tested on two types of

weeds i.e. broad and narrow. The developed algorithm has been tested on these

two types of weeds in the lab, which gives a very reliable performance. The

algorithm is applied on 240 images stored in a database in the lab, of which 100

images were taken from broad leaf weeds and 100 were taken from narrow leaf

weeds, and the remaining 40 were taken from no or little weeds. The result

showed over 89% results.


TABLE OF CONTENTS

CHAPTER
TITLE PG.NO
NO
ABSTRACT
LIST OF FIGURES

1 INTRODUCTION 1
2 BLOCK DIAGRAM 2
3 BLOCK DIAGRAM DESCRIPTION
3.1 8051 MICROCONTROLLERS
3.1.1 Power supply 5
3.1.2 Pin out Description 5
3.1.3 Input / Output Ports 8
3.1.4 Input / Output pin 9
3.1.5 Memory Organization 12
3.1.6 Memory Expansion 13
3.2 WEB CAMERA 17
3.3 MAX 232
3.3.1 Circuit 23
3.4 DRIVER CIRCUIT
3.4.1 Features 24
3.5 DC MOTOR 25
4 NUMBER OF UNITS ( MODULES)
4.1 Power Supply Unit 26
4.2 Microcontrollers Unit 26
4.3 Sensor Unit 27
4.4 communication Unit 27
4.5 Relay Unit 27
4.6 Software Unit 28

5 SOFTWARE PROGRAMMING
5.1 LCR 31
5.2 Serial T×r&R×r Programming 34
5.3 .NET 35
6 PROPOSED SYSTEM 37
7 CONCLUSION 38
8 REFERENCES 39
LIST OF FIGURES

FIGURE TITLE PAGE


NO. NO.
2.1 Block diagram of project 2

3.1 Pin diagram and Architecture 4

3.2 Circuit diagram of Power supply 5

3.3 Circuit diagram of input/output port 8

3.4 Schematic diagram of I/O pin 9

3.5 Schematic diagram of Output pin 9

3.6 Schematic diagram of Input pin 10

3.7 Function of Port 0 (1) 10

3.8 Function of Port 0 (2) 11

3.9 Block diagram of program memory 13

3.10 Handling of external memory by microcontroller 14


using EA pin
3.11 Circuit diagram of memory expansion 16

3.12 Web camera image 18

3.13 Pin diagram of Max232 22

3.14 Circuit diagram of Max232 23

3.15 Pin diagram of ULN2003 24

3.16 DC Motor image 25


CHAPTER 1

INTRODUCTION

A vision-based guidance method is presented to guide a robot platform


which is designed independently to drive through the crops in a field according
to the design concept of open architecture. Then, the offset and heading angle of
the robot platform are detected in real time to guide the platform on the basis of
recognition of a crop using machine vision. This project is basically developed
to implement a number of agricultural production in many countries, such as
picking, harvesting, weeding, pruning, planting, grafting, agricultural
classification etc.,
CHAPTER 2

BLOCK DIAGRAM

Power
Supply

PC with MATLAB

Recognition RELAY
Driver
R
8051
Authentication O
Micro
MAX 232
B
Controller
O
Processing RELAY
Driver T

Web camera Plant

Fig.2.1 Block diagram of project


CHAPTER 3

BLOCK DIAGRAM DESCRIPTION

3.1 8051 MICROCONTROLLER

Microcontroller manufacturers have been competing for a long time for


attracting choosy customers and every couple of days a new chip with a higher
operating frequency, more memory and upgraded A/D converters appeared on
the market.

However, most of them had the same or at least very similar architecture known
in the world of microcontrollers as “8051 compatible”. What is all this about?

The whole story has its beginnings in the far 80s when Intel launched the first
series of microcontrollers called the MCS 051. Even though these
microcontrollers had quite modest features in comparison to the new ones, they
conquered the world very soon and became a standard for what nowadays is
called the microcontroller.

The main reason for their great success and popularity is a skillfully chosen
configuration which satisfies different needs of a large number of users
allowing at the same time constant expansions (refers to the new types of
microcontrollers). Besides, the software has been developed in great extend in
the meantime, and it simply was not profitable to change anything in the
microcontroller’s basic core. This is the reason for having a great number of
various microcontrollers which basically are solely upgraded versions of the
8051 family.
Fig.3.1 Pin diagram and architecture

As seen in figure above, the 8051 microcontroller has nothing impressive in


appearance:

 4 Kb of ROM is not much at all.


 128Kb of RAM (including SFRs) satisfies the user's basic needs.
 4 ports having in total of 32 input/output lines are in most cases sufficient
to make all necessary connections to peripheral environment.

The whole configuration is obviously thought of as to satisfy the needs of most


programmers working on development of automation devices. One of its
advantages is that nothing is missing and nothing is too much. In other words, it
is created exactly in accordance to the average user‘s taste and needs. Another
advantages are RAM organization, the operation of Central Processor Unit
(CPU) and ports which completely use all recourses and enable further upgrade.
3.1.1 Power Supply

This section describes how to generate +5V DC power supply

Fig.3.2 Circuit diagram of power supply

The power supply section is the important one. It should deliver constant output
regulated power supply for successful working of the project. A 0-12V/1 mA
transformer is used for this purpose. The primary of this transformer is
connected in to main supply through on/off switch& fuse for protecting from
overload and short circuit protection. The secondary is connected to the diodes
to convert 12V AC to 12V DC voltage. And filtered by the capacitors, which is
further regulated to +5v, by using IC 7805.

3.1.2 Pin out Description

Pins 1-8: Port 1 Each of these pins can be configured as an input or an output.

Pin 9: RS A logic one on this pin disables the microcontroller and clears the
contents of most registers. In other words, the positive voltage on this pin resets
the microcontroller. By applying logic zero to this pin, the program starts
execution from the beginning.
Pins10-17: Port 3 Similar to port 1, each of these pins can serve as general input
or output. Besides, all of them have alternative functions:

Pin 10: RXD Serial asynchronous communication input or Serial synchronous


communication output.

Pin 11: TXD Serial asynchronous communication output or Serial synchronous


communication clock output.

Pin 12: INT0 Interrupt 0 input.

Pin 13: INT1 Interrupt 1 input.

Pin 14: T0 Counter 0 clock input.

Pin 15: T1 Counter 1 clock input.

Pin 16: WR Write to external (additional) RAM.

Pin 17: RD Read from external RAM.

Pin 18, 19: X2, X1 Internal oscillator input and output. A quartz crystal which
specifies operating frequency is usually connected to these pins. Instead of it,
miniature ceramics resonators can also be used for frequency stability. Later
versions of microcontrollers operate at a frequency of 0 Hz up to over 50 Hz.

Pin 20: GND Ground.

Pin 21-28: Port 2If there is no intention to use external memory then these port
pins are configured as general inputs/outputs. In case external memory is used,
the higher address byte, i.e. addresses A8-A15 will appear on this port. Even
though memory with capacity of 64Kb is not used, which means that not all
eight port bits are used for its addressing, the rest of them are not available as
inputs/outputs.

Pin 29: PSEN If external ROM is used for storing program then a logic zero (0)
appears on it every time the microcontroller reads a byte from memory.

Pin 30: ALE Prior to reading from external memory, the microcontroller puts
the lower address byte (A0-A7) on P0 and activates the ALE output. After
receiving signal from the ALE pin, the external register (usually 74HCT373 or
74HCT375 add-on chip) memorizes the state of P0 and uses it as a memory chip
address. Immediately after that, the ALU pin is returned its previous logic state
and P0 is now used as a Data Bus. As seen, port data multiplexing is performed
by means of only one additional (and cheap) integrated circuit. In other words,
this port is used for both data and address transmission.

Pin 31: EA By applying logic zero to this pin, P2 and P3 are used for data and
address transmission with no regard to whether there is internal memory or not.
It means that even there is a program written to the microcontroller, it will not
be executed. Instead, the program written to external ROM will be executed. By
applying logic one to the EA pin, the microcontroller will use both memories,
first internal then external (if exists).

Pin 32-39: Port 0 Similar to P2, if external memory is not used, these pins can
be used as general inputs/outputs. Otherwise, P0 is configured as address output
(A0-A7) when the ALE pin is driven high (1) or as data output (Data Bus) when
the ALE pin is driven low (0).

Pin 40: VCC +5V power supply.


3.1.3 Input and Output ports

All 8051 microcontrollers have 4 I/O ports each comprising 8 bits which
can be configured as inputs or outputs. Accordingly, in total of 32 input/output
pins enabling the microcontroller to be connected to peripheral devices are
available for use.

Pin configuration, i.e. whether it is to be configured as an input (1) or an output


(0), depends on its logic state. In order to configure a microcontroller pin as an
input, it is necessary to apply a logic zero (0) to appropriate I/O port bit. In this
case, voltage level on appropriate pin will be 0.

Similarly, in order to configure a microcontroller pin as an input, it is necessary


to apply a logic one (1) to appropriate port. In this case, voltage level on
appropriate pin will be 5V (as is the case with any TTL input). This may seem
confusing but don't loose your patience. It all becomes clear after studying
simple electronic circuits connected to an I/O pin.

Fig.3.3 Circuit diagram of input/output port


Fig.3.4 Schematic diagram of I/O pin

3.1.4 Input/Output pin

Figure above illustrates a simplified schematic of all circuits within the


microcontroller connected to one of its pins. It refers to all the pins except those
of the P0 port which do not have pull-up resistors built-in.

Fig.3.5 Schematic diagram of output pin

Output pin

Logic zero (0) is applied to a bit of the P register. The output FE


transistor is turned on, thus connecting the appropriate pin to ground.
Fig.3.6 Schematic diagram of input pin

Input pin

Logic one (1) is applied to a bit of the P register. The output FE transistor
is turned off and the appropriate pin remains connected to the power supply
voltage over a pull-up resistor of high resistance.

Port 0

The P0 port is characterized by two functions. If external memory is used


then the lower address byte (addresses A0-A7) is applied on it. The other
function is expressed when it is configured as an output. Unlike other ports
consisting of pins with built-in pull-up resistor connected by its end to 5 V
power supply, pins of this port have this resistor left out. This apparently small
difference has its consequences:

Fig.3.7 Function of Port 0 (1)


If any pin of this port is configured as an input then it acts as if it “floats”.
Such an input has unlimited input resistance and undetermined potential.

Fig.3.8 Function of Port 0 (2)

When the pin is configured as an output, it acts as an “open drain”. By


applying logic 0 to a port bit, the appropriate pin will be connected to ground
(0V). By applying logic 1, the external output will keep on “floating”. In order
to apply logic 1 (5V) on this output pin, it is necessary to built in an external
pull-up resistor.

Port 1

P1 is a true I/O port, because it doesn't have any alternative functions as


is the case with P0, but can be configured as general I/O only. It has a pull-up
resistor built-in and is completely compatible with TTL circuits.

Port 2

P2 acts similarly to P0 when external memory is used. Pins of this port


occupy addresses intended for external memory chip. This time it is about the
higher address byte with addresses A8-A15. When no memory is added, this
port can be used as a general input/output port showing features similar to P1.
Port 3

All port pins can be used as general I/O, but they also have an alternative
function. In order to use these alternative functions, a logic one (1) must be
applied to appropriate bit of the P3 register. In terms of hardware, this port is
similar to P0, with the difference that its pins have a pull-up resistor built-in.

Pin's Current limitations

When configured as outputs (logic zero (0)), single port pins can receive
a current of 10mA. If all 8 bits of a port are active, a total current must be
limited to 15mA (port P0: 26mA). If all ports (32 bits) are active, total
maximum current must be limited to 71mA. When these pins are configured as
inputs (logic 1), built-in pull-up resistors provide very weak current, but strong
enough to activate up to 4 TTL inputs of LS series.

3.1.5 Memory Organization

The 8051 has two types of memory and these are Program Memory and
Data Memory. Program Memory (ROM) is used to permanently save the
program being executed, while Data Memory (RAM) is used for temporarily
storing data and intermediate results created and used during the operation of
the microcontroller. Depending on the model in use (we are still talking about
the 8051 microcontroller family in general) at most a few Kb of ROM and 128
or 256 bytes of RAM is used.

All 8051 microcontrollers have a 16-bit addressing bus and are capable of
addressing 64 kb memory. It is neither a mistake nor a big ambition of
engineers who were working on basic core development. It is a matter of smart
memory organization which makes these microcontrollers a real
“programmers”.
Program Memory

The first models of the 8051 microcontroller family did not have internal
program memory. It was added as an external separate chip. These models are
recognizable by their label beginning with 803 (for example 8031 or 8032). All
later models have a few Kbyte ROM embedded. Even though such an amount
of memory is sufficient for writing most of the programs, there are situations
when it is necessary to use additional memory as well. A typical example is so
called lookup tables. They are used in cases when equations describing some
processes are too complicated or when there is no time for solving them. In such
cases all necessary estimates and approximates are executed in advance and the
final results are put in the tables (similar to logarithmic tables).

Fig.3.9 Block diagram of program memory

How does the microcontroller handle external memory depend on the EA pin
logic state?
Fig.3.10 Handling of external memory by microcontroller using EA pin

EA=0 In this case, the microcontroller completely ignores internal program


memory and executes only the program stored in external memory.

EA=1 In this case, the microcontroller executes first the program from built-in
ROM, then the program stored in external memory.

In both cases, P0 and P2 are not available for use since being used for data and
address transmission. Besides, the ALE and PSEN pins are also used.

Data Memory

As already mentioned, Data Memory is used for temporarily storing data


and intermediate results created and used during the operation of the
microcontroller. Besides, RAM memory built in the 8051 family includes many
registers such as hardware counters and timers, input/output ports, serial data
buffers etc. The previous models had 256 RAM locations, while for the later
models this number was incremented by additional 128 registers. However, the
first 256 memory locations (addresses 0-FFh) are the heart of memory common
to all the models belonging to the 8051 family. Locations available to the user
occupy memory space with addresses 0-7Fh, i.e. first 128 registers. This part of
RAM is divided in several blocks.

The first block consists of 4 banks each including 8 registers denoted by


R0-R7. Prior to accessing any of these registers, it is necessary to select the
bank containing it. The next memory block (address 20h-2Fh) is bit-
addressable, which means that each bit has its own address (0-7Fh). Since there
are 16 such registers, this block contains in total of 128 bits with separate
addresses (address of bit 0 of the 20h byte is 0, while address of bit 7 of the 2Fh
byte is 7Fh). The third group of registers occupy addresses 2Fh-7Fh, i.e. 80
locations, and does not have any special functions or features.

Additional RAM

In order to satisfy the programmers’ constant hunger for Data Memory,


the manufacturers decided to embed an additional memory block of 128
locations into the latest versions of the 8051 microcontrollers. However, it’s not
as simple as it seems to be… The problem is that electronics performing
addressing has 1 byte (8 bits) on disposal and is capable of reaching only the
first 256 locations, therefore. In order to keep already existing 8-bit architecture
and compatibility with other existing models a small trick was done.

What does it mean? It means that additional memory block shares the
same addresses with locations intended for the SFRs (80h- FFh). In order to
differentiate between these two physically separated memory spaces, different
ways of addressing are used. The SFRs memory locations are accessed by direct
addressing, while additional RAM memory locations are accessed by indirect
addressing.

3.1.6 Memory expansion

In case memory (RAM or ROM) built in the microcontroller is not


sufficient, it is possible to add two external memory chips with capacity of
64Kb each. P2 and P3 I/O ports are used for their addressing and data
transmission.

Fig.3.11 Circuit diagram of memory expansion

From the user’s point of view, everything works quite simply when
properly connected because most operations are performed by the
microcontroller itself. The 8051 microcontroller has two pins for data read
RD#(P3.7) and PSEN#. The first one is used for reading data from external data
memory (RAM), while the other is used for reading data from external program
memory (ROM). Both pins are active low. A typical example of memory
expansion by adding RAM and ROM chips (Hardware architecture), is shown
in figure above.

Even though additional memory is rarely used with the latest versions of the
microcontrollers, we will describe in short what happens when memory chips
are connected according to the previous schematic. The whole process
described below is performed automatically.

 When the program during execution encounters an instruction which


resides in external memory (ROM), the microcontroller will activate its
control output ALE and set the first 8 bits of address (A0-A7) on P0. IC
circuit 74HCT573 passes the first 8 bits to memory address pins.
 A signal on the ALE pin latches the IC circuit 74HCT573 and
immediately afterwards 8 higher bits of address (A8-A15) appear on the
port. In this way, a desired location of additional program memory is
addressed. It is left over to read its content.
 Port P0 pins are configured as inputs, the PSEN pin is activated and the
microcontroller reads from memory chip.

Similar occurs when it is necessary to read location from external RAM.


Addressing is performed in the same way, while read and write are performed
via signals appearing on the control outputs RD (is short for read) or WR (is
short for write).

3.2 WEB CAMERA

A webcam is a video camera that feeds its image in real time to


a computer or computer network. Unlike an IP camera (which uses a direct
connection using Ethernet or Wi-Fi), a webcam is generally connected by
a USB cable, FireWire cable, or similar cable. Their most popular use is the
establishment of video links, permitting computers to act
as videophones or videoconference stations. The common use as a video
camera for the World Wide Web gave the webcam its name. Other popular uses
include security surveillance, computer vision, video broadcasting, and for
recording social videos. Webcams are known for their low manufacturing cost
and flexibility, making them the lowest cost form of video telephony. They have
also become a source of security and privacy issues, as some built-in webcams
can be remotely activated via spyware.

Fig.3.12 Web camera image

Childcare webcast video monitoring

Childcare webcams can offer improved security, communication, and


increased service value in daycare facilities. According to researchers and
industry leaders, as many as 100 childcare facilities add Internet viewing
systems each month, and the total number of centers with some form of Internet
monitoring runs into the thousands. In the United States, private services have
been offering dedicated webcasting systems to centers nationwide for several
years as of 2010.
Video calling and videoconferencing

As webcam capabilities have been added to instant messaging, text chat


services such as AOL Instant Messenger, and VoIP services such as Skype, one-
to-one live video communication over the Internet has now reached millions of
mainstream PC users worldwide. Improved video quality has helped webcams
encroach on traditional video conferencing systems. New features such as
automatic lighting controls, real-time enhancements (retouching, wrinkle
smoothing and vertical stretch), automatic face tracking and autofocus, assist
users by providing substantial ease-of-use, further increasing the popularity of
webcams.

Webcam features and performance can vary by program, computer


operating system, and also by the computer's processor capabilities. Video
calling support has also been added to several popular instant messaging
programs.

Video security

Webcams are also used as security cameras. Software is available to


allow PC-connected cameras to watch for movement and sound, recording both
when they are detected. These recordings can then be saved to the computer, e-
mailed, or uploaded to the Internet. In one well-publicized case, a computer e-
mailed images of the burglar during the theft of the computer, enabling the
owner to give police a clear picture of the burglar's face even after the computer
had been stolen.

Recently webcam privacy software has been introduced by such


companies such as Stop Being Watched or Webcam lock. The software exposes
access to a webcam and prompts the user to allow or deny access by showing
what program is trying to access the webcam. Allowing the user to accept a
trusted program the user recognizes or terminate the attempt immediately. Other
companies on the market manufacture and sell sliding lens covers that allow
users to retrofit the computer and close access to the camera lens.

In December 2011 Russia announced that 290,000 Webcams would be


installed in 90,000 polling stations to monitor the Russian presidential election,
2012.

Input control devices

Special software can use the video stream from a webcam to assist or
enhance a user's control of applications and games. Video features, including
faces, shapes, models and colours can be observed and tracked to produce a
corresponding form of control. For example, the position of a single light source
can be tracked and used to emulate a mouse pointer; a head mounted light
would enable hands-free computing and would greatly improve computer
accessibility. This can be applied to games, providing additional control,
improved interactivity and immersiveness.

Free Track is a free webcam motion tracking application for Microsoft


Windows that can track a special head mounted model in up to six degrees of
freedom and output data to mouse, keyboard, joystick and Free Track-supported
games By removing the IR filter of the webcam, IR LEDs can be used, which
has the advantage of being invisible to the naked eye, removing a distraction
from the user. Track IR is a commercial version of this technology.

The Eye Toy for the PlayStation 2, PlayStation Eye for the PlayStation 3,
and the Xbox Live Vision camera and Kinect motion sensor for the Xbox
360 and are colour digital cameras that have been used as control input devices
by some games.

Small webcam-based PC games are available as either standalone


executables or inside web browser windows using Adobe Flash.
Webcams typically include a lens, an image sensor, support electronics,
and may also include a microphone for sound. Various lenses are available, the
most common in consumer-grade webcams being a plastic lens that can be
screwed in and out to focus the camera. Fixed focus lenses, which have no
provision for adjustment, are also available. As a camera system's depth of
field is greater for small image formats and is greater for lenses with a large f-
number (small aperture), the systems used in webcams have a sufficiently large
depth of field that the use of a fixed focus lens does not impact image sharpness
to a great extent.

Image sensors can be CMOS or CCD, the former being dominant for
low-cost cameras, but CCD cameras do not necessarily outperform CMOS-
based cameras in the low cost price range. Most consumer webcams are capable
of providing VGA resolution video at a frame rate of 30 frames per second.
Many newer devices can produce video in multi-megapixel resolutions, and a
few can run at high frame rates such as the PlayStation Eye, which can
produce 320×240 video at 120 frames per second.

Support electronics read the image from the sensor and transmit it to the
host computer. The camera pictured to the right, for example, uses a Sonix
SN9C101 to transmit its image over USB. Typically, each frame is transmitted
uncompressed in RGB or YUV or compressed as JPEG. Some cameras, such
as mobile phone cameras, use a CMOS sensor with supporting electronics "on
die", i.e. the sensor and the support electronics are built on a single silicon
chip to save space and manufacturing costs. Most webcams feature built-
in microphones to make video calling and videoconferencing more convenient.

The USB video device class (UVC) specification allows for


interconnectivity of webcams to computers without the need for proprietary
device drivers. Microsoft Windows XP SP2, Linux and Mac OS X (since
October 2005) have UVC support built in and do not require extra device
drivers, although they are often installed to add additional features.

3.3 MAX 232


The MAX232 is a dual driver/receiver that includes a capacitive voltage
generator to supply RS 232 voltage levels from a single 5v supply. Each
receiver converts RS-232 to 5v TTL/CMOS levels. Each driver converts
TLL/CMOS input levels into EIA-232 levels. The P3_0 (RX) and P3_1 (TX)
pin of controller is connected to the max 232 driver and the TX and RX pin of
max 232 is connected to the GSM modem or PC.

Fig.3.13 Pin diagram of max232

In this circuit the microcontroller transmitter pin is connected in the


MAX232 T2IN pin which converts input 5v TTL/CMOS level to RS232 level.
Then T2OUT pin is connected to reviver pin of 9 pin D type serial connector
which is directly connected to PC.In PC the transmitting data is given to R2IN
of MAX232 through transmitting pin of 9 pin D type connector which converts
the RS232 level to 5v TTL/CMOS level.
The R2OUT pin is connected to receiver pin of the microcontroller.
Likewise the data is transmitted and received between the microcontroller and
PC or other device vice versa.

3.3.1 Circuit Diagram

Fig.3.14 Circuit diagram of max232

3.4 DRIVER CIRCUIT

The ULN2003 is a monolithic high voltage and high current Darlington


transistor arrays. It consists of seven NPN darlington pairs that features high-
voltage outputs with common-cathode clamp diode for switching inductive
loads. The collector-current rating of a single Darlington pair is 500mA. The
darlington pairs may be paralleled for higher current capability. Applications
include relay drivers, hammer drivers, lamp drivers, display drivers (LED gas
discharge), line drivers, and logic buffers.

The ULN2003 has a 2.7kW series base resistor for each Darlington pair
for operation directly with TTL or 5V CMOS devices.

3.4.1 Features

* 500mA rated collector current (Single output)

* High-voltage outputs: 50V

* Inputs compatible with various types of logic.

* Relay driver application

Fig.3.15 Pin diagram of ULN2003

The ULN2003 series input resistors selected for operation directly with 5 V
TTL or CMOS. These devices will handle numerous interface needs particularly
those beyond the capabilities of standard logic buffers. The ULN2003 have
series input resistors for operation directly from 6 V to 15 VCMOS or PMOS
logic outputs. The ULN2003 is the standard Darlington arrays. The outputs are
capable of sinking 500mA and will withstand at least 50 V in the OFF state.
Outputs may be paralleled for higher load current capability. The
ULx2823A/LW and ULx2824ALW will withstand 95 V in the OFF state.

These Darlington arrays are furnished in 18-pin dual in-line plastic


packages (suffix ‘A’) or 18-lead small-outline plastic packages (suffix ‘LW’).
All devices are pinned with outputs opposite inputs to facilitate ease of circuit
board layout. Prefix ‘ULN’ devices are rated for operation over the temperature
range of -20 C to +85 C; prefix ‘ULQ’ devices are rated for operation to -
40 C.

3.5 DC MOTOR

A DC motor is designed to run on DC electric power. Two examples of


pure DC designs are Michael Faraday's homopolar motor (which is uncommon),
and the ball bearing motor, which is (so far) a novelty. By far the most common
DC motor types are the brushed and brushless types, which use internal and
external commutation respectively to create an oscillating AC current from the
DC source—so they are not purely DC machines in a strict sense. We in our
project are using brushed DC Motor, which will operate in the ratings of 12v
DC 0.6A which will drive the flywheels in order to make the robot move.

Fig.3.16 DC motor image


CHAPTER 4

NUMBER OF UNITS (MODULES)

4.1 POWER SUPPLY UNIT

The supply of 5V DC is given to the system which is converted from


230V AC supply. Firstly, the step down transformer will be used here for
converting the 230V AC into 12V AC. The microcontroller will support only
the DC supply, so the AC supply will be converted into DC using the bridge
rectifier. The output of the rectifier will have ripples so we are using the 2200uf
capacitor for filtering those ripples. The output from the filter is given to the
7805 voltage regulator which will convert the 12V DC into 5V DC. The output
from the regulator will be filtered using the 1000uf capacitor, so the pure 5V
DC is getting as the output from the power supply unit. Here we are using the
8051 microcontroller which will be capable of getting the supply of 5V DC so
we have to convert the 230V AC supply into 5V DC supply.

4.2 MICROCONTROLLER UNIT

PIC16F877A Microcontroller

In this project we are using the PIC16F877 microcontroller for


controlling the devices. The controller is connected with the robot mechanism,
relay, ultrasonic Sensor, LCD, and Zigbee. The controller controls the Robot
mechanism with respect to the ultrasonic range finder and CCTV. Zigbee
modem interfaced with controller which is used to communication between
control section and Robot section. The controller sends the status of system to
the LCD display using data lines.
4.3 SENSOR UNIT
The sensor unit will sense the physical parameters and convert them into
electrical signal and amplify the signal using the amplifiers.

Web Camera
Web camera capture the weed part of the plant and then it send the image
to the processing unit.

4.4 COMMUNICATION UNIT


Communication unit will send or receive the data’s from the
microcontroller.

MAX232
MAX 232 is used as communication modem between camera section and
control section. This converts RS-232 to 5v TTL/CMOS levels. Each driver
converts TLL/CMOS input levels into EIA-232 levels.

4.5 RELAY UNIT


Relay is the switching unit which is used to turn on or turn off the devices
connected to it.

DC motor
Here the DC motor is considered as the robot mechanism motors which
are connected with the relay circuit.
In this project the relay circuit is used to control the motor state and
direction depend upon the controller commands. The robot mechanism consist
of vehicle with sprayer.
4.6 SOFTWARE UNIT
Software is used to compile the coding of the desired application for the
corresponding embedded system.

KEIL µvision
This is the embedded C compiler which is compatible for the 8051
microcontroller to compile the code.
MATLAB
MATLAB is used to process the captured weed plant image with
reference plant image.

GIVEN INPUT AND EXPECTED OUTPUT:

Power Supply Unit:


In the power supply unit the 230V AC is converted into 5V DC.
 Given Input:
230V AC supply is given as the input to the power supply unit.
 Expected Output:
The 5V DC supply is getting as the output from the power supply unit.

Microcontroller Unit:
Microcontroller unit controls the devices connected with ultra sonic
sensor, relay with the DC motor, Zigbee and LCD).
PIC 16F877A Microcontroller:

 Given Input:
In this project the web camera image processing output is converted as
digital and given as the input to the microcontroller. The image processing unit
detect the weed plant in the crop plant using web camera and given to the
microcontroller. Those inputs will be 0s and 1s format.

 Expected Output:
Relay with robot mechanism, is the output devices used in this project.
When the image processing value gets abnormal then the microcontroller will
change the voltage level of the port pins in which those devices are connected to
the robot and spryer. If any weed plant detected by the camera the controller on
the sprayer.

Sensor Unit:
Sensor is a device which will convert the input physical signal into the
electrical signal.

Web camera & image processing unit:

 Given Input:
The weed plant image will be given as input to the web camera.
 Expected Output:
If there any weed plant detected which gives output as 1else 0.

Communication Unit:
Communication devices send or receive the data’s in wire/wireless to the
other section.
MAX232:

 Given Input:
RS232 logic level (-25 V to + 25V) given as input to MAX232.
 Expected Output:
TTL logic level (0-5V) is output of the MAX232.

Relay Unit:
DC motor:
In this project the DC motor is considered as the vehicle motor which is
connected with the relay unit.

 Given Input:
The 12V DC supply is given as the input to the coil of the relay. 5V DC is
given as the triggering input to the transistor for switching purpose. It contains
two terminals; they are normally open, normally closed. In normally open
terminal the supply for the DC motor is given.

 Expected Output:
After giving the input for the relay, the coil gets magnetize and the
magnetic tip will be moved from normally closed to normally open. The DC
motor will be turned off using the relay.
CHAPTER 5

SOFTWARE PROGRAMMING

5.1 LCD

#include <reg51.h>

#define ldata P2

void lcdcmd(unsigned char value);

void lcddata(unsigned char value);

void MSdelay(unsigned int itime);

void lcdstr(unsigned char *s);

void init();

sbit rs = P3^5;

sbit rw = P3^6;

sbit en = P3^7;

void main()

init();

while(1)

{
lcddata('h');

lcddata('a');

lcddata('i');

lcdstr("hello");

while(1);

void init()

lcdcmd(0x38);

lcdcmd(0x0E);

lcdcmd(0x01);

lcdcmd(0x06);

lcdcmd(0x80);

void lcdcmd(unsigned char value)

ldata = value;

rs = 0;

rw = 0;
en = 1;

MSdelay(10);

en = 0;

return;

void lcddata(unsigned char value)

ldata = value;

rs = 1;

rw = 0;

en = 1;

MSdelay(10);

en = 0;

return;

void MSdelay(unsigned int itime)

unsigned int i, j;

for(i=0;i<itime;i++)

for(j=0;j<1275;j++);
}

void lcdstr(unsigned char *s)

while(*s)

lcddata(*s++);

5.2 SERIAL TXR AND RXR PROGRAMMING

unsigned char s;

unsigned char n;

unsigned char *p;

void init1()

TMOD=0X20;

TH1=0XFD;

SCON=0X50;

TR1=1;

void txr(unsigned char n)

{
SBUF=n;

while(TI==0);

TI=0;

int rxr()

while(RI==0);

s=SBUF;

RI=0;

return s;

void ser_txr(unsigned char *p)

while(*p)

txr(*p++);

}
5.3 .NET

Note: Add this code snippet in the second review as matlab code to find weed
or not

snapit=getsnapshot(vid); //Get the snapshot from the camera


imwrite(snapit,'input.jpg'); //Naming the obtained snapshot
R=imread('input.jpg'); //Assigning the image to a variable
red=R(:,:,1);
gre=R(:,:,2);
blu=R(:,:,3);
rm=mean2(red) //Getting the mean value of red in the image
gm=mean2(gre) //Getting the mean value of green in the image
bm=mean2(blu) //Getting the mean value of blue in the image

if (gm>rm) && (gm>bm) //Condition checking


disp('Not Weed') //Statement
ccf=1;
else
disp(Weed') //Statement
ccf=0;
end
CHAPTER 6

PROPOSED SYSTEM

This paper presents, a robot spray the pesticide for a crop in agriculture
fields. A vision-based guidance method is presented to guide the robot platform
driven along crops planted in agriculture field. And the offset and heading angle
of the platform are calculated by detecting the infected crop automatically using
image processing technique in real time. Vision-based guidance is to use camera
to detect and identify crop plants and then to find accurate and stable navigation
information from the binary image.

The captured image are then processed by using image processing


technique, the processed are then converted into voltage levels through MAX
232 level converter and given it to the microcontroller unit. In the
microcontroller unit, c language coding is predefined, according to this coding
the robot which connected to it was controlled. Robot which has several motors
is activated by using the relays. Relays are nothing but electromagnetic switch
which ON/OFF according to the control given by the microcontroller unit.
CHAPTER 7

CONCLUSION

In precision agriculture, weed control and detection has become one of


the most interesting areas. Preventing damaging consequences of chemical
herbicides as well as saving money is some reasons of this trend. This paper
introduces a new weed control robot which is capable of identifying weeds in
corn fields. The future enhancement of this paper is to realize autonomous
wireless controlled Weed Detection System. With the proposed image
processing algorithm 95.89% classification accuracy has been reached. The
other feature of this system is being robustness against different light
conditions, which is the problem of many weed detection systems, as well as
being capable of operating under real-time conditions with the aid of mat lab
software.
CHAPTER 8

REFERENCES

[1] Sanchez, A. 1, Marchant, 1 A. (2000). Fusing 3D information for


crop/weeds classification. Proceedings of the 15th InternationalConference on
Pattern Recognition (ICPR'OO) (Vol. 4, p.4295).Los Alamitos, CA: IEEE
Computer Society Press.

[2] Mallat, S. G. (1989) A theory for multiresolution signal decomposition: the


wavelet representation. IEEE Transactionson Pattern Analysis and Mach. Int.,
11(7), 674--693.

[3] G. Polder et a!. "Weed Detection Using Textural Image Analysis".Plant


Research International, PO Box 16, 6700 AAWageningen, 2007.

[4] U. Ahmad, and N. Kondo, "Weed detection in lawn field".


http://mama.agr.okayama-u.ac.jp/lase/weed . htm ID.M. Woebbecke, G.E.
Meyer, V. B.K, and D.A Mortensen, "Color indices for weed identification
under various soil, residue andlighting conditions". Transactions of the ASAE.
v38. 259-269,I 995a.

[5] V. Zakeri, V. Naghavi, A A Safavi . Developing real-time wave-net models


for non-linear time-varying experimental processes.Computers & Chemical
Engineering 0112009;33:1379-1385.

Potrebbero piacerti anche