Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
A PROJECT REPORT
Submitted By
MAY 2014
I
SONA COLLEGE OF TECHNOLOGY, SALEM
(AUTONOMOUS)
BONAFIDE CERTIFICATE
R.VIJAYA RAJA, C.SENTHIL KUMAR” who carried out the project work
under my supervision.
OF SUPERVISOR
of any task would be incomplete without the mentioning of the people whose
presenting before you, our project, which is result of studied blend of both
this project.
Head of the Department of Electrical & Electronics Engineering for his concern
for his constant support, encouragement and guidance. We are greatful for his
Finally, we express our gratitude to all other members who are involved
Farmer needs alternatives for weed control due to the desire to reduce
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
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
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
INTRODUCTION
BLOCK DIAGRAM
Power
Supply
PC with MATLAB
Recognition RELAY
Driver
R
8051
Authentication O
Micro
MAX 232
B
Controller
O
Processing RELAY
Driver T
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
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.
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 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 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).
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.
Output 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
Port 1
Port 2
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.
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.
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).
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=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
Additional RAM
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.
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.
Video security
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.
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.
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 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
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.
3.5 DC MOTOR
PIC16F877A Microcontroller
Web Camera
Web camera capture the weed part of the plant and then it send the image
to the processing unit.
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.
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.
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.
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 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);
ldata = value;
rs = 0;
rw = 0;
en = 1;
MSdelay(10);
en = 0;
return;
ldata = value;
rs = 1;
rw = 0;
en = 1;
MSdelay(10);
en = 0;
return;
unsigned int i, j;
for(i=0;i<itime;i++)
for(j=0;j<1275;j++);
}
while(*s)
lcddata(*s++);
unsigned char s;
unsigned char n;
void init1()
TMOD=0X20;
TH1=0XFD;
SCON=0X50;
TR1=1;
{
SBUF=n;
while(TI==0);
TI=0;
int rxr()
while(RI==0);
s=SBUF;
RI=0;
return s;
while(*p)
txr(*p++);
}
5.3 .NET
Note: Add this code snippet in the second review as matlab code to find weed
or not
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.
CONCLUSION
REFERENCES