Escolar Documentos
Profissional Documentos
Cultura Documentos
INTRODUCTION
1.1 Objective
The main objective of this project is to develop a fire detector which can sense
the formation of smoke and temperature then actuate the control system to extinguish
the fire. Here the system has to detect smoke so that we can detect the fire accidents
quickly and avoid the major damage.
The environmental conditions that exist in industrial facilities can present huge
challenges. High levels of dust and dirt can cause malfunctions and nuisance alarms,
smoke dilution in large volumetric enclosures influenced by air movement and
stratification make it difficult to detect the early signs of fire. Normally occurring
background levels of smoke cannot easily be distinguished from real fire conditions.
Unheated or un-cooled spaces cause temperature extremes outside of the operating
range of some smoke detectors.
To provide the best possible fire protection for an industrial application or
environment means selecting the correct technology and the most appropriate product
in the first instance. The detector must maintain its sensitivity over the life of the
detector and provide a low total cost of ownership.
2. EMBEDDED SYSTEM
2.1 INTRODUCTION
Computers have evolved from few, huge mainframes shared by many people,
and mini computers that were smaller but still shared to todays PCsmillions in
number, miniscule in size compared to the mainframes, and used by only one person
at a time. The next generation could be invisible, with billions being around and each
of us using more than one at a time. Welcome to the world of embedded systems, of
computers that will not look like computers and wont function like anything were
familiar with.
Program installation you will need special tools to get your software
into embedded systems.
1)
2)
3)
4)
5)
6)
7)
APPLICATIONS
Military and aerospace embedded software applications
C o mmu n i ca t io n App l ic a t io ns
I nd us t r ia l au to ma t io n a nd p ro ce s s c on tr o l s o ft w a re
Mastering the complexity of applications.
Reduction of product design time.
Real time processing of ever increasing amounts of data.
Intelligent, autonomous sensors.
CLASSIFICATION
RTS CLASSIFICATION
"Soft" real-time systems have reduced constrains on "lateness" but still must
operate very quickly and repeatable.
Example: Railway reservation system takes a few extra seconds the data
remains valid.
3. HARDWARE REQUIREMENTS
6
3.1.1 Transformer
Transformers convert AC electricity from one voltage to another with a little
loss of power. Step-up transformers increase voltage, step-down transformers reduce
voltage. Most power supplies use a step-down transformer to reduce the dangerously
high voltage to a safer low voltage.
lines in the middle of the circuit symbol represent the core. Transformers waste very
little power so the power out is (almost) equal to the power in. Note that as voltage is
stepped down and current is stepped up.
The ratio of the number of turns on each coil, called the turns ratio,
determines the ratio of the voltages. A step-down transformer has a large number of
turns on its primary (input) coil which is connected to the high voltage mains supply,
and a small number of turns on its secondary (output) coil to give a low output
voltage.
TURNS RATIO :
Where,
Vp = primary (input) voltage, Vs = secondary (output) voltage
Np = number of turns on primary coil
Ns = number of turns on secondary coil
Ip = primary (input) current
Is = secondary (output) current.
3.1.2 Rectifier:
The output from the transformer is fed to the rectifier. It converts A.C. into
pulsating D.C. The rectifier may be a half wave or a full wave rectifier. In this project,
a bridge rectifier is used because of its merits like good stability and full wave
rectification.
3.1.3 Filter:
Capacitive filter is used in this project. It removes the ripples from the output
of rectifier and smoothens the D.C. Output received from this filter is constant until
8
the mains voltage and load is maintained constant. However, if either of the two is
varied, D.C. voltage received at this point changes. Therefore a regulator is applied at
the output stage.
10
contents but freezes the oscillator, disabling all other chip functions until the next
interrupt or hardware reset.
Block Diagram of AT89S52:
Features
Compatible with MCS-51 Products
8K Bytes of In-System Programmable (ISP) Flash Memory
Endurance: 10,000 Write/Erase Cycles
4.0V to 5.5V Operating Range
Fully Static Operation: 0 Hz to 33 MHz
Three-level Program Memory Lock
256 x 8-bit Internal RAM
32 Programmable I/O Lines
11
12
Port 0:
Port 0 is an 8-bit open drain bidirectional I/O port. 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 can also be configured to be the multiplexed low-order
address/data bus during accesses to 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 pullups are required during program verification.
Port 1:
Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. 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. In addition, P1.0 and P1.1 can be configured to be the timer/counter
2 external count input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX).
Port 2:
Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. 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 16bit addresses (MOVX @ DPTR). In this application, Port 2 uses strong internal pullups when emitting 1s. During accesses to external data memory that uses 8-bit
addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function
Register.
Port 3:
Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. 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
13
3 pins that are externally being pulled low will source current (IIL) because of the
pull-ups.
RST:
Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device. This pin drives high for 98 oscillator periods after the
Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can be used to
disable this feature. In the default state of bit DISRTO, the RESET HIGH out feature
is enabled.
ALE/PROG:
Address Latch Enable (ALE) is an 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 programming.
In normal operation, ALE is emitted at a constant rate of 1/6 the 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.
PSEN:
Program Store Enable (PSEN) is the read strobe to external program memory.
When the AT89S52 is executing code from external program memory, PSEN is
activated twice each machine cycle, except that two PSEN activations are skipped
during each access to external data memory.
EA/VPP:
External Access Enable. EA must be strapped to GND in order to enable the
device to fetch code from external program memory locations starting at 0000H up to
FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched
on reset. EA should be strapped to VCC for internal program executions. This pin also
receives the 12-volt programming enable voltage (VPP) during Flash programming.
XTAL1:
Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.
14
XTAL2:
Output from the inverting oscillator amplifier.
Oscillator Characteristics:
XTAL1 and XTAL2 are the input and output, respectively, of an inverting
amplifier which can be configured for use as an on-chip oscillator, as shown in Figure
1. Either a quartz crystal or ceramic resonator may be used. There are no requirements
on the duty cycle of the external clock signal, since the input to the internal clocking
circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage
high and low time specifications must be observed.
Idle Mode
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 idle mode
can be terminated by any enabled interrupt or by a hardware reset.
Power down Mode
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 enough to allow the oscillator
to restart and stabilize.
semiconductor has its own charge carriers and is not an efficient semiconductor, for
example, silicon. In intrinsic devices the only available electrons are in the valence
band, and hence the photon must have enough energy to excite the electron across the
entire band gap.
Good reliability
Small volume
High sensitivity
16
Fast response
Photoelectric controls
Annunciation
Industrial controls
Electronic toys
Measuring conditions:
color temperature) and 2hrs illumination at 400 to 600 lux prior to testing.
o
3.4 LM35
The LM35 series are precision integrated-circuit temperature sensors, whose
output voltage is linearly proportional to the Celsius (Centigrade) temperature. The
LM35 thus has an advantage over linear temperature sensors calibrated in Kelvin, as
the user is not required to subtract a large constant voltage from its output to obtain
convenient Centigrade scaling. The LM35 does not require any external calibration or
trimming to provide typical accuracies of 14C at room temperature and 34C
over a full 55 to +150C temperature range.
Low cost is assured by trimming and calibration at the wafer level. The
LM35s low output impedance, linear output, and precise inherent calibration make
interfacing to readout or control circuitry especially easy. It can be used with single
17
power supplies, or with plus and minus supplies. As it draws only 60 A from its
supply, it has very low self-heating, less than 0.1C in still air. The LM35 is rated to
operate over a 55 to +150C temperature range.
Features:
Typical Applications
it
is
with
low
cost
and
suitable
for
different
application.
Characteristics:
1. High sensitivity to Combustible gas in wide range
2. High sensitivity to LPG, Propane & Hydrogen
3. Fast response
4. Wide detection range
5. Stable performance long life low cost
6. Simple drive circuit
Applications:
1. Domestic gas leakage detector
2. Industrial Combustible gas detector
3. Portable gas detector
4. They are used in gas leakage detecting equipments in family and industry, are
suitable for detecting of LPG, i-butane, propane, methane, alcohol, Hydrogen, smoke.
3.5 ADC0808/09
19
FUNCTIONAL DESCRIPTION
Multiplexer:
The device contains an 8-channel single-ended analog signal multiplexer. A particular
input channel is selected by using the address decoder. The below table shows the input states
for the address lines to select any channel. The address is latched into the decoder on the lowto-high transition of the address latch enable signal.
CONVERTER CHARACTERISTICS
The Converter
The heart of this single chip data acquisition system is its 8-bit analog-to-digital
converter. The converter is designed to give fast, accurate, and repeatable conversions over a
wide range of temperatures. The converter is partitioned into 3 major sections: the 256R
ladder network, the successive approximation register, and the comparator. The converters
20
digital outputs are positive true. The 256R ladder network approach (Figure 1) was chosen
over the conventional R/2R ladder because of its inherent monotonicity, which guarantees no
missing digital codes. Monotonicity is particularly important in closed loop feedback control
systems. A non-monotonic relationship can cause oscillations that will be catastrophic for the
system. Additionally, the 256R network does not cause load variations on the reference
voltage.
The A/D converters successive approximation register (SAR) is reset on the positive
edge of the start conversion (SC) pulse. The conversion is begun on the falling edge of the
start conversion pulse. A conversion in process will be interrupted by receipt of a new start
conversion pulse. Continuous conversion may be accomplished by tying the end of
conversion (EOC) output to the SC input. If used in this mode, an external start conversion
pulse should be applied after power up. End-of-conversion will go low between 0 and 8 clock
pulses after the rising edge of start conversion. The most important section of the A/D
converter is the comparator. It is this section which is responsible for the ultimate accuracy of
the entire converter. It is also the comparator drift which has the greatest influence on the
repeatability of the device. A chopper-stabilized comparator provides the most effective
method of satisfying all the converter requirements.
I/O Pins
ADDRESS LINE A, B, C
The device contains 8-channels. A particular channel is selected by using the address
decoder line. The above table shows the input states for address lines to select any channel.
21
START
The ADCs Successive Approximation Register (SAR) is reset on the positive edge i.e.
Low- High of the Start Conversion pulse. Whereas the conversion is begun on the falling
edge i.e. high Low of the pulse.
Output Enable
Whenever data has to be read from the ADC, Output Enable pin has to be pulled high thus
enabling the TRI-STATE outputs, allowing data to be read from the data pins D0-D7.
This Pin becomes high when the conversion has ended, so the controller comes to know
that the data can now be read from the data pins.
Clock
External clock pulses are to be given to the ADC; this can be given either from LM 555 in
Astable mode or the controller can also be used to give the pulses.
ALGORITHM
1. Start.
2. Select the channel.
3. A Low High transition on ALE to latch in the address.
4. A Low High transition on Start to reset the ADCs SAR.
5. A High Low transition on ALE.
6. A High Low transition on start to start the conversion.
7. Wait for End of cycle (EOC) pin to become high.
8. Make Output Enable pin High.
22
23
The address and data pins of ADC can be connected to any of the ports of 8051.
voltage is applied to the gate, the other SCR conducts. This is provided that there is
sufficient voltage across the device to enable a minimum holding current to flow.
TRIAC Operation
The structure of a triac may be considered as a p-n-p-n structure and the triac
may be considered to consist of two conventional SCRs fabricated in an inverse
parallel configuration.
In operation, when terminal A2 is positive with respect to A1, then a positive
gate voltage will give rise to a current that will trigger the part of the triac consisting
of p1 n1 p2 n2 and it will have an identical characteristic to an SCR. When terminal
A2 is negative with respect to A1 a negative current will trigger the part of the triac
consisting of p2 n1 p1 n3. In this way conduction on the triac occurs over both halves
an alternating cycle.
any gate current flowing until the trigger voltage has reached a certain voltage in
either direction, this makes the firing point of the triac more even in both directions.
is
a common
clock
for Intel
the
with
26
precise
resonant
frequency.
FEATURES:
- The crystal oscillator circuit sustains oscillation by taking a voltage signal from the
quartz resonator, amplifying it, and feeding it
back to the resonator
- It provides clock pulses of 11.0592 MHz frequency.
- The popularity of the crystals is due to low cost.
Ground isolation
FEATURES
* HIGH CONTRAST LCD SUPERTWIST DISPLAY
* EA DIP162-DNLED: YELLOW/GREEN WITH LED BACKLIGHT
* EA DIP162-DN3LW AND DIP162J-DN3LW WITH WHITE LED B/L.,
LOPOWER
* INCL. HD 44780 OR COMPATIBLE CONTROLLER
* INTERFACE FOR 4- AND 8-BIT DATA BUS
* POWER SUPPLY +5V OR 2.7V OR 3.3V
* OPERATING TEMPERATURE 0~+50C (-DN3LW, -DHNLED: -20~+70C)
* LED BACKLIGHT Y/G max. 150mA@+25C
* LED BACKLIGHT WHITE max. 45mA@+25C
* SOME MORE MODULES WITH SAME MECHANIC AND SAME PINOUT:
-DOTMATRIX 1x8, 4x20
-GRAPHIC 122x32
* NO SCREWS REQUIRED: SOLDER ON IN PCB ONLY
* DETACHABLE VIA 9-PIN SOCKET EA B200-9 (2 PCS. REQUIRED)
Liquid crystal display is very important device in embedded system. It offers
high flexibility to user as he can display the required data on it. But due to lack of
proper approach to LCD interfacing many of them fail. Many people consider LCD
interfacing a complex job but according to me LCD interfacing is very easy task, you
29
just need to have a logical approach. This page is to help the enthusiast who wants to
interface LCD with through understanding. Copy and Paste technique may not work
when an embedded system engineer wants to apply LCD interfacing in real world
projects.
You will be known about the booster rockets on space shuttle. Without these
booster rockets the space shuttle would not launch in geosynchronous orbit. Similarly
to understand LCD interfacing you need to have booster rockets attached! To get it
done right you must have general idea how to approach any given LCD. This page
will help you develop logical approach towards LCD interfacing.
Major task in LCD interfacing is the initialization sequence. In LCD
initialization you have to send command bytes to LCD. Here you set the interface
mode, display mode, address counter increment direction, set contrast of LCD,
horizontal or vertical addressing mode, color format. This sequence is given in
respective LCD driver datasheet. Studying the function set of LCD lets you know the
definition of command bytes. It varies from one LCD to another. If you are able to
initialize the LCD properly 90% of your job is done.
Next step after initialization is to send data bytes to required display data
RAM memory location. Firstly set the address location using address set command
byte and than send data bytes using the DDRAM write command. To address specific
location in display data RAM one must have the knowledge of how the address
counter is incremented.
No. Instruction Hex Decimal
circuit is more portable for a wider range of computers, some of which may have no
internal pull up resistors.
We make no effort to place the Data bus into reverse direction. Therefore we
hard wire the R/W line of the LCD panel, into write mode. This will cause no bus
conflicts on the data lines. As a result we cannot read back the LCD's internal Busy
Flag which tells us if the LCD has accepted and finished processing the last
instruction. This problem is overcome by inserting known delays into our program.
The 10k Potentiometer controls the contrast of the LCD panel. Nothing fancy
here. As with all the examples, I've left the power supply out. You can use a bench
power supply set to 5v or use a onboard +5 regulator. Remember a few de-coupling
capacitors, especially if you have trouble with the circuit working properly.
The 2 line x 16 character LCD modules are available from a wide range of
manufacturers and should all be compatible with the HD44780. The one I used to test
this circuit was a Power tip PC-1602F and an old Philips LTN211F-10 which was
extracted from a Poker Machine! The diagram to the right shows the pin numbers for
these devices. When viewed from the front, the left pin is pin 14 and the right pin is
pin 1.
3.11 LED
A light-emitting diode (LED) is a semiconductor light source. LEDs are used
as indicator lamps in many devices, and are increasingly used for lighting. When a
light-emitting diode is forward biased (switched on), electrons are able to recombine
with holes within the device, releasing energy in the form of photons.
optical components may be used to shape its radiation pattern. LEDs present many
advantages over incandescent light sources including lower energy consumption,
longer lifetime, improved robustness, smaller size, faster switching, and greater
durability and reliability.
Light-emitting diodes are used in applications as diverse as replacements for
aviation lighting, automotive lighting as well as in traffic signals. The compact size,
the possibility of narrow bandwidth, switching speed, and extreme reliability of LEDs
has allowed new text and video displays and sensors to be developed, while their high
switching rates are also useful in advanced communications technology.
3.12 1N4007
Diodes are used to convert AC into DC these are used as half wave rectifier or full
wave rectifier. Three points must he kept in mind while using any type of diode.
1. Maximum forward current capacity
2. Maximum reverse voltage capacity
3. Maximum forward voltage capacity
33
Diode of same capacities can be used in place of one another. Besides this
diode of more capacity can be used in place of diode of low capacity but diode
of low capacity cannot be used in place of diode of high capacity. For
example, in place of IN4002; IN4001 or IN4007 can be used but IN4001 or
IN4002 cannot be used in place of IN4007.The diode BY125made by
company BEL is equivalent of diode from IN4001 to IN4003. BY 126 is
equivalent to diodes IN4004 to 4006 and BY 127 is equivalent to diode
IN4007.
PN JUNCTION OPERATION
Now that you are familiar with P- and N-type materials, how these
materials are joined together to form a diode, and the function of the diode, let
us continue our discussion with the operation of the PN junction. But before
we can understand how the PN junction works, we must first consider current
flow in the materials that make up the junction and what happens initially
within the junction when these two materials are joined together.
34
3.13 RESISTOR
A resistor is a two-terminal electronic component designed to oppose an
electric current by producing a voltage drop between its terminals in proportion to the
current, that is, in accordance with Ohm's law:
V = IR
Resistors are used as part of electrical networks and electronic circuits.
They are extremely commonplace in most electronic equipment. Practical resistors
can be made of various compounds and films, as well as resistance wire (wire made of
a high-resistivity alloy, such as nickel/chrome).
applied voltage. Critical resistance depends upon the materials constituting the
resistor as well as its physical dimensions; it's determined by design. Resistors can be
integrated into hybrid and printed circuits, as well as integrated circuits. Size, and
position of leads (or terminals) are relevant to equipment designers; resistors must be
physically large enough not to overheat when dissipating their power.
The series inductance of a practical resistor causes its behaviour to depart from
ohms law; this specification can be important in some high-frequency applications for
smaller values of resistance. In a low-noise amplifier or pre-amp the noise
characteristics of a resistor may be an issue. The unwanted inductance, excess noise,
and temperature coefficient are mainly dependent on the technology used in
manufacturing the resistor. They are not normally specified individually for a
particular family of resistors manufactured using a particular technology. A family of
discrete resistors is also characterized according to its form factor, that is, the size of
the device and position of its leads (or terminals) which is relevant in the practical
manufacturing of circuits using them.
Units
The ohm (symbol: ) is the SI unit of electrical resistance, named after Georg
Simon Ohm. An ohm is equivalent to a volt per ampere. Since resistors are specified
and manufactured over a very large range of values, the derived units of milliohm (1
m = 103 ), kilohm (1 k = 103 ), and megohm (1 M = 106 ) are also in
common usage.
The reciprocal of resistance R is called conductance G = 1/R and is measured
in Siemens (SI unit), sometimes referred to as a mho. Thus a Siemens is the reciprocal
of an ohm: S =
analysis, practical resistors are always specified in terms of their resistance (ohms)
rather than conductance.
3.14 CAPACITOR
A capacitor or condenser is a passive electronic component consisting of a
pair of conductors separated by a dielectric. When a voltage potential difference exists
between the conductors, an electric field is present in the dielectric. This field stores
37
energy and produces a mechanical force between the plates. The effect is greatest
between wide, flat, parallel, narrowly separated conductors.
An ideal capacitor is characterized by a single constant value, capacitance,
which is measured in farads. This is the ratio of the electric charge on each conductor
to the potential difference between them. In practice, the dielectric between the plates
passes a small amount of leakage current. The conductors and leads introduce an
equivalent series resistance and the dielectric has an electric field strength limit
resulting in a breakdown voltage.
The properties of capacitors in a circuit may determine the resonant
frequency and quality factor of a resonant circuit, power dissipation and operating
frequency in a digital logic circuit, energy capacity in a high-power system, and many
other important aspects.
stores energy and produces a mechanical force between the conductors. An ideal
capacitor is characterized by a single constant value, capacitance, measured in farads.
4. SOFTWARE REQUIREMENTS
project, simply select the microcontroller you use from the Device Database and the
Vision IDE sets all compiler, assembler, linker, and memory options for you.
Keil is a cross compiler. So first we have to understand the concept of
compilers and cross compilers. After then we shall learn how to work with keil.
40
A cross compiler is similar to the compilers but we write a program for the
target processor (like 8051 and its derivatives) on the host processors (like computer
of x86). It means being in one environment you are writing a code for another
environment is called cross development. And the compiler used for cross
development is called cross compiler. So the definition of cross compiler is a compiler
that runs on one computer but produces object code for a different type of computer.
Project Manager
Simulator
Debugger
The Keil ARM tool kit includes three main tools, assembler, compiler and
linker. An assembler is used to assemble the ARM assembly program. A compiler is
used to compile the C source code into an object file. A linker is used to create an
absolute object module suitable for our in-circuit emulator.
41
Select Project - Select Device and select an 8051, 251, or C16x/ST10 device
from the Device Database.
Select Project - Targets, Groups, Files. Add/Files, select Source Group1, and
add the source files to the project.
Select Project - Options and set the tool options. Note when you select the
target device from the Device Database all special options are set
automatically. You typically only need to configure the memory map of your
target hardware. Default memory model settings are optimal for most
applications.
Use the Step toolbar buttons to single-step through your program. You may
enter G, main in the Output Window to execute to the main C function.
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.
43
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.
target program you are debugging. Numerous example programs are included to help
you get started with the most popular embedded 8051 devices.
The Keil Vision Debugger accurately simulates on-chip peripherals (IC,
CAN, UART, SPI, Interrupts, I/O Ports, A/D Converter, D/A Converter, and PWM
Modules) of your 8051 device. Simulation helps you understand hardware
configurations and avoids time wasted on setup problems. Additionally, with
simulation, you can write and test applications before target hardware is available.
4.15 EMBEDDED C
Use of embedded processors in passenger cars, mobile phones, medical
equipment, aerospace systems and defense systems is widespread, and even everyday
domestic appliances such as dish washers, televisions, washing machines and video
recorders now include at least one such device.
Because most embedded projects have severe cost constraints, they tend to
use low-cost processors like the 8051 family of devices considered in this book. These
popular chips have very limited resources available most such devices have around
256 bytes (not megabytes!) of RAM, and the available processor power is around
1000 times less than that of a desktop processor. As a result, developing embedded
software presents significant new challenges, even for experienced desktop
programmers. If you have some programming experience - in C, C++ or Java - then
this book and its accompanying CD will help make your move to the embedded world
as quick and painless as possible.
45
5. CODING
if(C1>50)
{
init(0x01);
message(0x80,"High temparature");
buzz=0;
pump=0;
delay(300);
}
if(C2>4000)
{
init(0x01);
message(0x80,"High Smoke");
buzz=0;
pump=0;
delay(300);
}
if(C1<50 && C2<3500)
{
init(0x01);
message(0x80,"Normal conditions");
buzz=1;
pump=1;
delay(300);
}
if(ldr==0)
47
{
init(0x01);
message(0x80,"Bad light");
light=0;
delay(300);
}
else
light=1;
}//while(1)
}//main
1.
2.
48
3.
4.
5.
49
6.
7.
8.
9.
10.
Then Click on OK
11.
12.
13.
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.
17.
18.
19.
Now right click on Source group 1 and click on Add files to Group
Source.
20.
21.
Now select as per your file extension given while saving the file
22.
23.
Now Press function key F7 to compile. Any error will appear if so happen.
24.
25.
26.
27.
Now click on the Peripherals from menu bar, and check your required port
as shown in fig below.
55
28.
29.
30.
56
CONCLUSION
This project is used to develop industrial protection over smoke, temperature
and LDR (fire sensor). In this project, we are using a smoke sensor, temperature and
LDR which can detect and send a signal as input to the micro controller. The micro
controller will be continuously checking the respective pin.
Upon reception of
positive signal to the microcontroller from both the sensors that continuously
monitors them, a signal is sent to the buzzer that sounds alarm confirming fire, and
simultaneously a signal is sent to the LCD display. The sensitivity of the heat and
smoke sensor can be increased and decreased manually here by making the alarm
system more or less sensitive.
When it gets a high signal at that pin it means that smoke has been detected.
At that time it first gives siren to alert any humans in that premises to vacate and then
it actuates the extinguishers. They may be the water sprinklers or the CO2 containers.
At the same time control appliances based on the light sensor.
57
REFERENCES
The 8051 Microcontroller and Embedded Systems
- M.A Mazidi & J.G Mazidi
The Microcontroller Idea Book
- John Axelson
The Microcontroller Application Cookbook
Matt Gilliland
Digital design by Morris Mano
Linear integrated circuits by Roy choudary
58