vehicle accident prevention system using arm

68
A Project Report On ‘Vehicle Accident Prevention Using Eye Blink Sensor CHAPTER 1 INTAODUCTION “Driving to save lives, time, and money in spite of the conditions around you and the actions of others.”- This is the slogan for Defensive Driving. Vehicle accidents are most common if the driving is inadequate. These happen on most factors if the driver is drowsy or if he is alcoholic. Driver drowsiness is recognized as an important factor in the vehicle accidents. It was demonstrated that driving performance deteriorates with increased drowsiness with resulting crashes constituting more than 20% of all vehicle accidents. But the life lost once cannot be re-winded. Advanced technology offers some hope avoid these up to some extent. 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. This project involves controlling accident due to unconscious through Eye blink. Here one eye blink sensor is fixed in vehicle where if anybody looses conscious and indicate through alarm. A car simulator study was designed to collect physiological data for validation of this technology. Methodology for analysis of Department Of Electronics & Telecommunication Engineering Dr. Babasaheb Ambedkar Technological University, Lonere. Page 1

Upload: suyog-chavan

Post on 26-Nov-2015

42 views

Category:

Documents


0 download

DESCRIPTION

project report

TRANSCRIPT

A Project Report On Vehicle Accident Prevention Using Eye Blink Sensor

A Project Report On Vehicle Accident Prevention Using Eye Blink Sensor

chapter 1

intaoduction

Driving to save lives, time, and money in spite of the conditions around you and the actions of others.- This is the slogan for Defensive Driving.

Vehicle accidents are most common if the driving is inadequate. These happen on most factors if the driver is drowsy or if he is alcoholic. Driver drowsiness is recognized as an important factor in the vehicle accidents. It was demonstrated that driving performance deteriorates with increased drowsiness with resulting crashes constituting more than 20% of all vehicle accidents. But the life lost once cannot be re-winded. Advanced technology offers some hope avoid these up to some extent. 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. This project involves controlling accident due to unconscious through Eye blink. Here one eye blink sensor is fixed in vehicle where if anybody looses conscious and indicate through alarm. A car simulator study was designed to collect physiological data for validation of this technology. Methodology for analysis of physiological data, independent assessment of driver drowsiness and development of drowsiness detection algorithm by means of sequential fitting and selection of regression models is presented.chapter 2

system model2.1 General Block DIAGRAM:

Discription The Systems consist of AVR controller which is ATmega16 from Atmel l company In this project we are going to developed for automatic detection of the eye blink The whole setup consists of Micro controller, IR sensor and LCD The IR sensor would be used for sensing the eye blink. Whenever the IR pair sensor senses the eye movement the buzzer is on. The Crystal will be used for clock frequency Generation.

The RC network circuit will be used to generate the power on reset for the microcontroller.

The LCD is 16X2 used to display purpose. The relay driver is transistor which is used for boosting the current and controlling the buzzer2.2 Circuit Diagram

CHAPTER 3AVR MICROCONTROLLER3.1 Introduction Of AVR MicrocontrollerMicrocontroller is the heart of this circuit. The microcontroller used is AVR, ATMEGA32 from ATMEL company. The MOSFET IRF224 will be used as driver for driving DC motor. The sensing of speed for DC motor will be done using optical encoder .The output of sensor will be given as feedback to the microcontroller. For every one rotation of motor one interrupt signal will be send to microcontroller. The required speed can be entered through keypad. LCD 16 X 2 or 20 x4 will be attached to microcontroller. The HMI will be displayed on LCD.The crystal will provide required for the microcontroller.3.2 History of AVR ( ATMEGA32)The AVR is a Modified Harvard architecture 8-bit RISC single chip microcontroller (C) which was developed by Atmel in 1996. The AVR was one of the first microcontroller families to use on-chip flash memory for program storage, as opposed to One-Time Programmable ROM, EPROM, or EEPROM used by other microcontrollers at the time.

Why AVR ?

AVRs have been used in various automotive applications such as security, safety, power train and entertainment systems. Atmel has recently launched a new publication "Atmel Automotive Compilation" to help developers with automotive applications. Some current usages are in BMW, Daimler-Chrysler and TRW.System Semiconductor, Inc produces the M3000 Motor and Motion Control Chip, incorporating an Atmel AVR Core and an Advanced Motion Controller for use in a variety of motion applications. The New 32-Bit AVRs: In 2006 Atmel released microcontrollers based on the new, 32-bit, AVR32 architecture. They include SIMD and DSP instructions, along with other audio and video processing features. This 32-bit family of devices is intended to compete with the ARM based processors. Due to lot of features in built it is very cost effective and easy to build a controller.3.3 Technical Details Of AVR

High-performance, Low-power AVR 8-bit Microcontroller

Advanced RISC Architecture

131 Powerful Instructions Most Single-clock Cycle Execution

32 x 8 General Purpose Working Registers

On-chip 2-cycle Multiplier

Nonvolatile Program and Data Memories

32K Bytes of In-System Self-Programmable Flash

Endurance: 10,000 Write/Erase Cycles

In-System Programming by On-chip Boot Program

True Read-While-Write Operation

1024 Bytes EEPROM\

Endurance: 100,000 Write/Erase Cycles

2K Byte Internal SRAM

Programming Lock for Software Security

JTAG (IEEE std. 1149.1 Compliant) Interface

Boundary-scan Capabilities According to the JTAG Standard

Extensive On-chip Debug Support

Programming of Flash, EEPROM, Fuses, and Lock Bits through the JTAG Interface

3.4 Peripheral Features Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes

One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and CaptureMode

Real Time Counter with Separate Oscillator

Four PWM Channels

8-channel, 10-bit ADC

8 Single-ended Channels

Byte-oriented Two-wire Serial Interface

Programmable Serial USART

Master/Slave SPI Serial Interface

Programmable Watchdog Timer with Separate On-chip Oscillator

On-chip Analog Comparator

Special Microcontroller Features

Power-on Reset and Programmable Brown-out Detection

Internal Calibrated RC Oscillator

External and Internal Interrupt Sources

Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, Standby and Extended Standby

I/O and Package

-32 Programmable I/O Lines

40-pin PDIP, 44-lead TQFP, and 44-pad QFN/MLF

Operating Voltages

2.7 - 5.5V for ATmega32L

4.5 - 5.5V for ATmega32

Speed Grades

0 - 8 MHz for ATmega32L

0 - 16 MHz for ATmega32

Power Consumption at 1 MHz, 3V, 25C for ATmega32L

Active: 1.1 mA

Idle Mode: 0.35 mA

Power-down Mode: < 1 A

3.5 Pin Diagram

3.6 Architecture

3.7 Oscillator circuitAny micro controller requires circuitry that generates the clock pulses by which all internal operations are synchronized.

Fig. Oscillator circuit FOR AVR18F8685

In AVR two pins (OSC1/CLKI & OSC2/CLKO) are provided for connecting a resonant network to form an oscillator. A quartz crystal is used with ceramic capacitors as shown in above circuit diagram. The crystal frequency is basic internal frequency of the microcontroller. The crystal that can be connected to the microcontroller is 32.768 KHz. We have preferred to use Quartz crystal because it is inexpensive and readily available. The capacitors C1 and C2 used are each of value 27pF. The capacitors C1, C2 are used for stable frequency operation i.e. in the condition where is high noise and humidity as in the case of factories. High noise and humidity can affect the oscillator frequency. To avoid this effect, the capacitors are used for stable frequency.

3.8 Reset CircuitA Power-on Reset pulse is generated on-chip whenever VDD rises above a certain threshold. This allows the device to start in the initialized state when VDD is adequate for operation. To take advantage of the POR circuitry, tie the MCLR pin through a resistor (1 k to 10 k) to VDD. This will eliminate external RC components usually needed to create a Power-on Reset delay. A minimum rise rate for VDD is specified (parameter D004). For a slow rise time, see FIG. 2.e. When the device starts normal operation (i.e., exits the Reset condition), device operating parameters (voltage, frequency, temperature, etc.) must be met to ensure operation. If these conditions are not met, the device must be held in Reset until the operating conditions are met. POR events are captured by the POR bit (RCON). The state of the bit is set to 0 whenever a Power-on Reset occurs; it does not change for any other Reset event. POR is not reset to 1 by any hardware event. To capture multiple events, the user manually resets the bit to 1 in software following any Power-on Reset.

Fig. Reset circuit for AVRNoteI. 1: External Power-on Reset circuit is required only if the VDD power-up slope is too slow. The diode D helps discharge the capacitor quickly when VDD powers down.

II. 2: R < 40 k is recommended to make sure that the voltage drop across R does not violate the devices electrical specification.

III. 3: R1 1 k will limit any current flowing into MCLR from external capacitor C, in the event of MCLR/VPP pin breakdown, due to Electrostatic Discharge (ESD) or Electrical Overstress (EOS).CHAPTER 4

parts of system 4.1 IR Sensor Module This infrared sensor module is used for detecting reflecting surface. This sensor can be used to detect reflecting silver/white strip, obstacle detection, flame detection, etc. These sensors are primary requirement of any simple line follower robo-car.

4. 1.1 Images

4.1.2 Technical Specification:

IR Based Obstacle Detecter

Adjustable Range with POT

Operating Voltage 5v

Sesitivity upto - 30cm-Adjustable

Logic output -1/0 -5v

Application - Industrial safety devices.4.1.3 Principle HYPERLINK "http://elecrom.files.wordpress.com/2008/02/sensor.jpg" \t "_blank" IR LED emits infrared radiation. This radiation illuminates the surface in front of LED. Surface reflects the infrared light. Depending on reflectivity of the surface, amount of light reflected varies. This reflected light is made incident on reverse biased IR sensor. When photons are incident on reverse biased junction of this diode, electron-hole pairs are generated, which results in reverse leakage current. Amount of electron-hole pairs generated depends on intensity of incident IR radiation. More intense radiation results in more reverse leakage current. This current can be passed through a resistor so as to get proportional voltage. Thus as intensity of incident rays varies, voltage across resistor will vary accordingly. This voltage can then be given to OPAMP based comparator. Output of the comparator can be read by uC. Alternatively, you can use on-chip ADC in AVR microcontroller to measure this voltage and perform comparison in software.

4.2 IR LED and IR sensor

IR LED is used as a source of infrared rays. It comes in two packages 3mm or 5mm. 3mm is better as it is requires less space. IR sensor is nothing but a diode, which is sensitive for infrared radiation. Connect cathode of one LED to +ve terminal of DMM

Connect anode of the same LED to common terminal of DMM (means connect LED such that It gets reverse biased by DMM )

Set DMM to measure resistance upto 2M Ohm.

Check the reading.

Repeat above procedure with second LED.

In above process, when you get the reading of the few hundred Kilo Ohms on DMM, then it indicated that LED that you are testing is IR sensor. In case of IR transmitter DMM will not show any reading. Following snap shows typical DMM reading obtained when IR receiver is connected to it as mentioned above. Second snap shows how sensors resistance increases when it is covered by a finger. Note that, these are just illustrative figures and they will depend upon sensor as well as DMM that you are using.

This Module has three pin.

Vcc

GND

Output

When the obstacle is detected the output is High else Low.

4.3 ResistorsA resistor is a two-terminal electronic component designed to oppose an electric current by producing a voltage drop between its terminals in proportion to the current, that is, in accordance with Ohm's law: V = IR. The resistance R is equal to the voltage drop V across the resistor divided by the current I through the resistor. The primary characteristics of resistors are their resistance and the power they can dissipate. Practical resistors can be made of resistive wire, and various compounds and films, and they can be integrated into hybrid and printed circuits. Size, and position of leads are relevant to equipment designers; resistors must be physically large enough not to overheat when dissipating their power.

4.4 Transistor BC 547

In electronics, a transistor is a semiconductor device commonly used to amplify or switch electronic signals. A transistor is made of a solid piece 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 flowing through another pair of terminals. Because the controlled (output) power can be much larger than the controlling (input) power, the transistor provides amplification of a signal. The transistor is the fundamental building block of modern electronic devices, and is used in radio, telephone, computer and other electronic systems. Some transistors are packaged individually but most are found in integrated circuits.

How transistor works?

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; this is called an "amplifier". Or, the transistor can be used to turn current on or off in a circuit like 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 labelled base, collector and emitter. A small current at base terminal can control or switch a muchlarger current between collector and emitter terminals. For a field-effect transistor, the terminals are labelled 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 size of this voltage depends on the material the transistor is made from, and is referred to as Vbe.4.5 LED

A light-emitting diode (LED) is an electronic light source. The LED was discovered in the early 20th century, and introduced as a practical electronic component in 1962. All early devices emitted low-intensity red light, but modern LEDs are available across the visible, ultraviolet and infra red wavelengths, with very high brightness. LEDs are based on the semiconductor diode. When the diode is forward biased (switched on), electrons are able to recombine with holes and energy is released in the form of light. This effect is called electrolumine scence and the color of the light is determined by the energy gap of the semiconductor. The LED is usually small in area (less than 1 mm2) with integrated optical components to shape its radiation pattern and assist in reflection.

LEDs present many advantages over traditional light sources including lower energy consumption, longer lifetime, improved robustness, smaller size and faster switching. However, they are relatively expensive and require more precise current and heat management than traditional light sources. Applications of LEDs are diverse. They are used as low-energy replacements for traditional light sources in well-established applications such as indicators and automotive lighting. The compact size of LEDs has allowed new text and video displays and sensors to be developed, while their high switching rates are useful in communications technology.

4.5.1 Types of LEDsLEDs are produced in an array of shapes and sizes. The 5 mm cylindrical package (red, fifth from the left) is the most common, estimated at 80% of world production.[citation needed] The color of the 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.

4.6 LCD DisplayAn LCD consists of two glass panels, with the liquid crystal material sand witched in between them. The inner surface of the glass plates are coated with transparent electrodes which define the character, symbols or patterns to be displayed polymeric layers are present in between the electrodes and the liquid crystal, which makes the liquid crystal molecules to maintain a defined orientation angle. One each polarisers are pasted outside the two glass panels. These polarisers would rotate the light rays passing through them to a definite angle, in a particular direction When the LCD is in the off state, light rays are rotated by the two polarisers and the liquid crystal, such that the light rays come out of the LCD without any orientation, and hence the LCD appears transparent. When sufficient voltage is applied to the electrodes, the liquid crystal molecules would be aligned in a specific direction. The light rays passing through the LCD would be rotated by the polarisers, which would result in activating / highlighting the desired characters.The LCDs are lightweight with only a few millimeters thickness. Since the LCDs consume less power, they are compatible with low power electronic circuits, and can be powered for long durations. The LCDs dont generate light and so light is needed to read the display. By using backlighting, reading is possible in the dark. The LCDs have long life and a wide operating temperature range. Changing the display size or the layout size is relatively simple which makes the LCDs more customer friendly.

4.6.1.Introduction

Fig. LCD DisplayThe LCD display consists of two lines, 20 characters per line that is interfaced with the PIC16F73.The protocol (handshaking) for the display is as shown in Fig. The display contains two internal byte-wide registers, one for commands (RS=0) and the second for characters to be displayed (RS=1). It also contains a user-programmed RAM area (the character RAM) that can be programmed to generate any desired character that can be formed using a dot matrix. To distinguish between these two data areas, the hex command byte 80 will be used to signify that the display RAM address 00h will be chosen Port1 is used to furnish the command or data type, and ports 3.2 to 3.4 furnish register select and read/write levels.4.6.3.Pin DiagramThe Pin diagram for LCD is shown in the following fig 5.7 and the pin description is also explained in Table 5.

4.7 Alarm Circuit4.7.1Buzzer: 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.4.7.2 Circuit description:

The circuit is designed to control the buzzer. The buzzer ON and OFF is controlled by the pair of switching transistors (BC 547). The buzzer is connected in the Q2 transistor collector terminal. When high pulse signal is given to base of the Q1 transistors, the transistor is conducting and close the collector and emitter terminal so zero signals is given to base of the Q2 transistor. Hence Q2 transistor and buzzer is turned OFF state. When low pulse is given to base of transistor Q1 transistor, the transistor is turned OFF. Now 12v is given to base of Q2 transistor so the transistor is conducting and buzzer is energized and produces the sound signal.

Voltage from MC or PC Transistor O1 Transistor Q2 Transistor O3

1 ON OFF OFF

0 OFF ON ON

CHAPTER 5

POWER SUPPLY5.1 Power SupplyThe power supply circuits built using filters, rectifiers, and then voltage regulators. Starting with an ac voltage, a steady dc voltage is obtained by rectifying the ac voltage, then filtering to a dc level, and finally, regulating to obtain a desired fixed dc voltage. The regulation is usually obtained from an IC voltage regulator unit, which takes a dc voltage and provides a somewhat lower dc voltage, which remains the same even if the input dc voltage varies, or the output load connected to the dc voltage changes. The block diagram of power supply is shown in fig below.

AC I/P

Transformer Rectifier Filter Regulator LoadBlock diagram of power supplyWhen working with electronics, you always need one basic thing: Power. In every electronic circuit power supply is required. The proper working of each and every component, the exact amount of voltage and current to be supplied to it. If the power exceed its limit, it can be fatal. Below is the circuit diagram of power supply which gives output of 5V, as only that much is required for microcontroller. Its circuit diagram and designing calculation are given below.

Fig. +5 V Regulated Power SupplyThe +5 volt power supply is based on the commercial 7805 voltage regulator IC. This IC contains all the circuitry needed to accept any input voltage from 8 to 18 volts and produce a steady +5 volt output, accurate to within 5% (0.25 volt). It also contains current-limiting circuitry and thermal overload protection, so that the IC won't be damaged in case of excessive load current; it will reduce its output voltage instead. The advantage of a bridge rectifier is you dont need a centre tap on the secondary of the transformer. A further but significant advantage is that the ripple frequency at the output is twice the line frequency(i.e. 50Hz) and makes filtering somewhat easier. The use of capacitor c1,c2,c3 and c4 is to make signal ripple free. The two capacitor used before the regulator is to make ac signal ripple free and then later which we are using is for safety, if incase there is a ripple left after regulating, then c3 and c4 will remove it.5.1.1 Transformer DesignWe require 5V at the o/p of the regulator. The drop out voltage of the regulator is 2V As per the data sheet)

Vdc = 5+2 = 7V

So at the regulator input, the voltage applied should be of 7V. According to the formula,

Vdc = 2Vm/Pi

Assuming there is no ripple Capacitor from

Vm= Vdc .pi/2

=7 x 3.14)/2

=10.99V

Vm= 10.99V

During one cycle , two diodes are conducting . Drop out voltage of one diode = 0.7V Drop out voltage of two diode = 1.4V

Vim = Vm+ 1.4V

=10.99+1.4= 12.39V

Vim=12.39V

Vrms = Vim/sqrt(2)

= 12.39/sqrt(2)

= 8.76V Vrms = 8.76V

So we select transformer of 9V. Similarly

Im=Idc x pi/2

Im=400m x 3.14/2

= 628mA.

Irms= Im/sqrt(2)

= 628mA/sqrt(2)

= 444.06mA

Irms = 444.06mA

So we select the transformer of current rating 500mA. Considering the above transformer rating. We take the transformer of 0-9V/500mATransformer 0-9V/500mA Stepdown transformer.5.1.2 Rectifier Design PIV of diode = Vm = 12.39VIm= 628mABridge rectifier -So, we select the bridge IC of 1Ampere rating.5.1.3 Filter Capacitor DesignR = Vdc/Idc

= 7 / 400m = 17.5Ohms.

Vr = 2(Vim Vdc)

= 2(12.39 7)

= 10.78V

C = Vdc/ (FxRxVr)

= 7/ (100x17.5x10.78)

= 371.05uF

So for Safe working we select capacitor of 1000uF

C = 1000uF / 35V

C1= 1000uF/35V Electrolytic Capacitor.

C2,C4 = 0.1uF Ceramic Capacitor.

C3 = 220uF/25V Electrolytic Capacitor.

So the power supply made from the above mentioned components gives the output of 5V. For master PCB we are taking supply from USB. Through USB we get 5V, 500mA supply. This is given to PIC and LM317. Using LM 317 we can get 3.3 V outputs which are given to RF module. For the slave side we are using 9V battery. The output of battery is 9V DC is given to 7805 which is given to PIC controller. The output of 7805 is further given to the LM317 which gives 3.3V output which is given to RF module.5.2 Variable RegulatorLM317 is the standard part number for an integrated three-terminal adjustable linear voltage regulator. LM317 is a positive voltage regulator supporting input voltage of 3V to 40V and output voltage between 1.25V and 37V. A typical current rating is 1.5A although several lower and higher current models are available. Variable output voltage is achieved by using a potentiometer or a variable voltage from another source to apply a control voltage to the control terminal. LM317 also has a built-in current limiter to prevent the output current from exceeding the rated current, and LM317 will automatically reduce its output current if an overheat condition occurs under load. LM317 is manufactured by many companies, including National Semiconductor, Fairchild Semiconductor, and STMicroelectronics. Although LM317 is an adjustable regulator, it is sometimes preferred for high-precision fixed voltage applications instead of the similar LM78xx devices because the LM317 is designed with superior output tolerances. For a fixed voltage application, the control pin will typically be biased with a fixed resistor network, a Zener diode network, or a fixed control voltage from another source. Manufacturer datasheets provide standard configurations for achieving various design applications, including the use of a pass transistor to achieve regulated output currents in excess of what the LM317 alone can provide. LM317 is available in a wide range of package forms for different applications including heat sink mounting and surface-mount applications. Common form factors for high-current applications include TO-220 with part number LM317T and TO-3 with part number LM317K. LM317 is capable of dissipating a large amount of heat at medium to high current loads and the use of a heat sink is recommended to maximize the lifespan and power-handling capability. LM337 is the negative voltage complement to LM317 and the specifications and function are essentially identical, except that the regulator must receive a control voltage and act on an input voltage that are below the ground reference point instead of above it.

Vout range1.25V - 37V

Vin - Vout difference3V - 40V

Operation ambient temperature0 - 125C

Output Imax