Sie sind auf Seite 1von 37

CHAPTER 1

1.1 INTRODUCTION TO PROPOSED PROJECT


Road fatalities are a major concern in the developed world. Recent studies [1] show that a
third of the number of fatal or serious accidents are associated with excessive or inappropriate
speed, as well as changes in the roadway (like the presence of road-work or unexpected
obstacles). Reduction of the number of accidents and mitigation of their consequences are a
big concern for traffic authorities, the automotive industry and transport research groups. One
important line of action consists in the use of advanced driver assistance systems (ADAS),
which are acoustic, haptic or visual signals produced by the vehicle itself to communicate to
the driver the possibility of a collision. These systems are somewhat available in commercial
vehicles today, and future trends indicate that higher safety will be achieved by automatic
driving controls and a growing number of sensors both on the road infrastructure and the
vehicle itself [2]. A prime example of driver assistance systems is cruise control (CC), which
has the capability of maintaining a constant user-preset speed [3], and its evolution, the
adaptive cruise control (ACC), which adds to CC the capability of keeping a safe distance
from the preceding vehicle [4]. A drawback of these systems is that they are not
independently capable of distinguishing between straight and curved parts of the road, where
the speed has to be lowered to avoid accidents. However, curve warning systems (CWS) have
been recently developed that use a combination of global positioning systems (GPS) and
digital maps obtained from a Geographical Information System (GIS), to assess threat levels
for a driver approaching a curve too quickly [5]; likewise, intelligent speed assistance (ISA)
systems warn the driver when the vehicle’s velocity is inappropriate, using GPS in
combination with a digital road map containing information about the speed limits [6].
However useful, these systems are inoperative in case of unexpected road circumstances (like
roadwork, road diversions, accidents, etc.), which would need the use of dynamically-
generated digital maps. The key idea offered by this paper is to use Radio Frequency
Identification (RFID) technology to tag the warning signals placed in the dangerous portions
of the road. While artificial vision-based recognition of traffic signals might fail if visibility is
poor (insufficient light, difficult weather conditions or blocking of the line of sight by
preceding vehicles), RF signals might still be transmitted reliably. In the last years, RFID
technology has been gradually incorporated to commercial transportation systems. A well
known example is the RFID-based highway toll collection systems which are now routinely
employed in many countries, like the Telepass system in Italy or the Autopass system in
Norway. Other uses include monitoring systems to avoid vehicle theft [7], access control to
car parking or private areas [8], and embedding of RFID tags in license plates with specially
coded IDs for automatic vehicle detection and identification [9]. Placement of RFID tags on
the road lanes has been proposed in order to provide accurate vehicle localization in tunnels
or downtown areas where GPS positioning might be unreliable [10]. In the work by Seo et al.
[11], RFID tagging of cars is offered as an alternative to traffic data collection by inductive
loops placed under the road surface. The information about the traffic collected by a network
of RF readers is then used to regulate traffic at intersection or critical points in the city. The

1
work by Sato et al. [12] describes an ADAS, where passive RFID tags are arranged in the
road close to the position of real traffic signals. An antenna placed in the rear part of the car
and close to the floor (since the maximum transmitting range of the Sensors 2010, 10 5874
tags is about 40 cm) permits reading of the information stored in the tag memory and conveys
a visual or auditive message to the driver. Initial tests at low driving speeds (20 km/h) show
good results. The work described in this paper is a collaboration between AUTOPIA
(Autonomous Vehicles Group) and LOPSI (Localization and Exploration for Intelligent
Systems), both belonging to the Center for Automation and Robotics (CAR, UPM-CISC).
The aim of the research is to build a sensor system for infrastructure to vehicle (I2V)
communication, which can transmit the information provided by active signals placed on the
road to adapt the vehicle’s speed and prevent collisions. By active signals we mean ordinary
traffic signals that incorporate long-range active RFID tags with information stored into
them. This information is collected in real time by RFID sensors placed onboard of the
vehicle (an electric Citroën Berlingo), which we have modified to automatically change its
speed to adapt to the circumstances of the road. In particular, we have implemented a fuzzy
logic control algorithm acting on the longitudinal speed of the vehicle, with actuators which
control the vehicle’s throttle and brake to reach and maintain a given target speed. This paper
in organized as follows. A description of the sensors installed in vehicle and infrastructure is
provided in Section 2. This includes the RFID traffic identification tags and the placement of
the detector readers in the vehicle; the differential Hall Effect sensor installed in the vehicle’s
wheels for better longitudinal speed control and the DGPS (Differential GPS). Section 3
discusses the system architecture, covering sensor data fusion, decision and control stages,
followed by an explanation of the Cruise Control (CC) algorithm based in fuzzy logic in
Section 4. Experimental demonstrations of the system in a test circuit in our institute’s
grounds are described in Section 5. The paper ends with a discussion of the results in Section
6. Figure 1. Sensors installed in the vehicle for the CC experiments: GPS unit, RFID readers
and a speed measurement system based on a differential Hall Effect sensor mounted in a
cogwheel (left-hand side). Traffic signals equipped with the RFID tags (right-hand side)

1.1.1 Introduction to Pulse Width Modulation

Pulse width modulation (PWM) is a powerful technique for controling analog circuits with a
microprocessor's digital outputs. PWM is employed in a wide variety of applications, ranging
from measurement and communications to power control and conversion.

1.1.2 Analog circuits

An analog signal has a continuously varying value, with infinite resolution in both time and
magnitude. A nine-volt battery is an example of an analog device, in that its output voltage is
not precisely 9V, changes over time, and can take any real-numbered value. Similarly, the
amount of current drawn from a battery is not limited to a finite set of possible values.
Analog signals are distinguishable from digital signals because the latter always take values
only from a finite set of predetermined possibilities, such as the set {0V, 5V}.

2
Analog voltages and currents can be used to control things directly, like the volume of a car
radio. In a simple analog radio, a knob is connected to a variable resistor. As you turn the
knob, the resistance goes up or down. As that happens, the current flowing through the
resistor increases or decreases. This changes the amount of current driving the speakers, thus
increasing or decreasing the volume. An analog circuit is one, like the radio, whose output is
linearly proportional to its input.

As intuitive and simple as analog control may seem, it is not always economically attractive
or otherwise practical. For one thing, analog circuits tend to drift over time and can,
therefore, be very difficult to tune. Precision analog circuits, which solve that problem, can be
very large, heavy (just think of older home stereo equipment), and expensive. Analog circuits
can also get very hot; the power dissipated is proportional to the voltage across the active
elements multiplied by the current through them. Analog circuitry can also be sensitive to
noise. Because of its infinite resolution, any perturbation or noise on an analog signal
necessarily changes the current value.

1.1.3 Digital control


By controlling analog circuits digitally, system costs and power consumption can be
drastically reduced. What's more, many microcontrollers and DSPs already include on-chip
PWM controllers, making implementation easy.

In a nutshell, PWM is a way of digitally encoding analog signal levels. Through the use of
high-resolution counters, the duty cycle of a square wave is modulated to encode a specific
analog signal level. The PWM signal is still digital because, at any given instant of time, the
full DC supply is either fully on or fully off. The voltage or current source is supplied to the
analog load by means of a repeating series of on and off pulses. The on-time is the time
during which the DC supply is applied to the load, and the off-time is the period during which
that supply is switched off. Given a sufficient bandwidth, any analog value can be encoded
with PWM.

Figure 1.1 shows three different PWM signals. Figure 1a shows a PWM output at a 10% duty
cycle. That is, the signal is on for 10% of the period and off the other 90%. Figures 1b and 1c
show PWM outputs at 50% and 90% duty cycles, respectively. These three PWM outputs
encode three different analog signal values, at 10%, 50%, and 90% of the full strength. If, for
example, the supply is 9V and the duty cycle is 10%, a 0.9V analog signal results.

Fig 1.1.:PWM signals of varying duty cycles

3
Figure 1.2 shows a simple circuit that could be driven using PWM. In the figure, a 9V battery
powers an incandescent light bulb. If we closed the switch connecting the battery and lamp
for 50ms, the bulb would receive 9V during that interval. If we then opened the switch for the
next 50ms, the bulb would receive 0V. If we repeat this cycle 10 times a second, the bulb will
be lit as though it were connected to a 4.5V battery (50% of 9V). We say that the duty cycle
is 50% and the modulating frequency is 10Hz.

Figure 1.2: A simple circuit

Most loads, inductive and capacitive alike, require a much higher modulating frequency than
10Hz. Imagine that our lamp was switched on for five seconds, then off for five seconds, then
on again. The duty cycle would still be 50%, but the bulb would appear brightly lit for the
first five seconds and off for the next. In order for the bulb to see a voltage of 4.5 volts, the
cycle period must be short relative to the load's response time to a change in the switch state.
To achieve the desired effect of a dimmer (but always lit) lamp, it is necessary to increase the
modulating frequency. The same is true in other applications of PWM. Common modulating
frequencies range from 1kHz to 200kHz.

1.1.4 The need of pulse width modulation

The conventional speed control mechanism are failed to speed control without noise and this
method is not accurate, and large amount of heat is wasted in the form of heat and wear and
tear is increased, so compared with the electromechanical approach of sped control the PWM
speed control provides greater flexibility, reliability, accuracy, higher efficiency with less
operational speed.

1.1.5 PWM principle


The behind the operation is varying the duty cycle we control the input power within the two
half cycles. We generate pulses based on the carrier signals and reference sinusoidal using
particular modulation, the entire criteria are explained in the coming sections.

1.1.6 Hardware controllers and RFID


Many microcontrollers include PWM controllers. For example, atMega_16 includes two,
each of which has a selectable on-time and period. The duty cycle is the ratio of the on-time
to the period; the modulating frequency is the inverse of the period. To start PWM operation,
the data sheet suggests the software should:

 Set the period in the on-chip timer/counter that provides the modulating square wave.
 Set the on-time in the PWM control register.
 Set the direction of the PWM output, which is one of the general-purpose I/O pins.
 Start the timer.

4
 Enable the PWM controller.
Although specific PWM controllers do vary in their programmatic details, the basic idea is
generally the same.

Fig 1.3: General PWM signals for sin wave

RFID :- Radio-frequency identification (RFID) uses electromagnetic fields to


automatically identify and track tags attached to objects. The tags contain electronically-
stored information. Passive tags collect energy from a nearby RFID reader's
interrogating radio waves. Active tags have a local power source (such as a battery) and may
operate hundreds of meters from the RFID reader. Unlike a barcode, the tag need not be
within the line of sight of the reader, so it may be embedded in the tracked object. RFID is
one method for Automatic Identification and Data Capture (AIDC)

5
CHAPTER 2

2.1 Hardware used

2.1.1 DC Motor- 120rpm

A brushed DC electric motor generating torque from DC power supply by using an internal
mechanical commutation. Stationary permanent magnets form the stator field. Torque is
produced by the principle that any current-carrying conductor placed within an external
magnetic field experiences a force, known as Lorentz force. In a motor, the magnitude of this
Lorentz force (a vector represented by the green arrow), and thus the output torque,is a
function for rotor angle, leading to a phenomenon known as torque ripple) Since this is a two-
pole motor, the commutator consists of a split ring, so that the current reverses each half turn.

Fig 2.1: dc motor Fig 2.2: dc motor

2.1.2 Introduction of RC522


The MFRC522 is a highly integrated reader/writer for contactless communication at
13.56 MHz. TheMFRC522 reader supports ISO 14443A / MIFARE® mode.The
MFRC522’s internal transmitter part is able to drive a reader/writer antenna
designed to communicate with ISO/IEC 14443A/MIFARE ® cards and
transponders without additional active circuitry. The receiver part provides a robust
and efficient implementation of a demodulation and decoding circuitry for signals
from ISO/IEC 14443A/MIFARE® compatible cards and transponders. The digital
part handles the complete ISO/IEC 14443A framing and error detection (Parity &
CRC).The MFRC522 supports MIFARE® The MFRC522 is a highly integrated
reader/writer for contactless communication at 13.56 MHz. The MFRC522 reader
supports ISO 14443A / MIFARE® mode.
The MFRC522’s internal transmitter part is able to drive a reader/writer antenna
designed to communicate with ISO/IEC 14443A/MIFARE® cards and transponders
without additional active circuitry. The receiver part provides a robust and efficient
implementation of a demodulation Classic (e.g. MIFARE® Standard) products. The
MFRC522 supports contactless communication using MIFARE® higher transfer
speeds up to 848 kbit/s in both directions.

6
Various host interfaces are implemented:
• SPI interface
• Serial UART (similar to RS232 with voltage levels according pad voltage supply)
• I2C interface.
Block diagram of RC522 rfid
The Analog interface handles the modulation and demodulation of the analog signals.The
contactless UART handles the protocol requirements for the communication schemes in co-
operation with the host. The comfortable FIFO buffer allows a fast and convenient data
transfer from the host to the contactless UART and vice versa.
Various host interfaces are implemented to fulfil different customer requirements.

Fig 2.3: Block diagram of RC522

Fig 2.4: Pin diagram of RC522

7
2.1.3 MICROCONTROLLER ATmega16

ATmega16 is an 8-bit high performance microcontroller of Atmel’s Mega AVR family with
low power consumption. Atmega16 is based on enhanced RISC (Reduced Instruction Set
Computing, Know more about RISC and CISC Architecture) architecture with 131 powerful
instructions. Most of the instructions execute in one machine cycle. Atmega16 can work on a
maximum frequency of 16MHz.
ATmega16 has 16 KB programmable flash memory, static RAM of 1 KB and EEPROM of
512 Bytes. The endurance cycle of flash memory and EEPROM is 10,000 and 100,000,
respectively.

ATmega16 is a 40 pin microcontroller. There are 32 I/O (input/output) lines which are
divided into four 8-bit ports designated as PORTA, PORTB, PORTC and PORTD.
ATmega16 has various in-built peripherals like USART, ADC, Analog
Comparator, SPI, JTAG etc. Each I/O pin has an alternative task related to in-built
peripherals. The following table shows the pin description of ATmega16.

Fig 2.5: Pin Diagram Atmega16

8
Pin Description

Pin No. Pin name Description Alternate Function

(XCK/T0) T0: Timer0 External Counter Input.


1 I/O PORTB, Pin 0
PB0 XCK : USART External Clock I/O

2 (T1) PB1 I/O PORTB, Pin 1 T1:Timer1 External Counter Input

(INT2/AIN0) AIN0: Analog Comparator Positive I/P


3 I/O PORTB, Pin 2
PB2 INT2: External Interrupt 2 Input
AIN1: Analog Comparator Negative I/P
(OC0/AIN1)
4 I/O PORTB, Pin 3 OC0 : Timer0 Output Compare Match
PB3
Output
5 (SS) PB4 I/O PORTB, Pin 4

6 (MOSI) PB5 I/O PORTB, Pin 5


In System Programmer (ISP)
Serial Peripheral Interface (SPI)
7 (MISO) PB6 I/O PORTB, Pin 6

8 (SCK) PB7 I/O PORTB, Pin 7

Reset Pin, Active


9 RESET
Low Reset
10 Vcc Vcc = +5V
11 GND GROUND

12 XTAL2 Output to Inverting Oscillator Amplifier


13 XTAL1 Input to Inverting Oscillator Amplifier
14 (RXD) PD0 I/O PORTD, Pin 0
USART Serial Communication Interface
15 (TXD) PD1 I/O PORTD, Pin 1

16 (INT0) PD2 I/O PORTD, Pin 2 External Interrupt INT0


17 (INT1) PD3 I/O PORTD, Pin 3 External Interrupt INT1
18 (OC1B) PD4 I/O PORTD, Pin 4
PWM Channel Outputs
19 (OC1A) PD5 I/O PORTD, Pin 5

20 (ICP) PD6 I/O PORTD, Pin 6 Timer/Counter1 Input Capture Pin


Timer/Counter2 Output Compare Match
21 PD7 (OC2) I/O PORTD, Pin 7
Output

9
22 PC0 (SCL) I/O PORTC, Pin 0
TWI Interface
23 PC1 (SDA) I/O PORTC, Pin 1

24 PC2 (TCK) I/O PORTC, Pin 2

25 PC3 (TMS) I/O PORTC, Pin 3


JTAG Interface
26 PC4 (TDO) I/O PORTC, Pin 4

27 PC5 (TDI) I/O PORTC, Pin 5

PC6
28 I/O PORTC, Pin 6 Timer Oscillator Pin 1
(TOSC1)
PC7
29 I/O PORTC, Pin 7 Timer Oscillator Pin 2
(TOSC2)

30 AVcc Voltage Supply = Vcc for ADC

31 GND GROUND

32 AREF Analog Reference Pin for ADC

33 PA7 (ADC7) I/O PORTA, Pin 7 ADC Channel 7

34 PA6 (ADC6) I/O PORTA, Pin 6 ADC Channel 6

35 PA5 (ADC5) I/O PORTA, Pin 5 ADC Channel 5

36 PA4 (ADC4) I/O PORTA, Pin 4 ADC Channel 4

37 PA3 (ADC3) I/O PORTA, Pin 3 ADC Channel 3

38 PA2 (ADC2) I/O PORTA, Pin 2 ADC Channel 2

39 PA1 (ADC1) I/O PORTA, Pin 1 ADC Channel 1

40 PA0 (ADC0) I/O PORTA, Pin 0 ADC Channel 0

10
2.2 PWM Signal Generation by Using AVR Timer

2.2.1Setting Up TIMER0 in Fast PWM mode


Setting up the TIMER0 in fast pwm mode is very easy and just require one line of code. You
only need to deal with one register named TCCR0 (Timer Counter Control Register For
Timer 0). You just need to set up various bits in it to get the required setting. The various bits
of TCCR0 is given below.
TCCR0
This register is used for configuring the TIMER0. See Timer Tutorial for more info. The
explanation of various bits of this register is as follows.
Table 2.1: initializing mode

Bit No 7 6 5 4 3 2 1 0

Name FOC0 WGM00 COM01 COM00 WGM01 CS02 CS01 CS00

Initial
0 0 1 0 0 0 0 0
Val

(Note The Bits in RED are discussed here)


2.2.2 WGM – Wave Form Generation Mode
The table below shows the various modes supported by TIMER0. We have covered Normal
mode in "Timer0 tutorial" and CTC mode in "Timers In compare mode" tutorial. And this
tutorial we are interested in Fast PWM mode.
Table 2.2: WGM mode

Mode WGM00 WGM01 Mode Of Operation

0 0 0 Normal

1 0 1 PWM Phase Correct

2 1 0 CTC

3 1 1 Fast PWM

From the table it is clear that for Fast PWM we need mode 3. To get it we must set
WGM00=1 and WGM01=1

11
2.2.3 COM – Compare Output Mode
These bits are used to set the Output mode in various Wave form generation mode. For Fast
PWM mode these can be used to achieve following output modes.
Table 2.3: COM mode

COM01 COM00 Output Mode

0 0 Normal Port Operation (OC0 disconnected)

1 0 RESERVED

0 1 Non Inverted PWM

1 1 Inverted PWM

We need the "Non Inverted PWM output mode" so we set COM01=0 and COM00=1

2.2.4 CS – Clock Select


These are used to set an Input Clock for TIMER. We set them as follows to get
Ftimer=F_CPU (i.e. no prescalling). See "Timer Tutorial" for more info.

CS02 = 0
CS01 = 0
CS00 = 1

Now the TIMER is in Fast PWM mode to vary its output duty cycle we just need to set the
OCR0 (Output Compare Register for Timer 0). For example setting it to 0 will generate
PWM with duty cycle 0% (Totally off) while setting it to 128 will generate 50% duty cycle
and 255 will generate 100% duty cycle signals.The output waveform is available in the
associated Output Compare Pin of the microcontroller.
For example for Timer 0 the associated OC pin is OC0. You can find its location from Pin
diagram in datasheet. In ATmega16 and ATmega32 it is on PORTB bit 3, i.e. PB3. This pin
must be set to output to get the PWM signals.

12
2.3 Hardware Setup
To run and test this program you need an AVR MCU (ATmega16 or ATmega32)(ATmega8
won’t work!). To keep the hardware simple we will use the MCU with internal 1MHz
oscillator (this is default factory setting for new MCUs). We will add a good quality RED
LED to output compare pin (OC0) of the MCU. This is PIN no 4 on ATmega16/32 Micros.
Vcc PIN (pin 10) is connected to +5v and GndPIN(pin 11,31) is connected to gnd.

Fig 2.6: Hardware setup

13
CHAPTER 3

3.1 LCD DISPLAY

LCD16x2 Interfacing with AVR ATmega16/ATmega32


LCDs (Liquid Crystal Displays) are used for displaying status or parameters in embedded
systems.

LCD 16x2 is a 16 pin devices which has 8 data pins (D0-D7) and 3 control pins (RS, RW,
EN). The remaining 5 pins are for supply and backlight for the LCD.

The control pins help us configure the LCD in command mode or data mode. They also help
configure read mode or write mode and also when to read or write.LCD 16x2 can be used in
4-bit mode or 8-bit mode depending on requirement of application. In order to use it we need
to send certain commands to the LCD in command mode and once the LCD is configured
according to our need, we can send the required data in data mode.For more information
about LCD 16x2 and how to use it, refer the topic LCD 16x2 display module in the sensors
and modules section.

Fig 3.1:LCD16x2 Display

Hardware Connections
Table 3.1: Hardware connections

LCD 162 Pins ATmega16 Pins

Data pins D0-D7 PORTB

RS PORTC.0

RW PORTC.1

E PORTC.2

14
3.1.1 Interfacing Diagram

Fig 3.2: Interfacing LCD 16x2 with Ardino ATmega16/ATmega32

15
Programming for LCD16x2 with AVR ATmega16/ATmega32

3.1.1 Initialize LCD16x2: It is very easy to initialize a LCD16x2

1. Power ON the LCD


2. Wait for 15 ms (‘Power ON’ initialization time for LCD16x2)
3. Send 0x38 command to initialize 2 line, 5x8 matrix, 8-bit mode LCD16x2
4. Send any ‘Display ON’ command (0x0E, 0x0C) to LCD16x2
5. Send 0x06 command (increment cursor) to LCD16x2

voidLCD_Init(void) /* LCD Initialize function */


{
LCD_Command_Dir = 0xFF; /* Make LCD command port direction as o/p
*/
LCD_Data_Dir = 0xFF; /* Make LCD data port direction as o/p */

_delay_ms(20); /* LCD Power ON delay always >15ms */


LCD_Command (0x38); /* Initialization of 16X2 LCD in 8bit mode */
LCD_Command (0x0C); /* Display ON Cursor OFF */
LCD_Command (0x06); /* Auto Increment cursor */
LCD_Command (0x01); /* clear display */
LCD_Command (0x80); /* cursor at home position */
}

Now that we have initialized LCD, it is ready to accept data for displaying.

3.1.2 Command Write function

1. Send the command value to the LCD16x2 data port.


2. Make RS pin low, RS = 0 (command reg.)
3. Make RW pin low, RW = 0 (write operation)
4. Give high to low pulse at the Enable (E) pin of minimum delay 450 ns.

When we give an enable pulse, the LCD latches the data present at D0 to D7, and execute as
command since RS is command reg.

16
voidLCD_Command(unsignedcharcmnd)
{
LCD_Data_Port= cmnd;
LCD_Command_Port&= ~(1<<RS); /* RS=0 command reg. */
LCD_Command_Port&= ~(1<<RW); /* RW=0 Write operation */
LCD_Command_Port |= (1<<EN); /* Enable pulse */
_delay_us(1);
LCD_Command_Port&= ~(1<<EN);
_delay_ms(3);
}

3.1.3 Data write function

1. Send command to the data port.


2. Make the RS pin High, RS = 1 (Data reg.)
3. Make the RW pin Low, RW = 0 (Write operation)
4. Give high to low pulse at the Enable (E) pin

When we give an enable pulse the LCD latches the data present (on the pins D0 to D7) and
displays it on a 5x8 matrix, as RS is a data register.
voidLCD_Char(unsignedcharchar_data) /* LCD data write function */
{
LCD_Data_Port = char_data;
LCD_Command_Port |= (1<<RS); /* RS=1 Data reg. */
LCD_Command_Port&= ~(1<<RW); /* RW=0 write operation */
LCD_Command_Port |= (1<<EN); /* Enable Pulse */
_delay_us(1);
LCD_Command_Port&= ~(1<<EN);
_delay_ms(1);
}

17
3.2Layout of Bridge

Fig 3.3: Layout of bridge

3.3 Push Button AcclerationSystem (Remote Control)

Fig 3.4: Remote control system

18
3.3.1 PCB Design

Fig 3.5: PCB design

3.3.2 Electric Car

Fig 3.6: Electric car

19
3.4 Block Diagram

Block Diagram
Power
Supply
M
A
G
N
E
Speed T
Acclerating
Microcontroller I/P I
Switches ATmega16 Device C
S
W
I
T
C
M H
O/P E
O
Device
T
O
LCD
R
DISPLAY
S

Fig 3.7: Block diagram

20
3.5 Project Layout

START

(NORMAL SPEED)

ENTER OVERBRIDGE

WITH SPEED LIMIT

120 km/hr OR 80 km/hr

UNDER MAGNETIC FIELD,

RELAY SWITCH ON

SIGNAL TO PWM
CONNECTED TO
MICROCONTROLLER

LIMITS THE MOTOR


VOLTAGE TO

60 km/hr

DISPLAY THE SPEED ON


LCD

EXIT OF BRIDGE.

BACK TO NORMAL SPEED.

21
3.6 Software Development

The program is developed for the microcontroller using the Proteus software [15] in C
language, then debugged and edited as required and finally the hex codes are generated using
a microcomputer. The hex codes of the developed program are sent to the microcontroller
through the parallel port (DB25) of the microcomputer by the Proteus software.

Parallel port was connected to the miso, mosi, ack, reset and gnd terminals of ATmega16
microcontroller. The ISP Programmer was also developed specially for this work to
download the hex codes to the microcontroller.

C is a general-purpose programming language that can work on any microprocessor that has a
C compiler written for it. C abstracts the concepts of what a computer does and provides a
text based logical and readable way to get computers to do what computers do. WinAVR is a
set of tools for C programming. The AVR microcontroller family is a suite of executable,
open source software development tools for the ATMEL AVR series of RISC
microprocessors hosted on the Windows platform. Proteus works as burner software for the
microcontroller.

In this work, we need to develop and use interrupt service routine, delay sub-routine and
PWM function to make change the DC voltage of the armature and hence the speed of the
DC motor and also to change the direction of rotation. The main programs have been
developed to calculate the appropriate number of pulses and amount of time required for the
pulses.

22
CHAPTER 4

4.1 10 YEARS DATA ANALYSIS OF ROAD ACCIDENT

Fig 4.1: Road accidents

Road accidents are an outcome of the interplay of various factors, some of which are the
length of road network, vehicle population, human population and adherence/enforcement
of road safety regulations etc. Road accident causes injuries, fatalities, disabilities and
hospitalization with severe socio economic costs across the country. Consequently, road
safety has become an issue of concern for both at national and international level. The
United Nations has rightly proclaimed 2011-20 as the Decade of Action on Road Safety.
India is also signatory to Brasilia Declaration and is committed to reduce the number of
road accidents and fatalities by 50 per cent by 2020.

23
4.1.1 Long-term Trends

The Compound Annual Growth Rate (CAGR) of number of road accidents as well as the
number of persons injured in the country during the decades 1994 -2004 and 2005-2015
declined from 2.8 per cent to 1.3 per cent and from 4.1 per cent to 0.7 per cent respectively.
However, the CAGR in respect of the number of road accident fatalities, increased from 3.7
per cent to 4.4 per cent during the same period.

Fig 4.2: Trends of road accidents

4.1.2 Normalized Indicators of Road Accidents, Injuries Fatalities : All India Averages

To get an appropriate measure of incidence of accidents, normalized/standardized


accident rates for India have been worked out in terms of number of road accidents, killings
and injuries (a) per lakh persons, (b) per ten thousand motor vehicles and (c) per ten
thousand kilometers of the road length.

A significant decline in the number of accidents per ten thousand motor


vehicles is from 814 in 1970 to about 27 in 2013.

24
Fig 4.3: Number of road accidents per ten thousand vehicles

4.1.3 Number of Road Accidents

A comparison of States which accounted for 86.7 per cent of share in road accidents
during the calendar year 2015 reveals that Tamil Nadu stood on top in road accidents in
the entire country with a percentage share of 13.8 per cent followed by Maharashtra12.7 per
cent and Madhya Pradesh 11.0 per cent. A comparative view of top 13 States for the
calendar year 2015 . Tamil Nadu reported the highest number of road accidents in 2015.

25
4.1.4 TYPES OF ROAD ACCIDENTS

4.1.5 Accidents classified according to type of Injuries (Grievous Injury and Minor
Injury)

During the year 2015 the state of Kerala ranked the highest (29,096) in the total number
of persons grievously injured in the country followed by Karnataka (26,501) and
0Maharashtra (23,363). Persons with minor injuries in road accidents were the highest in
Tamil Nadu (70,321) followed by Madhya Pradesh (49,570) and Karnataka (30,470). The
total number of grievously injured and minor injured persons in the country during the
calendar year 2015 were 1,81,471and 3,18,808 respectively. The States/UT wise
distribution is as follows:

Table 4.1: Share of states


Share of 13 States 86.7 4,34,814
1.Tamil Nadu 13.8 69,059
2.Maharashtra 12.7 63,805
3. Madhya Pradesh 11.0 54,947
4.Karnataka 8.8 44,011
5. Kerala 7.8 39,014
6.Uttar Pradesh 6.5 32,385
7. Andhra Pradesh 4.8 24,258
8. Rajasthan 4.8 24,072
9. Gujarat 4.6 23,183
10. Telangana 4.2 21,252
11. Chhattisgarh 2.9 14,446
12. West Bengal 2.6 13,208
13. Haryana 2.2 11,174

Fig 4.4: Severity of road accidents during 2015

26
4.1.4. Road Accidents, Deaths, Injuries and Severity in Million Plus Cities

Out of the 53 Million Plus cities, 50 Million Plus cities reported road accident data for
2015.These 50 Million Plus Cities accounted for a share of22.1 per cent in total road
accidents in the country during 2015 as against 22.7 percent in 2014. During 2015, in
Million Plus Cities 11.3 per cent persons were killed in road accidents as against 11.9
percent in 2014.Whereas, 16.4 per cent persons were injured in road accidents in the
country during 2015 as against 16.8 percent in 2014.

Table 4.2: Accidents/deaths/injuries

S.no Accidents/Deaths/Injuries 2014 2015

1 All Accidents 22.7 22.1

2 Fatal Accidents 12.8 12.8

3 Persons Killed 11.9 11.3

4 Persons Injured 16.8 16.4

An important accident related parameter is the extent of accident severity (road accident
related deaths per 100 accidents). It varies from a low of 2.6 per cent in Mumbai to a high
of66.0 per cent in Amritsar . The other cities which reported a very high accident
severity included Ludhiana (55.4 per cent), Varanasi (47.9 per cent), Asansol - Durgapur
(47.1 per cent), Allahabad (47.0 per cent), and Jamshedpur (45.2 per cent).

4.1.5 Accidents classified according to classification of roads

National Highways accounted for a share of 28.4 per cent in total road accidents and35.0
per cent in total number of persons killed in road accidents during 2015. The State
Highways accounted for a share of 24.0 per cent of total accidents and 28.0 per cent in the
total number of persons killed in road accidents during same period of time .

Table 4.3: Road classifications


Road Classification National State Other
Highways Highways Roads

No. of Accidents 1,42,268 (28.4) 1,20,518 (24.0) 2,38,637 (47.6)

No. of Persons Killed 51,204 (35.0) 40,863 (28.0) 54,066 (37.0)

No. of Persons Injured 1,45,341 (29.1) 1,31,809 (26.3) 2,23,129(44.6)


Note: Figures within parentheses indicate share in total accidents, killed and injured in the
respective
road categories.

27
4.1.6 Time of Occurrence of Road Accidents

For framing strategies for prevention and provision of medical care for accident victims,
timing of accidents is a relevant factor. During 2015 high rate of accidents took place
between 15:00 to 18:00 hours followed by 18:00 hours to 21:00 hours This is depicted in
Tables h. State/UT wise details are at Annexure-XX.

Table 4.4: Road Accidents as per the Time of Occurrence (2015)


Per cent Share in
Time Number of Accidents
total Accidents
06:00 - 09:00 hrs (Day) 55,518 11.1
09:00 - 12:00 hrs (Day) 81,964 16.3
12:00 - 15:00 hrs (Day) 79,616 15.9
15:00 - 18:00 hrs (Day) 87,819 17.5
18:00 - 21:00 hrs (Night) 86,836 17.3
21:00 - 24:00 hrs (Night) 51,425 10.3
00:00 - 03:00 hrs (Night ) 27,954 5.6
03:00 - 06:00 hrs (Night) 30,291 6.0
Total 24 hrs 5,01,423 100.0

4.1.7 Spatial Distribution of Road Accidents (Urban vis-à-vis Rural)


An analysis of road accidents in urban and rural areas for the calendar year 2015
reveals that rural areas are more prone to accidents. The total number of road accidents in
urban areas were lower (2,31,894) as compared to number of accidents in rural areas
(2,69,529). The percentage share of accidents in rural areas and urban areas were 53.8
and46.2 respectively in total number of accidents in the country. A comparison of
percentage share of fatal accidents, total accidents, persons killed and injured in rural vis-à-
vis urban is given in table i:
Table 4.5: Spatial distribution of road accidents
Category Fatal Accidents Total Accidents Person Killed Person Injured
50,959 (38.7) 2,31,894 (46.2) 56,978(39.0) 2,04,545 (40.9)
Urban Area

80,767 (61.3) 2,69,529 (53.8) 89,155 (61.0) 2,95,734 (59.1)


Rural Area

1,31,726 (100.0) 5,01,423(100.0) 1,46,133(100.0) 5,00,279(100.0)


Total

4.1.8 Based on Accidents classified in terms of Involvement by Vehicle Type


Motorized vehicles accounted for 95.5 per cent of the total road accidents during the
calendar year 2015. Amongst the vehicle categories, two-wheelers accounted for the highest
share in total road accidents (28.8 per cent) in 2015 followed by cars, jeeps and taxis (23.6
per cent); trucks, tempos, tractors and other articulated vehicles (19.7 per cent), Other
motor vehicles (9.0 per cent), buses (8.3 per cent) and Auto-Rickshaws (6.1 per cent).

28
4.1.9 Nature and Causes of Road Accidents

The analysis of road accidents in terms of causal factors reveals that drivers’ fault is
single most important factor responsible for accidents, followed by fault of drivers of other
vehicles, defects in motor vehicles, defect in road conditions and faults of pedestrians.
Drivers’ fault accounted for 77.1 per cent of total road accidents, 72.6 per cent of the total
number of persons killed and 80.3 per cent of the total number of persons injured in road
accidents during 2015.

Age profile of Road Accident Victims (Passengers and drivers)

Young people in the productive age group lose their lives in road accidents every year.
Premature deaths of such young people cause substantial loss of productivity to the nation.
The detailed age profile of road accidents victims for the calendar year 2015 reveals that the
most productive age group of 15 to 34 years accounted for the largest share of 54.1 per cent
(79,076 persons) in total road accident fatalities. The details of other age profiles are
indicated in table given below:

Fig 4.5: Age profile of road accident victims

29
Fig 4.6: Pie chart

30
Due to severity of accidents increase in million pulse cities. Delhi and Mumbai shows deacrese in accidents

As well as death in accidents and severity of accidents also going down this shows the awareness of people

About traffic rules due to different road prevention scheme/plans launch by govt..

Fig 4.7 : DIP in deaths in delhi in 2016

These state shows a reduction in road injuries/death .tableindictes the reduction rate of few state recorded by

Supreme court committee on road safety. Punjab is on top with a highest reduction rate of 15.7% and bihar
shows increase in rate of 10.8% as compare to 2016 in 2017.

Fig 4.8: Reductions in road deaths in 2017

31
4.1.1 TEN GOLDEN RULES FOR ROAD SAFETY

1. STOP OR SLOW DOWN : Allow pedestrians to cross first at uncontrolled


zebra crossings.

2. BUCKLE UP :So that your family and you are safe in the car. Seat Belts
reduce the chances of death of a car occupant in accidents.

3. OBEY TRAFFIC RULES AND SIGNS :To prevent road accidents.

4. OBEY SPEED LIMITS :For your own safety and that of others. In residential
areas and market places, ideal speed should be 20 kmph and the maximum
speed limit is 30 kmph.

5. KEEP VEHICLE FIT : To prevent breakdown and accidents on road.

6.NEVER USE MOBILE WHILE DRIVING :To avoid distractions that


largely lead to accidents.

7. WEAR HELMET : To protect your head while riding a two wheeler. A good
quality helmet reduces the chances of severe head injury.

8. NEVER DRIVE DANGEROUSLY :To ensure your own safety and that of
other road users.

9. BE COURTEOUS : Share the road with all and be considerate. Never rage on
the road.

10. NEVER MIX DRINKING AND DRIVING: Be Responsible….. Never Drink


Whiledriving

32
CHAPTER 5

5.1 Project programming

#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 7, 5, 4, 3, 2);

//creating mfrc522 instance


#define RSTPIN 9
#define SSPIN 10
int readsuccess;

//byte defcard[4]={0x32,0xD7,0x0F,0x2B}; // if you only want one card


byte
defcard[][4]={{0xA0,0x5D,0xD6,0x2B},{0x61,0x75,0xD7,0x2B},{0x52,0xF1,0xD6,0x2B}
}; //for multiple cards
int N=3; //change this to the number of cards/tags you will use
byte readcard[4]; //stores the UID of current tag which is read

void setup() {
Serial.begin(9600);
lcd.begin(16, 2);
SPI.begin();
rc.PCD_Init(); //initialize the receiver
rc.PCD_DumpVersionToSerial(); //show details of card reader module
lcd.clear();
lcd.setCursor(0, 1);
lcd.print("CAR SPEED CONTROLL");
delay (2000);
lcd.print("SEARCHING FOR SPEEDLIMIT");
lcd.setCursor(0, 1);
lcd.print("MIET 2018");
delay (2000);
lcd.clear();
pinMode(6,OUTPUT); //led for authorised
pinMode(5,OUTPUT); //led for not authorised

Serial.println(F("the authorised cards are")); //display authorised cards just to demonstrate


you may comment this section out
for(int i=0;i<N;i++){

for(int j=0;j<4;j++){
Serial.print(defcard[i][j],HEX);
}
Serial.println("");
}

33
Serial.println("");

Serial.println(F("Scan Access Card to see Details"));


}

void loop() {

readsuccess = getid();

lcd.clear();
lcd.setCursor(0, 0);
lcd.print("CAR SPEED CONTROLL");
if(readsuccess){

int match=0;

//this is the part where compare the current tag with pre defined tags
for(int i=0;i<N;i++){
Serial.print("Testing Against Authorised card no: ");
Serial.println(i+1);
if(!memcmp(readcard,defcard[0],4))
//{
{
Serial.println("60 limit reached");
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("60 limit reached");
delay (600);
lcd.clear();

match++;
}

if(!memcmp(readcard,defcard[1],4))
//{
{
Serial.println("80 limit reached");
delay (600);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("80 limit reached");

match++;
}

// if(!memcmp(readcard,defcard[i],4)){
// match++;
// }

34
}

if(match)
{Serial.println("CARD AUTHORISED");
lcd.clear();

// lcd.print("speed Limit 60");


digitalWrite(6,HIGH);
delay(2000);
digitalWrite(6,LOW);
delay(500);

}
//else {
// Serial.println("CARD NOT Authorised");
// lcd.clear();
// lcd.print("No Speed Bar");
// digitalWrite(5,HIGH);
// delay(2000);
// digitalWrite(5,LOW);
// delay(500);

// }

}
}
//function to get the UID of the card
int getid(){
if(!rc.PICC_IsNewCardPresent()){
return 0;
}
if(!rc.PICC_ReadCardSerial()){
return 0;
}

Serial.println("THE UID OF THE SCANNED CARD IS:");

for(int i=0;i<4;i++){
readcard[i]=rc.uid.uidByte[i]; //storing the UID of the tag in readcard
Serial.print(readcard[i],HEX);

}
Serial.println("");
Serial.println("Now Comparing with Authorised cards");
rc.PICC_HaltA();
return 1;
}

35
5.2 FUTURE SCOPE
1. DC motor plays a significant role in modern industries. They are widely used in industry
because of its low cost, less complex control structure and wide range of speed and torque so
better future of this project.

2. In this project we are used pulse width modulation technique, it is a modern technology in
solid state field and it provide smooth speed control of motor.

3. Now a day PWM technique are using in fuzzy logic control system, so PWM method is
very efficient and reliable method to control the speed of motor so it future is also bright in
the modern era with fuzzy logic.

5.3 CONCLUSION
This project presents an architecture for automatic adaptation of the longitudinal speed
control of a vehicle to the circumstances of the road which can help to decrease one of the
major causes of fatalities: the excessive or inadequate vehicle speed. Our approach is based
on a combination of three different sensor technologies: RFID tagging of traffic signals to
convey their information to the car, Hall Effect sensors located in the vehicle’s wheels for
high accuracy measurement of the speed of the car, and DGPS for precise positioning of the
vehicle and control loop time. Sensor fusion is applied to the information received by these
subsystems, and used to adjust the longitudinal speed of the vehicle with a fuzzy controller.
The proposed on-board architecture is portable and easily adaptable to any commercial car
with minimal modifications. The system shows promising results, since active RFID
technology permits to detect the presence and identity of the traffic signals reliably and
sufficiently in advance, so corrective actions on the vehicle’s behaviour can be taken. In the
empirical trials in our installations, the vehicle’s speed was successfully changed as a result
of the detection of the signals, increasing the driver’s safety. The technology developed can
assist human drivers in difficult road circumstances, as well as a complement ISA or CWS
systems if the car is already equipped with them. In our experiments, only the test vehicle
was present on the road. In normal driving situations, we can expect other vehicles circulating
nearby and possibly blocking or attenuating some of the RFID transmitting signals, especially
with large vehicles like trucks. In this aspect, more experimentation is needed to know how
this circumstance will affect the vehicle’s control performance. A possible solution is the use
of redundant RFID tags (since their cost relatively low), placed at different locations near the
traffic signal, to guarantee RF signal reception in unfavourable conditions.

36
REFERENCES
[1]. https://iijarc.org/wiki/Crystal_oscillator

[2] International Journal of Advanced Research in Computer and Communication


Engineering Vol. 4, Issue 1, January 2015

[3] Jeetender Singh Chauhan, Sunil Semwal / International Journal of Engineering Research
and Applications (IJERA) ISSN: 2248-9622 www.ijera.com Vol. 3, Issue 1, January -
February 2013, pp.778-783

[4] Nandkishor P. Joshi,Member ISTE1, Ajay P. Thakare,Member IEEE,Member ISTE2


Department of Instrumentation and control, SCET, Surat1, Department of Electronics
Engineering, SIPNA, Amravati

[5] Speed control of dc motor using pulse width modulation by professor janusz zalewaski

[6] http://www.8051microcontrollers.com/8051-tutorials-a/ program m ming -


microcontroller-j-25

[7] http://elprojects.blogspot.in/2010/06/microcontroller-at89s5descript i on.html

[8] https://thestraig.wordpress.com/2012/02/16/interfacing-of-lcd-withat89s528051/

[9] https://www.google.co.in/search?q=ic+L293D&source=lnms&tbm
=isch&sa=X&ved=0ahUKEwiky4aP6frLAhWEA44KHdA0CsQ_A
UIBygB&biw=1024&bih=643#imgrc=E2i8fEplkQJ1cM%3A

[10] https://www.google.co.in/search?q=small+dc+gear+motor&source
=lnms&tbm=isch&sa=X&ved=0ahUKEwiXyJrT5_vLAhXYWo4KHaA8
BGYQ_AUIBygB&biw=1024&bih=643#imgrc=c5mnjoS2Um4DzM%3A

[11] https://www.google.co.in/search?q=IR+speed+sensor+circuit&sour
ce=lnms&tbm=isch&sa=X&ved=0ahUKEwiG5dGn8fzLAhUEGY
4KHZucBFwQ_AUICCgC&biw=1024&bih=643#tbm=isch&q=IR
+LED&imgrc=eGCz9Z9lSSAc0M%3A

[12] http://itech.fgcu.edu/faculty/zalewski/CDA4170/files/Presentation Tim.pdf

[13] http://www.ijert.org/view-pdf/1641/speed-control-of-dc-motorusing-analog-pwm-
technique

[14] http://www.ijera.com/papers/Vol3_issue1/DP31778783.pdf

37

Das könnte Ihnen auch gefallen