Professional Documents
Culture Documents
Project Report ON
Smart Grid Protection
And auto security
System
CONTENTS
1. ABSTRACT
2.INTRODUCTION
1
Transformer
Transistor
Resistor
Voltage Regulator
Capacitor
Diode
Microcontroller
Relay
IR SENSOR
Buzzer
Potentiometer
4. SCHEMATIC DESCRIPTION
Block diagram
5. CIRCUIT DESCRIPTION
2.2.1 Power supply
2.2.2 Microcontroller
2.2.3 LCD
2.2.4 Circuit operation
6.
7.
8.
REFERENCES
ABSTRACT
although the entire subject is still in its infancy stage. The smart grid delivers electricity from
producers to consumers using two-way digital technology, and allows control of appliances
in the consumers' houses and of machines in factories to save energy, while reducing costs
and increasing reliability and transparency. Such a modern electricity network is promoted by
many governments as a way of handling energy independence, global warming and security
of supply.
A smart grid includes an intelligent monitoring system that keeps track of all the electricity
that flows in the system. So in our project there will be two system through which when there is a
visitors entry in the grid, then our microcontroller sense that and counts visitors by means of a IR
sensor. Then if there is an over voltage occurs in the grid then our microcontroller senses that and
trips the whole feeder by help of a relay.
2. INTRODUCTION:
An Embedded System is a combination of computer hardware and software, and perhaps additional
mechanical or other parts, designed to perform a specific function. An embedded system is a
microcontroller-based, software driven, reliable, real-time control system, autonomous, or human or
network interactive, operating on diverse physical variables and in diverse environments and sold into
a competitive and cost conscious market.
We have used ATMEGA16 controller here to control all the functions in the system. We are using
relays here to control the power and to power load shedding purpose.
3.1
TRANSFORMER:
Transformer is the electrical device that converts one voltage to another with little loss of power.
Transformers work only with AC. There are two types of transformers as Step-up and Step-down
transformer. Step-up transformers increase voltage, step-down transformers reduce voltage. Most
power supplies use a step-down transformer to reduce the dangerously high mains voltage to a safer
low voltage.
Here a step down transformer is used to get 5V AC from the supply
i.e.230V AC. Step down
transformers are designed to reduce electrical voltage. Their primary voltage is greater than their
secondary voltage. This kind of transformer "steps down" the voltage applied to it. For instance, a step
down transformer is needed to use a 110v product in a country with a 220v supply. Step down
transformers convert electrical voltage from one level or phase configuration usually down to a lower
level. They can include features for electrical isolation, power distribution, and control and
instrumentation applications. Step down transformers typically rely on the principle of magnetic
induction between coils to convert voltage and/or current levels. Step down transformers are made
from two or more coils of insulated wire wound around a core made of iron. When voltage is applied to
one coil (frequently called the primary or input) it magnetizes the iron core, which induces a voltage in
the other coil, (frequently called the secondary or output). The turns ratio of the two sets of windings
determines the amount of voltage transformation.
OPERATING PRINCIPLE:
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.
An ideal transformer is shown in the above figure. Current passing through the primary coil creates
a magnetic field. The primary and secondary coils are wrapped around a core of very high magnetic
5
permeability, such as iron, so that most of the magnetic flux passes through both the primary and
secondary coils. If a load is connected to the secondary winding, the load current and voltage will be
in the directions indicated, given the primary current and voltage in the directions indicated .
3.2 TRANSISTORS:
S o m e transistors are packaged individually but most are found in circuits. The transistor is the
fundamental building block of modern electronic devices, and its presence is ubiquitous in modern
electronic systems.
In this fire alarm circuit we are used three transistors BC548,BC558, SL100B. SL100B is a special
type transistor.
6
SL100B is a general purpose medium power NPN transistor. It is mostly used as a switch in common
emitter configuration .For switching application SL100 is biased in such a way that it remains fully
on if there is a signal at its base .In the absence of base signal it gets turned off completely. The
emitter leg of SL100 is indicated by protruding edge in the transistor case. The base is nearest to
emitter while collector lies at other extreme of the casing.
TRANSISTOR WORKING:
transistor as an amplifier, each of these junctions must be modified by some external bias voltage. For
the transistor to function in this capacity, the first PN junction (emitter-base junction) is biased in the
forward, or low-resistance, direction. At the same time the second PN junction (base-collector
junction) is biased in the reverse, or high-resistance, direction. A simple way to remember how to
properly bias a transistor is to observe the NPN or PNP elements that make up the transistor.
3.3 RESISTORS:
Resister is an electrical component that limits or regulates the flow of electrical current in an
electronic circuit. Resisters can also be used to provide a specific voltage for an active device such as
transistor. It is a two terminal component that produces a voltage across its terminals that
is proportional t o t h e electric current through it in accordance with Ohm's law:
V = IR
Resistors are 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).The
primary characteristics of a resistor are the resistance, the tolerance, maximum working
voltage and the power rating. Resistors can be integrated into hybrid and printed circuits, a s
w e l l a s integrated circuits. S i z e , a n d p o s i t i o n o f l e a d s ( o r terminals) are
relevant to equipment designers; resistors must be physically large enough not to overheat when
dissipating their power.
There are eight resisters R1 to R8 are used in this circuit of different value. The resistance value can
differ from one another by means of colzor coding technique. Colour coding technique can be
described as follows;
Then a potential difference is required between the two terminals of a resistor for current to flow. This
potential difference balances out the energy lost. When used in DC circuits the potential difference,
also known as a resistors voltage drop, is measured across the terminals as the circuit current flows
through the resistor.
Most resistors are linear devices that produce a voltage drop across themselves when an electrical
current flow through them because they obey Ohm's Law and different values of resistance produces
different values of current or voltage. This can be very useful in Electronic circuits by controlling or
reducing either the current flow or voltage produced across them.
10
There are many thousands of different Types of Resistors and are produced in a variety of forms
because their particular characteristics and accuracy suit certain areas of application, such as High
Stability, High Voltage, High Current etc, or are used as general purpose resistors where their
characteristics are less of a problem. Some of the common characteristics associated with the humble
resistor are; Temperature Coefficient, Voltage Coefficient, Noise, Frequency Response, Power as well
as Temperature Rating, Physical Size and Reliability.
Resistors are broadly classified into 3 types based on composition. These are described below.
Carbon Resistors are the most common type of Composition Resistors. Carbon resistors are a cheap
general purpose resistor used in electrical and electronic circuits. Their resistive element is
manufactured from a mixture of finely ground carbon dust or graphite (similar to pencil lead) and a
non-conducting ceramic (clay) powder to bind it all together.
The generic term "Film Resistor" consist of Metal Film, Carbon Film and Metal Oxide Film resistor
types, which are generally made by depositing pure metals, such as nickel, or an oxide film, such as
tin-oxide, onto an insulating ceramic rod or substrate.
Another type of resistor, called a Wire wound Resistor, is made by winding a thin metal alloy wire
(Nichrome) or similar wire onto an insulating ceramic former in the form of a spiral helix similar to
the film resistor above. These types of resistors are generally only available in very low ohmic high
precision values due to the gauge of the wire and number of turns possible on the former making them
ideal for use in measuring circuits and Whetstone bridge type applications.
11
Many of the fixed voltage regulators have 3 leads and look like power transistors, such as the 7805
(+5V 1A) regulator shown on the above. If adequate heat sinking is provided then it can deliver up to
maximum 1A current.For 7805 IC, for an input of 10v the minimum output voltage is 4.8V and the
maximum output voltage is 5.2V. The typical dropout voltage is 2V. . T h e s e I C s h a v e internal
thermal shutdown and short circuit current limiting.
3.5 CAPACITORS:
A device used to store an electric charge consisting of one or more pairs of conductor separated by an
insulator. The capacitance is the amount of electric charge stored in the capacitor at a voltage of
1volt.The capacitance is measured in the unit of farad. The capacitor disconnects current in dc circuit
and short circuits current in ac circuit. In fire alarm circuit polarized and ceramic capacitor is used.
There are three capacitors are used in this circuit.one is 10microfarad 16volt,means its capacitance is
10 microfarad at 16 volt. similarly other two are .04microfarad and .01microfarad at 63volt.
A capacitor is a passive component consisting of a pair of conductor separated by a dielectric.
When a voltage potential difference exists between the conductors, an electric field is present
in
the
dielectric.
This
field
stores
energy
a n d p r o d u c e s a m e c h a n i c a l f o r c e b e t w e e n t h e p l a t e s . T h e e f f e c t i s g r e a t e s t be
tween 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 practices; the dielectric
material which placed in place between the plates passes a small amount of leakage
12
current. Capacitors are widely used in electronic circuits to block the flow of direct current while
allowing alternating current to pass, to filter out interference, to smooth the output of power supplies,
and for many other purposes.
WORKING OF CAPACITOR:
A capacitor consists of two metal plates which are separated by a non-conducting substance or
dielectric. Take a look at the figure given below to know about dielectric in a capacitor.
Though any non-conducting substance can be used as a dielectric, practically some special materials
like porcelain, mylar, teflon, mica, cellulose and so on. A capacitor is defined by the type of dielecric
selected.
It
also
defines
the
application
of
the
capacitor.
According to the size and type of dielectric used, the capacitor can be used for high-voltage as well as
low-voltage
applications.
For applications in radio tuning circuits air is commonly used as the dielectric. for applications in
timer circuits mylar is used as the dielectric. For high voltage applications glass is normally used. For
application
in
X-ray
and
MRI
machines,
ceramic
is
mostly
preferred.
The metal plates are separated by a distance d, and a dielectric material is separately placed in
between
the
plates.
The dielectric constant of the dielectric material is equal to the dielectric of air.The dielectric material
is the main substance that helps in storing the electrical energy.
ADVANTAGES:
Since the capacitor can discharge in a fraction of a second, it has a very large advantage.
Capacitors are used for appliances which require high speed use like in camera flash and laser
techniques.
Capacitors are used to remove ripples by removing the peaks and filling in the valleys.
A capacitor allows ac voltage to pass through and blocks dc voltage. This has been used in many
electronic applications.
3.6 DIODE:
13
In this circuit one diode is present. A PN junction diode is formed by combining a p type
semiconductor with n type semiconductor .It has the property of offering a low resistance to current
flow in one direction and is the main component used in rectifying circuits. PN junction diodes are
mainly manufactured using Germanium and silicon semiconductor material. It contains two mobile
charge carrier holes and electrons. In electronics a diode is a two-terminal electronic component
which conducts electric current asymmetrically or unidirectionally; that is, it conducts current more
easily in one direction than in the opposite direction. The term usually refer to
semiconductor Diode.
The most common function of a diode is to allow an electric current in one direction (called the
forward direction) while blocking current in the opposite direction(the reverse direction). Thus, the
diode can be thought of as an electronic version of a check valve. This unidirectional behaviour is
called rectification, and is used to convert alternating current to direct current, and remove modulation
from radio signals in radio receivers.
DIODE WORKING PRINCIPLE:
A pn junction diode is made of a crystal of semiconductor. Impurities are added to it to create a
region on one side that contains negative charge carriers (electrons), called n-type semiconductor, and
a region on the other side that contains positive charge carriers (holes), called p-type semiconductor.
When two materials i.e. n-type and p-type are attached together, a momentary flow of electrons occur
from n to p side resulting in a third region where no charge carriers are present. It is called Depletion
region due to the absence of charger carrier (electrons and holes in this case). The diode's terminals
are attached to each of these regions. The boundary between these two regions, called a pn junction,
is where the action of the diode takes place. The crystal allows electrons to flow from the N-type side
(called the cathode) to the P-type side (called the anode), but not in the opposite direction.
A semiconductor diodes behavior in a circuit is given by its currentvoltage characteristic, or IV
graph (see graph below). The shape of the curve is determined by the transport of charge carriers
through the so-called depletion layer or depletion region that exists at the pn junction between
differing semiconductors. When a pn junction is first created, conduction-band (mobile) electrons
from the N-doped region diffuse into the P-doped region where there is a large population of holes
(vacant places for electrons) with which the electrons "recombine". When a mobile electron
recombines with a hole, both hole and electron vanish, leaving behind an immobile positively charged
donor (dopant) on the N side and negatively charged acceptor (dopant) on the P side. The region
around the pn junction becomes depleted of charge carriers and thus behaves as an insulator.
However, the width of the depletion region (called the depletion width) cannot grow without limit.
For each electronhole pair that recombines, a positively charged dopant ion is left behind in the Ndoped region, and a negatively charged dopant ion is left behind in the P-doped region. As
recombination proceeds more ions are created, an increasing electric field develops through the
14
depletion zone that acts to slow and then finally stop recombination. At this point, there is a "built-in"
potential across the depletion zone.
If an external voltage is placed across the diode with the same polarity as the built-in potential, the
depletion zone continues to act as an insulator, preventing any significant electric current flow (unless
electron/hole pairs are actively being created in the junction by, for instance, light. see photodiode).
This is the reverse bias phenomenon. However, if the polarity of the external voltage opposes the
built-in potential, recombination can once again proceed, resulting in substantial electric current
through the pn junction (i.e. substantial numbers of electrons and holes recombine at the junction).
For silicon diodes, the built-in potential is approximately 0.7 V (0.3 V for Germanium and 0.2 V for
Scottky). Thus, if an external current is passed through the diode, about 0.7 V will be developed
across the diode such that the P-doped region is positive with respect to the N-doped region and the
diode is said to be "turned on" as it has a forward bias.
3 . 7 RECTIFIERS
A rectifier is a circuit that converts AC signals to DC. A rectifier circuit is made using diodes. There
are two types of rectifier circuits as Half-wave rectifier and Full-wave rectifier depending upon the
DC signal generated.
15
Half-wave Rectifier: It is the rectifier circuit that rectifies only half part of the AC signal. It uses only
a single diode. It only uses only positive part of the AC signal to produce half-wave varying DC and
produce gaps when the AC is negative.
Full-wave Rectifier: It is also called as Bridge Rectifier. A bridge rectifier can be made using four
individual diodes, but it is also available in special packages containing the four diodes required. It is
called a full-wave rectifier because it uses the total AC wave (both positive and negative sections).
16
SMOOTHING
Smoothing is performed by a large value electrolytic capacitor connected across the DC supply to act
as a reservoir, supplying current to the output when the varying DC voltage from the rectifier is falling.
The diagram shows the unsmoothed varying DC (dotted line) and the smoothed DC (solid line). The
capacitor charges quickly near the peak of the varying DC, and then discharges as it supplies current to
the output. Here a capacitor of 330uF is used as a smoothing circuit.
17
3.10
MICROCONTROLLER
18
Microcontroller can be termed as a system on chip computer which includes number of peripherals
like RAM, EEPROM, Timers etc., required to perform some predefined task.
Does this mean that the microcontroller is another name for a computer? The answer is NO!
The computer on one hand is designed to perform all the general purpose tasks on a single machine
like you can use a computer to run a software to perform calculations or you can use a computer to
store some multimedia file or to access internet through the browser, whereas the microcontrollers are
meant to perform only the specific tasks, for e.g., switching the AC off automatically when room
temperature drops to a certain defined limit and again turning it ON when temperature rises above the
defined limit.
There are number of popular families of microcontrollers which are used in different applications as
per their capability and feasibility to perform the desired task, most common of these are 8051, AVR
and PIC microcontrollers. In this article we will introduce you with AVR family of microcontrollers.
History of AVR
AVR was developed in the year 1996 by Atmel Corporation. The architecture of AVR was developed
by Alf-Egil Bogen and Vegard Wollan. AVR derives its name from its developers and stands for AlfEgilBogen VegardWollan RISC microcontroller, also known as Advanced Virtual RISC. The
AT90S8515 was the first microcontroller which was based on AVR architecture however the first
microcontroller to hit the commercial market was AT90S1200 in the year 1997.
AVR microcontrollers are available in three categories:
1. Tiny AVR Less memory, small size, suitable only for simpler applications
2. Mega AVR These are the most popular ones having good amount of memory (up to 256
KB), higher number of inbuilt peripherals and suitable for moderate to complex applications.
3. Xmega AVR Used commercially for complex applications, which require large program
memory and high speed.
The following table compares the above mentioned AVR series of microcontrollers:
19
Series Name
Pins
Flash Memory
Special Feature
TinyAVR
6-32
0.5-8 KB
Small in size
MegaAVR
28-100
4-256KB
Extended peripherals
XmegaAVR
44-100
16-384KB
8051
PIC
AVR
SPEED
Slow
Moderate
Fast
MEMORY
Small
Large
Large
ARCHITECTURE
CISC
RISC
RISC
ADC
Not Present
Inbuilt
Inbuilt
Timers
Inbuilt
Inbuilt
Inbuilt
PWM Channels
Not Present
Inbuilt
Inbuilt
AVR is an 8-bit microcontroller belonging to the family of Reduced Instruction Set Computer
(RISC). In RISC architecture the instruction set of the computer are not only fewer in number but
also simpler and faster in operation. The other type of categorization is CISC (Complex Instruction
Set Computers). We will explore more on this when we will learn about the architecture of AVR
microcontrollers in following section.
Lets see what this entire means. What is 8-bit? This means that the microcontroller is capable of
transmitting and receiving 8-bit data. The input/output registers available are of 8-bits. The AVR
families controllers have register based architecture which means that both the operands for an
operation are stored in a register and the result of the operation is also stored in a register. Following
figure shows a simple example performing OR operation between two input registers and storing the
value in Output Register.
20
The CPU takes values from two input registers INPUT-1 and INPUT-2, performs the logical
operation and stores the value into the OUTPUT register. All this happens in 1 execution cycle.
In our journey with the AVR we will be working on Atmega16 microcontroller, which is a 40-pin IC
and belongs to the mega AVR category of AVR family. Some of the features of Atmega16 are:
1KB of SRAM
4 PWM Channels
21
Serial USART
SPI Interface
Architecture of AVR
The AVR microcontrollers are based on the advanced RISC architecture and consist of 32 x 8-bit
general purpose working registers. Within one single clock cycle, AVR can take inputs from two
general purpose registers and put them to ALU for carrying out the requested operation, and transfer
back the result to an arbitrary register. The ALU can perform arithmetic as well as logical operations
over the inputs from the register or between the register and a constant. Single register operations like
taking a complement can also be executed in ALU. We can see that AVR does not have any register
like accumulator as in 8051 family of microcontrollers; the operations can be performed between any
of the registers and can be stored in either of them.
AVR follows Harvard Architecture format in which the processor is equipped with separate memories
and buses for Program and the Data information. Here while an instruction is being executed, the next
instruction is pre-fetched from the program memory.
Since AVR can perform single cycle execution, it means that AVR can execute 1 million instructions
per second if cycle frequency is 1MHz. The higher is the operating frequency of the controller, the
higher will be its processing speed. We need to optimize the power consumption with processing
speed and hence need to select the operating frequency accordingly.
2.
22
If we are using a crystal of 8 MHz = 8 x 106 Hertz = 8 Million cycles, then AVR can execute 8
million instructions.
Naming Convention.!
The AT refers to Atmel the manufacturer, Mega means that the microcontroller belong to Mega AVR
category, 16 signifies the memory of the controller, which is 16KB.
23
DAC: Atmega16 is also equipped with a Digital to Analog Converter (DAC) interface which
can be used for reverse action performed by ADC. DAC can be used when there is a need of
converting a digital signal to analog signal.
24
SPI: Serial Peripheral Interface, SPI port is used for serial communication between two devices
on a common clock source. The data transmission rate of SPI is more than that of USART.
TWI: Two Wire Interface (TWI) can be used to set up a network of devices, many devices can be
connected over TWI interface forming a network, the devices can simultaneously transmit and receive
and have their own unique address.
PIN DIAGRAM:
Pin Descriptions
VCC:Digital supply voltage.
GND:Ground.
25
Port A (PA7...PA0)
:Port A serves as the analog inputs to the A/D Converter.Port A also serves as
an 8-bit bi-directional I/O port, if the A/D Converter is not used. Port pins can provide internal pull-up
resistors (selected for each bit). The Port A output buffers have symmetrical drive characteristics with
both high sink and source capability. When pins PA0 to PA7 are used as inputs and are externally
pulled low, they will source current if the internal pull-up resistors are activated. The Port A pins are
tri-stated when a reset condition becomes active, even if the clock is not running.
Port B (PB7...PB0):Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected
for each bit). The Port B output buffers have symmetrical drive characteristics with both high sink and
source capability. As inputs, Port B pins that are externally pulled low will source current if the pullup resistors are activated. The Port B pins are tri-stated when a reset condition becomes active, even if
the clock is not running.
Port C (PC7...PC0):Port C is an 8-bit bi-directional I/O port with internal pull-up resistors (selected
for each bit). The Port C output buffers have symmetrical drive characteristics with both high sink and
source capability. As inputs, Port C pins that are externally pulled low will source current if the pullup resistors are activated. The Port C pins are tri-stated when a reset condition becomes active, even if
the clock is not running. If the JTAG interface is enabled, the pull-up resistors on pins PC5 (TDI),
PC3 (TMS) and PC2(TCK) will be activated even if a reset occurs.
Port D (PD7...PD0):Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected
for each bit). The Port D output buffers have symmetrical drive characteristics with both high sink and
source capability. As inputs, Port D pins that are externally pulled low will source current if the pullup resistors are activated. The Port D pins are tri-stated when a reset condition becomes active, even if
the clock is not running.
RESET:Reset Input. A low level on this pin for longer than the minimum pulse length will generate a
reset, even if the clock is not running. Shorter pulses are not guaranteed to generate a reset.
XTAL1:Input to the inverting Oscillator amplifier and input to the
circuit.
internal
clock
operating
26
The display used here is 16x2 LCD (Liquid Crystal Display); this means 16 characters per line by 2 lines. A
very popular standard exists which allows us to communicate with the vast majority of LCDs regardless of their
manufacturer. The standard is referred to as HD44780U, which refers to the controller chip which receives data
from an external source (in this case, the Atmega16) and communicates directly with the LCD. The 44780
standard requires 3 control lines as well as either 4 or 8 I/O lines for the data bus. Here we are using 8-bit mode
of LCD, i.e., using 8-bit data bus.
Control & Data pins
The three control lines are referred to as EN, RS, and RW.
The EN line is called "Enable." This control line is used to tell the LCD that we are sending it data. To send data
to the LCD, our program should make sure this line is low (0) and then set the other two control lines and/or put
data on the data bus. When the other lines are completely ready, bring EN high (1) and wait for the minimum
amount of time required by the LCD datasheet (this varies from LCD to LCD), and end by bringing it low (0)
again.
The RS line is the "Register Select" line. When RS is low (0), the data is to be treated as a command or special
instruction (such as clear screen, position cursor, etc.). When RS is high (1), the data being sent is text data
which should be displayed on the screen. For example, to display the letter "T" on the screen you would set RS
high.
The RW line is the "Read/Write" control line. When RW is low (0), the information on the data bus is being
written to the LCD. When RW is high (1), the program is effectively querying (or reading) the LCD. Only one
instruction ("Get LCD status") is a read command. All others are write commands--so RW will almost always
be low.
In our case of an 8-bit data bus, the lines are referred to as DB0, DB1, DB2, DB3, DB4, DB5, DB6, and DB7.
These pins should be connected to any port of the microcontroller.
The figure below is to show the pin diagram of before mentioned LCD.
27
RELAY:
A relay is an electrically operated switch. Current flowing through the coil of the relay creates a magnetic
field which attracts a lever and changes the switch contacts. The coil current can be on or off so relays have two
switch positions and they are double throw (changeover) switches.
Relays allow one circuit to switch a second circuit which can be completely separate from the first. For example
a low voltage battery circuit can use a relay to switch a 230V AC mains circuit. There is no electrical connection
inside the relay between the two circuits; the link is magnetic and mechanical.
The coil of a relay passes a relatively large current, typically 30mA for a 12V relay, but it can be as much as
100mA for relays designed to operate from lower voltages. Most ICs (chips) cannot provide this current and a
transistor is usually used to amplify the small IC current to the larger value required for the relay coil. The
28
maximum output current for the popular 555 timer IC is 200mA so these devices can supply relay coils directly
without amplification.
Relays are usually SPDT or DPDT but they can have many more sets of switch contacts, for example relays
with 4 sets of changeover contacts are readily available. For further information about switch contacts and the
terms used to describe them please see the page on switches.
Most relays are designed for PCB mounting but you can solder wires directly to the pins providing you take care
to avoid melting the plastic case of the relay.
The supplier's catalogue should show you the relay's connections. The coil will be obvious and it may be
connected either way round. Relay coils produce brief high voltage 'spikes' when they are switched off and this
can destroy transistors and ICs in the circuit. To prevent damage you must connect a protection diode across the
relay coil.
The animated picture shows a working relay with its coil and switch contacts. You can see a lever on the left
being attracted by magnetism when the coil is switched on. This lever moves the switch contacts. There is one
set of contacts (SPDT) in the foreground and another behind them, making the relay DPDT.
The relay's switch connections are usually labeled COM, NC and NO:
COM = Common, always connect to this, it is the moving part of the switch.
NC = Normally Closed, COM is connected to this when the relay coil is off.
NO = Normally Open, COM is connected to this when the relay coil is on.
Connect to COM and NO if you want the switched circuit to be on when the relay coil is on.
Connect to COM and NC if you want the switched circuit to be on when the relay coil is off.
29
Transistors and ICs must be protected from the brief high voltage produced when a relay coil is switched off.
The diagram shows how a signal diode (e.g. 1N4148) is connected 'backwards' across the relay coil to provide
this protection.
Current flowing through a relay coil creates a magnetic field which collapses suddenly when the current is
switched off. The sudden collapse of the magnetic field induces a brief high voltage across the relay coil which
is very likely to damage transistors and ICs. The protection diode allows the induced voltage to drive a brief
current through the coil (and diode) so the magnetic field dies away quickly rather than instantly. This prevents
the induced voltage becoming high enough to cause damage to transistors and ICs.
Relays can switch AC and DC, transistors can only switch DC.
Relays can switch high voltages, transistors cannot.
Relays are a better choice for switching large currents (> 5A).
Relays can switch many contacts at once.
30
Disadvantages of relays:
Relays are bulkier than transistors for switching small currents.
Relays cannot switch rapidly (except reed relays), transistors can switch many times
Relays use more power due to the current flowing through their coil.
Relays require more current than many ICs can provide, so a low power transistor
needed to switch the current for the relay's coil.
per second.
may
be
POTENTIOMETER:
Variable resistors let you dial in a specific resistance. The actual range of resistance is determined by
the upward value of the potentiometer. Potentiometers are thus marked with this upward value, such as 10K,
50K, 100K, 1M, and so forth. For example, a 50K potentiometer will let you dial in any resistance from 0 to
50,000 ohms. Note that the range is approximate only.
Potentiometers are of either the dial or slide type, as shown in Fig. 5-8. The dial type is the most familiar and is
used in such applications as television volume controls and electric blanket thermostat controls. The rotation of
the dial is nearly 360, depending on which potentiometer you use. In one extreme, the resistance through the
potentiometer (or pot) is zero; in the other extreme, the resistance is the maximum value of the component.
Some projects require precision potentiometers. These are referred to as multi-turn potsor trimmers.
Instead of turning the dial one complete rotation to change the resistance from, say, 0 to 10,000 ohms, a multiturn pot requires you to rotate the knob 3, 5, 10, even 15 times to span the same range. Most are designed to be
mounted directly on the printed circuit board. If you have to adjust them, you will need a screwdriver or plastic
tool.
IR SENSOR:
DEFINITION
IR stands for Infra Red. Infrared detectors/sensors are transducers of radiant energy.IR Sensor is a
sensor that sends and detects IR Radiation/Signals. Infrared radiation is the portion of electromagnetic
spectrum having wavelengths longer than visible light wavelengths, but smaller than microwaves, i.e.,
the region roughly from 0.75m to 1000 m is the infrared region. Infrared waves are invisible to
human eyes. The wavelength region of 0.75m to 3 m is called near infrared, the region from 3 m to
31
6 m is called mid infrared and the region higher than 6 m is called far infrared. (The demarcations are
not rigid; regions are defined differently by many).
TYPES OF IR SENSORS:
1.
Active IR Sensors:
Active IR Sensors are the type of IR Sensors that employs an IR source & IR detectors (emitter &
receiver). They operate by transmitting energy from either a light emitting diode (LED) or a laser diode.
A phototransistor is used as an active IR detector. In these types of IR sensors, the LED or laser diode
illuminates the target, and the reflected energy is focused onto a detector. Photoelectric cells,
Photodiode or phototransistors are generally used as detectors. The measured data is then processed
using various signal-processing algorithms to extract the desired information.
Active IR detectors provide count, presence, speed, and occupancy data
in both night and day
operation.
2.
Passive IR Sensors:
These are basically IR detectors; they dont use any IR source. These form the major class of IR
sensors/detectors.
A passive infrared system detects energy emitted by objects in the field of view and may use signalprocessing algorithms to extract the desired information. It does not emit any energy of its own for the
purposes of detection. Passive infrared systems can detect presence, occupancy, and count.
32
This principle is used in intrusion detection, object detection (measure the presence of an object in the
sensors FOV), barcode decoding, and surface feature detection (detecting features painted, taped, or
otherwise marked onto the floor), wall tracking (detecting distance from the wall), etc.
It can also be used to scan a defined area; the transmitter emits a beam of light into the scan zone, the
reflected light is used to detect a change in the reflected light thereby scanning the desired zone.
It consist of a pair of IR sensors
-Transmitter
- Receiver
The transmitter transmits the IR signals & the receiver receives the IR signal.
33
Transmitter:
It is similar to normal LEDs but emit infra-red light its glow can be seen
WORKING PRINCIPLE
34
CONNECTIONS
35
APPLICATIONS:
Military Applications
system
36
BLOCK DIAGRAM:
POWER
SUPPLY
POTENTIOMETERS
LOAD
RELAY
MICRO
CONTROLLER
LCD
ATMEGA 16
IR SENSOR
Buzzer
IR SENSOR
37
down transformer is used to get 12V AC which is later converted to 12V DC using a rectifier. The output of
rectifier still contains some ripples even though it is a DC signal due to which it is called as Pulsating DC. To
remove the ripples and obtain smoothed DC power filter circuits are used. Here a capacitor is used. The 12V DC
is rated down to 5V using a positive voltage regulator chip 7805. Thus a fixed DC voltage of 5V is obtained.
A 5V regulated supply is taken as followed:
38
The liquid crystal display (LCD) is interfaced with the microcontroller circuit in order to display the status of
the devices. Here we used a 16 pins LCD.Its PIN-1 & PIN-16 are grounded. PIN-2 is connected with 5v DC
supply voltage. PIN-1 is connected to the PIN-11, PIN-2 is connected to the PIN-10, PIN-4 is connected to the
PIN-22, PIN-5 is connected to the PIN-23, and PIN-6 is connected to the PIN-24 of the microcontroller
circuit.PIN-7, 8,9,10,11,12,13 & 14are data pins. When PIN-6 is high it enables to access to LCD & when low it
disabled to access the LCD.When PIN-5 is in logic zero the message will be displayed on the LCD. It means
this line determines the direction of data between the LCD and microcontroller. When it is low, data is written to
the LCD. When it is high, data is read from the LCD.
Embedded C:
What is an embedded system?
An embedded system is an application that contains at least one programmable computer and
which is used by individuals who are, in the main, unaware that the system is computer-based.
Which programming language should you use?
Having decided to use an AVR processor as the basis of your embedded system, the next key decision
that needs to be made is the choice of programming language. In order to identify a suitable language
for embedded systems, we might begin by making the following observations:
All software, whether in assembly, C, C++, Java or Ada must ultimately be translated into
machine code in order to be executed by the computer.
Embedded processors like the AVR have limited processor power and very limited
memory available: the language used must be efficient.
It is mid-level, with high-level features (such as support for functions and modules), and lowlevel features (such as good access to hardware via pointers).
39
It is very efficient.
Even desktop developers who have used only Java or C++ can soon understand C syntax.
Good, well-proven compilers are available for every embedded processor (8-bit to 32-bit or
more).
// SFR declarations
// Infinite loop
}
}
UTILITY:
This system is very useful in industrial applications for load managing purpose.
ADVANTAGES:
40
We have used microcontroller in our project to control all the functions and we have interfaced relay,
potentiometers to control the network. So this is a very efficient system.
By doing this project we have been acquainted with the controller working and their programming to
make the system working.
41
REFERENCES
Adler, R. B., A. C. Smith, and R. L. Longani: Introduction to Semiconductor Physics,
vol. 1, p. 78, Semiconductor Electronics Education Comitee, John Wiley & Sons, Inc.,
New York ,1964.
Stout, M. B.: Analysis of Rectifier Circuits, Elec. Eng., vol. 54, September, 1935.
Jacob Millman Christos C. Halkias.: Electronic Devices And Circuits, Tata McGraw-Hill
Publishing Company Ltd. Sep, 2003.
Sawhney, A.K.: Electrical and Electronic Measurements and Instruments, Dhanpat Rai
& Co. 2003
42