Sie sind auf Seite 1von 81

A Project Report on

VEHICLE ACCIDENT PREVENTION USING EYE BLINK AND


ALCOHOL SENSOR
Submitted in partial fulfillment of the requirement for the award of the Degree of
BACHELOR OF TECHNOLOGY
In

ELECTRONICS AND COMMUNICATION ENGINEERING


By
K. RAMYA LAKSHMI

11MH1A0438

B. RATNA KIRAN

11MH1A0408

K.V.V. SATISH KUMAR

12MH5A0405

CH. SATISH

11MH1A0413

M. SATHISH

11MH1A0456

Under the esteemed guidance of


Mr. D.AVINASH BABU, M.Tech
Associate Professor

DEPARTMENT OF ELECTRONICS AND COMMUNICATION


ENGINEERING
SRI ADITYA ENGINEERING COLLEGE
(Affiliated to JNTU, Kakinada & Approved by AICTE, New Delhi)
Surampalem-533437, ADB Road, E.G.Dist, AP-533437
2011-2015

1 | Page

CERTIFICATE
DEPARTMENT OF ELECTRONICS AND COMMUNICATION
ENGINEERING
SRI ADITYA ENGINEERING COLLEGE
(Affiliated to JNTU, Kakinada& Approved by AICTE, New Delhi)
Surampalem-533437, ADB Road, E.G.Dist, AP-533437
2011-2015

This is to certify that the project report entitled


VEHICLE ACCIDENT PREVENTION USING EYE BLINK AND
ALCOHOL SENSOR
Being submitted by

In partial fulfillment for the award of the Degree of Bachelor of Technology in


ELECTRONICS AND COMMUNICATION ENGINEERING. It is a record of bonafied
work carried out by them under the esteemed guidance and supervision of Mr.D.AVINASH
BABU (M.Tech) and head of the department.
K. RAMYA LAKSHMI

11MH1A0438

B. RATNA KIRAN

11MH1A0408

K.V.V. SATISH KUMAR

12MH5A0405

CH. SATISH

11MH1A0413

M. SATHISH

11MH1A0456

Signature of Project Guide

Signature of H.O.D

Mr.D.AVINASH BABU M.Tech

Mr.G.RAMA KRISHNA M.Tech (Ph.D.)

2 | Page

ACKNOWLEDGEMENT
We express our sincere gratitude and heartful thanks to the under stated person for
the successful completion of our final project on VEHICLE ACCIDENT
PREVENTION USING EYEBLINK AND ALCOHOL SENSOR.

First and foremost we wish to thank our beloved guide MR. D.AVINASH BABU
(M.TECH), for his kind guidance, valuable advices and almost care at every stage
of our final project.
We would also like to thank MR.G.RAMA KRISHNA m.tech(ph.d), Head of
the department of E.C.E who has provided vital information, which was
necessary for success of our project.
We also wish to convey our sincere thanks to Prof. A.RAMESH, PRINCIPAL
OF SRI ADITYA ENGINEERING COLLEGE for providing appropriate
environment required for our project.
We own our sincere gratitude to all other faculty members of SRI ADITYA for
their help directly & indirectly on completion of this project.

Yours sincerely,
K. RAMYA LAKSHMI
B. RATNA KIRAN
K.V.V. SATISH KUMAR
CH. SATISH
M. SATISH

ABSTRACT
3 | Page

Accident due to drowsy is prevented and controlled when the vehicle is out of control. And also
the drunken drive also prevented by installing alcohol detector in the vehicle. The term used
here for the recognisation that the driver is drowsy is by using eye blink of the driver. In recent
times drowsiness is one of the major causes for highway accidents. The drowsiness is identified
by the eye blink sensor. The alcohol consumption is also verified during the startingprocess of
the vehicle using alcohol detector. If the driver is drunk then the buzzer indicates and the
vehicle doesnt allow the driver to start the vehicle. If the driver is drowsy, then the system will
give buzzer signal.
This project involves measure and controls the eye blink using IR sensor. The IR transmitter is
used to transmit the infrared rays in our eye. The IR receiver is used to receive the reflected
infrared rays of eye. If the eye is closed means the output of IR receiver is high otherwise the IR
receiver output is low. This to know the eye is closing or opening position. This output is give
to logic circuit to indicate the alarm.
The other unit of this project is an Alcohol sensor. If the person inside car has consumed alcohol
then it is detected by the sensor. Sensor gives this signal to a comparator IC. The output of
comparator is connected to the microcontroller. Microcontroller gives high pulse to the buzzer
circuit and the buzzer is turned on. At the same time a relay is turned off. Due to this the
ignition of the car is deactivated.
Hardware Requirements:
PIC 16F877 Microcontroller, Eye Blink Sensor, Alcohol Sensor, LED, DC MOTOR, ALARM,
Signal Conditioning Circuits, Relay Driver IC
Software Requirements:
Kiel Software

CONTENTS
4 | Page

Chapter 1

Introduction
1.1 Embedded system
1.2 Application areas

Chapter 2

Micro controller
2.1 Introduction
2.2 Feature of 89S52
2.3 Description
2.4 Pin diagram
2.5 Pin description
2.6 Ports
2.7 Addressing modes

Chapter 3

Functional block diagram


3.1 LM 358
3.2 LM 7805

Chapter 4

Power supply
4.1 Transformer
4.2 Rectifier
4.3 Filter
4.4 Voltage regulator

Chapter 5

Hardware components
5.1 Buzzer
5.2 LCD
5.3 LED
5.4 Capacitor
5.5 Transistor
5.6 Resistor
5.7 Relay
5 | Page

5.8 Diode
5.9 DC motor
5.10 Crystal oscillator
Chapter 6

Eye blink sensor


6.1 IR Technology

Chapter 7

Alcohol sensor

Chapter 8

KIEL software
8.1 Introduction to KIEL
8.2 Coding

Chapter 9

Hardware Implementation

Chapter 10

Conclusion
Future Scope
Reference

6 | Page

CHAPTER 1

INTRODUCTION

1.1 Embedded Systems


An embedded system can be defined as a computing device that does a specific focused
job. Appliances such as the air-conditioner, VCD player, DVD player, printer, fax machine,
mobile phone etc. are examples of embedded systems. Each of these appliances will have a
processor and special hardware to meet the specific requirement of the application along with
the embedded software that is executed by the processor for meeting that specific requirement.
The embedded software is also called firm ware. The desktop/laptop computer is a general
purpose computer. You can use it for a variety of applications such as playing games, word
processing, accounting, software development and so on. In contrast, the software in the
embedded systems is always fixed listed below:
Embedded systems do a very specific task, they cannot be programmed to do different
things. . Embedded systems have very limited resources, particularly the memory. Generally,
they do not have secondary storage devices such as the CDROM or the floppy disk. Embedded
systems have to work against some deadlines. A specific job has to be completed within a
specific time. In some embedded systems, called real-time systems, the deadlines are stringent.
Missing a deadline may cause a catastrophe-loss of life or damage to property. Embedded
systems are constrained for power. As many embedded systems operate through a battery, the
power consumption has to be very low.
7 | Page

Some embedded systems have to operate in extreme environmental conditions such as


very high temperatures and humidity.
1.1 EMBEDDED SYSTEM ARCHITECTURE
Let us see the details of the various building blocks of the hardware of an embedded system.
As shown in Fig 1.2.2 the building blocks are;

Central Processing Unit (CPU)

Memory (Read-only Memory and Random Access Memory)

Input Devices

Output devices

Application-specific circuitry

Fig 2.2.1 Block Diagram of Hardware of Embedded System


1.1.1 Central Processing Unit (CPU):

8 | Page

The Central Processing Unit (processor, in short) can be any of the following:
microcontroller, microprocessor or Digital Signal Processor (DSP). A micro-controller is a lowcost processor. Its main attraction is that on the chip itself, there will be many other components
such as memory, serial communication interface, analog-to digital converter etc.
So, for small applications, a micro-controller is the best choice as the number of external
components required will be very less. On the other hand, microprocessors are more powerful,
but you need to use many external components with them. D5P is used mainly for applications
in which signal processing is involved such as audio and video processing.
1.1.2 Memory:
The memory is categorized as Random Access 11emory (RAM) and Read Only
Memory (ROM). The contents of the RAM will be erased if power is switched off to the chip,
whereas ROM retains the contents even if the power is switched off. So, the firmware is stored
in the ROM. When power is switched on, the processor reads the ROM; the program is program
is executed.
1.1.3 Input Devices:
Unlike the desktops, the input devices to an embedded system have very limited
capability. There will be no keyboard or a mouse, and hence interacting with the embedded
system is no easy task. Many embedded systems will have a small keypad-you press one key to
give a specific command. A keypad may be used to input only the digits. Many embedded
systems used in process control do not have any input device foruser interaction; they take
inputs fromsensors or transducers produce electrical signals that are in turn fed to other systems.
1.1.4 Output devices:
The output devices of the embedded systems also have very limited capability. Some
embedded systems will have a fewLight Emitting Diodes (LEDs) toindicate the health status of
the system modules, or for visual indication of alarms. A small Liquid Crystal Display (LCD)
may also be used to display someimportant parameters.
1.1.5 Communication interfaces:

9 | Page

The embedded systems may need to, interact with other embedded systems at they may
have to transmit data to a desktop. To facilitate this, the embedded systems are provided with
one or a fewcommunication interfaces such as RS232, RS422, RS485, Universal Serial Bus
(USB), and IEEE 1394, Ethernet etc.
1.1.6 Application-specific circuitry:
Sensors, transducers, special processing and control circuitry may be required fat an
embedded system, depending on its application. This circuitry interacts with the processor to
carry out the necessary work. The entire hardware has to be given power supply either through
the 230 volts main supply or through a battery. The hardware has to design in such a way that
the power consumption is minimized.

1.2 APPLICATION AREAS


Nearly 99 per cent of the processors manufactured end up in embedded systems. The
embedded system market is one of the highest growth areas as these systems are used in very
market segment- consumer electronics, office automation, industrial automation, biomedical
engineering, wireless communication, data communication, telecommunications, transportation,
military and so on.
1.2.1Consumer appliances:
At home we use a number of embedded systems which include digital camera, digital
diary, DVD player, electronic toys, microwave oven, remote controls for TV and airconditioner, VCO player, video game consoles, video recorders etc.
1.2.2 Office Automation:
The office automation products using embedded systems are copying machine, fax
machine, key telephone, modem, printer, scanner etc.
1.2.3 Industrial Automation:
Today a lot of industries use embedded systems for process control. These include
pharmaceutical, cement, sugar, oil exploration, nuclear energy, electricity generation and
transmission. The embedded systems for industrial use are designed to carry out specific tasks
10 | P a g e

such as monitoring the temperature, pressure, humidity, voltage, current etc., and then take
appropriate action based on the monitored levels to control other devices or to send information
to a centralized monitoring station.
1.2.4 Medical Electronics:
Almost every medical equipment in the hospital is an embedded system. These
equipments include diagnostic aids such as ECG, EEG, blood pressure measuring devices, Xray scanners; equipment used in blood analysis, radiation, colonoscopy, endoscope etc.
Developments in medical electronics have paved way for more accurate diagnosis of diseases.
1.2.5 Computer Networking:
Computer networking products such as bridges, routers, Integrated Services Digital
Networks (ISDN), Asynchronous Transfer Mode (ATM), X.25 and frame relay switches are
embedded systems which implement the necessary data communication protocols. For example,
a router interconnects two networks. The two networks may be running different protocol
stacks.
1.2.6 Telecommunications:
In the field of telecommunications, the embedded systems can be categorized as
subscriber terminals and network equipment. The subscriber terminals such as key telephones,
ISDN phones, terminal adapters, web cameras are embedded systems. The network equipment
includes multiplexers, multiple access systems, Packet Assemblers Dissemblers (PADs),
sate11ite modems etc. IP phone, IP gateway, IP gatekeeper etc. are the latest embedded systems
that provide very low-cost voice communication over the Internet.
1.2.7 Wireless Technologies:
Advances in mobile communications are paving way for many interesting applications
using embedded systems. The mobile phone is one of the marvels of the last decade of the 20h
century. It is a very powerful embedded system that provides voice communication while we are
on the move. The Personal Digital Assistants and the palmtops can now be used to access
multimedia services over the Internet. Mobile communication infrastructure such as base station
controllers, mobile switching centers are also powerful embedded systems.
11 | P a g e

1.2.8 Security:
Security of persons and information has always been a major issue. We need to protect
our homes and offices; and also the information we transmit and store. Developing embedded
systems for security applications is one of the most lucrative businesses nowadays. Security
devices at homes, offices, airports etc. for authentication and verification are embedded
systems.

CHAPTER 2

MICRO CONTROLLERS
2.1 INTRODUCTION:
12 | P a g e

Microprocessors and microcontrollers are widely used in embedded systems products.


Microcontroller is a programmable device. A microcontroller has a CPU in addition to a fixed
amount of RAM, ROM, I/O ports and a timer embedded all on a single chip. The fixed amount
of on-chip ROM, RAM and number of I/O ports in microcontrollers makes them ideal for many
applications in which cost and space are critical.
The Intel 8051 is Harvard architecture, single chip microcontroller (C) which was
developed by Intel in 1980 for use in embedded systems. It was popular in the 1980s and early
1990s, but today it has largely been superseded by a vast range of enhanced devices with 8051compatible processor cores that are manufactured by more than 20 independent manufacturers
including Atmel, Infineon Technologies and Maxim Integrated Products.
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-bit pieces to be processed by the CPU. 8051
is available in different memory types such as UV-EPROM, Flash and NV-RAM.
The microcontroller used in this project is At89s52. Atmel Corporation introduced this
at89s52 microcontroller. This microcontroller belongs to 8051 family. 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. At89s52 is Flash type 8051.
The present project is implemented on Keil Uvision. In order to program the device,
proload tool has been used to burn the program onto the microcontroller.
The features, pin description of the microcontroller and the software tools used are discussed in
the following sections.

2.2 FEATURES OF At89s52:


4K Bytes of Re-programmable Flash Memory.
RAM is 128 bytes.
2.7V to 6V Operating Range.
Fully Static Operation: 0 Hz to 24 MHz.
13 | P a g e

Two-level Program Memory Lock.


128 x 8-bit Internal RAM.
32 Programmable I/O Lines.
Two 16-bit Timer/Counters.
Six Interrupt Sources.
Programmable Serial UART Channel.
Low-power Idle and Power-down Modes.

2.3 DESCRIPTION:
The At89s52 is a low-voltage, high-performance CMOS 8-bit microcomputer with 4K bytes of
Flash programmable memory. The device is manufactured using Atmels high-density
nonvolatile memory technology and is compatible with the industry-standard MCS-51
instruction set. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel
At89s52 is a powerful microcomputer, which provides a highly flexible and cost-effective
solution to many embedded control applications.
In addition, the At89s52 is designed with static logic for operation down to zero
frequency and supports two software selectable power saving modes. The Idle Mode stops the
CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue
functioning. The power-down mode saves the RAM contents but freezes the oscillator disabling
all other chip functions until the next hardware reset.

2.4 PIN DIAGRAM

14 | P a g e

Fig 4.2.1: Pin diagram

15 | P a g e

Fig 4.2.2: Block diagram of at89s52

2.5 PIN DESCRIPTION:


2.5.1 VCC: Pin 40 provides supply voltage to the chip. The voltage source is +5V.
16 | P a g e

2.5.2GND: Pin 20 is the ground


2.5.3 XTAL1 and XTAL2XTAL1 and XTAL2 are the input and output, respectively, of an
inverting amplifier that can be configured for use as an on-chip oscillator, as shown in Figure
11. Either a quartz crystal or ceramic resonator may be used. To drive the device from an

Figure: 11

external clock source, XTAL2 should be left unconnected while XTAL1 is driven, as shown in
the below figure. There are no requirements on the duty cycle of the external clock signal, since
the input to the internal clocking circuitry is through a divide-by-two flip-flop, but minimum
and maximum voltage high and low time specifications must be observed.

Fig 4.2.3: Oscillator Connections


17 | P a g e

C1, C2 = 30 pF 10 pF for Crystals


= 40 pF 10 pF for Ceramic Resonator
2.5.4 RESET:
Pin9 is the reset pin. It is an input and is active high. Upon applying a high pulse to this pin, the
microcontroller will reset and terminate all the activities. This is often referred to as a power-on
reset.
2.5.5 EA (External access):
Pin 31 is EA. It is an active low signal. It is an input pin and must be connected to either
Vcc or GND but it cannot be left unconnected.
The 8051 family members all come with on-chip ROM to store programs. In such cases,
the EA pin is connected to Vcc. If the code is stored on an external ROM, the EA pin must be
connected to GND to indicate that the code is stored externally.
2.5.6 PSEN (Program store enable):
This is an output pin.
2.5.7 ALE (Address latch enable):
This is an output pin and is active high.

2.6 PORTS 0, 1, 2 & 3:


The four ports P0, P1, P2 and P3 each use 8 pins, making them 8-bit ports. All the ports
upon RESET are configured as input, since P0-P3 have value FFH on them.
2.6.1 PORT 0(P0):
Port 0 is also designated as AD0-AD7, allowing it to be used for both address and data.
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. Therefore, ALE is used for demultiplexing address and data with
the help of an internal latch.
18 | P a g e

When there is no external memory connection, the pins of P0 must be connected to a


10K-ohm pull-up resistor. This is due to the fact that P0 is an open drain. With external pull-up
resistors connected to P0, it can be used as a simple I/O, just like P1 and P2. But the ports P1,
P2 and P3 do not need any pull-up resistors since they already have pull-up resistors internally.
Upon reset, ports P1, P2 and P3 are configured as input ports.
2.6.2 PORT 1 & PORT 2:
With no external memory connection, both P1 and P2 are used as simple I/O. With
external memory connections, port 2 must be used along with P0 to provide the 16-bit address
for the external memory. Port 2 is designated as A8-A15 indicating its dual function. While P0
provides the lower 8 bits via A0-A7, it is the job of P2 to provide bits A8-A15 of the address.
2.6.3 PORT 3:
Port 3 occupies a total of 8 pins, pins 10 through 17. It can be used as input or output. P3
does not need any pull-up resistors, the same as port 1 and port 2. Port 3 has an additional
function of providing some extremely important signals such as interrupts.

Table 1.2.1: Port 3 Alternate Functions

2.7 Addressing Modes:


While operating, processor processes data according to the program instructions. Each
instruction consists of two parts. One part describes what should be done and another part
19 | P a g e

indicates what to use to do it. This later part can be data (binary number) or address where the
data is stored. All 8051 microcontrollers use two ways of addressing depending on which part of
memory should be accessed:
2.7.1 Direct Addressing:
On direct addressing, a value is obtained from a memory location while the address of
that location is specified in instruction. Only after that, the instruction can process data (how
depends on the type of instruction: addition, subtraction, copy). Obviously, a number being
changed during operating a variable can reside at that specified address. For example: Since the
address is only one byte in size ( the greatest number is 255), this is how only the first 255
locations in RAM can be accessed in this case the first half of the basic RAM is intended to be
used freely, while another half is reserved for the SFRs.
2.7.2 Indirect Addressing:
On indirect addressing, a register which contains address of another register is specified
in the instruction. A value used in operating process resides in that another register. For
example:
Only RAM locations available for use are accessed by indirect addressing (never in the
SFRs). For all latest versions of the microcontrollers with additional memory block (those 128
locations in Data Memory), this is the only way of accessing them. Simply, when during
operating, the instruction including @ sign is encountered and if the specified address is
higher than 128 (7F hex.), the processor knows that indirect addressing is used and jumps over
memory space reserved for the SFRs.

20 | P a g e

CHAPTER 3

FUNCTIONAL BLOCK DIAGRAM AND DESCRIPTION

21 | P a g e

Block diagram

DESCRIPTION
3.1LM358
Use the LM158/LM258/LM358 dual op amp with a single supply in place of the
LM1458/LM1558 with split supply and reap the profits in terms of :
a. Input and output voltage range down to the negative (ground) rail
b. Single supply operation
c. Lower standby power dissipation
d. Higher output voltage swing
e. Lower input offset current
f. Generally similar performance otherwise
The main advantage, of course, is that you can eliminate the negative supply in many
applications and still retain equivalent op amp performance. Additionally, and in some cases
more importantly, the input and output levels are permitted to swing down to ground (negative
rail) potential. Table 1 shows the relative performance of the two in terms of guaranteed and/or
typical specifications.
22 | P a g e

Description/ordering information
These devices consist of two independent, high-gain frequency-compensated operational
amplifiers designed to operate from a single supply over a wide range of voltages. Operation
from split supplies also is possible if the difference between the two supplies is 3 V to 32 V (3 V
to 26 V for the LM2904), and VCC is at least 1.5 V more positive than the input common-mode
voltage. The low supply-current drain is independent of the magnitude of the supply voltage.
Applications include transducer amplifiers, dc amplification blocks, and all the conventional
operational amplifier circuits that now can be implemented more easily in single-supply-voltage
systems. For example, these devices can be operated directly from the standard 5-V supply used
in digital systems and easily can provide the required interface electronics without additional
5-V supplies.
23 | P a g e

24 | P a g e

3.2 LM 7805 VOLTAGE REGULATOR


P1. Fixed output voltage regulator
P1.1. DC Parameters

From the IC 7805 datasheet, write down the minimum, typical and maximumvalues of
the output voltage VO and then compute the value of the output current IO, for the load resistance
RL=47.

Determine the smallest value of the input voltage VIfor which IC7805 can still work as a
voltage regulator.

Considering VI=8V, compute the value of the output current IO1, for a load resistance
RL1=22.

From the IC 7805 datasheet, write down the value of the short circuit current ISC.

P1.2. Line regulation

From the IC 7805 datasheet, write down the typical and maximumvalues for the variation of the
output voltage VO, when the input voltage VI varies between 8V and 12V.

For the typical and maximum values of the output voltage variation, compute the line regulation
coefficient, using the formula:

P1.3. Load regulation

From the IC 7805 datasheet, write down the typical and maximumvalues for the variation of the
output voltage VO, when the output current varies.

For the typical and maximum values of the output voltage variation, compute the load
regulation coefficient, using the formula:

For the circuit in Fig. 3., compute the value of the load resistance, corresponding to both values (levels)
of the TTL voltage.

P2. Adjustable output voltage regulator


25 | P a g e

For the circuit in Fig. 4.,compute the minimum and maximum values of the output voltage VO.
Compute VO for the tap of the potentiometer POT in the middle position.

P3. Voltage regulator with external transistor and protection circuit


For the circuit in Fig. 5.,compute the value of the output current IO for VI=8V and
RL=47.
If RL=47 is replaced with RL2=22, recompute the value of the output current
IO1.
Compute the value of the short circuit current IO,SC and compare it with the value
of the short circuit current for the basic IC 7805, without the external transistor and
protection circuit.

CHAPTER 4

POWER SUPPLY
Power Supply:
The input to the circuit is applied from the regulated power supply. The a.c. input i.e., 230V
from the mains supply is step down by the transformer to 12V and is fed to a rectifier. The
output obtained from the rectifier is a pulsating d.c voltage. So in order to get a pure d.c voltage,
the output voltage from the rectifier is fed to a filter to remove any a.c components present even
26 | P a g e

after rectification. Now, this voltage is given to a voltage regulator to obtain a pure constant dc
voltage.

4.1 Transformer:
Usually, DC voltages are required to operate various electronic equipment and these
voltages are 5V, 9V or 12V. But these voltages cannot be obtained directly. Thus the a.c input
available at the mains supply i.e., 230V is to be brought down to the required voltage level. This
is done by a transformer. Thus, a step down transformer is employed to decrease the voltage to a
required level.
4.2 Rectifier:
The output from the transformer is fed to the rectifier. It converts A.C. into pulsating
D.C. The rectifier may be a half wave or a full wave rectifier. In this project, a bridge rectifier is
used because of its merits like good stability and full wave rectification.
4.3 Filter:
27 | P a g e

Capacitive filter is used in this project. It removes the ripples from the output of rectifier and
smoothens the D.C. Output received from this filter is constant until the mains voltage andload
is maintained constant. However, if either of the two is varied, D.C. voltage received at this
point changes. Therefore a regulator is applied at the output stage.
4.4 Voltage regulator:
As the name itself implies, it regulates the input applied to it. A voltage regulator is an
electrical regulator designed to automatically maintain a constant voltage level. In this project,
power supply of 5V and 12V are required. In order to obtain these voltage levels, 7805 and
7812 voltage regulators are to be used. The first number 78 represents positive supply and the
numbers 05, 12 represent the required output voltage levels.

CHAPTER 5

28 | P a g e

HARDWARE COMPONENTS
5.1 BUZZER
5.1.1

Introduction

A buzzer or beeper is a signalling device, usually electronic, typically used in automobiles,


household appliances such as a microwave oven, or game shows.
It most commonly consists of a number of switches or sensors connected to a control unit that
determines if and which button was pushed or a preset time has lapsed, and usually illuminates
a light on the appropriate button or control panel, and sounds a warning in the form of a
continuous or intermittent buzzing or beeping sound. Initially this device was based on an
electromechanical system which was identical to an electric bell without the metal gong (which
makes the ringing noise). Often these units were anchored to a wall or ceiling and used the
ceiling or wall as a sounding board. Another implementation with some AC-connected devices
was to implement a circuit to make the AC current into a noise loud enough to drive a
loudspeaker and hook this circuit up to a cheap 8-ohm speaker. Nowadays, it is more popular to
use a ceramic-based piezoelectric sounder like a Sonalert which makes a high-pitched tone.
Usually these were hooked up to "driver" circuits which varied the pitch of the sound or pulsed
the sound on and off.
In game shows it is also known as a "lockout system," because when one person signals
("buzzes in"), all others are locked out from signalling. Several game shows have large buzzer
buttons which are identified as "plungers".
The word "buzzer" comes from the rasping noise that buzzers made when they were
electromechanical devices, operated from stepped-down AC line voltage at 50 or 60 cycles.
Other sounds commonly used to indicate that a button has been pressed are a ring or a beep.
Some systems, such as the one used on Jeopardy!, make no noise at all, instead using light.
5.1.2

Buzzer interfacing to microcontroller:

To interface a buzzer the standard transistor interfacing circuit is used. Note that if a different
power supply is used for the buzzer, the 0V rails of each power supply must be connected to
provide a common reference. If a battery is used as the power supply, it is worth remembering
29 | P a g e

that piezo sounders draw much less current than buzzers. Buzzers also just have one tone,
whereas a piezo sounder is able to create sounds of many different tones.

5.2 LIQUID CRYSTAL DISPLAY:


LCD stands for Liquid Crystal Display. LCD is finding wide spread use replacing LEDs (seven
segment LEDs or other multi segment LEDs) because of the following reasons:
1. The declining prices of LCDs.
2. The ability to display numbers, characters and graphics. This is in contrast to LEDs, which
are limited to numbers and a few characters.
3. Incorporation of a refreshing controller into the LCD, thereby relieving the CPU of the
task of refreshing the LCD. In contrast, the LED must be refreshed by the CPU to keep
displaying the data.
4. Ease of programming for characters and graphics.
These components are specialized for being used with the microcontrollers, which means that
they cannot be activated by standard IC circuits. They are used for writing different messages on
a miniature LCD.

30 | P a g e

A model described here is for its low price and great possibilities most frequently used in
practice. It is based on the HD44780 microcontroller (Hitachi) and can display messages in two
lines with 16 characters each. It displays all the alphabets, Greek letters, punctuation marks,
mathematical symbols etc. In addition, it is possible to display symbols that user makes up on
its own.
Automatic shifting message on display (shift left and right), appearance of the pointer, backlight
etc. are considered as useful characteristics.

Pins Functions:
There are pins along one side of the small printed board used for connection to the
microcontroller. There are total of 14 pins marked with numbers (16 in case the background
light is built in). Their function is described in the table below:
31 | P a g e

Function

Pin Number

Name

Logic State

Description

Ground

Vss

0V

Power supply

Vdd

+5V

Contrast

Vee

0 Vdd

Control of operating

RS

0
1

D0 D7 are interpreted as commands


D0 D7 are interpreted as data

RS

0
1

D0 D7 are interpreted as commands


D0 D7 are interpreted as data

R/W

0
1

Write data (from controller to LCD)


Read data (from LCD to controller)

D0

0/1

Bit 0 LSB

D1

0/1

Bit 1

D2

0/1

Bit 2

10

D3

0/1

Bit 3

11

D4

0/1

Bit 4

12

D5

0/1

Bit 5

13

D6

0/1

Bit 6

14

D7

0/1

Bit 7 MSB

Control of operating

Data / commands

0
Access to LCD disabled
1
Normal operating
From 1 to 0 Data/commands are transferred to LCD

LCD screen:
LCD screen consists of two lines with 16 characters each. Each character consists of 5x7 dot
matrix. Contrast on display depends on the power supply voltage and whether messages are
displayed in one or two lines. For that reason, variable voltage 0-Vdd is applied on pin marked
as Vee. Trimmer potentiometer is usually used for that purpose. Some versions of displays have
built in backlight (blue or green diodes). When used during operating, a resistor for current
limitation should be used (like with any LE diode).
32 | P a g e

LCD Connection:
Depending on how many lines are used for connection to the microcontroller, there are 8-bit and
4-bit LCD modes. The appropriate mode is determined at the beginning of the process in a
phase called initialization. In the first case, the data are transferred through outputs D0-D7 as
it has been already explained. In case of 4-bit LED mode, for the sake of saving valuable I/O
pins of the microcontroller, there are only 4 higher bits (D4-D7) used for communication, while
other may be left unconnected.

Consequently, each data is sent to LCD in two steps: four higher bits are sent first (that normally
would be sent through lines D4-D7), four lower bits are sent afterwards. With the help of
initialization, LCD will correctly connect and interpret each data received. Besides, with regards
to the fact that data are rarely read from LCD (data mainly are transferred from microcontroller
to LCD) one more I/O pin may be saved by simple connecting R/W pin to the Ground. Such
saving has its price.
Even though message displaying will be normally performed, it will not be possible to read
from busy flag since it is not possible to read from display.

33 | P a g e

LCD Initialization
Once the power supply is turned on, LCD is automatically cleared. This process lasts for
approximately 15mS. After that, display is ready to operate. The mode of operating is set by
default. This means that:
1. Display is cleared
2. Mode
DL = 1 Communication through 8-bit interface
N = 0 Messages are displayed in one line
F = 0 Character font 5 x 8 dots
3. Display/Cursor on/off
D = 0 Display off
U = 0 Cursor off
B = 0 Cursor blink off
4. Character entry
ID = 1 Addresses on display are automatically incremented by 1
S = 0 Display shift off
Automatic reset is mainly performed without any problems. If for any reason power supply
voltage does not reach full value in the course of 10mS, display will start perform completely
unpredictably.
If voltage supply unit cannot meet this condition or if it is needed to provide completely safe
operating, the process of initialization by which a new reset enabling display to operate
normally must be applied.

34 | P a g e

Algorithm according to the initialization is being performed depends on whether connection to


the microcontroller is through 4- or 8-bit interface. All left over to be done after that is to give
basic commands and of course- to display messages.

Contrast control:
To have a clear view of the characters on the LCD, contrast should be adjusted. To adjust the
contrast, the voltage should be varied. For this, a preset is used which can behave like a variable
voltage device. As the voltage of this preset is varied, the contrast of the LCD can be adjusted.

35 | P a g e

Presets:
These are miniature versions of the standard variable resistor. They are designed to be mounted
directly onto the circuit board and adjusted only when the circuit is built. For example, to set the
frequency of an alarm tone or the sensitivity of a light-sensitive circuit, a small screwdriver or
similar tool is required to adjust presets.
Presets are much cheaper than standard variable resistors so they are sometimes used in projects
where a standard variable resistor would normally be used.
Multiturn presets are used where very precise adjustments must be made. The screw must be
turned many times (10+) to move the slider from one end of the track to the other, giving very
fine control.

LCD interface with the microcontroller (4-bit mode):

36 | P a g e

5.3 Light-emitting diode


.Light-emitting diode

Red, pure green and blue LEDs of


the 5mm diffused
Working principle
Invented
Electronic symbol

Electroluminescence
Nick Holonyak Jr. (1962)

37 | P a g e

Parts of an LED. Although not directly labeled, the flat bottom surfaces of the anvil and post
embedded inside the epoxy act as anchors, to prevent the conductors from being forcefully
pulled out from mechanical strain or vibration.
A light-emitting diode (LED) is a semiconductor light source. LEDs are used as indicator
lamps in many devices and are increasingly used for other lighting. Introduced as a practical
electronic component in 1962, early LEDs emitted low-intensity red light, but modern versions
are available across the visible, ultraviolet and infrared wavelengths, with very high brightness.
When a light-emitting diode is forward biased (switched on), electrons are able to recombine
with electron holes within the device, releasing energy in the form of photons. This effect is
called electroluminescence and the color of the light (corresponding to the energy of the photon)
is determined by the energy gap of the semiconductor. An LED is often small in area (less than
1 mm2), and integrated optical components may be used to shape its radiation pattern. LEDs
present many advantages over incandescent light sources including lower energy consumption,
longer lifetime, improved robustness, smaller size, faster switching, and greater durability and
reliability. LEDs powerful enough for room lighting are relatively expensive and require more
precise current and heat management than compact fluorescent lamp sources of comparable
output.
Light-emitting diodes are used in applications as diverse as replacements for aviation lighting,
automotive lighting (particularly brake lamps, turn signals and indicators) as well as in traffic
38 | P a g e

signals. The compact size, the possibility of narrow bandwidth, switching speed, and extreme
reliability of LEDs has allowed new text and video displays and sensors to be developed, while
their high switching rates are also useful in advanced communications technology. Infrared
LEDs are also used in the remote control units of many commercial products including
televisions, DVD players, and other domestic appliances.

Practical use
The first commercial LEDs were commonly used as replacements for incandescent and neon
indicator lamps, and in seven-segment displays, first in expensive equipment such as laboratory
and electronics test equipment, then later in such appliances as TVs, radios, telephones,
calculators, and even watches (see list of signal uses). These red LEDs were bright enough only
for use as indicators, as the light output was not enough to illuminate an area. Readouts in
calculators were so small that plastic lenses were built over each digit to make them legible.
Later, other colors grew widely available and also appeared in appliances and equipment. As
LED materials technology grew more advanced, light output rose, while maintaining efficiency
and reliability at acceptable levels. The invention and development of the high power white
light LED led to use for illumination, which is fast replacing incandescent and fluorescent
lighting. (see list of illumination applications). Most LEDs were made in the very common
5 mm T1 and 3 mm T1 packages, but with rising power output, it has grown increasingly
necessary to shed excess heat to maintain reliability, so more complex packages have been
adapted for efficient heat dissipation. Packages for state-of-the-art high power LEDs bear little
resemblance to early LEDs.

The inner workings of an LED

39 | P a g e

I-V diagram for a diode. An LED will begin to emit light when the on-voltage is exceeded.
Typical on voltages are 23 volts
LED development began with infrared and red devices made with gallium arsenide. Advances
in materials science have enabled making devices with ever-shorter wavelengths, emitting light
in a variety of colors.
LEDs are usually built on an n-type substrate, with an electrode attached to the p-type layer
deposited on its surface. P-type substrates, while less common, occur as well. Many commercial
LEDs, especially GaN/InGaN, also use sapphire substrate.
Most materials used for LED production have very high refractive indices. This means that
much light will be reflected back into the material at the material/air surface interface. Thus,
light extraction in LEDs is an important aspect of LED production, subject to much research
and development.

Types

LEDs are produced in a variety of shapes and sizes. The 5 mm cylindrical package (red, fifth
from the left) is the most common, estimated at 80% of world production The color of the
40 | P a g e

plastic lens is often the same as the actual color of light emitted, but not always. For instance,
purple
plastic is often used for infrared LEDs, and most blue devices have clear housings. There are
also LEDs in SMT packages, such as those found on blinkies and on cell phone keypads (not
shown).
The main types of LEDs are miniature, high power devices and custom designs such as
alphanumeric or multi-color.

Advantages

Efficiency: LEDs emit more light per watt than incandescent light bulbs. Their
efficiency is not affected by shape and size, unlike fluorescent light bulbs or tubes.

Color: LEDs can emit light of an intended color without using any color filters as
traditional lighting methods need. This is more efficient and can lower initial costs.

Size: LEDs can be very small (smaller than 2 mm2) and are easily populated onto
printed circuit boards.

On/Off time: LEDs light up very quickly. A typical red indicator LED will achieve full
brightness in under a microsecond. LEDs used in communications devices can have even faster
response time.

Dimming: LEDs can very easily be dimmed either by pulse width modulation or
lowering the forward current.

Slow failure: LEDs mostly fail by dimming over time, rather than the abrupt failure of
incandescent bulbs.

Lifetime: LEDs can have a relatively long useful life. One report estimates 35,000 to
50,000 hours of useful life, though time to complete failure may be longer. Fluorescent tubes
typically are rated at about 10,000 to 15,000 hours, depending partly on the conditions of use,
and incandescent light bulbs at 1,0002,000 hours.

41 | P a g e

Disadvantages

High initial price: LEDs are currently more expensive, price per lumen, on an initial
capital cost basis, than most conventional lighting technologies. The additional expense
partially stems from the relatively low lumen output and the drive circuitry and power
supplies needed.

Temperature dependence: LED performance largely depends on the ambient


temperature of the operating environment. Over-driving an LED in high ambient
temperatures may result in overheating the LED package, eventually leading to device
failure. Adequate heat sinking is needed to maintain long life. This is especially
important in automotive, medical, and military uses where devices must operate over a
wide range of temperatures, and need low failure rates.

Voltage sensitivity: LEDs must be supplied with the voltage above the threshold and a
current below the rating. This can involve series resistors or current-regulated power
supplies.[90]

Area light source: LEDs do not approximate a point source of light, but rather a
lambertian distribution. So LEDs are difficult to apply to uses needing a spherical light
field. LEDs cannot provide divergence below a few degrees. In contrast, lasers can emit
beams with divergences of 0.2 degrees or less.

Applications

LED lighting in the aircraft cabin of an Airbus A320 Enhanced.

42 | P a g e

A large LED display behind a disc jockey.

LED destination signs on buses, one with a colored route number.

LED digital display that can display 4 digits along with points.

5.4 CERAMIC CAPACITOR


in electronics,

a ceramic

capacitor is

a capacitor constructed

of

alternating

layers

of metal and ceramic, with the ceramic material acting as the dielectric. The coefficient depends
on whether the dielectric is Class 1 or Class 2. A ceramic capacitor (especially the class 2) often
has high dissipation factor, high frequency coefficient of dissipation.

43 | P a g e

A ceramic capacitor is a two-terminal, non-polar device. The classical ceramic capacitor is the
"disc capacitor". This device pre-dates the transistor and was used extensively in vacuum-tube
equipment (e.g., radio receivers) from about 1930 through the 1950s, and in discrete transistor
equipment from the 1950s through the 1980s. As of 2007, ceramic disc capacitors are in
widespread use in electronic equipment, providing high capacity and small size at low price
compared to other low value capacitor types.
Ceramic capacitors come in various shapes and styles, including:

disc, resin coated, with through-hole leads

multilayer rectangular block, surface mount

bare leadless disc, sits in a slot in the PCB and is soldered in place, used for UHF
applications

tube shape, not popular now

5.4.1 CLASSES OF CERAMIC CAPACITOR


Class I capacitors: accurate, temperature-compensating capacitors. They are the most stable
over voltage, temperature, and to some extent, frequency. They also have the lowest losses. On
the other hand, they have the lowest volumetric efficiency. A typical class I capacitor will have a
temperature coefficient of 30 ppm/C. This will typically be fairly linear with temperature.
These also allow for high Q filtersa typical class I capacitor will have a dissipation factor of
0.15%. Very high accuracy (~1%) class I capacitors are available (typical ones will be 5% or
10%). The highest accuracy class 1 capacitors are designated C0G or NP0.
Class II capacitors: better volumetric efficiency, but lower accuracy and stability. A typical class
II capacitor may change capacitance by 15% over a 55 C to 85 C temperature range. A
typical class II capacitor will have a dissipation factor of 2.5%. It will have average to poor
accuracy (from 10% down to +20/-80%).
Class III capacitors: high volumetric efficiency, but poor accuracy and stability. A typical class
III capacitor will change capacitance by -22% to +56% over a temperature range of 10 C to 55
C. It will have a dissipation factor of 4%. It will have fairly poor accuracy (commonly, 20%, or
+80/-20%). These are typically used for decoupling or in other power supply applications.

44 | P a g e

At one point, Class IV capacitors were also available, with worse electrical characteristics than
Class III, but even better volumetric efficiency. They are now rather rare and considered
obsolete, as modern multilayer ceramics can offer better performance in a compact package.
In aluminum electrolytic capacitors, the layer of insulating aluminum oxide on the surface of
the aluminum plate acts as the dielectric, and it is the thinness of this layer that allows for a
relatively high capacitance in a small volume. This oxide has a dielectric constant of 10, which
is several times higher than most common polymer insulators. It can withstand an electric field
strength of the order of 25 megavolts per meter which is an acceptable fraction of that of
common polymers. This combination of high capacitance and reasonably high voltage result in
high energy density.
Most electrolytic capacitors are polarized and require one of the electrodes to be positive
relative to the other; they may catastrophically fail if voltage is reversed. This is because a
reverse-bias voltage above 1 to 1.5 Vwill destroy the center layer of dielectric material via
electrochemical reduction (see redox reactions). Following the loss of the dielectric material, the
capacitor will short circuit, and with sufficient short circuit current, the electrolyte will rapidly
heat up and either leak or cause the capacitor to burst, often in spectacularly dramatic fashion.
To minimize the likelihood of a polarized electrolytic being incorrectly inserted into a circuit,
polarity is very clearly indicated on the case. A bar across the side of the capacitor is usually
used to indicate the negative terminal. Also, the negative terminal lead of a radial electrolytic is
shorter than the positive lead and may be otherwise distinguishable. On a printed circuit board it
is customary to indicate the correct orientation by using a square through-hole pad for the
positive lead and a round pad for the negative.
Special capacitors designed for AC operation are available, usually referred to as "nonpolarized" or "NP" types. In these, full-thickness oxide layers are formed on both the aluminum
foil strips prior to assembly. On the alternate halves of the AC cycles, one of the foil strips acts
as a blocking diode, preventing reverse current from damaging the electrolyte of the other one.
Modern capacitors have a safety valve, typically either a scored section of the can, or a specially
designed end seal to vent the hot gas/liquid, but ruptures can still be dramatic. An electrolytic
can withstand a reverse bias for a short period, but will conduct significant current and not act
as a very good capacitor. Most will survive with no reverse DC bias or with only AC voltage,

45 | P a g e

but circuits should be designed so that there is not a constant reverse bias for any significant
amount of time.

Capacitor

Polarized
Capacitor

The above are the most common schematic symbols for electrolytic capacitors. Some schematic
diagrams do not print the "+" adjacent to the symbol. Older circuit diagrams show electrolytic
capacitors as a small positive plate surrounded below and on the sides by a larger dish-shaped
negative electrode, usually without "+" marking.

5.4.2 Capacitance
The capacitance value of any capacitor is a measure of the amount of electric charge stored per
unit of potential difference between the plates. The basic unit of capacitance is a farad; however,
this unit has been too large for general use until the invention of the double-layer capacitor, so
microfarad (F, or less correctly uF), nanofarad (nF) and picofarad (pF) are more commonly
used.
Many conditions determine a capacitor's value, such as the thickness of the dielectric and the
plate area. In the manufacturing process, electrolytic capacitors are made to conform to a set of
preferred numbers. By multiplying these base numbers by a power of ten, any practical
capacitor value can be achieved, which is suitable for most applications.
Passive electronic components, including capacitors, are usually produced in preferred values
(e.g., IEC 60063 E6, E12, etc. series).

46 | P a g e

The capacitance of aluminum electrolytic capacitors tends to change over time, and they usually
have a tolerance range of 20%. Some have asymmetric tolerances, typically 20% but with
much larger positive tolerance as many circuits merely require a capacitance to be not less than
a given value; this can be seen on datasheets for many consumer-grade capacitors. Tantalum
electrolytics can be produced to tighter tolerances and are more stable.

5.4.3 Types

Electrolytic capacitors of several sizes


Unlike capacitors that use a bulk dielectric made from an intrinsically insulating material, the
dielectric in electrolytic capacitors depends on the formation and maintenance of a microscopic
metal oxide layer. Compared to bulk dielectric capacitors, this very thin dielectric allows for
much more capacitance in the same unit volume, but maintaining the integrity of the dielectric
usually requires the steady application of the correct polarity of voltage or the oxide layer will
break down and rupture, causing the capacitor to lose its ability to withstand applied voltage
(although it can often be "reformed"). In addition, electrolytic capacitors generally use an
internal wet chemistry and they will eventually fail if the water within the capacitor evaporates.
Electrolytic capacitance values are not as tightly-specified as with bulk dielectric capacitors.
Especially with aluminum electrolytics, it is quite common to see an electrolytic capacitor
specified as having a "guaranteed minimum value" and no upper bound on its value. For most
purposes (such as power supply filtering and signal coupling), this type of specification is
acceptable.
5.5 TRANSISTOR
Transistor is a semiconductor device used to amplify and switch electronic signals. It is
composed of a semiconductor material with at least three terminals for connection to an external
circuit. A voltage or current applied to one pair of the transistor's terminals changes the current
47 | P a g e

flowing through another pair of terminals. Because the controlled (output) power can be much
more than the controlling (input) power, a transistor can amplify a signal. Today, some
transistors are packaged individually, but many more are found embedded in integrated circuits.
The transistor is the fundamental building block of modern electronic devices, and is ubiquitous
in modern electronic systems. Following its release in the early 1950s the transistor
revolutionized

the

field

of

electronics,

and

paved

the

way

for

smaller

and

cheaper radios, calculators, and computers, among other things.


symbols

PNP

NPN

Importance
The transistor is the key active component in practically all modern electronics. Many consider
it to be one of the greatest inventions of the 20th century. Its importance in today's society rests
on its ability to be mass produced using a highly automated process (semiconductor device
fabrication) that achieves astonishingly low per-transistor costs. The invention of the first
transistor at Bell Labs was named an IEEE Milestone in 2009
5.5.1

Usage

The bipolar junction transistor (BJT) was the most commonly used transistor in the 1960s and
70s. Even after MOSFETs became widely available, the BJT remained the transistor of choice
for many analog circuits such as simple amplifiers because of their greater linearity and ease of
manufacture. Desirable properties of MOSFETs, such as their utility in low-power devices,
usually in the CMOSconfiguration, allowed them to capture nearly all market share for digital
circuits; more recently MOSFETs have captured most analog and power applications as well,
48 | P a g e

including modern clocked analog circuits, voltage regulators, amplifiers, power transmitters and
motor drivers.
The essential usefulness of a transistor comes from its ability to use a small signal applied
between one pair of its terminals to control a much larger signal at another pair of terminals.
This property is called gain. A transistor can control its output in proportion to the input signal;
that is, it can act as an amplifier. Alternatively, the transistor can be used to turn current on or
off in a circuit as an electrically controlled switch, where the amount of current is determined by
other circuit elements.
The two types of transistors have slight differences in how they are used in a circuit. A bipolar
transistor has terminals labeled base, collector, and emitter. A small current at the base
terminal (that is, flowing from the base to the emitter) can control or switch a much larger
current between the collector and emitter terminals. For a field-effect transistor, the terminals
are labeled gate, source, and drain, and a voltage at the gate can control a current between
source and drain.
The image to the right represents a typical bipolar transistor in a circuit. Charge will flow
between emitter and collector terminals depending on the current in the base. Since internally
the base and emitter connections behave like a semiconductor diode, a voltage drop develops
between base and emitter while the base current exists. The amount of this voltage depends on
the material the transistor is made from, and is referred to as VBE.
5.5.2

Transistor as a switch

BJT used as an electronic switch, in grounded-emitter configuration.


Transistors are commonly used as electronic switches, both for high-power applications such
as switched-mode power supplies and for low-power applications such as logic gates.

49 | P a g e

In a grounded-emitter transistor circuit, such as the light-switch circuit shown, as the base
voltage rises the base and collector current rise exponentially, and the collector voltage drops
because of the collector load resistor. The relevant equations:
VRC = ICE RC, the voltage across the load (the lamp with resistance RC)
VRC + VCE = VCC, the supply voltage shown as 6V
If VCE could fall to 0 (perfect closed switch) then Ic could go no higher than V CC / RC, even with
higher base voltage and current. The transistor is then said to be saturated. Hence, values of
input voltage can be chosen such that the output is either completely off, [14] or completely on.
The transistor is acting as a switch, and this type of operation is common in digital
circuits where only "on" and "off" values are relevant.
5.5.3

Transistor as an amplifier

Amplifier circuit, common-emitter configuration.


The common-emitter amplifier is designed so that a small change in voltage in (Vin) changes the
small current through the base of the transistor; the transistor's current amplification combined
with the properties of the circuit mean that small swings in Vin produce large changes in Vout.
Various configurations of single transistor amplifier are possible, with some providing current
gain, some voltage gain, and some both.
From mobile phones to televisions, vast numbers of products include amplifiers for sound
reproduction, radio transmission, and signal processing. The first discrete transistor audio
50 | P a g e

amplifiers barely supplied a few hundred milliwatts, but power and audio fidelity gradually
increased as better transistors became available and amplifier architecture evolved.
Modern transistor audio amplifiers of up to a few hundred watts are common and relatively
inexpensive.
Prior to the development of transistors, vacuum (electron) tubes (or in the UK "thermionic
valves" or just "valves") were the main active components in electronic equipment.
5.5.4

Advantages

The key advantages that have allowed transistors to replace their vacuum tube predecessors in
most applications are
Small size and minimal weight, allowing the development of miniaturized electronic

devices.

Highly automated manufacturing processes, resulting in low per-unit cost.

Lower possible operating voltages, making transistors suitable for small, batterypowered applications.

No warm-up period for cathode heaters required after power application.

Lower power dissipation and generally greater energy efficiency.

Higher reliability and greater physical ruggedness.

Extremely long life. Some transistorized devices have been in service for more than 50
years.
5.5.5

Limitations
Silicon transistors typically do not operate at voltages higher than about

1000 volts (SiC devices can be operated as high as 3000 volts). In contrast, vacuum tubes have
been developed that can be operated at tens of thousands of volts.

51 | P a g e

High-power, high-frequency operation, such as that used in over-the-air television

broadcasting, is better achieved in vacuum tubes due to improved electron mobility in a


vacuum.
Silicon transistors are much more vulnerable than vacuum tubes to an electromagnetic

pulse generated by a high-altitude nuclear explosion.

Prefix class

Usage

Example

AC

Germanium small signal transistor

AC126

AF

Germanium RF transistor

AF117

BC

Silicon, small signal transistor ("allround")

BC548B

BD

Silicon, power transistor

BD139

BF

Silicon, RF (high frequency) BJT or FET

BF245

BS

Silicon, switching transistor (BJT or MOSFET)

BS170

BL

Silicon, high frequency, high power (for transmitters)

BLW34

BU

Silicon, high voltage (for CRT horizontal deflection circuits)

BU5

52 | P a g e

5.6 RESISTOR

A typical axial-lead resistor

Partially exposed Tesla TR-212 1 k carbon film resistor

Axial-lead resistors on tape. The tape is removed during assembly before the leads are formed
and the part is inserted into the board.

53 | P a g e

Three carbon composition resistors in a 1960s valve (vacuum tube) radio


A resistor is a two-terminalpassiveelectronic component which implements electrical resistance
as a circuit element. When a voltage V is applied across the terminals of a resistor, a current I
will flow through the resistor in direct proportion to that voltage. The reciprocal of the constant
of proportionality is known as the resistance R, since, with a given voltage V, a larger value of R
further "resists" the flow of current I as given by Ohm's law:
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 series inductance of a practical resistor causes its behavior to depart from ohms law; this
specification can be important in some high-frequency applications for smaller values of
resistance. In a low-noise amplifier or pre-amp the noise characteristics of a resistor may be an
issue. The unwanted inductance, excess noise, and temperature coefficient are mainly dependent
on the technology used in manufacturing the resistor. They are not normally specified
individually for a particular family of resistors manufactured using a particular technology.[1] A
family of discrete resistors is also characterized according to its form factor, that is, the size of
the device and position of its leads (or terminals) which is relevant in the practical
manufacturing of circuits using them.

Theory of operation
Ohm's law:
Ohm's law states that the voltage (V) across a resistor is proportional to the current (I) passing
through it, where the constant of proportionality is the resistance (R).
This formulation of Ohm's law states that, when a voltage (V) is present across a resistance (R),
a current (I) will flow through the resistance. 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) will flow through that resistor.

54 | P a g e

1.1.1 Series and parallel resistors


In a series configuration, the current through all of the resistors is the same, but the voltage
across each resistor will be in proportion to its resistance. The potential difference (voltage)
seen across the network is the sum of those voltages, thus the total resistance can be found as
the sum of those resistances:
Resistors in a parallel configuration are each subject to the same potential difference (voltage),
however the currents through them add. The conductances of the resistors then add to determine
the conductance of the network. Thus the equivalent resistance (Req) of the network can be
computed:
The parallel equivalent resistance can be represented in equations by two vertical lines "||" (as in
geometry) as a simplified notation. For the case of two resistors in parallel, this can be
calculated using:
Power dissipation
The power P dissipated by a resistor.The first form is a restatement of Joule's first law. Using
Ohm's law, the two other forms can be derived.The total amount of heat energy released over a
period of time can be determined from the integral of the power over that period of
time.Practical resistors are rated according to their maximum power dissipation. The vast
majority of resistors used in electronic circuits absorb much less than a watt of electrical power
and require no attention to their power rating. Such resistors in their discrete form, including
most of the packages detailed below, are typically rated as 1/10, 1/8, or 1/4 watt.
Resistors required to dissipate substantial amounts of power, particularly used in power
supplies, power conversion circuits, and power amplifiers, are generally referred to as power
resistors; this designation is loosely applied to resistors with power ratings of 1 watt or greater.
Power resistors are physically larger and tend not to use the preferred values, color codes, and
external packages described below.
If the average power dissipated by a resistor is more than its power rating, damage to the
resistor may occur, permanently altering its resistance; this is distinct from the reversible change
in resistance due to its temperature coefficient when it warms. Excessive power dissipation may
raise the temperature of the resistor to a point where it can burn the circuit board or adjacent

55 | P a g e

components, or even cause a fire. There are flameproof resistors that fail (open circuit) before
they overheat dangerously.
Note that the nominal power rating of a resistor is not the same as the power that it can safely
dissipate in practical use. Air circulation and proximity to a circuit board, ambient temperature,
and other factors can reduce acceptable dissipation significantly. Rated power dissipation may
be given for an ambient temperature of 25 C in free air. Inside an equipment case at 60 C,
rated dissipation will be significantly less; a resistor dissipating a bit less than the maximum
figure given by the manufacturer may still be outside the safe operating area and may
prematurely fail.
1.1.2

Lead arrangements

Resistors with wire leads for through-hole mounting


5.7 RELAYS:
A relay is an electrically controllable switch widely used in industrial controls, automobiles and
appliances.
The relay allows the isolation of two separate sections of a system with two different voltage
sources i.e., a small amount of voltage/current on one side can handle a large amount of
voltage/current on the other side but there is no chance that these two voltages mix up.

Inductor

56 | P a g e

Fig: Circuit symbol of a relay


Operation:
When current flows through the coil, a magnetic field is created around the coil i.e., the
coil is energized. This causes the armature to be attracted to the coil. The armatures contact acts
like a switch and closes or opens the circuit. When the coil is not energized, a spring pulls the
armature to its normal state of open or closed. There are all types of relays for all kinds of
applications.

Fig: Relay Operation and use of protection diodes


Transistors and ICs must be protected from the brief high voltage 'spike' produced when the
relay coil is switched off. The above diagram shows how a signal diode (eg 1N4148) is
connected across the relay coil to provide this protection. The diode is connected 'backwards' so
that it will normally not conduct. Conduction occurs only when the relay coil is switched off, at
this moment the current tries to flow continuously through the coil and it is safely diverted
through the diode. Without the diode no current could flow and the coil would produce a
damaging high voltage 'spike' in its attempt to keep the current flowing.
In choosing a relay, the following characteristics need to be considered:
57 | P a g e

1.

The contacts can be normally open (NO) or normally closed (NC). In the NC type, the
contacts are closed when the coil is not energized. In the NO type, the contacts are
closed when the coil is energized.

2.

There can be one or more contacts. i.e., different types like SPST (single pole single
throw), SPDT (single pole double throw) and DPDT (double pole double throw) relays.

3.

The voltage and current required to energize the coil. The voltage can vary from a few
volts to 50 volts, while the current can be from a few milliamps to 20milliamps. The
relay has a minimum voltage, below which the coil will not be energized. This minimum
voltage is called the pull-in voltage.

4.

The minimum DC/AC voltage and current that can be handled by the contacts. This is in
the range of a few volts to hundreds of volts, while the current can be from a few amps
to 40A or more, depending on the relay.

DRIVING A RELAY:
An SPDT relay consists of five pins, two for the magnetic coil, one as the common
terminal and the last pins as normally connected pin and normally closed pin. When the current
flows through this coil, the coil gets energized. Initially when the coil is not energized, there
will be a connection between the common terminal and normally closed pin. But when the coil
is energized, this connection breaks and a new connection between the common terminal and
normally open pin will be established. Thus when there is an input from the microcontroller to
the relay, the relay will be switched on. Thus when the relay is on, it can drive the loads
connected between the common terminal and normally open pin. Therefore, the relay takes 5V
from the microcontroller and drives the loads which consume high currents. Thus the relay acts
as an isolation device.

5.8 DIODE
In electronics, a diode is a type of two-terminalelectronic component with nonlinearresistance
and conductance (i.e., a nonlinear currentvoltage characteristic), distinguishing it from
components such as two-terminal linear resistors which obey Ohm's law. A semiconductor
diode, the most common type today, is a crystalline piece of semiconductor material connected

58 | P a g e

to two electrical terminals. A vacuum tube diode (now rarely used except in some high-power
technologies) is a vacuum tube with two electrodes: a plate and a cathode.
The most common function of a diode is to allow an electric current to pass in one direction
(called the diode's 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 behavior is called rectification, and is used to convert alternating current to
direct current, and to extract modulation from radio signals in radio receivers these diodes are
forms of rectifiers.
However, diodes can have more complicated behavior than this simple onoff action.
Semiconductor diodes do not begin conducting electricity until a certain threshold voltage is
present in the forward direction (a state in which the diode is said to be forward-biased). The
voltage drop across a forward-biased diode varies only a little with the current, and is a function
of temperature; this effect can be used as a temperature sensor or voltage reference.
Semiconductor diodes' nonlinear currentvoltage characteristic can be tailored by varying the
semiconductor materials and introducing impurities into (doping) the materials. For example,
diodes are used to regulate voltage (Zener diodes), to protect circuits from high voltage surges
(avalanche diodes), to electronically tune radio and TV receivers (varactor diodes), to generate
radio frequencyoscillations (tunnel diodes, Gunn diodes, IMPATT diodes), and to produce light
(light emitting diodes). Tunnel diodes exhibit negative resistance, which makes them useful in
some types of circuits.

RECTIFIER DIODE
These diodes are used to convert AC into DC these are used as half wave rectifier or full wave
rectifier. Three points must he kept in mind while using any type of diode.
1. Maximum forward current capacity
2. Maximum reverse voltage capacity karissa grace dela cerna
3. Maximum forward voltage capacity awesome
The number and voltage capacity of some of the important diodes available in the market are as
follows:
59 | P a g e

Diodes of number IN4001, IN4002, IN4003, IN4004, IN4005, IN4006 and IN4007 have
maximum reverse bias voltage capacity of 50V and maximum forward current capacity of
1 Amp.

Diode of same capacities can be used in place of one another. Besides this diode of more
capacity can be used in place of diode of low capacity but diode of low capacity can not
be used in place of diode of high capacity.For example, in place of IN4002; IN4001 or
IN4007 can be used but IN4001 or IN4002 can not be used in place of IN4007.The diode
BY125made by company BEL is equivalent of diode from IN4001 to IN4003. BY 126 is
equivalent to diodes IN4004 to 4006 and BY 127 is equivalent to diode IN4007.

5.8 DC Motors:
Electric motors are used to efficiently convert electrical energy into mechanical energy.
Magnetism is the basis of their principles of operation. They use permanent magnets,
electromagnets, and exploit the magnetic properties of materials in order to create these
amazing machines.
There are several types of electric motors available today. The following outline gives an
overview of several popular ones. There are two main classes of motors: AC and DC. AC
motors require an alternating current or voltage source (like the power coming out of the wall
outlets in your house) to make them work. DC motors require a direct current or voltage source
(like the voltage coming out of batteries) to make them work. Universal motors can work on
either type of power. Not only is the construction of the motors different, but the means used to
control the speed and torque created by each of these motors also varies, although the principles
of power conversion are common to both.
They range in power ratings from less than 1/100 hp to over 100,000 hp. The rotate as slowly
as 0.001 rpm to over 100,000 rpm. They range in physical size from as small as the head of a
pin to the size of a locomotive engine.
DC Motors:

60 | P a g e

DC motors are fairly simple to understand. They are also simple to make and only require a
battery or dc supply to make them run.
A simple motor has six parts, as shown in the diagram below:

Armature or rotor

Commutator

Brushes

Axle

Field magnet

DC power supply of some sort

Phase, Voltage & Rotation:


Whether or not you can use a motor will likely depend on these factors.
Single Phase:
Ordinary household wiring is single phase, alternating current. Each cycle peaks and dips as
shown. To run a three phase motor a phase converter must be used, usually this is not practical,
it is often less expensive to change the motor on a machine to a single phase style.

Three Phase:
This is used in industrial shops, rather than peaks and valleys the current supply is more even
because of the other two cycles each offset by 120 degrees.
61 | P a g e

Voltage:
Many motors are dual voltage i.e., by simply changing the wiring configuration, they can be run
on 110 volts or 220 volts. Motors usually run better on 220 volts, especially if there is any line
loss because of having to use a long wire to reach the power supply.
Motors are available for both AC and DC current, our typical home wiring will be AC. There
are DC converters available which are used in applications where the speed of the motor is
controlled.
Rotation:
The direction the shaft rotates can be changed on most motors by switching the right wires. The
direction of rotation is usually determined by viewing the motor from the shaft end and is
designated as CW (clockwise) or CCW (counter-clockwise).
Inside the Wipers:
The wipers combine two mechanical technologies to perform their task
1. A combination electric motor and worm gear reduction provides power to the wipers.
2. A neat linkage converts the rotational output of the motor into the back-and-forth motion
of the wipers.
On any gear, the ratio is determined by the distances from the center of the gear to the point of
contact. For instance, in a device with two gears, if one gear is twice the diameter of the other,
the ratio would be 2:1.
One of the most primitive types of gears we could look at would be a wheel with wooden pegs
sticking out of it.
The problem with this type of gear is that the distance from the center of each gear to the point
of contact changes as the gears rotate. This means that the gear ratio changes as the gear turns,
meaning that the output speed also changes. If you used a gear like this in your car, it would be
impossible to maintain a constant speed you would be accelerating and decelerating constantly.

62 | P a g e

Description of the wiper motors selected


The motor is two pole design having high energy permanent magnets, together with a gear box
housing, having two stages of gear reduction .power from the motor is a transferred by a three
start worm on a extension of the armature shaft through a two stage gear system.
A ball bearing system is provided on the commutator end of the armature to minimize the
friction losses and thereby increase torque of the wiper motor. Power from the final gear arm
spindles .A special inbuilt limit switch ensures in applying regenerative braking to the OFF
position.
Thermal protector is connected in series with armature to avoid burning of armature under
locked position. Consistent parking of the wiper arms and blades in the correct position is there
by ensured. The side on which the arms come to rest is preset to requirements.
Electrical connections are made to the motor via a non-reversible in line plug and socket
assembly .This type of connections ensures that the correct motor polarity is maintained when
the motor is connected to the vehicle wiring. The wiper motor incorporates radio interference
capacitor.

CHAPTER 6

63 | P a g e

EYE BLINK SENSOR


6.1 WHAT IS INFRARED?
Infrared is an energy radiation with a frequency below our eyes sensitivity, so we cannot see it.
Even that we can not "see" sound frequencies, we know that it exist, we can listen them.

Even that we can not see or hear infrared, we can feel it at our skin temperature sensors.
When you approach your hand to fire or warm element, you will "feel" the heat, but you can't
see it. You can see the fire because it emits other types of radiation, visible to your eyes, but it
also emits lots of infrared that you can only feel in your skin.

6.1.1 IR GENERATION
To generate a 36 kHz pulsating infrared is quite easy, more difficult is to receive and identify
this frequency. This is why some companies produce infrared receives, that contains the filters,
decoding circuits and the output shaper, that delivers a square wave, meaning the existence or
not of the 36kHz incoming pulsating infrared.
It means that those 3 dollars small units, have an output pin that goes high (+5V) when there is a
pulsating 36kHz infrared in front of it, and zero volts when there is not this radiation.
64 | P a g e

A square wave of approximately 27uS (microseconds) injected at the base of a transistor, can
drive an infrared LED to transmit this pulsating light wave. Upon its presence, the
commercial receiver will switch its output to high level (+5V).If you can turn on and off this
frequency at the transmitter, your receiver's output will indicate when the transmitter is on or
off.

Those IR demodulators have inverted logic at its output, when a burst of IR is sensed it drives
its output to low level, meaning logic level = 1.
The TV, VCR, and Audio equipment manufacturers for long use infra-red at their remote
controls. To avoid a Philips remote control to change channels in a Panasonic TV, they use
different codification at the infrared, even that all of them use basically the same transmitted
frequency, from 36 to 50 kHz. So, all of them use a different combination of bits or how to
code the transmitted data to avoid interference.

65 | P a g e

RC-5
Various remote control systems are used in electronic equipment today. The RC5 control
protocol is one of the most popular and is widely used to control numerous home appliances,
entertainment systems and some industrial applications including utility consumption remote
meter reading, contact-less apparatus control, telemetry data transmission, and car security
systems. Philips originally invented this protocol and virtually all Philips remotes use this
protocol. Following is a description of the RC5.
When the user pushes a button on the hand-held remote, the device is activated and sends
modulated infrared light to transmit the command. The remote separates command data into
packets. Each data packet consists of a 14-bit data word, which is repeated if the user continues
to push the remote button.
The data packet structure is as follows:

2 start bits,

1 control bit,

5 address bits,

6 command bits.

The start bits are always logic 1 and intended to calibrate the optical receiver automatic gain
control loop. Next, is the control bit. This bit is inverted each time the user releases the remote
button and is intended to differentiate situations when the user continues to hold the same button
or presses it again. The next 5 bits are the address bits and select the destination device. A
number of devices can use RC5 at the same time. To exclude possible interference, each must
use a different address. The 6 command bits describe the actual command. As a result, a RC5
transmitter can send the 2048 unique commands.

The transmitter shifts the data word, applies Manchester encoding and passes the created one-bit
sequence to a control carrier frequency signal amplitude modulator. The amplitude modulated
66 | P a g e

carrier signal is sent to the optical transmitter, which radiates the infrared light. In RC5 systems
the carrier frequency has been set to 36 kHz. Figure below displays the RC5 protocol.
The receiver performs the reverse function. The photo detector converts optical transmission
into electric signals, filters it and executes amplitude demodulation. The receiver output bit
stream can be used to decode the RC5 data word. This operation is done by the microprocessor
typically, but complete hardware implementations are present on the market as well. Single-die
optical receivers are being mass produced by a number of companies such as Siemens, Temic,
Sharp, Xiamen Hualian, Japanese Electric and others. Please note that the receiver output is
inverted (log. 1 corresponds to illumination absence).

The IR Receiver
Many different receiver circuits exist on the market. The most important selection criteria are
the modulation frequency used and the availability in you region.

In the picture above, the typical block diagram of an IR receiver is shown. The received IR
signal is picked up by the IR detection diode on the left side of the diagram. This signal is
amplified and limited by the first 2 stages. The limiter acts as an AGC circuit to get a constant
pulse level, regardless of the distance to the handset. As it can be seen, only the AC signal is
sent to the Band Pass Filter. The Band Pass Filter is tuned to the modulation frequency of the
handset unit. Common frequencies range from 30 kHz to 60 kHz in consumer electronics.
The next stages are a detector, integrator and comparator. The purpose of these three blocks is to
detect the presence of the modulation frequency. If this modulation frequency is present the
output of the comparator will be pulled low.

67 | P a g e

All these blocks are integrated into a single electronic component. There are many different
manufacturers of these components on the market. And most devices are available in several
versions each of which are tuned to a particular modulation frequency.
It should be noted that the amplifier is set to a very high gain. Therefore, the system tends to
start oscillating very easily. Placing a large capacitor of at least 22F close to the receiver's
power connections is mandatory to decouple the power lines. Some data sheets recommend a
resistor of 330 Ohms in series with the power supply to further decouple the power supply from
the rest of the circuit.
Some examples for such disturbance signals which are suppressed by the TSOP17 are:

DC light (e.g. from tungsten bulb or sunlight)

Continuous signal at 38 kHz or at any other frequency

Signals from fluorescent lamps with electronic ballast (an example of the signal
modulation is in the figure below).

There are several manufacturers of IR receivers on the market. Siemens, Vishay and Telefunken
are the main suppliers here in Europe. Siemens has its SFH506-xx series, where xx denotes the
modulation frequency of 30, 33, 36, 38, 40 or 56kHz. Telefunken had its TFMS5xx0 and
68 | P a g e

TK18xx series, where xx again indicates the modulation frequency the device is tuned to. It
appears that these parts have now become obsolete. They are replaced by the Vishay
TSOP12xx, TSOP48xx and TSOP62xx product series.
Sharp, Xiamen Hualian and Japanese Electric are 3 Asian IR receiver producing companies.
Sharp has devices with very cryptic ID names, like: GP1UD26xK, GP1UD27xK and
GP1UD28xK, where x is related to the modulation frequency. Hualian has it's HRMxx00 series,
like the HRM3700 and HRM3800. Japanese Electric has a series of devices that don't include
the modulation frequency in the part's ID. The PIC-12042LM is tuned to 36.7kHz, and the
PIC12043LM is tuned to 37.9kHz.

CHAPTER 7

ALCHOLIC SENSOR
TECHNICAL DATA

MQ-3 SENSOR

FEATURES
69 | P a g e

* High sensitivity to alcohol and small sensitivity to Benzine


*

Fast response and High sensitivity

Stable and long life

Simple drive circuit

APPLICATIONS
They are suitable for alcohol checker, Breathalyser.
SPECIFICATIONS
A. Standard work condition
Symbol
Vc

Parameter name
Circuit voltage

Technical condition
5V0.1

VH

Heating voltage

5V0.1

RL

Load resistance

200K

RH

Heater resistance

335%

PH

Heating consumption

Remarks
AC OR DC
ACOR DC

Room Tem

less than 750mw

B. Environment condition
Symbol

Parameter name

Technical condition

Tao

Using Tem

-10-50

Tas

Storage Tem

-20-70

RH

Related humidity

O2

Oxygen concentration

Remarks

less than 95%Rh


21%(standard condition)Oxygen

minimum value is

concentration can affect sensitivity

over 2%

C. Sensitivity characteristic
Symbol

Parameter name

Technical parameter

Remarks

Rs

Sensing Resistance

1M- 8 M

Detecting concentration

(0.4mg/L alcohol )

scope
0.05mg/L10mg/L
Alcohol

(0.4/1 mg/L)
Standard
detecting

0.6

Concentration slope rate


Temp: 202
Humidity: 65%5%

condition
Parts

Materials

Gas sensing
Preheat
time

SnO2

Vc:5V0.1
Vh: 5V0.1

Over 24 hour

layer
2

Electrode

Au

Electrode line

Pt

Heater coil

Ni-Cr alloy

Tubular ceramic

Al2O3

Anti-explosion

Stainless steel gauze

network

(SUS316 100-mesh)

Clamp

Resin

ring

Tube Pin

base

D.

Structure and configuration, basic measuring circuit

70 | P a g e

Copper plating Ni
Bakelite
Copper plating Ni

Figure 2. Configuration

Figure 2. Configuration B
Structure and configuration of MQ-3 gas sensor is shown as Fig. 1&2, sensor composed by micro
AL2O3 ceramic tube, Tin Dioxide (SnO2) sensitive layer, measuring electrode and heater are
fixed into a crust made by plastic and stainless steel net. The heater provides necessary work
conditions for work of sensitive components. The enveloped MQ-3 have 6 pin ,4 of them are used
to fetch signals, and other 2 are used for providing heating current.
Electric parameter measurement circuit is shown as Fig.2
E. Sensitivity characteristic curve
MQ-3

100

Fig.3 is shows the


typical
sensitivity
characteristics of the
MQ-3 for several gases.
in their: Temp: 20
Humidity: 65%
O2 concentration
21% RL=200k
Ro: sensor resistance at
0.4mg/L of Alcohol in
the clean air.
Rs:sensor resistance at
various
concentrations
of
gases.

Alcohol
Benzine
CH4

10

Hexane
LPG

Rs/Ro

CO
Air

0.1
0.1

mg/L

Fig.3sensitivity characteristics of the MQ-3

10

1.70

71 | P a g e

Rs/Ro--Temp

Rs/Ro

1.60
1.50
1.40
1.30
1.20
1.10

33%RH
85%RH

1.00

0.90
0.80
0.70
0.60
0.50

Temp
-10

10

20

30

40

50

60

Fig4

Fig.4 is shows the typical


dependence of the MQ-3
on
temperature
and
humidity.
Ro: sensor resistance at
0.4mg/L of Alcohol in air at
33%RH and 20
Rs: sensor resistance at
0.4mg/L of Alcohol at
different temperatures and
humidities.

SENSITVITY ADJUSTMENT
Resistance value of MQ-3 is difference to various kinds and various concentration gases.
So,When using this components, sensitivity adjustment is very necessary. we recommend that
you calibrate the detector for 0.4mg/L ( approximately 200ppm ) of Alcohol concentration in
air and use value of Load resistancethat( RL) about200 K(100K to 470 K).
When accurately measuring, the proper alarm point for the gas detector should be determined
after considering the temperature and humidity influence.

72 | P a g e

CHAPTER 8

KIEL SOFTWARE
8.1 Introduction
Keil is to provide you software development tools for your embedded microcontroller
applications.The Keil Development Tools are designed for the professional softwaredeveloper,
however programmers of all levels can use them to get the mostout of the embedded microcontroller
architectures that are supported.
Tools developed by Keil endorse the most popular microcontrollers and are distributed in several
packages and configurations, dependent on the architecture This book, Getting Started, describes
the Vision IDE, Vision Debugger and Analysis Tools, the simulation, and debugging and tracing
capabilities.
In addition to describing the basic behavior and basic screens of Vision, this book provides a
comprehensive overview of the supported microcontroller architecture types, their advantages and
highlights, and suports you in selecting the appropriate target device.
This book incorporates hints to help you to write better code. As with any Getting Started book, it
does not cover every aspect and the many available configuration options in detail. We encourage
you to work through the examples to get familiar with Vision and the computer.
Software Development Tools
Like all software based on Keils Vision IDE, the toolsets

provide a powerful, easy to


use and easy to learn
environment for developing
embedded applications.

They include the components you need to create, debug, and


assemble your C/C++ source files, and incorporate simulation
for microcontrollers and related peripherals.

Software Development Tools


C/C++ Compiler

The RTX RTOS Kernel helps you to implement complex and


time-critical softwar

RTX RTOS Kernel Library


_Vision
IDE & Device Database
_Vision Debugger & Analysis Tools
Complete Device Simulation

RTOS and Middleware Components


These components are designed to solve communication and realtime challenges of embedded systems. While it is possible to
implement embedded applications without using a real-time kernel,
a proven kernel saves time and shortens the development cycle.

This component also


includes the source code
files for the operating
system.e
Components
RTX RTOS Source Code
TCPnet Networking Suite
Flash File System
USB Device Interface
CAN Interface

Hardware Debug Adapters


The Vision Debugger fully supports several emulators provided by Keil, and other vendors.
The Keil ULINK USB-JTAG family of adapters con nect the USB port of a PC to the target
hardware. They enable you to download, test, and debug your embedded application on real
hardware.
Installation using the web download
1. Download the product from www.keil.com/demo
2. Run the downloaded executable
3. Follow the instructions displayed by the SETUP program
Installation from CD-ROM
1. Insert the CD-ROM into your CD-ROM drive. The CD-ROM browser should
start automatically. If it does not, you can run SETUP.EXE from the CD-ROM.
2. Select Install Products & Updates from the CD Browser menu
3. Follow the instructions displayed by the SETUP program
4. 8.2 CODING
#include<reg52.h>
sbit rs=P2^7;
sbit rw=P2^6;
sbit en=P2^5;
sbit motor=P1^0;
sbit buz=P1^1;
sbit led=P1^2;
sbit alcohal=P1^3;
void delay(unsigned int ch) //delay function
{
unsigned int i=0,j=0;
for(i=0;i<=ch;i++)
for(j=0;j<=i;j++);
}
void clcd(unsigned char ch)
{
P0=ch;
rs=0;
rw=0;
en=1;
delay(50);
en=0;
}
void dlcd(unsigned char ch)
{
P0=ch;
rs=1;
rw=0;
en=1;
delay(50);
en=0;
}
void stringlcd(unsigned char ch,unsigned char *chrt)
{
unsigned int ix=0;
75 | P a g e

if(ch==0x80)
clcd(0x01);
clcd(ch);
for(ix=0;chrt[ix]!='\0';ix++)
{
dlcd(chrt[ix]);
}
}
void initlcd()
{
clcd(0x38);
clcd(0x0e);
clcd(0x06);
clcd(0x01);
clcd(0x80);
}
void conv(unsigned long int ch)
{
unsigned long int temp=0,temp2=0;
temp2=ch;
temp=temp2/100000;
dlcd(temp+0x30);
temp2=temp2%100000;
temp=temp2/10000;
dlcd(temp+0x30);
temp2=temp2%10000;
temp=temp2/1000;
dlcd(temp+0x30);
temp2=temp2%1000;
temp=temp2/100;
dlcd(temp+0x30);
temp2=temp2%100;
temp=temp2/10;
dlcd(temp+0x30);
temp2=temp2%10;
dlcd(temp2+0x30);
}
unsigned long int speed=0;
void main()
{
initlcd();
stringlcd(0x80,"welcome");
delay(500);
clcd(0x01);
motor=1;
buz=1;
led=1;
ignition=0;
alcohal=0;
EA=1;
IT0=1;//EDGE TRIGGER
EX0=1;//ENTERNAL
ET0=1;//TIMER
TH0=0X00;
TL0=0X00;
TR0=1;
while(1)
{
delay(400);
}
}
void intr() interrupt 0
{
speed++;
76 | P a g e

ET0=1;
}
unsigned int count=0;
void timer0() interrupt 1
{
count++;
TF0=0;
EA=0;
TR0=0;
if(count==555)
//111 for one second //555 for five sec
{
EA=0;
while(alcohal==1)
{
ignition=1;
stringlcd(0x80,"alcohal detected");
motor=0;
buz=0;
led=0;
delay(600);
buz=1;
led=1;
delay(600);
}
buz=1;
led=1;
if(speed==0)
{
motor=0;
stringlcd(0x80,"stopped ");dlcd(speed+0x30);
buz=0;
while(1);
}
if(speed==1)
{
motor=0;
stringlcd(0x80,"stopped ");dlcd(speed+0x30);
buz=0;
while(1);
}
if(speed==2)
{
motor=1;
stringlcd(0x80,"alert ");dlcd(speed+0x30);
buz=0;
delay(600);
buz=1;
}
if(speed==3)
{
motor=1;
stringlcd(0x80,"alert ");dlcd(speed+0x30);
buz=0;
delay(400);
buz=1;
}
if(speed==4)
{
motor=1;
stringlcd(0x80,"abnormal ");dlcd(speed+0x30);
buz=0;
delay(300);
buz=1;
}
if(speed>=5)
{
motor=1;
77 | P a g e

stringlcd(0x80,"normal ");dlcd(speed+0x30);
}
led=0;
delay(350);
led=1;
speed=0;
count=0;
}
TH0=0X00;
TL0=0X00;
TR0=1;
EA=1;
}

78 | P a g e

CHAPTER 9

HARDWARE IMPLEMENTATION

79 | P a g e

CHAPTER 10

REFERENCES
Real-Time Non - intrusive Monitoring and Prediction of Driver Fatigue by Qiang Ji,
Zhiwei Zhu, and Peilin Lan, IEEE TRANSACTIONS ON VEHICULAR
TECHNOLOGY, VOL. 53, NO. 4, JULY 2014
Boston University Computer Science Technical Report No.2005-12 Real Time Eye
Tracking and Blink Detection with USB Cameras Michael Chau and Margrit Betke,
Computer Science Department Boston University Boston, MA 02215, USA
{ mikechau, betke@cs.bu.edu} May 12, 2014
IJCSNS International Journal of Computer Science and Network Security, VOL.9
No.3, March 2009, A Neuro- Genetic System Design for Monitoring Drivers Fatigue
N.G.Narole , Reserch Scholar,G.H.Raisoni College of ngineering, Nagpur,
Dr.P.R.Bajaj, Principal, G.H.Raisoni College of Engineering, Nagpur. [4] Embedded
Systems by Raj Kamal, 2nd Edition, TMH.
Frank Vahid, Embedded system design , PHI
www.indiastudychannel.com/.../132270-3137-Eyeblink- report-Copy
FEATURE SCOPE
By using wire-less technology such as Car Talk2000 If the driver gets a heart attack
or he is drunk it will send signals to vehicles nearby about this so driver become alert.
Instead of alarm we can use Automatic Braking System which will reduce the speed
of the car
We can automatically park the car by first using Automatic braking system, which
will slow down the car and simultaneously will turn on the parking lights of the car
and will detect the parking space and will automatically park the car preventing from
accident.
CONCLUSION
80 | P a g e

This Technology helps in controlling deadfull accidents due to unconscious through


Eye blink.
It also helps in prevention of drinking and driving accidents.

"Safety First" is "Safety Always"

81 | P a g e

Das könnte Ihnen auch gefallen