Documente Academic
Documente Profesional
Documente Cultură
I.ABSTRACT
Chapter No. Description Page No.
1 INTRODUCTION 1
1.1 Objective of the project 1
1.2 Block diagram 2
1.3 Embedded system 2
2 DESCRIPTION OF THE PROJECT 6
2.1 Circuit diagram 6
2.2 Working description 7
3 HARDWARE DESCRIPTION 8
3.1 Microcontroller 8
3.2 Power supply 23
3.3 RELAY 34
3.4 Electrodes 37
4 SOFTWARE DESCRIPTION 39
4.1 Introduction 39
4.2 Tools used 39
4.3 C51 Compiler & A51 Macro Assembler 40
4.4 vision 40
4.5 Creating Your Own Application in Vision 41
4.6 Flow chart 44
4.7 Assembly/KEIL C language 52
6 CONCLUSION 55
1
ABSTRACT
Now a days technology is running with time, it completely occupied the life style of
human beings. Even though there is such an importance for technology in our routine life
there are even people whose life styles are very far to this well-known term technology. So it
is our responsibility to design few reliable systems which can be even efficiently used by
2
them. Using the water in the farm for irrigation is one of the most water consumptions in the
planet. Irrigation water management requires timely application of the right amount of water.
In the world, water development for agriculture is a priority, but poorly designed and
planned irrigation water management procedures and practices undermines efforts to improve
livelihoods and exposes people and environment to risks. By far, one of the largest losses of
the plant materials in the farm is the direct result of the improper irrigation scheduling. There
are many types of irrigation control systems available in the market. These controllers are
based on the measurement of the soil water tension. Soil water tension, soil water suction, or
soil water potential are all terms describing the energy status of soil water.
Soil water tension is a measure of the amount of energy with which water is held in
the soil and represents the energy required to extract water from the soil. This is expressed in
negative pressure. There are many types of sensors in the market that can be used to measure
the soil tension. Some of these sensors are based on resistance principle and some based on
capacitance principle. Embedded system is a combination of software and hardware to
perform a dedicated task.
CHAPTER 1
INTORDUCTION
3
The Project presented here waters your plants regularly when you are out for
vocation. Soil probe is inserted in the soil to sense the whether the Soil is wet or
dry. The Microcontroller was used to control the whole system it monitors the
sensors and when more than two sensors sense the dry condition then the
microcontroller will switch on the motor and it will switch off the motor when all
the sensors are in wet. The microcontroller does the above job it receives the
signals from the sensors, and this signals operated under the control of software
which is stored in ROM.
HARDWARE:
1. MICRO CONTROLLER
2. POWER SUPPLY
3. ELECTRODES
4. RELAY
5. DC MOTOR
SOFTWARE:
1.2 BLOCKDIAGRAM:
4
Sensor Elec - Relay driver
trodes A
RELAY
T
8
9
RESET S
5
CRYSTAL 2
DC
Motor
1.3.1 DEFINITIONS:
5
Embedded systems provide several major functions including monitoring
of the analog environment by reading data from sensors and controlling
actuators.
Embedded
System
6
Home automation products
Handheld calculators
Household appliances
Medical equipment
Measurement equipment
Multifunction wrist watches
Multifunction printers
Mobile phones with additional capabilities
Programmable Logic Controllers.
7
display the results for user use. The program is used by microprocessor are
stored in the mass storage devices and loaded into RAM as the user directs.
cost is less
speed is more
power consumption is less
compact device
external components are minimum
8
Microprocessor may have one or two types of bit handling
instructions microcontroller will have many.
Microprocessor concerned with rapid movement of code and data
from external address to the chip, microcontroller is concerned with
rapid data movement of bits with in chip.
operate a computer.
CHAPTER 2
9
2.2. WORKING DESCRIPTION:
The system checks the moisture content in the soil, based on that
pumping motor will automatically pumps the water into the field. Here we are
using soil moisture sensor. By using this sensor, we can find whether the soil is
wet or dry. If it is dry, pumping motor will pump the water. In this system, the
main controlling device is microcontroller. Here soil sensor will give the status of
the soil to the microcontroller and switch on or off the pumping motor through
relay. The pumping motor will pump the water into the field by using drip water
system until the field is wet which is continuously monitor by the microcontroller.
10
In irrigation process, most parameter of monitoring is soil, so we have to
monitor the soil condition, whether the soil is dry or wet. If it is dry, then by using
pumping motor, water has to be pumped automatically. The main aim of our
system presenting here is to monitor the moisture content in the soil in
cultivating field. Based on soil moisture, pumping motor will be automatically
switch on or off through relay. This saves the water at the same time and on the
other hand the plant can get optimum level of water, so increasing productivity
of crop.
CHAPTER 3
HARDWARE DESCRIPTION
11
3.1 MICROCONTROLLER:
The 8051 is an 8-bit processor meaning that the CPU can work only on 8
bits data at a time. Data larger than 8 bits has to be broken into 8 bits pieces to
be processed by the CPU. The 8051 has a total of four I\O ports each 8 bit wide.
There are many versions of 8051 with different speeds and amount of on-
chip ROM and they are all compatible with the original 8051. this means that if
you write a program for one it will run on any of them.
The 8051 is an original member of the 8051 family. There are two other
members in the 8051 family of microcontrollers. They are 8052 and 8031. All the
three microcontrollers will have the same internal architecture, but they differ in
the following aspects.
12
The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port,
and interrupt system to continue functioning. The Power down Mode saves the
RAM contents but freezes the oscillator, disabling all other chip functions until
the next hardware reset.
In addition, the AT89C52 is designed with static logic for operation down to
zero frequency and supports two software selectable power saving modes.
The Idle Mode stops the CPU while allowing the RAM, timer/counters,
serial port and interrupt system to continue functioning. The Power Down Mode
saves the RAM contents but freezes the oscillator disabling all other chip
functions until the next hardware reset.
13
3.1.4 Block Diagram of Microcontroller
14
15
Figure: Block Diagram Of 8052
Pin Configuration:
VCC
Pin 40 provides Supply voltage to the chip. The voltage source is +5v
GND.
16
Port 0
Port 0 is an 8-bit open drain bidirectional I/O port from pin 32 to 39. As an
output port each pin can sink eight TTL inputs. When 1s are written to port
0 pins, the pins can be used as high-impedance inputs. Port 0 may also be
external program and data memory. In this mode P0 has internal pull-ups.Port 0
also receives the code bytes during Flash programming, and outputs the code
bytes during program verification. External pull-ups are required during program
verification.
Port 1
Port 1 is an 8-bit bidirectional I/O port with internal pull-ups from pin 1 to 8.
The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to
Port 1 pins they are pulled high by the internal pull-ups and can be used as
inputs. As inputs, Port 1 pins that are externally being pulled low will source
current (IIL) because of the internal pull-ups. Port 1 also receives the low-order
Port 2
Port 2 is an 8-bit bidirectional I/O port with internal pull-ups from pin 21 to 28.
The Port 2 output buffers can sink / source four TTL inputs. When 1s are written
to Port 2 pins they are pulled high by the internal pull-ups and can be used as
inputs. As inputs, Port 2 pins that are externally being pulled low will source
current (IIL) because of the internal pull-ups. Port 2 emits the high-order address
byte during fetches from external program memory and during accesses to
external data memory that uses 16-bit addresses (MOVX @ DPTR). In this
application it uses strong internal pull-ups when emitting 1s. During accesses to
external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits the
17
contents of the P2 Special Function Register. Port 2 also receives the high-order
address bits and some control signals during Flash programming and verification
Port 3
Port 3 is an 8-bit bidirectional I/O port with internal pull-ups from pin 10 to 17.
The Port 3 output buffers can sink / source four TTL inputs. When 1s are written
to Port 3 pins they are pulled high by the internal pull-ups and can be used as
inputs. As inputs, Port 3 pins that are externally being pulled low will source
Port 3 also serves the functions of various special features of the AT89C51 as
listed below:
Port 3 also receives some control signals for Flash programming and
programming verification.
RST
18
Pin 9 is the Reset input. It is active high. Upon applying a high pulse to this
pin, the microcontroller will reset and terminate all activities. A high on this pin
for two machine cycles while the oscillator is running resets the device.
ALE/PROG
Address Latch is an output pin and is active high. Address Latch Enable
output pulse for latching the low byte of the address during accesses to external
memory. This pin is also the program pulse input (PROG) during Flash
oscillator frequency, and may be used for external timing or clocking purposes.
Note, however, that one ALE pulse is skipped during each access to external
Data Memory. If desired, ALE operation can be disabled by setting bit 0 of SFR
location 8EH. With the bit set, ALE is active only during a MOVX or MOVC
instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit
PSEN
Program Store Enable is the read strobe to external program memory. When
the AT89C52 is executing code from external program memory, PSEN is activated
twice each machine cycle, except that two PSEN activations are skipped during
EA/VPP
device to fetch code from external program memory locations starting at 0000H
This pin also receives the 12-volt programming enable voltage (VPP) during Flash
19
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.
XTAL2
XTAL1 and XTAL2 are the input and output, respectively, of an inverting
Figure 5.3. Either a quartz crystal or ceramic resonator may be used. To drive the
device from an external clock source, XTAL2 should be left unconnected while
20
Figure : External
flop, but minimum and maximum voltage high and low time specifications must
be observed.
3.1.7 TIMERS
Timer 0 and 1
Timer 0 and Timer 1 in the AT89C52 operate the same way as Timer 0 and
1. Timer 2
event counter. The type of operation is selected by bit C/T2 in the SFR T2CON.
Timer 2 has three operating modes: capture, auto-reload (up or down counting),
and baud rate generator. The modes are selected by bits in T2CON, as shown in
Table 5.2. Timer 2 consists of two 8-bit registers, TH2 and TL2. In the Timer
function, the TL2 register is incremented every machine cycle. Since a machine
cycle consists of 12 oscillator periods, the count rate is 1/12 of the oscillator
frequency.
21
Table : Timer 2 Operating Modes
transition at its corresponding external input pin, T2. In this function, the external
input is sampled during S5P2 of every machine cycle. When the samples show a
high in one cycle and a low in the next cycle, the count is incremented. The new
count value appears in the register during S3P1 of the cycle following the one in
which the transition was detected. Since two machine cycles (24 oscillator
periods) are required to recognize a 1-to-0 transition, the maximum count rate is
1/24 of the oscillator frequency. To ensure that a given level is sampled at least
once before it changes, the level should be held for at least one full machine
cycle.
There are no restrictions on the duty cycle of external input signal, but it
should for at least one full machine to ensure that a given level is sampled at
3.1.8 Interrupts
The AT89C52 has a total of six interrupt vectors: two external interrupts
(INT0 and INT1), three timer interrupts (Timers 0, 1, and 2), and the serial port
22
Figure : Interrupts source
setting or clearing a bit in Special Function Register IE. IE also contains a global
Note that Table shows that bit position IE.6 is unimplemented. In the
AT89C51, bit position IE.5 is also unimplemented. User software should not write
1s to these bit positions, since they may be used in future AT89 products.
23
Table: Interrupts Enable Register
register T2CON. Neither of these flags is cleared by hardware when the service
routine is vectored
to. In fact, the service routine may have to determine whether it was TF2 or EXF2
that generated the interrupt, and that bit will have to be cleared in software.
The Timer 0 and Timer 1 flags, TF0 and TF1, are set at S5P2 of the cycle in
which the timers overflow. The values are then polled by the circuitry in the next
cycle. However, the Timer 2 flag, TF2, is set at S2P2 and is polled in the same
24
In idle mode, the CPU puts itself to sleep while all the on-chip peripherals
remain active. The mode is invoked by software. The content of the on-chip RAM
and all the special functions registers remain unchanged during this mode. The
should be noted that when idle is terminated by a hardware reset, the device
normally resumes program execution, from where it left off, up to two machine
On-chip hardware inhibits access to internal RAM in this event, but access
write to a port pin when Idle is terminated by reset, the instruction following the
one that invokes Idle should not be one that writes to a port pin or to external
memory.
In the power down mode the oscillator is stopped, and the instruction that
invokes power down is the last instruction executed. The on-chip RAM and
Special Function Registers retain their values until the power down mode is
terminated. The only exit from power down is a hardware reset. Reset redefines
the SFRs but does not change the on-chip RAM. The reset should not be activated
before VCC is restored to its normal operating level and must be held active long
Table: Status of External Pins During Idle and Power Down Mode
25
Program Memory Lock Bits
On the chip are three lock bits which can be left unprogrammed (U) or can
be programmed (P) to obtain the additional features listed in the table 5.4. When
lock bit 1 is programmed, the logic level at the EA pin is sampled and latched
during reset. If the device is powered up without a reset, the latch initializes to a
random value, and holds that value until reset is activated. It is necessary that
the latched value of EA be in agreement with the current logic level at that pin in
The AT89C51 is normally shipped with the on-chip Flash memory array in
the erased state (that is, contents = FFH) and ready to be programmed. The
(VCC) program enable signal. The low voltage programming mode provides a
26
convenient way to program the AT89C51 inside the users system, while the
Memory, the entire memory must be erased using the Chip Erase Mode.
Before programming the AT89C52, the address, data and control signals
should be set up according to the Flash programming mode table and Figures 3
27
3. Activate the correct combination of control signals.
5. Pulse ALE/PROG once to program a byte in the Flash array or the lock bits. The
byte-write cycle is self-timed and typically takes no more than 1.5 ms. Repeat
steps 1 through 5, changing the address and data for the entire array or until the
Data Polling
The AT89C52 features Data Polling to indicate the end of a write cycle.
During a write cycle, an attempted read of the last byte written will result in the
complement of the written datum on PO.7. Once the write cycle has been
completed, true data are valid on all outputs, and the next cycle may begin. Data
Polling may begin any time after a write cycle has been initiated.
Ready/Busy
output signal. P3.4 is pulled low after ALE goes high during programming to
indicate BUSY. P3.4 is pulled high again when programming is done to indicate
READY.
Program Verify
If lock bits LB1 and LB2 have not been programmed, the programmed
code data can be read back via the address and data lines for verification. The
lock bits cannot be verified directly. Verification of the lock bits is achieved by
Chip Erase
28
The entire Flash array is erased electrically by using the proper
combination of control signals and by holding ALE/PROG low for 10 ms. The code
array is written with all "1"s. The chip erase operation must be executed before
verification of locations 030H, 031H, and 032H, except that P3.6 and P3.7 must
Every code byte in the Flash array can be written and the entire array can
operation cycle is self-timed and once initiated, will automatically time itself to
completion.
29
3.2 POWER SUPPLY:
There are many types of power supply. Most are designed to convert high
voltage AC mains electricity to a suitable low voltage supply for electronic
circuits and other devices. A power supply can by broken down into a series of
blocks, each of which performs a particular function.
30
Fig: Block Diagram of a Regulated Power Supply System
3.2.2 Transformer:
A transformer steps down high voltage AC mains to low voltage AC. Here
we are using a center-tap transformer whose output will be sinusoidal with
36volts peak to peak value.
The low voltage AC output is suitable for lamps, heaters and special AC
motors. It is not suitable for electronic circuits unless they include a rectifier and
a smoothing capacitor. The transformer output is given to the rectifier circuit.
3.2.3 Rectifier:
31
For the positive half cycle of the input ac voltage, diodes D1 and D3
conduct, whereas diodes D2 and D4 remain in the OFF state. The conducting
diodes will be in series with the load resistance R L and hence the load current
flows through RL.
For the negative half cycle of the input ac voltage, diodes D2 and D4
conduct whereas, D1 and D3 remain OFF. The conducting diodes D2 and D4 will
be in series with the load resistance R L and hence the current flows through R L in
the same direction as in the previous half cycle. Thus a bi-directional wave is
converted into unidirectional.
32
The varying DC output is suitable for lamps, heaters and standard motors.
It is not suitable for electronic circuits unless they include a smoothing capacitor.
3.2.4 Smoothing:
33
3.2.5 Regulator:
Many of the fixed voltage regulator ICs has 3 leads (input, output and high
impedance). They include a hole for attaching a heat sink if necessary. Zener
diode is an example of fixed regulator which is shown here.
34
Fig: Regulator
3.3. RELAY
3.3.1 Overview
35
use a relay to switch a 230V AC mains circuit. There is no electrical connection
inside the relay between the two circuits; the link is magnetic and mechanical.
The coil of a relay passes a relatively large current, typically 30mA for a
12V relay, but it can be as much as 100mA for relays designed to operate from
lower voltages. Most ICs (chips) cannot provide this current and a transistor is
usually used to amplify the small IC current to the larger value required for the
relay coil. The maximum output current for the popular 555 timer IC is 200mA so
these devices can supply relay coils directly without amplification.
Relays are usually SPDT or DPDT but they can have many more sets of
switch contacts, for example relay with 4 sets of changeover contacts are readily
available. Most relays are designed for PCB mounting but you can solder wires
directly to the pins providing you take care to avoid melting the plastic case of
the relay.
The supplier's catalogue should show you the relay's connection. The coil
will be obvious and it may be connected either way round. Relay coils produce
brief high voltage 'spikes' when they are switched off and this can destroy
transistors and ICs in the circuit. To prevent damage you must connect a
protection diode across the relay coil.
The relays switch connections are usually contains COM, NC and NO.
COM = Common, always connect to this; it is the moving part of the switch.
NC = Normally Closed, COM is connected to this when the relay coil is off.
NO = Normally Open, COM is connected to this when the relay coil is on.
Connect to COM and NO if you want the switched circuit to be on when the relay
coil is on.
Connect to COM and NC if you want the switched circuit to be on when the relay
coil is off.
Most relays are SPDT or DPDT which are often described as "single pole
changeover" (SPCO)
36
This is a Single Pole Double Throw relay. Current will flow between the
movable contact and one fixed contact when the coil is energized and between
the movable contact and the alternate fixed contact when the relay coil is
energized. The most commonly used relay in car audio, the Bosch relay, is a
SPDT relay.
This relay is a Double Pole Double Throw relay. It operates like the SPDT
relay but has twice as many contacts. There are two completely isolated sets of
contacts.
37
3.3.2 Relay Construction:
Relays are amazingly simple devices. There are four parts in every relay :
Electromagnet
Spring
When you purchase relays, you generally have control over several variables:
The maximum voltage and current that can run through the armature and
the armature contacts
The number of contacts for the armature (generally one or two -- the relay
shown here has two, one of which is unused)
Whether the contact (if only one contact is provided) is normally open
(NO) or normally closed(NC)
38
In general, the point of a relay is to use a small amount of power in the
electromagnet coming, say, from a small dashboard switch or a low-power
electronic circuit -- to move an armature that is able to switch a much larger amount
of power. For example, you might want the electromagnet to energize using 5 volts
and 50 milliamps (250 mill watts), while the armature can support 120V AC at 2
amps (240 watts).
Relays can switch AC and DC, transistors can only switch DC.
Relays are a better choice for switching large currents (> 5A).
3.4 ELECTRODES:
This water level sensor is conducive for liquids that have a conductivity of
equal to or more than 25m Siemens. It is your best choice for a water level
switch. The system is economical to install as no special cable is required for
signal transmission. The level probe and the evaluation unit can be connected
using a long cable. The AC is provided on the probe for preventing electrode
deterioration. You can choose from among a variety of level control and
installation systems such as
39
Two point sensors for independent switching and automatic control of
pump.
Three point switching: two for pump control logic and one independent
point with or without a settable delay (for probe covered or uncovered).
Applications:
The SLW... series water level switches work to maintain a constant water
level avoiding material wastage in your process plant. Common applications also
include switching pumps on and off to avoid overflow, dry running and indicating
water level in an empty tank to avoid wear and tear and production stoppage.
Many of our customers in the Food, Power, Chemicals, Sugar, Detergent, Steel,
Minerals and Textile industry have used the SLW... series water level indicator
/sensor. Principle A low AC voltage is applied between the probe electrode and
the tank wall (or reference electrode in case of insulated tank). When the
water/liquid comes in contact with the electrode tip, a conductive path is
established between the sense electrode and the tank wall/reference electrode.
This current is sensed, amplified and made to operate a relay whose contacts in
turn can be used for annunciation/control.
40
CHAPTER 4
SOFTWARE DESCRIPTION
4.1 INTRODUCTION:
In this chapter the software used and the language in which the program
code is defined is mentioned and the program code dumping tools are explained.
The chapter also documents the development of the program for the application.
This program has been termed as Source code. Before we look at the source
code we define the two header files that we have used in the code.
41
4.2 TOOLS USED:
Source files are created by the Vision IDE and are passed to the C51
Compiler or A51 Macro Assembler. The compiler and assembler process source
files and create replaceable object files.
42
The Keil C51 Compiler is a full ANSI implementation of the C programming
language that supports all standard features of the C language. In addition,
numerous features for direct support of the 8051 architecture have been added.
4.4 VISION
Vision3 adds many new features to the Editor like Text Templates, Quick
Function Navigation, and Syntax Coloring with brace high lighting Configuration
Wizard for dialog based startup and debugger setup. Vision3 is fully compatible
to Vision3 and can be used in parallel with Vision3.
What is Vision3?
A project manager.
A make facility.
Tool configuration.
Editor.
A powerful debugger.
To help you get started, several example programs (located in the
\C51\Examples, \C251\Examples, \C166\Examples, and \ARM\...\Examples)
are provided.
HELLO is a simple program that prints the string "Hello World" using the Serial
Interface.
MEASURE is a data acquisition system for analog and digital systems.
TRAFFIC is a traffic light controller with the RTX Tiny operating system.
SIEVE is the SIEVE Benchmark.
DHRY is the Dhrystone Benchmark.
WHETS is the Single-Precision Whetstone Benchmark.
43
Additional example programs not listed here are provided for each device
architecture.
44
3 Open the Serial Window using the Serial #1 button on the toolbar.
Debug your program using standard options like Step, Go, Break, and so on.
Project New Project. This opens a standard Windows dialog that asks you for
the new project file name.
We suggest that you use a separate folder for each project. You can simply use
the icon Create New Folder in this dialog to get a new empty folder. Then select
this folder and enter the file name for the new project, i.e. Project1.
Vision3 creates a new project file with the name PROJECT1.UV2 which contains
a default target and file group name. You can see these names in the Project
Window Files.
Now use from the menu Project Select Device for Target and select a CPU for
your project. The Select Device dialog box shows the Vision3 device database.
Just select the microcontroller you use. We are using for our examples the Philips
80C51RD+ CPU. This selection sets necessary tool options for the 80C51RD+
device and simplifies in this way the tool Configuration
Typical, the tool settings under Options Target are all you need to start a
new application. You may translate all source files and line the application with a
click on the Build Target toolbar icon. When you build an application with syntax
errors, Vision3 will display errors and warning messages in the Output Window
Build page. A double click on a message line opens the source file on the correct
45
location in a Vision3 editor window. Once you have successfully generated your
application you can start debugging.
After you have tested your application, it is required to create an Intel HEX
file to download the software into an EPROM programmer or simulator. Vision3
creates HEX files with each build process when Create HEX files under Options
for Target Output is enabled. You may start your PROM programming utility
after the make process when you specify the program under the option Run User
Program #1.
CPU Simulation
Database selection
You have made when you create your project target. Refer to page 58 for
more
Information about selecting a device. You may select and display the on-chip
peripheral components using the Debug menu. You can also change the aspects
of each peripheral using the controls in the dialog boxes.
Start Debugging
You start the debug mode of Vision3 with the Debug Start/Stop Debug
Configuration, Vision3 will load the application program and run the startup
46
code Vision3 saves the editor screen layout and restores the screen layout of
the last debug session. If the program execution stops, Vision3 opens an
editor window with the source text or shows CPU instructions in the disassembly
window. The next executable statement is marked with a yellow arrow. During
debugging, most editor features are still available.
For example, you can use the find command or correct program errors.
Program source text of your application is shown in the same windows. The
Vision3 debug mode differs from the edit mode in the following aspects:
The Debug Menu and Debug Commands described below are available.
The additional debug windows are discussed in the following.
The project structure or tool parameters cannot be modified. All build
Commands are disabled.
Disassembly Window
The Disassembly window shows your target program as mixed source and
assembly program or just assembly code. A trace history of previously executed
instructions may be displayed with Debug View Trace Records. To enable the
trace history, set Debug Enable/Disable Trace Recording.
If you select the Disassembly Window as the active window all program
step commands work on CPU instruction level rather than program source lines.
You can select a text line and set or modify code breakpoints using toolbar
buttons or the context menu commands.
You may use the dialog Debug Inline Assembly to modify the CPU
instructions. That allows you to correct mistakes or to make temporary changes
to the target program you are debugging.
47
PROCEDURE:
48
5. Save the Project by typing suitable project name with no extension in u
r own folder sited in either C:\ or D:\
49
9. Select AT89C51 as shown below
50
12. Then Click either YES or NOmostly NO
13. Now your project is ready to USE
14. Now double click on the Target1, you would get another option Source
group 1 as shown in next page.
15. Click on the file option from menu bar and select new
51
16. The next screen will be as shown in next page, and just maximize it by
double clicking on its blue boarder.
52
19. Now right click on Source group 1 and click on Add files to Group Source
20. Now you will get another window, on which by default C files will appear.
53
21. Now select as per your file extension given while saving the file
22. Click only one time on option ADD
23. Now Press function key F7 to compile. Any error will appear if so happen.
54
26. Then Click OK
27. Now click on the Peripherals from menu bar, and check your required port as
shown in fig below.
28. Drag the port a side and click in the program file.
55
29. Now keep Pressing function key F11 slowly and observe.
30. You are running your program successfully
#include <REG51.H>
Sbit input1=P1^0;
Sbit input2=P1^1;
Sbit motor1=P1^2;
Sbit motor2=P1^3;
main ( )
56
while (1)
if(input1==1)
motor1=1;
if(input2==1)
motor2=1;
if (input1==0)
Motor1=0;
if (input1==0)
Motor2=0
57
CHAPTER 5
MERITS:
This system reduces the risk of electric shocks, deaths due to poisonous
creatures in the fields.
Temperature sensor based fan speed control.
Visual display using LCD display unit.
Watering depends on the moisture level present in the field.
Automatic controlling of water pump.
Efficient and low cost design.
Fast response.
User friendly.
DEMERITS:
58
CHAPTER 6
CONCLUSION
59
The proposed controller eliminates the manual switching mechanism used
by the farmers to ON/OFF the irrigation system. The system is also designed for
temperature sensor based fan speed control. Integrating features of all the
hardware components used have been developed in it. Presence of every module
has been reasoned out and placed carefully, thus contributing to the best
working of the unit. Secondly, using highly advanced ICs with the help of
growing technology, the project has been successfully implemented.
CHAPTER 7
BIBILOGRAPHY:
ULN2003 WWW.ALLEGRO.COM
WWW.ALLEGROMICRO.COM
60
WWW.BAYLINEAR.COM
REFERENCES
7. www.8051freeprojectsinfo.com.
61