4 Content PDF

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 59

CHAPTER 1

1- INTRODUCTION
1.1Objective
Technology has made a significant place in our life. With advancement of technology
things are becoming simpler and easier for us. Automation is the use of control
systems and information technologies to reduce the need for human work in the
production of goods and services. Automation is a step beyond mechanization.
Whereas mechanization provided human operators with machinery to assist them with
the muscular requirements of work, automation greatly decreases the need for human
sensory and mental requirements as well. Automation plays an increasingly important
role in the world economy and in daily experience. Automatic systems are being
preferred over manual system. Through this project we have tried to show automatic
control of a cars condition.
In old era it was simple and have tough access to its features. Today this access is not
made simple but made automatic using modern era sensors. The automobile industry
can be a innovative place if we include all these modern sensor in the industry.
In this project our main aim is to revolutionaries the automobile industry using these
sensors and make high cost features cheap. Some of the feature we have include in
our project are these.
1. MFD: - Multi-function detection Feature (Will detect shocks and vibration on the
substation ).
2. Concealed magnetic sensor: - detects the impact on the car and decides whether the
airbags should open or not.
3. Contact magnetic sensor: - detects some dangerous part are on their place or not.
4. IR Sensor: - Stops supply if somebody is go to the prohibited area and hence avoid
accidents.
5. Universal gas sensor: - will detect the combustible gases and smoke inside the
engine chamber.
6. These all features we have provided here are done at low cost using modern
technique, so that we can give advance feature to the whole automobile industry.

1.2 Advantages

1
1. This setup is relatively simple to design and install.
2. This is very useful to all climatic conditions and it is economic friendly.
3. This makes our car safe.
4. Micro controllers make system error free.
5. This is safest and no manpower is required.
6. modern technique used to implement features at cheap rate..

2
CHAPTER 2
2 LITERATURE SURVEY
2.1 Microcontroller
A microcontroller (sometimes abbreviated µC, uC or MCU) is a small computer on a
single integrated circuit containing a processor core, memory, and programmable
input/output peripherals. Program memory in the form of NOR flash or OTP ROM is
also often included on chip, as well as a typically small amount of RAM.
Microcontrollers are designed for embedded applications, in contrast to
the microprocessors used in personal computers or other general purpose applications.
Microcontrollers are used in automatically controlled products and devices, such as
automobile engine control systems, implantable medical devices, remote controls,
office machines, appliances, power tools, toys and other embedded systems. By
reducing the size and cost compared to a design that uses a separate microprocessor,
memory, and input/output devices, microcontrollers make it economical to digitally
control even more devices and processes. Mixed signal microcontrollers are common,
integrating analog components needed to control non-digital electronic systems.
Some microcontrollers may use four-bit words and operate at clock rate frequencies
as low as 4 kHz, for low power consumption (mill watts or microwatts). They will
generally have the ability to retain functionality while waiting for an event such as a
button press or other interrupt; power consumption while sleeping (CPU clock and
most peripherals off) may be just nano watts, making many of them well suited for
long lasting battery applications. Other microcontrollers may serve performance-
critical roles, where they may need to act more like a digital signal processor (DSP),
with higher clock speeds and power consumption.
2.2 Embedded Design
Microcontroller can be considered a self-contained system with a processor, memory
and peripherals and can be used as an embedded system.[1] The majority of
microcontrollers in use today are embedded in other machinery, such as automobiles,
telephone, appliances and application for computer systems. These are
called embedded systems. While some embedded systems are very sophisticated,
many have minimal requirements for memory and program length, with no operating
system, and low software complexity. Typical input and output devices include

3
switches, relays, solenoids, LEDs, small or custom LCD displays, radio frequency
devices, and sensors for data such as temperature, humidity, light level etc. Embedded
systems usually have no keyboard, screen, disks, printers, or other recognizable I/O
devices of a personal computer, and may lack human interaction devices of any kind.
2.3 Programming environments
Microcontrollers were originally programmed only in assembly language, but
various high-level programming languages are now also in common use to target
microcontrollers. These languages are either designed specially for the purpose, or
versions of general purpose languages such as the C programming
language. Compilers for general purpose languages will typically have some
restrictions as well as enhancements to better support the unique characteristics of
microcontrollers. Here in this project we have used embedded C.
The compiler we are going to use in our project is Keil Compiler. Keil was founded in
1982 by Günter and Reinhard Keil, initially as a German GbR. In April 1985 the
company was converted to Keil Elektronik GmbH to market add-on products for the
development tools provided by many of thesilicon vendors. Keil implemented the
first C compiler designed fromthe ground-up specifically for the 8051microcontroller.
Keil provides a broad range of development tools like ANSI C compiler, macro
assemblers, debuggers and simulators, linkers, IDE, library managers, real-time
operating systems and evaluation boards for Intel 8051, Intel MCS-251, ARM,
and XC16x]/C16x/ST10 families.
In October 2005, Keil (Keil Elektronik GmbH in Munich, Germany, and Keil
Software, Inc. in Plano, Texas) were acquired by ARM.
For 8051 microcontroller programming the Keil Compiler is the best compiler.
Programming done in this compiler is easy and simple. For Embedded C its like cake
walk to program the 8051 microcontroller.

4
CHAPTER 3
3 BACKGROUND OF PROJECT
3.1 Functional Block Diagram

Figure 3.1 Block Diagram


In this diagram, various blocks present the working of circuit.
3.1.1Power Supply
Transformers used here are Step down transformers. As output of transformer is AC,
so it gets converted into DC by using capacitor circuit. Above circuit shows output of
first module.
3.1.2 Comparator Circuit and Indicators
Keypad Comparator circuit gets data from the sensors like the IR sensor and LDR
sensor and send it to the microcontroller. In actual comparator circuit sends the digital
data to the microcontroller. Indicators we have used are high power 10mm LED’s
which glow using transistor as a driver circuit. We can’t run this indicator directly
using microcontroller. We need drivers so that they can fulfill the requirement of
current.
3.1.3Microcontroller part
Microcontroller is the heart of the project. This is backbone for all processing
operation of the microcontroller. It takes data from all the sensors and process it for
further operation for example whether airbags to be opened or not etc.

5
3.1.4 LCD
It display the status of the sensors detection and operation. LCD (Liquid Crystal
Display) screen is an electronic display module and find a wide range of applications.
A 16x2 LCD display is very basic module and is very commonly used in various
devices and circuits. These modules are preferred over seven segments and other
multi segment LEDs. The reasons being: LCDs are economical; easily programmable;
have no limitation of displaying special & even custom characters (unlike in seven
segments),animations and so on.
A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In
this LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers,
namely, Command and Data.
The command register stores the command instructions given to the LCD. A
command is an instruction given to LCD to do a predefined task like initializing it,
clearing its screen, setting the cursor position, controlling display etc. The data
register stores the data to be displayed on the LCD. The data is the ASCII value of the
character to be displayed on the LCD. Click to learn more about internal structure of
a LCD..
3.2.Working
The traditional power supply of substation is almost manual. But in modern time
everybody wants to have a smart work in which most of the task take place automatic.
Our project is made to fulfill the current demand of automatic power supply of
substation Here in this project the heart and the mind of the microcontroller is 8051
microcontroller. It processes all the information coming from the sensors and then
activates the particular thing we want. We have included all the latest sensor like Mfd
(multifunctioning detector), smoke detector sensor, etc,
3.3 Organization of the Project
The project organization is done in following modules.
1. Designing of Block Diagram and Circuit Diagram.
2. Selecting various components to be used and to calculate various values.
3. Soldering of various components and IC’s.
4. Mechanical work such as placement of components on Sheet.
Chapter 4 deals with various Components used in project.
Chapter 5 deals with hardware implementation of project.
6
Chapter 6 consists of various results and conclusions related to project.
Chapter 7 deals with applications of project and further improvements or future scope
of it.

7
CHAPTER 4
4 SYSTEM ARCHITECTURE
Before going into details of project let us first emphasize on the basic system,
functional units and functional IC’s to be used in it.
4.1 Transformer
4.1.1 Introduction
A transformer is a device that transfers electrical energy from one circuit to another
through inductively coupled conductors—the transformer's coils. A varying current in
the first or primary winding creates a varying magnetic flux in the transformer's core
and thus a varying magnetic field through the secondary winding. This varying
magnetic field induces a varying electromotive force (EMF), or "voltage", in the
secondary winding. This effect is called mutual induction.
A transformer makes use of Faraday's law and the ferromagnetic properties of an iron
core to efficiently raise or lower AC voltages. It of course cannot increase power so
that if the voltage is raised, the current is proportionally lowered and vice versa.
4.1.2 Basic principles
The transformer is based on two principles: first, that an electric current can produce a
magnetic field (electromagnetism), and, second that a changing magnetic field within
a coil of wire induces a voltage across the ends of the coil (electromagnetic
induction). Changing the current in the primary coil changes the magnetic flux that is
developed. The changing magnetic flux induces a voltage in the secondary coil.
4.1.3 Types of Transformer
There are basically two types of Transformers:
1) Step up Transformers
2) Step down Transformers.
Step Up Transformer:
Step-Up Transformers are one of the really common and vital electrical tools used in
power transmission and modification. They are usually the first major transformer in
a transmission system and are often used in various forms throughout the system.
A step-up transformer is one whose secondary voltage is greater than its primary
voltage. This kind of transformer "steps up" the voltage applied to it. For instance, a
step up transformer is needed to use a 220v product in a country with a 110v supply.

8
Step Down Transformer:
Step-Down Transformers are very close to the construction of Step-Up Transformers,
except that the windings on the primary side are always more numerous than those on
the secondary side. In fact, if you are already thinking it, yes, either type of
transformer could be wired in backwards and therefore achieve the opposite
application. The one caveat in this is that one has to assure that the resultant voltage
is equivalent to what is desirable as it is possible to arrive at an output in a range not
at all desirable for one's needs, depending on the proportionate number of windings
on primary and secondary sides. To be safe and effective, the output of a transformer
must be within a few percent of the voltage needed.
4.1.4 Detailed Operation:
The simplified description above neglects several practical factors, in particular the
primary current required to establish a magnetic field in the core, and the contribution
to the field due to current in the secondary circuit.
Models of an ideal transformer typically assume a core of negligible reluctance with
two windings of zero resistance.[31] When a voltage is applied to the primary
winding, a small current flows, driving flux around the magnetic circuit of the core.
[31] The current required to create the flux is termed the magnetizing current; since
the ideal core has been assumed to have near-zero reluctance, the magnetizing current
is negligible, although still required to create the magnetic field.
The changing magnetic field induces an electromotive force (EMF) across each
winding.[32] Since the ideal windings have no impedance, they have no associated
voltage drop, and so the voltages VP and VS measured at the terminals of the
transformer, are equal to the corresponding EMFs. The primary EMF, acting as it
does in opposition to the primary voltage, is sometimes termed the "back EMF".[33]
This is due to Lenz's law which states that the induction of EMF would always be
such that it will oppose development of any such change in magnetic field.
4.1.5 Construction:
A transformer consists of a rectangular core of soft iron in the form of sheets insulated
from one another. Two separate coils of insulated wires, a primary coil and a
secondary coil are wound on the core. These coils are well insulated from one another
and from the core. The coil on the input side is called Primary coil and the coil on the
output side is called Secondary coil.
9
4.1.6 Energy Losses
An ideal transformer would have no energy losses, and would be 100% efficient. In
practical transformers energy is dissipated in the windings, core, and surrounding
structures. Larger transformers are generally more efficient, and those rated for
electricity distribution usually perform better than 98%.
Experimental transformers using superconducting windings achieve efficiencies of
99.85%.[42] The increase in efficiency can save considerable energy, and hence
money, in a large heavily-loaded transformer; the trade-off is in the additional initial
and running cost of the superconducting design.
Losses in transformers (excluding associated circuitry) vary with load current, and
may be expressed as "no-load" or "full-load" loss. Winding resistance dominates load
losses, whereas hysteresis and eddy currents losses contribute to over 99% of the no-
load loss. The no-load loss can be significant, so that even an idle transformer
constitutes a drain on the electrical supply and a running cost; designing transformers
for lower loss requires a larger core, good-quality silicon steel, or even amorphous
steel, for the core, and thicker wire, increasing initial cost, so that there is a trade-off
between initial cost and running cost. (Also see energy efficient transformer).
Transformer losses are divided into losses in the windings, termed copper loss, and
those in the magnetic circuit, termed iron loss. Losses in the transformer arise from:
Winding resistance:
Current flowing through the windings causes resistive heating of the conductors. At
higher frequencies, skin effect and proximity effect create additional winding
resistance and losses.
Hysteresis losses
Each time the magnetic field is reversed, a small amount of energy is lost due to
hysteresis within the core. For a given core material, the loss is proportional to the
frequency, and is a function of the peak flux density to which it is subjected.[43]
Eddy currents
Ferromagnetic materials are also good conductors, and a core made from such a
material also constitutes a single short-circuited turn throughout its entire length.
Eddy currents therefore circulate within the core in a plane normal to the flux, and are
responsible for resistive heating of the core material. The eddy current loss is a
complex function of the square of supply frequency and inverse square of the material
10
thickness. Eddy current losses can be reduced by making the core of a stack of plates
electrically insulated from each other, rather than a solid block; all transformers
operating at low frequencies use laminated or similar cores.
Magnetostriction
Magnetic flux in a ferromagnetic material, such as the core, causes it to physically
expand and contract slightly with each cycle of the magnetic field, an effect known as
magnetostriction. This produces the buzzing sound commonly associated with
transformers, and can cause losses due to frictional heating.
Mechanical losses
In addition to magnetostriction, the alternating magnetic field causes fluctuating
forces between the primary and secondary windings. These incite vibrations within
nearby metalwork, adding to buzzing noise, and consuming a small amount of power.
Stray losses
Leakage inductance is by itself largely lossless, since energy supplied to its magnetic
fields is returned to the supply with the next half-cycle. However, any leakage flux
that intercepts nearby conductive materials such as the transformer's support structure
will give rise to eddy currents and be converted to heat. There are also radiative losses
due to the oscillating magnetic field, but these are usually small.
4.2 Microcontroler 8051
4.2.1 Introduction
In 1981,Intel Corporation introduced an 8-bit microcontroller called 8051.This
microcontroller had 128 bytes of RAM,4K bytes of on-chip ROM, two timers, one
serial port and four ports(each 8-bits wide) all on a single chip. At that time it was
also referred to as a “system on a chip”. The 8051 is an 8-bit processor meaning that
the CPU can work on only 8-bits of 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 bits wide. The 8051 can have a maximum of 64K bytes of on-chip
ROM.
4.2.2 Features of 8051
 It provides many functions (CPU, RAM, ROM, I/O, interrupt logic, timer, etc.) in
single package
 8-bit ALU, Accumulator and Registers; hence it is an 8-bit microcontroller

11
 8-bit data bus - It can access 8 bits of data in one operation

 16-bit address bus - It can access 216 memory locations - 64 kB (65536 locations)
each of RAM and ROM

 On-chip RAM - 128 bytes (data memory)

 On-chip ROM - 4 kB (program memory)


 Four byte bi-directional input/output port
 UART (serial port)

 Two 16-bit Counter/timers

 Two-level interrupt priority.


4.2.3 Members of 8051 Family
There are two other members in the 8051 family of microcontrollers. They are 8052
and 8031.
8052 Microcontroller
The 8052 is another member of 8051 family. The 8052 has all the standard features of
8051 as well as an extra 128 bytes of RAM and an extra timer. In other words, the
8052 has 256 bytes of RAM and 3 timers. It also has 8K bytes of on-chip program
ROM instead of 4K bytes.
8031Microcontroller
Another member of 8051 family is the 8031 chip. This chip is often referred to as a
ROM-less 8051 since it has 0K bytes of on-chip ROM. To use this chip external
ROM is added to it. The ROM containing the program attached to the 8031 can be as
large as 64K bytes. In the process of adding external ROM containing the program
attached to the 8031, two ports are lost. This leaves only 2 ports for I/O operations. To
solve this problem, we can add external I/O to the 8031 by interfacing the 8031 with
memory and I/O ports such as 8255 chip.

4.2.4 Comaprison of 8051 Family Members


Table 4.1: 8051 Family Members

FEATURE 8051 8052 8031

12
ROM 4K 8K 0K

RAM 128 256 128

TIMERS 2 3 2

I/O PINS 32 32 32

SEARIAL PORT 1 1 1

INTERRUPT SOURCES 6 8 6

4.2.5 Block Diagram

Figure 4.1 Block Diagram

Figure shows the block diagram of a typical microcontroller, which is a true computer
on a chip. The design incorporates all of the features found in microprocessor CPU:
ALU, PC, SP, and registers. It also added the other features needed to make a
complete computer: ROM, RAM, parallel I/O, serial I/O, counters, and clock circuit.

4.2.6 Pin Description


(i)Vcc
Pin 40 provides supply voltage to the chip. The voltage source is +5V.
(ii)GND
13
Pin 20 is the ground.
(iii)XTAL1 and XTAL2

Figure 4.2 Pin Diagram


The 8051 has an on-chip oscillator but requires an external clock to run it. Most often
a quartz crystal oscillator is connected to inputs XTAL1 (pin 19) and XTAL2 (pin
18).The quartz crystal oscillator connected to XTAL1 and XTAL2 also needs two
capacitors of 30pF value. One side of each capacitor is connected to the ground. There
are various speeds of 8051 family. Speed refers to the maximum oscillator frequency
connected to XTAL .

14
Figure 4.3 Oscillator connections

(iv) RST
Pin 9 is the RESET pin. It is an input and is active high (normally low).Upon applying
a high pulse to this pin, the microcontroller will reset and terminate all activities. This
is often referred to as a power-on reset. Activating a power-on reset will cause all
values in the registers to be lost. It will set program counter to all 0s.
In order for reset input to be effective, it must have a minimum duration of two
machine cycles. In other words, the high pulse must be high for a minimum of two
machine cycles before to go low.
(iv) EA
The 8051 family members such as 8751/52, 89C51/52 all come with on-chip ROM to
store programs. In such cases the this pin is connected to V cc. For family members
such as 8031 and 8052 in which there is no on-chip ROM, code is stored on an
external ROM.
and is fetched by the 8051/52.Therefore, for 8051 the EA pin must be connected to
GND to indicate that the code is stored externally. EA which stands for “external
access” is pin number 31 in the DIP packages. It is an input pin and must be
connected to either Vcc or GND. This pin cannot be left unconnected.
(v) PSEN
This pin is an output pin. PSEN stands for “program store enable”. In an 8051 based
system in which an external ROM holds the program code, this pin is connected to the
OE pin of the ROM.
(vi) ALE
ALE (address latch enable) is an output pin and is active high. When connecting an
8051 to external memory, port 0 provides both address and data. In other words, the
8051 multiplexes address and data through port 0 to save pins. The ALE pin is used
for demultiplexing the address and data by connecting to the G pin of the 74LS373
chip.
(vii) I/O PORT PINS
The four ports P0, P1, P2, P3 each use 8 pins, making them 8-bit ports. All the ports
upon RESET are configured as inputs, ready to be used as input ports. When the first

15
0 is written to a port, it becomes an output. To reconfigure it as an input, a 1 must be
sent to the port. To use any of these ports as an input port, it must be programmed.
(vii) PORT 0
Port 0 occupies a total of 8 pins (pins32-39).It can be used for an input or output. To
use the pins of port 0 as both input and output ports, each pin must be connected
externally to a 10K-ohm pull-up resistor. Port 0 is also designated as AD0-AD7,
allowing it to be used for both address and data. When connecting an 8051 to an
external memory, port 0 provides both address and data. The 8051 multiplexes
address and data through port 0 to save pins. ALE indicates if P0 has address or data.
When ALE=0,it provides data D0-D7 but when ALE=1 it has address A0-A7.
(viii) PORT1
Port 1 occupies a total of 8 pins (pins 1 through 8).It can be used as input or output. In
contrast to port 0, this port does not need any pull-up resistors since it already has pull
up resistors. Upon reset, port1 is configured as an input port. If port 1 has been
configured as an output port, to make it an input port again, it must be programmed as
such by writing 1 to all its bits.
(ix) PORT2
Port 2 occupies a total of 8 pins (pins 21 through 28).It can be used as an input or
output. Just like P1.port 2 does not need any pull up resistors since it already has pull
up resistors internally. Upon reset port 2 is configured as an input port. To make port
2 as an input, it must be programmed as such by writing 1 to all its bits.
(x) Dual role of port 2
In many 8051 systems, P2 is used as simple I/O. But in 8051-based systems, port 2
must be used along with P0 to provide the 16-bit address for external memory. Port 2
is also designated as A8-A15, indicating its dual function.
(xi) PORT 3
Port 3 occupies a total of 8 pins, pins 10 through 17.It can be used as input or
oputput.P3 does not need any pull up resistors, just like P1 and P2 did not. Although
port 3 is configured as an input port upon reset, this is not the way it is most
commonly used. Port 3 has the additional function of providing some extremely
important signals such as interrupts. Port 3 has an additional function of providing
some extremely important signals such as interrupts. Some of the alternate functions
of P3 are listed below:
16
P3.0 RXD (Serial input)
P3.1 TXD (Serial output)
P3.2 INT0 (External interrupt 0)
P3.3 INT1 (External interrupt 1)
P3.4 T0 (Timer 0 external input)
P3.5 T1 (Timer 1 external input)
P3.6 WR (External memory write strobe)
P3.7 RD (External memory read strobe).
4.2.7 Memory Space Allocation
1. Internal ROM
The 89C51 has 4K bytes of on-chip ROM. This 4K bytes ROM memory has memory
addresses of 0000 to 0FFFh. Program addresses higher than 0FFFh, which exceed the
internal ROM capacity, will cause the microcontroller to automatically fetch code
bytes from external memory. Code bytes can also be fetched exclusively from an
external memory, addresses 0000h to FFFFh, by connecting the external access pin to
ground. The program counter doesn’t care where the code is: the circuit designer
decides whether the code is found totally in internal ROM, totally in external ROM or
in a combination of internal and external ROM.
2. Internal RAM
The 128 bytes of RAM inside the 8051 are assigned addresses 00 to 7Fh. These 128
bytes can be divided into three different groups as follows:
 A total of 32 bytes from locations 00 to 1Fh are set aside for register banks and the
stack.
 A total of 16 bytes from locations 20h to 2Fh are set aside for bit addressable
read/write memory and instructions.
 A total of 80 bytes from locations 30h to 7Fh are used for read and write storage,
or what is normally called a scratch pad. These 80 locations of RAM are widely
used for the purpose of storing data and parameters by 8051 programmers.
4.2.8 microconttroller programming of project
#include<reg51.h>
#define dataport P0
#define key P3
sbit rs = P2^7;
17
sbit rw = P2^6;
sbit en = P2^5;
sbit relay= P2^0;
sbit smoke = P1^0 ; // smoke
sbit shock = P1^1 ; // shock
sbit ir = P1^2 ; // object
sbit mag = P1^3 ; // door open
sbit tog = P1^4 ; // airbag
sbit red = P3^0 ;
sbit white = P3^1 ;
sbit buzzer = P3^2
void delay(unsigned int msec) //Time delay function
{
int i,j ;
for(i=0;i<msec;i++)
for(j=0;j<1275;j++);
}
void lcd_cmd(unsigned char item) //Function to send command to LCD
{
dataport = item;
rs= 0;
rw=0;
en=1;
delay(1);
en=0;
return;
}
void lcd_data(unsigned char item) // Function to send data to LCD
{
dataport = item;
rs= 1;
rw=0;
en=1;
18
delay(1);
en=0;
return;
}
void lcd_data_string(unsigned char /str) // Function to send string to LCD
{
int i=0;
while(str[i]!='*0')
{
lcd_data(str[i]);
i++; //delay(10);
}
return;
}
void lcd(unsigned char str[10]) // Function to send string to LCD
{
lcd_cmd(0x38);
lcd_cmd(0x0e);
lcd_data_string(str);
}
void main()
{
red=white=0;
buzzer=1;
relay =1;
lcd_cmd(0x01);
lcd_cmd(0x38);
lcd_cmd(0x0C);
lcd_cmd(0x01);
lcd_cmd(0x82);
lcd("Pre-Heating");
lcd_cmd(0xC5);
lcd(" Time ");
19
red=0;
delay(30);
red=1;
delay(50);
red=0;
delay(30);
red=1;
delay(50);
red=0;
delay(30);
red=1;
delay(50);
red=0;
delay(30);
red=1;
delay(50);
red=0;
delay(30);
red=1;
delay(50);
red=0;
delay(30);
red=1;
delay(50);
red=0;
delay(30);
red=1;
delay(50);
red=0;
delay(30);
red=1;
delay(50);
red=0;
20
delay(30);
red=1;
delay(50);
red=0;
delay(30);
red=1;
delay(50);
red=0;
delay(30);
red=1;
delay(50);
red=0;
delay(30);
red=1;
delay(50);
red=0;
delay(30);
red=1;
delay(50);
while(smoke==0);
{
delay(50);
while(1)
{
relay= white= 1 ;
red=0;
buzzer=1;
lcd_cmd(0x01);
lcd_cmd(0x80);
lcd("Substation is in");
lcd_cmd(0xC0);
lcd("Good Condition");
while(smoke == 1 && shock == 0 && ir ==0 && mag == 0 && tog ==1 );
21
if(smoke==0)
{
while(smoke==0)
{
red=1;
white =0;
relay=0;
buzzer=0;
lcd_cmd(0x01);
lcd_cmd(0x80);
lcd("Smoke / Fire ");
lcd_cmd(0xC0);
lcd(" Detected ");
delay(300);
lcd_cmd(0x01);
lcd_cmd(0x80);
lcd("inside the ");
lcd_cmd(0xC0);
lcd("Electri. Chamber");
delay(300);
}
}
if(shock==1)
{
red=1;
white =0;
relay=0;
buzzer=0;
while(shock ==1)
{
lcd_cmd(0x01);
lcd_cmd(0x80);
lcd("strong Vibration");
22
lcd_cmd(0xC0);
lcd("Shock, Frequency");
delay(200);
lcd_cmd(0x01);
lcd_cmd(0x80);
lcd(" Detected Near");
lcd_cmd(0xC0);
lcd("Electri. Unit");
delay(200);
}
}
if(ir==1)
{
red=1;
white =0;
relay=0;
while(ir ==1)
{
buzzer=0;
lcd_cmd(0x01);
lcd_cmd(0x80);
lcd("Object");
lcd_cmd(0xC0);
lcd(" Detected");
delay(200);
buzzer=1;
lcd_cmd(0x01);
lcd_cmd(0x80);
lcd("In the Proxmity");
lcd_cmd(0xC0);
lcd("Danger Zone");
delay(200);
}
23
}
if(mag==1)
{
red=1;
white =0;
relay=0;
buzzer=0;
while ( mag == 1)
{
lcd_cmd(0x01);
lcd_cmd(0x80);
lcd(" Heavy Rain ");
lcd_cmd(0xC0);
lcd(" Detected ");
delay(200);
lcd_cmd(0x01);
lcd_cmd(0x80);
lcd(" Near The ");
lcd_cmd(0xC0);
lcd("Danger Zone");
delay(200);
}
}
if( tog==0 )
{
red=1;
white =0;
relay=0;
while ( tog == 0)
{
buzzer=0;
delay(40);
buzzer=1;
24
lcd_cmd(0x01);
lcd_cmd(0x80);
lcd("MANUAL CUT OFF ");
lcd_cmd(0xC0);
lcd(" ACTIVATED");
delay(200);
}
}
}
}
4.3 Diode
An electric component that conducts electric current in only one direction, functioning
as a one-way valve. Diodes typically are made from semiconductor materials such as
silicon, germanium or selenium and are uses as voltage regulators, signal rectifiers,
oscillators and signal modulators/demodulators. In computer equipment, diodes are
commonly used to emit light by passing a current through it, as in light emitting
diodes (LEDs).
Abbreviation of light emitting diode, an electronic device that lights up when
electricity is passed through it. LEDs are usually red. They are good for displaying
images because they can be relatively small, and they do not burn out. However, they
require more power than LCDs.
The semiconductor diode, also known as a pn junction diode, is a two-element
semiconductor device that makes use of the rectifying properties of a PN junction to
convert alternating current into direct current by permitting current flow in only one
direction.

Figure 4.4: A PN junction diode

4.3.1 Function
25
Diodes allow electricity to flow in only one direction. The arrow of the circuit symbol
shows the direction in which the current can flow. Diodes are the electrical version of
a valve and early diodes were actually called valves.

4.3.2 Forward Voltage


Electricity uses up a little energy pushing its way through the diode, rather like a
person pushing through a door with a spring. This means that there is a small voltage
across a conducting diode, it is called the forward voltage drop and is about 0.7V for
all normal diodes which are made from silicon. The forward voltage drop of a diode is
almost constant whatever the current passing through the diode so they have a very
steep characterstic (currenet-voltage graph).

4.3.3 Reverse Voltage


When a reverse voltage is applied a perfect diode does not conduct, but all real diodes
leak a very tiny current of a few uA or less. This can be ignored in most circuits
because it will be very much smaller than the current flowing in the forward direction.
However, all diodes have a maximum reverse voltage(usually 50V or more) and if
this is exceeded the diode will fail and pass a large current in the reverse direction,
this is called breakdown.
Ordinary diodes can be split into two types:
 Signal diodes, which pass small currents of 100mA or less.
 Rectifier diode, which can pass large currents.

Figure.4.6 A reverse biased PN junction diode

4.3.4 Biasing
4.3.4.1 Forward biasing
26
It is an external voltage that is applied to a PN junction to reduce its barrier and,
therefore aid current flow through the junction. To accomplish this function,the
external voltage is connected so that it opposes the electrostatic field of the junction.

Figure.4.7 Internal diagram of forward biased PN junction

4.3.4.2 Reverse biasing


It is an external voltage that is connected across a PN junction so that its voltage aids
the junction and thereby, offers a high resistance to the current flow through the
junction.

Figure.4.8 Internal diagram of reverse biased PN junction

4.3.5 V-I Characterstics


The charcterstics are plotted under three heads: Zero external voltage, forward
biasing, reverse biasing. From the chracterstics following points may be noted:
 At Zero external voltage,no current flows through the circuit or diode.
 At forward bias ,the current increases slightly the barrier potential is wiped-off.
 After knee voltage,the forward current rise abruptly.
 The forward current is limited by series resistance and a small value of junction
resistance. If the forward current increase beyond the rated value of the diode, the
diode may be destroyed.

27
 At reverse bias, the reverse current increases slightly with the increase in voltage
because of the minority carriers. For silicon the maximum value of reverse current
is low as 1uA. However, for Ge, it is about 100uA.
 At a certain reverse voltage, the reverse current rises abruptly to a large value. It is
because at this voltage the junction breaks and the resistance of the barrier region
falls suddenly.
 Breakdown voltage is the reverse votage at which pn junction breaks. At reverse
votage, when the junction breaks the diode may be destroyed.

Figure 4.9 characteristics of PN junction diode

4.4 Oscillator Circuit


Oscillator circuit is the heart of the 8051 microcontroller. The 8051 has an on chip
oscillator but it requires an external clock to run it.
Most often a quartz crystal oscillator is connected to inputs XTAL1(Pin 19) and
XTAL2(Pin 18).The a quartz crystal oscillator connected to inputs XTAL1 and
XTAL2 requires two capacitors of 30pF each.One side of each capacitor is connected
to ground.

28
Figure 4.10 : Crystal connection to 8051
4.5 Resistor
A linear resistor is a linear, passive two-terminal electrical component that
implements electrical resistance as a circuit element. The current through a resistor is
in direct proportion to the voltage across the resistor's terminals. Thus, the ratio of the
voltage applied across a resistor's terminals to the intensity of current through the
circuit is called resistance.
This relation is represented by Ohm's law:
I= V/R.
Resistors are common elements of electrical networks and electronic circuits and are
ubiquitous 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). Resistors are also implemented within integrated circuits,
particularly analog devices, and can also be integrated into hybrid and printed circuits.
The electrical functionality of a resistor is specified by its resistance: common
commercial resistors are manufactured over a range of more than nine orders of
magnitude. When specifying that resistance in an electronic design, the required
precision of the resistance may require attention to the manufacturing tolerance of the
chosen resistor, according to its specific application. The temperature coefficient of
the resistance may also be of concern in some precision applications. Practical

29
resistors are also specified as having a maximum power rating which must exceed the
anticipated power dissipation of that resistor in a particular circuit: this is mainly of
concern in power electronics applications. Resistors with higher power ratings are
physically larger and may require heat sinks. In a high-voltage circuit, attention must
sometimes be paid to the rated maximum working voltage of the resistor.
Practical resistors have a series inductance and a small parallel capacitance; these
specifications can be important in high-frequency applications. 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.[1] A family of discrete resistors is also characterized according to its
form factor, that is, the size of the device and the position of its leads (or terminals)
which is relevant in the practical manufacturing of circuits using them.
Units:
The behavior of an ideal resistor is dictated by the relationship specified by Ohm's
law:
Ohm's law states that the voltage (V) across a resistor is proportional to the current
(I), where the constant of proportionality is the resistance (R).
Equivalently, Ohm's law can be stated:
This formulation states that the current (I) is proportional to the voltage (V) and
inversely proportional to the resistance (R). This is directly used in practical
computations. For example, if a 300 ohm resistor is attached across the terminals of a
12 volt battery, then a current of 12 / 300 = 0.04 amperes (or 40 milliamperes) occurs
across that resistor.
Power dissipation:
The power P dissipated by a resistor (or the equivalent resistance of a resistor
network) is calculated as:

Construction:
1) Lead arrangements
30
Through-hole components typically have leads leaving the body axially. Others have
leads coming off their body radially instead of parallel to the resistor axis. Other
components may be SMT (surface mount technology) while high power resistors may
have one of their leads designed into the heat sink.
2) Carbon Composition
Carbon composition resistors consist of a solid cylindrical resistive element with
embedded wire leads or metal end caps to which the lead wires are attached. The body
of the resistor is protected with paint or plastic. Early 20th-century carbon
composition resistors had uninsulated bodies; the lead wires were wrapped around the
ends of the resistance element rod and soldered. The completed resistor was painted
for color coding of its value.
The resistive element is made from a mixture of finely ground (powdered) carbon and
an insulating material (usually ceramic). A resin holds the mixture together. The
resistance is determined by the ratio of the fill material (the powdered ceramic) to the
carbon. Higher concentrations of carbon, a weak conductor, result in lower resistance.
Carbon composition resistors were commonly used in the 1960s and earlier, but are
not so popular for general use now as other types have better specifications, such as
tolerance, voltage dependence, and stress (carbon composition resistors will change
value when stressed with over-voltages). Moreover, if internal moisture content (from
exposure for some length of time to a humid environment) is significant, soldering
heat will create a non-reversible change in resistance value. Carbon composition
resistors have poor stability with time and were consequently factory sorted to, at
best, only 5% tolerance.[4] These resistors, however, if never subjected to overvoltage
nor overheating were remarkably reliable considering the component's size.

4.6 Capacitors
A capacitor (formerly known as condenser) is a passive two-terminal electrical
component used to store energy in an electric field. The forms of practical capacitors
vary widely, but all contain at least two electrical conductors separated by a dielectric
(insulator). Capacitors are used as parts of electrical systems, for example, consist of
metal foils separated by a layer of insulating film.
When there is a potential difference (voltage) across the conductors, a static electric
field develops across the dielectric, causing positive charge to collect on one plate and

31
negative charge on the other plate. Energy is stored in the electrostatic field. An ideal
capacitor is characterized by a single constant value, capacitance, measured in farads.
This is the ratio of the electric charge on each conductor to the potential difference
between them.
The capacitance is greatest when there is a narrow separation between large areas of
conductor, hence capacitor conductors are often called "plates," referring to an early
means of construction. In practice, the dielectric between the plates passes a small
amount of leakage current and also has an electric field strength limit, resulting in a
breakdown voltage, while the conductors and leads introduce an undesired inductance
and resistance.
Capacitors are widely used in electronic circuits for blocking direct current while
allowing alternating current to pass, in filter networks, for smoothing the output of
power supplies, in the resonant circuits that tune radios to particular frequencies and
for many other purposes.
4.7 Battery
An electrical battery is one or more electrochemical cells that convert stored chemical
energy into electrical energy. Since the invention of the first battery (or "voltaic pile")
in 1800 by Alessandro Volta, batteries have become a common power source for
many household and industrial applications. According to a 2005 estimate, the
worldwide battery industry generates US$48 billion in sales each year, with 6%
annual growth.
There are two types of batteries: primary batteries (disposable batteries), which are
designed to be used once and discarded, and secondary batteries (rechargeable
batteries), which are designed to be recharged and used multiple times. Batteries come
in many sizes, from miniature cells used to power hearing aids and wristwatches to
battery banks the size of rooms that provide standby power for telephone exchanges
and computer data centers.
Principle of operation
A battery is a device that converts chemical energy directly to electrical energy.It
consists of a number of voltaic cells; each voltaic cell consists of two half cells
connected in series by a conductive electrolyte containing anions and cations. One
half-cell includes electrolyte and the electrode to which anions (negatively charged
ions) migrate, i.e., the anode or negative electrode; the other half-cell includes
32
electrolyte and the electrode to which cations (positively charged ions) migrate, i.e.,
the cathode or positive electrode. In the redox reaction that powers the battery, cations
are reduced (electrons are added) at the cathode, while anions are oxidized (electrons
are removed) at the anode. The electrodes do not touch each other but are electrically
connected by the electrolyte. Some cells use two half-cells with different electrolytes.
A separator between half cells allows ions to flow, but prevents mixing of the
electrolytes.
Each half cell has an electromotive force (or emf), determined by its ability to drive
electric current from the interior to the exterior of the cell. The net emf of the cell is
the difference between the emfs of its half-cells, as first recognized by Volta.
Therefore, if the electrodes have emfs and , then the net emf is ; in other words, the
net emf is the difference between the reduction potentials of the half-reactions.
The electrical driving force or across the terminals of a cell is known as the terminal
voltage (difference) and is measured in volts. The terminal voltage of a cell that is
neither charging nor discharging is called the open-circuit voltage and equals the emf
of the cell. Because of internal resistance, the terminal voltage of a cell that is
discharging is smaller in magnitude than the open-circuit voltage and the terminal
voltage of a cell that is charging exceeds the open-circuit voltage. An ideal cell has
negligible internal resistance, so it would maintain a constant terminal voltage of
until exhausted, then dropping to zero. If such a cell maintained 1.5 volts and stored a
charge of one coulomb then on complete discharge it would perform 1.5 joule of
work.In actual cells, the internal resistance increases under discharge, and the open
circuit voltage also decreases under discharge. If the voltage and resistance are plotted
against time, the resulting graphs typically are a curve; the shape of the curve varies
according to the chemistry and internal arrangement employed.
As stated above, the voltage developed across a cell's terminals depends on the energy
release of the chemical reactions of its electrodes and electrolyte. Alkaline and
carbon-zinc cells have different chemistries but approximately the same emf of 1.5
volts; likewise NiCd and NiMH cells have different chemistries, but approximately
the same emf of 1.2 volts.On the other hand the high electrochemical potential
changes in the reactions of lithium compounds give lithium cells emfs of 3 volts or
more.
4.8 Micro switches
33
A miniature snap-action switch, also trademarked and frequently known as a micro
switch, is an electric switch that is actuated by very little physical force, through the
use of a tipping-point mechanism, sometimes called an "over-center" mechanism.
Switching happens reliably at specific and repeatable positions of the actuator, which
is not necessarily true of other mechanisms. They are very common due to their low
cost and durability, greater than 1 million cycles and up to 10 million cycles for heavy
duty models. This durability is a natural consequence of the design.
The defining feature of micro switches is that a relatively small movement at the
actuator button produces a relatively large movement at the electrical contacts, which
occurs at high speed (regardless of the speed of actuation). Most successful designs
also exhibit hysteresis, meaning that a small reversal of the actuator is insufficient to
reverse the contacts; there must be a significant movement in the opposite direction.
Both of these characteristics help to achieve a clean and reliable interruption to the
switched circuit.
Micro switches are very widely used; among their applications are appliances,
machinery, industrial controls, vehicles, and many other places for control of
electrical circuits. They are usually rated to carry current in control circuits only,
although some switches can be directly used to control small motors, solenoids,
lamps, or other devices.

Figure 4.11 Micro switch

4.9 IC1 7806


It is a voltage regulator meant to give regulated 6V supply when provided with
suitable input.

34
The 78xx (sometimes LM78xx) is a family of self-contained fixed linear voltage
regulator integrated circuits. The 78xx family is commonly used in electronic circuits
requiring a regulated power supply due to their ease-of-use and low cost. For ICs
within the family, the xx is replaced with two digits, indicating the output voltage (for
example, the 7805 has a 5 volt output, while the 7812 produces 12 volts). The 78xx
line are positive voltage regulators: they produce a voltage that is positive relative to a
common ground. There is a related line of79xx devices which are complementary
negative voltage regulators. 78xx and 79xx ICs can be used in combination to provide
positive and negative supply voltages in the same circuit.
78xx ICs have three terminals and are commonly found in the TO220 form factor,
although smaller surface-mount and larger TO3 packages are available. These devices
support an input voltage anywhere from a couple of volts over the intended output
voltage, up to a maximum of 35 or 40 volts, and typically provide 1 or
1.5 amperes of current (though smaller or larger packages may have a lower or higher
current rating).
Advantages
 78xx series ICs do not require additional components to provide a constant,

regulated source of power, making them easy to use, as well as economical and
efficient uses of space. Other voltage regulators may require additional
components to set the output voltage level, or to assist in the regulation process.
Some other designs (such as a switching power supply) may need substantial
engineering expertise to implement.
 78xx series ICs have built-in protection against a circuit drawing too much power.
They have protection against overheating and short-circuits, making them quite
robust in most applications. In some cases, the current-limiting features of the 78xx
devices can provide protection not only for the 78xx itself, but also for other parts
of the circuit.
Disadvantages
 The input voltage must always be higher than the output voltage by some
minimum amount (typically 2 volts). This can make these devices unsuitable for
powering some devices from certain types of power sources (for example,
powering a circuit that requires 5 volts using 6-volt batteries will not work using a
7805).
35
 As they are based on a linear regulator design, the input current required is always
the same as the output current. As the input voltage must always be higher than the
output voltage, this means that the total power (voltage multiplied by current)
going into the 78xx will be more than the output power provided. The extra input
power is dissipated as heat. This means both that for some applications an
adequate heatsink must be provided, and also that a (often substantial) portion of
the input power is wasted during the process, rendering them less efficient than
some other types of power supplies. When the input voltage is significantly higher
than the regulated output voltage (for example, powering a 7805 using a 24 volt
power source), this inefficiency can be a significant issue.
 Even in larger packages, 78xx integrated circuits cannot supply as much power as
many designs which use discrete components, and are generally inappropriate for
applications requiring more than a few amperes of current.
In spite of the above mentioned disadvantes, these are widely used for voltage
regulation as their advantages hold good over disadvantages.
4.10 Relay
A relay is an electrically operated switch. Many relays use an electromagnet to
operate a switching mechanism mechanically, but other operating principles are also
used. Relays are used where it is necessary to control a circuit by a low-power signal
(with complete electrical isolation between control and controlled circuits), or where
several circuits must be controlled by one signal. The first relays were used in long
distance telegraph circuits, repeating the signal coming in from one circuit and re-
transmitting it to another. Relays were used extensively in telephone exchanges and
early computers to perform logical operations.
A type of relay that can handle the high power required to directly control an electric
motor is called a contactor. Solid-state relays control power circuits with no moving
parts, instead using a semiconductor device to perform switching. Relays with
calibrated operating characteristics and sometimes multiple operating coils are used to
protect electrical circuits from overload or faults; in modern electric power systems
these functions are performed by digital instruments still called "protective relays"
4.10.1Basic Operation:
A simple electromagnetic relay consists of a coil of wire surrounding a soft iron core,
an iron yoke which provides a low reluctance path for magnetic flux, a movable iron
36
armature, and one or more sets of contacts (there are two in the relay pictured). The
armature is hinged to the yoke and mechanically linked to one or more sets of moving
contacts. It is held in place by a spring so that when the relay is de-energized there is
an air gap in the magnetic circuit. In this condition, one of the two sets of contacts in
the relay pictured is closed, and the other set is open. Other relays may have more or
fewer sets of contacts depending on their function. The relay in the picture also has a
wire connecting the armature to the yoke. This ensures continuity of the circuit
between the moving contacts on the armature, and the circuit track on the printed
circuit board (PCB) via the yoke, which is soldered to the PCB.

Figure 4.12 Relay

When an electric current is passed through the coil it generates a magnetic field that
attracts the armature, and the consequent movement of the movable contact(s) either
makes or breaks (depending upon construction) a connection with a fixed contact. If
the set of contacts was closed when the relay was de-energized, then the movement
opens the contacts and breaks the connection, and vice versa if the contacts were
open. When the current to the coil is switched off, the armature is returned by a force,
approximately half as strong as the magnetic force, to its relaxed position. Usually
this force is provided by a spring, but gravity is also used commonly in industrial
motor starters. Most relays are manufactured to operate quickly. In a low-voltage
application this reduces noise; in a high voltage or current application it reduces
arcing.
When the coil is energized with direct current, a diode is often placed across the coil
to dissipate the energy from the collapsing magnetic field at deactivation, which
would otherwise generate a voltage spike dangerous to semiconductor circuit

37
components. Some automotive relays include a diode inside the relay case.
Alternatively, a contact protection network consisting of a capacitor and resistor in
series (snubber circuit) may absorb the surge. If the coil is designed to be energized
with alternating current (AC), a small copper "shading ring" can be crimped to the
end of the solenoid, creating a small out-of-phase current which increases the
minimum pull on the armature during the AC cycle.[1]
A solid-state relay uses a thyristor or other solid-state switching device, activated by
the control signal, to switch the controlled load, instead of a solenoid. An optocoupler
(a light-emitting diode (LED) coupled with a photo transistor) can be used to isolate
control and controlled circuits.
4.10.2 Pole and throw
Since relays are switches, the terminology applied to switches is also applied to
relays. A relay will switch one or more poles, each of whose contacts can be thrown
by energizing the coil in one of three ways:
Normally-open (NO) contacts connect the circuit when the relay is activated; the
circuit is disconnected when the relay is inactive. It is also called a Form A contact or
"make" contact. NO contacts can also be distinguished as "early-make" or NOEM,
which means that the contacts will close before the button or switch is fully engaged.
Normally-closed (NC) contacts disconnect the circuit when the relay is activated; the
circuit is connected when the relay is inactive. It is also called a Form B contact or
"break" contact. NC contacts can also be distinguished as "late-break" or NCLB,
which means that the contacts will stay closed until the button or switch is fully
disengaged.
Change-over (CO), or double-throw (DT), contacts control two circuits: one
normally-open contact and one normally-closed contact with a common terminal. It is
also called a Form C contact or "transfer" contact ("break before make"). If this type
of contact utilizes a "make before break" functionality, then it is called a Form D
contact.

38
Figure 4.13 Function of Relay

The following designations are commonly encountered:


SPST – Single Pole Single Throw. These have two terminals which can be connected
or disconnected. Including two for the coil, such a relay has four terminals in total. It
is ambiguous whether the pole is normally open or normally closed. The terminology
"SPNO" and "SPNC" is sometimes used to resolve the ambiguity.
SPDT – Single Pole Double Throw. A common terminal connects to either of two
others. Including two for the coil, such a relay has five terminals in total.
DPST – Double Pole Single Throw. These have two pairs of terminals. Equivalent to
two SPST switches or relays actuated by a single coil. Including two for the coil, such
a relay has six terminals in total. The poles may be Form A or Form B (or one of
each).
DPDT – Double Pole Double Throw. These have two rows of change-over terminals.
Equivalent to two SPDT switches or relays actuated by a single coil. Such a relay has
eight terminals, including the coil.
The "S" or "D" may be replaced with a number, indicating multiple switches
connected to a single actuator. For example 4PDT indicates a four pole double throw
relay (with 14 terminals).
EN 50005 are among applicable standards for relay terminal numbering; a typical EN
50005-compliant SPDT relay's terminals would be numbered 11, 12, 14, A1 and A2
for the C, NC, NO, and coil connections, respectively.
4.10.3 Applications:
Relays are used to and for:
 longer (up to a minute) delay, a dashpot is used. A dashpot is a piston filled with
fluid that is allowed to escape slowly. The time period can be varied by increasing
or Amplify a digital signal, switching a large amount of power with a small
operating power.
39
 Detect and isolate faults on transmission and distribution lines by opening and
closing circuit breakers (protection relays).
 Isolate the controlling circuit from the controlled circuit when the two are at
different potentials, for example when controlling a mains-powered device from a
low-voltage switch. The latter is often applied to control office lighting as the low
voltage wires are easily installed in partitions, which may be often moved as needs
change. They may also be controlled by room occupancy detectors in an effort to
conserve energy.
 Safety-critical logic. Because relays are much more resistant than semiconductors
to nuclear radiation, they are widely used in safety-critical logic, such as the
control panels of radioactive waste-handling machinery.
 Time delay functions. Relays can be modified to delay opening or delay closing a
set of contacts. A very short (a fraction of a second) delay would use a copper disk
between the armature and moving blade assembly. Current flowing in the disk
maintains magnetic field for a short time, lengthening release time. For a slightly
decreasing the flow rate. For longer time periods, a mechanical clockwork timer is
installed.
4.11 Sensors
The sensors we have used here are of many types like magnetic contact, magnetic
concealed sensor, IR Sensor, LDR sensor, MFD sensor, Smoke Detection circuit etc.
All these sensors sense the environment around the car and give signal to the
microcontroller so that the operation can be performed. Most Advance sensor used
here are MFD and concealed magnetic sensor.

Fig 4.14 - sensors

40
4.11.1 MFD (Multi function detector)

Fig 4.15-Multi function detector


Multifunction detector sensor is a sensor which works at multilevel. It can take input
from multiple environmental conditions and gives the signal in the form of continuity
breakage. The sensor out is shown on the LED’s. when there is no detection then the
LED will be green but if there is a detection then the LED turn red. Circuits
Continuity will broken on detection. Output is taken from the NC ( Normally
connected ) Connector. This NC connector becomes NO ( Normally open ) on
detection. MFD is a great advancement in the area of security. If
 Detects Vibration related to the Earthquakes etc.
 Detects Vibration, breaking of glass, cutting of metal grills and aluminum frames

 Alarm LED glows on alarm triggering

 High Low sensitivity jumper

 Further sensitivity adjustment switch

 Green comfort LED

 Red alarm LED

41
 White ABS Housing

4.11.2 Contact Magnetic sensor

Fig 4.16- Contact magnetic sensor


The basic principal of contact magnetic sensor and the concealed magnetic sensor is
same which the reed switches inside them for the main operation. The reed switch is
capable of sensing the presence of magnet near it. If we take any magnet near the
reed switch it gets connected and shows continuity. And if we take away the magnet it
shows discontinuity. So, the basic principal of contact magnetic sensor is simple but
the application is big. Contact magnetic sensor is installed in open places. So the
installation is open and can be seen by the thief and more prone to security threats.
Contact magnetic sensor can be utilized anywhere where we need indication when
something is moved from place to another place. This action is well sensed by the
contact magnetic sensor. The application area of the contact magnetic sensor is huge.
Main feature if the contact magnetic sensor are as follows:-

• 2 Wire connectivity options


• Tamper loop can be made
• Opening gap 15mm (max)
• White ABS bodies
• Model SEC-MS4

42
4.11.3 Concealed Magnetic Sensor

Fig 4.17-Concealed magnetic detector


Concealed magnetic sensor utilizes the reed switch inside them for main operation.
The reed switch is capable of sensing the presence of magnet near it. If we take any
magnet near the reed switch it gets connected and shows continuity. And if we take
away the magnet it shows discontinuity. So, the basic principal of concealed magnetic
sensor is simple but the application is complex. The main benefit of concealed
magnetic sensor in comparison to the contact magnetic sensor is that during
installation it is inside the body and so cannot be seen by the intruder or thieves etc. so
installation of concealed magnetic sensor is more secured as comparison to contact
magnetic sensor.
The main feature of the concealed magnetic sensors are as follow:-
 Concealed pencil type shaped easily recessed in frames
 Hole can be made with standard drill bit

 2 wire connectivity

 Opening gap 15mm

 Available in black & white bodies

43
CHAPTER 5
5- HARDWARE IMPLEMENTATION
5.1 Hardware Description
5.1.1 Component Used
The various components used in the project are listed as below:

S.No Component Name Quantity


1. IR sensor 1
2. Transformer(6-0-6 500 mA) 1
3. Capacitor 30 pF 2
4. Voltage regulator 7806 1
5. General Purpose PCB 1
6. Pin Connectors 2
7. Diodes 1N4007 6
8. Microcontroller 8051(AT89C52P6) 1
9. Sensor Magnetic contact and Concealed 1
10. Smoke Detector 1
11. MFD Multifunction detector 1
12. CPU fan 1
13. Relay 1
14. Driver IC L293D, etc. 1
Besides these some other equipments and materials were also used such as
Soldering iron and Solder wire
5.1.2 Circuit Modules
This project is divided into following modules
1. AC to DC conversion
2. Sensor arrangement section
3. Controller Section

44
4. Motor and Motor Driver Section
1) AC to DC Conversion:

The following are the circuit diagrams AC to DC Conversion.


.

Figure 5.1 AC to DC conversion

Transformers used here are Step down transformers. As output of transformer is AC,
so it gets converted into DC by using capacitor circuit. Above circuit shows output of
first module.

2) Sensor arrangement section


In this section all the sensors are arranged in proper way. IR Sensor and LDR sensor
have wire connection. One for signal and the other for positive and 3 rd for the negative
terminal. MFD sensor need 4 wires two for the power supply and another two for the
continuity. Contact magnetic sensor and concealed magnetic sensor both works in the
similar way. They are used to maintain the continuity.

3) Microcontroller part
45
Microcontroller is the heart of the setup.

Figure 5.2 Pin diagram 8051


The microcontroller is getting its input from the keypad and electrical conduction
section. As the water reaches user defined level, controller performs the predefined
function on getting high signal at input. Now the motor is disconnected from power
supply so as to stop further water supply to tank. Thereby it prevents any wastage of
water.
4) Motor and Motor Driver Section
Motor driver is used to drive the motor. Motor is further meant to drive the pump.
Thus water level indicator not only indicates level of water but also controls the pump
or the water source. Once the desired level of water is reached, the motor(or any other
water source) will automatically be switched off there by avoiding any chances of
wastage of water.
5.2 Tools and Platform Used
Various tools are used in this project as:
5.2.1 Printed Circuit Board:

46
A printed circuit board, or PCB, is used to mechanically support and electrically
connect electronic components using conductive pathways, tracks or signal traces
etched from copper sheets laminated onto a non-conductive substrate. It is also
referred to as printed wiring board (PWB) or etched wiring board. A PCB populated
with electronic components is a printed circuit assembly (PCA), also known as a
printed circuit board assembly (PCBA). Printed circuit boards are used in virtually all
but the simplest commercially-produced electronic devices.
PCBs are inexpensive, and can be highly reliable. They require much more layout
effort and higher initial cost than either wire wrap or point-to-point construction, but
are much cheaper and faster for high-volume production; the production and soldering
of PCBs can be done by totally automated equipment. Much of the electronics
industry's PCB design, assembly, and quality control needs are set by standards that
are published by the IPC organization.
Materials Used:
Conducting layers are typically made of thin copper foil. Insulating layers dielectric
are typically laminated together with epoxy resin prepreg. The board is typically
coated with a solder mask that is green in color. Other colors that are normally
available are blue, black, white and red. There are quite a few different dielectrics that
can be chosen to provide different insulating values depending on the requirements of
the circuit. Some of these dielectrics are polytetrafluoroethylene (Teflon), FR-4, FR-1,
CEM-1 or CEM-3. Well known prepreg materials used in the PCB industry are FR-2
(Phenolic cotton paper), FR-3 (Cotton paper and epoxy), FR-4 (Woven glass and
epoxy), FR-5 (Woven glass and epoxy), FR-6 (Matte glass and polyester), G-10
(Woven glass and epoxy), CEM-1 (Cotton paper and epoxy), CEM-2 (Cotton paper
and epoxy), CEM-3 (Woven glass and epoxy), CEM-4 (Woven glass and epoxy),
CEM-5 (Woven glass and polyester). Thermal expansion is an important
consideration especially with ball grid array (BGA) and naked die technologies, and
glass fiber offers the best dimensional stability.
Here in below figure show images of Printed Circuit board
FR-4 is by far the most common material used today. The board with copper on it is
called "copper-clad laminate".
Copper foil thickness can be specified in ounces per square foot or micrometres. One
ounce per square foot is 1.344 mils or 34 micrometres.
47
5.2.2 Soldering Iron
A soldering iron is a hand tool most commonly used in soldering. It supplies heat to
melt the solder so that it can flow into the joint between two workpieces.
A soldering iron is composed of a heated metal tip and an insulated handle. Heating is
often achieved electrically, by passing an electric current (supplied through an
electrical cord or battery cables) through the resistive material of a heating element.
Another heating method includes combustion of a suitable gas, which can either be
delivered through a tank mounted on the iron (flameless), or through an external
flame.
Less common uses include pyrography (burning designs into wood) and plastic
welding.
Soldering irons are most often used for installation, repairs, and limited production
work. High-volume production lines use other soldering methods
Tips while using Soldering Iron:
Some soldering irons have interchangeable tips, also known as bits, that vary in size
and shape for different types of work.[2] Pyramid tips with a triangular flat face and
chisel tips with a wide flat face are useful for soldering sheet metal. Fine conical or
tapered chisel tips are typically used for electronics work.
Older and very cheap irons typically use a bare copper tip, which is shaped with a file
or sandpaper. This dissolves gradually into the solder, suffering pitting and erosion of
the shape. Copper tips are sometimes filed when worn down. Iron-plated copper tips
have become increasingly popular since the 1980s. Because iron is not readily
dissolved by molten solder, the plated tip is more durable than a bare copper one. This
is especially important when working at the higher temperatures needed for modern
lead-free solders. Solid iron and steel tips are seldom used because they store less
heat, and rusting can break the heating element.
Cleaning:
When burnt flux and oxidized material begin to accumulate on the tip, they can block
heat transfer and contaminate joints, making soldering difficult or impossible.
Therefore, the tips are periodically cleaned. Many soldering stations come with
cellulose sponges which are dampened and used to wipe a hot iron's tip clean. A wire
brush, preferably brass or wire wheel (mounted on a bench grinder), is sometimes
carefully used to remove very severe oxidation, though this may risk damaging the
48
tip's protective iron plating. A small amount of fresh solder is usually then applied to
the clean tip in a process called tinning. The working surface of the tip is usually kept
tinned (coated with wet solder) to minimize oxidation. Oxidation blocks heat transfer,
corrodes the tip, and contaminates the joint
5.2.3 Soldering Wire
Solder (usually pronounced /sɒldər/, /soʊdər/ or in USA /sɒdər/) is a fusible metal
alloy used to join together metal workpieces and having a melting point below that of
the workpiece(s).
Soft solder is what is most often thought of when solder or soldering are mentioned
and it typically has a melting range of 90 to 450 °C (190 to 840 °F). It is commonly
used in electronics and plumbing. Alloys that melt between 180 and 190 °C (360 and
370 °F) are the most commonly used. By definition, using alloys with melting point
above 450 °C (840 °F) is called 'hard soldering', 'silver soldering' or brazing. Soft
solder can contain lead and/or flux but in many applications lead free solder is used.
Perhaps the most common and most familiar form of solder is as a wire or rod, though
plumbers often use bars of solder while jewelers often use solder in thin sheets which
they cut into snippets. Solder can also come in a paste or as a preformed foil shaped to
match the workpiece. The word solder comes from the Middle English word soudur,
via Old French solduree and soulder, from the Latin solidare, meaning "to make
solid".
Eutectic alloys melt at a single temperature. Non-eutectic alloys have markedly
different solidus and liquidus temperature, and within that range they exist as a paste
of solid particles in a melt of the lower-melting phase. The pasty state causes some
problems during handling; it can however be exploited as it allows molding of the
solder during cooling, e.g. for ensuring watertight joint of pipes, resulting in a so
called 'wiped joint'.
With the reduction of the size of circuit board features, the size of interconnects
shrinks as well. Current densities above 104 A/cm2 are often achieved and
electromigration becomes a concern. At such current densities the Sn63Pb37 solder
balls form hillocks on the anode side and voids on the cathode side; the increased
content of lead on the anode side suggests lead is the primary migrating species.
5.2.4 Lead solder

49
Tin/lead solders, also called soft solders, are commercially available with tin
concentrations between 5% and 70% by weight. The greater the tin concentration, the
greater the solder’s tensile and shear strengths. At the retail level, the two most
common alloys are 60/40 Tin/lead (Sn/Pb) which melts at 370 °F or 188 °C and 63/37
Sn/Pb used principally in electrical/electronic work. The 63/37 ratio is notable in that
it is a eutectic mixture, which means:
1) It has the lowest melting point (183 °C or 361.4 °F) of all the tin/lead alloys; and
2) The melting point is truly a point — not a range.
In plumbing, a higher proportion of lead was used, commonly 50/50. This had the
advantage of making the alloy solidify more slowly, so that it could be wiped over the
joint to ensure watertightness, the pipes being physically fitted together before
soldering. Although lead water pipes were displaced by copper when the significance
of lead poisoning began to be fully appreciated, lead solder was still used until the
1980s because it was thought that the amount of lead that could leach into water from
the solder was negligible from a properly soldered joint. The electrochemical couple
of copper and lead promotes corrosion of the lead and tin, however tin is protected by
insoluble oxide. Since even small amounts of lead have been found detrimental to
health, lead in plumbing solder was replaced by silver (food grade applications) or
antimony, with copper often added, and the proportion of tin was increased (see Lead-
free solder.)
The addition of tin improves wetting properties of the alloy; lead itself has poor
wetting characteristics. Tin however increases the cost of the solder. High-tin tin-lead
alloys have limited use as the workability range can be provided by a cheaper high-
lead alloy.
In electronics, printed circuit boards use solder joints to mount components and create
a circuit. For miniaturised PCB joints with surface mount components, solder paste
has largely replaced solid solder.

5.3 Circuit Diagram

50
Figure 5.3: Circuit Diagram

51
CHAPTER 6
6- APPLICATIONS AND FUTURE SCOPE
6.1 Response Time of System
The Microcontroller based modern car implementation system proves to be a real time
feedback control system which monitors and controls all the activities efficiently and
automatically. The controller controls all activities in few milliseconds which is
indeed a very fast response for practical applications.

6.2 Applications
This project is very useful. It removes the need of constant human monitoring
required during driving the vehicle thereby reducing human efforts to great extent.
Microcontroller monitored modern car implementation has following advantages:
1) It finds great application in today’s modern automobile world.
2) Innovation can be used in Railway, Air- space department to modernize them.
3) Can be used in smart robots.

6.3 Future Scope


Now days the speed for new inventions has reached up to great extent. Each day you
can see new invention in the industries. Our project is supporting the current trend of
the technology. We have included the latest sensor to modernize the car system. As
everyone in today’s time love to have smart car so, our project is step ahead according
to today’s time. We can say that because of the popularity of the features our car have,
it’s control system has huge potential. Because of its low cost it is going to be use by
almost all the company

52
CHAPTER 7
Conclusion
After working on this project we have reached to the conclusion that this project has
proved itself to be very simple, user friendly, cheap in comparison with its utility,
accurate and fast. It can be used to establish completely automated control on
distanced switching of the motor or other appliances through the mobile of user.
Which can further give rise to many other applications.

53
REFERENCES

[1]http://www.google.co.in/#sclient=psyb&hl=en&source=hp&q=microcontroller+A
T89C52P6+pin+diagram&pbx=1&oq=microcontroller+AT89C52P6
[2] www.electricalprojects.com
[3] Basic electronics by J.B Gupta.
[4]http://www.sensorsmag.com/sensors/acoustic-ultrasound/choosing-ultrasonic-
sensor-proximity-or-distance-measurement-825

54
APPENDIX A

MICROCONTROLLER 8051 DATASHEET

55
56
APPENDIX B

MOTOR DRIVER L293D DATASHEET

57
58
59

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy