Академический Документы
Профессиональный Документы
Культура Документы
Here a ultrasonic transceiver circuit is used for estimating the distance of the obstacle.
this signal is given to the micro controller depending upon the time de taken for receiving the
signal from the obstacle the the microcontroller estimates the distance of the obstacle and
requisite relay is operated for controlling the speed of the motor depending upon the distance.
Since we are using an adc converter the distance at which the obstacle is present can be
viewed on the lcd display so this helps us to know which relay is in operating condition among
the others and the speed is regulated automatically by itself.
Therefore ASDC reduces driver strain by reducing the need to constantly monitor the
vehicles speed and can be used in present day cars since it plays a vital role in reducing car
accidents
1
Introduction:
Driver error is the major cause of most accidents. These types of errors can be reduced
or eliminated from the driving experience by introducing the electronic control device into the
automotive arena.
With the advent of new automotive and computer technologies, new models of
automobile behavior, and robust control algorithms and technologies, have begun to increase
driver safety and Comfort by adding electronic systems such as Adaptive Safe Distance Control,
ASDC, that are all controlled electronically
Many reported accidents are the result of driver error. This is exactly where new
technologies of control systems that allows the implementation of ideas such as adaptive cruise
control to play important role in automotive arena .Control of vehicle cruising speed is concept
that has been in use for many years.
2
Background:
An early form of cruise control was the hand throttle. This was a level situated at the centre of
the steering column and it could be set to any position chosen by the driver so that the foot could
be relieved of the effort of holding the throttle open on long journey.
The availability of electronic control of the throttle actuator means that a much more
sophisticated system of control is now available illustrates a basic cruise control system in
automotive today.
3
Objective:
In Adaptive Safe Distance Control system to day, driver just need to input the speed they wish
the automobile to maintain, and then the driver only need be concerned with steering of the
vehicle. The system will automatically adjust the speed to stay a safe distance from other traffic.
Meanwhile, ASDC also allows the driver to set a desired following distance for cars that may be
in front of the vehicle. As long as the ASDC system does not detect any obstacles in the vehicles
path, the maximum velocity as entered by the driver will be maintained.
When an object is in the vehicles path, the ASDC system will adjust the vehicles velocity
accordingly to maintain the desired, safe, distance from the obstacle [2,3]
Therefore, ASDC reduces driver strain by reducing the need to constantly monitoring the
vehicles speed. It could also be coupled with other driver convenience systems to provide
control for lane changing, obstacle detection, and collision avoidance to further reduce driver
fatigue when traveling long
distances.
As mention above, it is easy to see how ASDC can be further enhanced to provide lane changing
mechanisms for automatic passing of slower traffic, and to provide collision avoidance
mechanisms that allow vehicles to not only maintain a specific distance, but to go around, or
even halt in the presence of an accident or other nonmoving obstacle in the road.
4
Block Diagram:
Transceiver circuit
Control circuit
Relay circuit
Motor circuit
5
Components:
1A 125V AC
2A 30V DC
Capacitor-ceramic-33micro farad
Resistor-10k ohms
Transistor-ML 15478
Diode-IN4007
Motor-12V/60rpm,1kg torque
ADC converter-ADC0804LCN
Voltage Regulator-7805
6
Operation:
The ultrasonic emitter sends the required signal to the obstacle and the signal is reflected
from the obstacle and the reflected signal is absorbed by the receiver and then the signal is
sent to the Adc converter.
This signal is converted to digital signal by the adc converter. This signal is sent to the micro
controller and depending upon the signal and the distance at which the obstacle is present is
displayed on the lcd display
Here the micro controller is also connected to the relay circuit which consists of relays which
operate on a specific distance condition.When the distance at which object present is
analysed and sent to the micro controller ,the controller operates the requisite relay and speed
of the motor is regulated depending upon the condition since the different speeds at which the
car has to run is already programmed to the controller
In this way the motors are also controlled by the relay and micro controller circuit.For
demonstration wheels are attached to this circuit and operation of ASDC control is shown
7
Transceiver Circuit:
Ultrasonic sensors (also known as transceivers when they both send and receive) work on a
principle similar to radar or sonar which evaluate attributes of a target by interpreting the echoes
from radio or sound waves respectively.
Ultrasonic sensors generate high frequency sound waves and evaluate the echo which is received
back by the sensor. Sensors calculate the time interval between sending the signal and receiving
the echo to determine the distance to an object
Here in ultrasonic transceiver circuit it consists of a emitter and receiver circuit emitter circuit is
used to emit the signal and the receiver is used to absorb the reflected signal from the
obstacle.With the help of this signal the distance at which
time taken for the reflection of the signal. With help of this the distance can be found out.
The main advantage of this ultra sonic transceiver circuit is it emits continous signal and when
supply is given the sensor circuit keeps on sending signals continuously and also depending upon
the time of delay it send the required signal to adc converter
8
Explanation:
The circuit described generates (transmits) ultrasonic sound of frequency between 40 and 50
kHz. The ultrasonic transmitter uses a 555 based astable multivibrator. It oscillates at a frequency
of 40-50 kHz. The transmitter is powered from a 9-volt PP3 single cell.Ultrasonic receiver circuit
uses an ultrasonic receiver transducer to sense ultrasonic signals. It also uses a two-stage
amplifier, a rectifier stage, and an operational amplifier in inverting mode. Output of op-amp is
connected to a relay through a complimentary relay driver stage.
A 9-volt battery eliminator can be used for receiver circuit, if required. When switch S1 of
transmitter is pressed, it generates ultrasonic sound. The sound is received by ultrasonic receiver
transducer. It converts it to electrical variations of the same frequency. These signals are
amplified by transistors T3 and T4. The amplified signals are then rectified and filtered. The
filtered DC voltage is given to inverting pin of op-amp IC2. The non- inverting pin of IC2 is
connected to a variable DC voltage via preset VR2 which determines the threshold value of
ultrasonic signal received by receiver for operation of relay RL1. The inverted output of IC2 is
used to bias transistor T5. When transistor T5 conducts, it supplies base bias to transistor T6.
When transistor T6 conducts, it actuates the relay. The relay can be used to control any
electrical or electronic equipment. Important hints:
1. Frequency of ultrasonic sound generated can be varied from 40 to 50 kHz range by adjusting
VR1. Adjust it for maximum performance.
2. Ultrasonic sounds are highly directional. So when you are operating the switch the ultrasonic
transmitter transducer of transmitter should be placed towards ultrasonic receiver transducer of
receiver circuit for proper functioning.
3. Use a 9-volt PP3 battery for transmitter. The receiver can be powered from a battery
eliminator and is always kept in switched on position.
4. For latch facility use a DPDT relay if you want to switch on and switch off the load. A flip-
flop can be inserted between IC2 and relay. If you want only an ON-time delay use a 555 only
9
at output of IC2. The relay will be energised for the required period determined by the timing
components of 555 monostable multivibrator.
5. Ultrasonic waves are emitted by many natural sources. Therefore, sometimes, the circuit might
get falsely triggered, espically when a flip-flop is used with the circuit, and there is no remedy
for that
Control Unit:
Here the control unit plays a vital role in this ASDC circuit with the help of this controller the
speed regulation and working of the relay operation circuit is done
The Micro control used here has more advantages when compared to the othe pic controllers
since its memory,speed is almost twice that of a normal pic controller and also the program here
can be changed during execution itself and also parallel programming can be done here
The speed at which the car should run depends upon the program given to the controller
The display of the lcd is also decided by the adc converter and micro controller
10
Features:
Four 8-bit I/O ports with three high-current Port 1 pins (16 mA each)
11
Eight interrupt sources with four priority levels
Microcontroller's pins
Pins 1-8: Port 1 Each of these pins can be configured as input or output.
Pin 9: RS Logical one on this pin stops microcontrollers operating and erases the contents of
most registers. By applying logical zero to this pin, the program starts execution from the
beginning. In other words, a positive voltage pulse on this pin resets the microcontroller.
Pins10-17: Port 3 Similar to port 1, each of these pins can serve as universal input or output .
Besides, all of them have alternative functions:
Pin 10: RXD Serial asynchronous communication input or Serial synchronous communication
output.
Pin 11: TXD Serial asynchronous communication output or Serial synchronous communication
clock output.
12
Pin 14: T0 Counter 0 clock input
Pin 18, 19: X2, X1 Internal oscillator input and output. A quartz crystal which determines
operating frequency is usually connected to these pins. Instead of quartz crystal, the miniature
ceramics resonators can be also used for frequency stabilization. Later versions of the
microcontrollers operate at a frequency of 0 Hz up to over 50 Hz.
Pin 21-28: Port 2 If there is no intention to use external memory then these port pins are
configured as universal inputs/outputs. In case external memory is used then the higher address
byte, i.e. addresses A8-A15 will appear on this port. It is important to know that even memory
with capacity of 64Kb is not used ( i.e. note all bits on port are used for memory addressing) the
rest of bits are not available as inputs or outputs.
Pin 29: PSEN If external ROM is used for storing program then it has a logic-0 value every time
the microcontroller reads a byte from memory.
Pin 30: ALE Prior to each reading from external memory, the microcontroller will set the lower
address byte (A0-A7) on P0 and immediately after that activates the output ALE. Upon receiving
signal from the ALE pin, the external register (74HCT373 or 74HCT375 circuit is usually
embedded ) memorizes the state of P0 and uses it as an address for memory chip. In the second
part of the microcontrollers machine cycle, a signal on this pin stops being emitted and P0 is
used now for data transmission (Data Bus). In this way, by means of only one additional (and
cheap) integrated circuit, data multiplexing from the port is performed. This port at the same time
used for data and address transmission.
13
Pin 31: EA By applying logic zero to this pin, P2 and P3 are used for data and address
transmission with no regard to whether there is internal memory or not. That means that even
there is a program written to the microcontroller, it will not be executed, the program written to
external ROM will be used instead. Otherwise, by applying logic one to the EA pin, the
microcontroller will use both memories, first internal and afterwards external (if it exists), up to
end of address space.
Pin 32-39: Port 0 Similar to port 2, if external memory is not used, these pins can be used as
universal inputs or outputs. Otherwise, P0 is configured as address output (A0-A7) when the
ALE pin is at high level (1) and as data output (Data Bus), when logic zero (0) is applied to the
ALE pin.
Port 0
It is specific to this port to have a double purpose. If external memory is used then the lower
address byte (addresses A0-A7) is applied on it. Otherwise, all bits on this port are configured as
inputs or outputs. Another characteristic is expressed when it is configured as output. Namely,
unlike other ports consisting of pins with embedded pull-up resistor ( connected by its end to 5 V
power supply ), this resistor is left out here. This, apparently little change has its consequences: If
any pin on this port is configured as input then it performs as if it floats. Such input has
unlimited input resistance and has no voltage coming from inside. When the pin is configured
as output, it performs as open drain, meaning that by writing 0 to some ports bit, the
appropriate pin will be connected to ground (0V). By writing 1, the external output will keep on
floating. In order to apply 1 (5V) on this output, an external pull-up resistor must be
embedded.
Port 1
This is a true I/O port, because there are no role assigning as it is the case with P0. Since it has
embedded pull-up resistors it is completely compatible with TTL circuits.
14
Port 2
Similar to P0, when using external memory, lines on this port occupy addresses intended for
external memory chip. This time it is the higher address byte with addresses A8-A15. When there
is no additional memory, this port can be used as universal input-output port similar by its
features to the port 1.
Port 3
Even though all pins on this port can be used as universal I/O port, they also have an alternative
function. Since each of these functions use inputs, then the appropriate pins have to be
configured like that. In other words, prior to using some of reserve port functions, a logical one
(1) must be written to the appropriate bit in the P3 register. From hardwares perspective , this
port is also similar to P0, with the difference that its outputs have a pull-up resistor embedded.
Here ADC is used to convert the distance analog signal into digital and it gives the
signal to the controller
The distance signal is given to the ADC converter from the ultrasonic transceiver
circuit
15
Flow diagram:
16
A circuit that changes a continuously varying voltage or current (analog) into a digital
output.
The input may be ac or dc, and the output may be serial or parallel, binary or decimal and
also it translates analog signals (voltages, pressures, etc.) from sensors in.to numerical
digital form (binary, decimal, etc.).
An 8 bit ADC converts an input into 256 steps. A 10-bit ADC produces 1024 steps
LCD Display
17
o Here lcd display is used to view the distance at which the obstacle is
present
Lcd panel
18
Pin connections
The alphanumeric 16character X 2line LCD requires 8data lines and also 3
control signals and they are interfaced to 3664.By using 2 ports, port 0&3 data pins are
connected to LCD as data bus. Port0 can be basically used as I/O port i.e. it can be programmed
as an input or as an output port.
They are EN bar & RS bar, RW bar. At different instance such as data write /
command write / data read etc. Various signals are to be provided as indicated by the by the LCD
manufacturers.
To interface the LCD, to the Micro controller it require an 8 bit and also three
control signals differentiate the data from the control words send to the LCD. The Micro
controller has to send the necessary control words followed by the data to be displayed.
19
Depending on the operation to be performed the control words are selected and
passes to the LCD. The data to be displayed on the LCD is to be sent in the ASCII format. Thus
all the character to be displayed are converted into ASCII form and then sent to the LCD along
with different control words. The control word differentiated the various operations and are
executed. It is also possible to read the LCD data if required.
The control signals to the LCD are also provided by the Micro controller. This is
also done through pins 3.5,3.6&3.7.Through program necessary control signals are passed to the
LCD by using the bits of the port. The remaining can be used for some other purpose if there is a
need. The software controls the necessary ports and performs the task it is designed for. The soft
ware and associated hardware perform the LCD interface.
LCD DISPLAY
20
Relay Circuit:
A relay is an electrically operated switch. Current flowing through the coil of the relay creates a
magnetic field which attracts a lever and changes the switch contacts. The coil current can be on
or off so relays have two switch positions and they are double throw (changeover) switches.
Relays allow one circuit to switch a second circuit which can be completely separate
from the first. For example a low voltage battery circuit can use a relay to switch a 230V AC
mains circuit. There is no electrical connection inside the relay between the two circuits, the link
is magnetic and mechanical.
Here 3 relays are used with an led connected to each of them in series.when
the obstacle is at a certain distance, depending upon the distance the required
relay is switched on and the led glows according to the distance , and the motor
21
The relay's switch connections are usually labelled COM, NC and NO:
COM = Common, always connect to this, it is the moving part of the switch.
NC = Normally Closed, COM is connected to this when the relay coil is off.
NO = Normally Open, COM is connected to this when the relay coil is on.
Connect to COM and NO if you want the switched circuit to be on when the relay coil is
on.
Connect to COM and NC if you want the switched circuit to be on when the relay coil is
off.
Advantages of relays:
Relays can switch AC and DC, transistors can only switch DC.
Relays can switch high voltages, transistors cannot.
Relays are a better choice for switching large currents (> 5A).
Relays can switch many contacts at once.
Motor Operation:
22
This simple circuit lets you run a DCmotor in clockwise or anti-clockwise direction and
stop it using a single switch. It provides a constant voltage forproper operation of the
motor. The glowing of LED1 through LED3 indicates that the motor is in stop, forward
rotation and reverse conditions, respectively
Now if you press S1 again, the high output of IC2 shifts from Q1 to Q2. The low Q1
output of IC2 makes pin 3 of IC3 high and the motor doesnt rotate. LED1glows (via
diode D2) to indicate that the motor is in stop condition.Pressing switch S1 once again
shifts the high output of IC2 from Q2 to Q3.The high Q3 output of IC2 makes pin 3 of
IC4 low and the motor starts running in anti-clockwise (reverse) direction. LED3 glows
to indicate that the motor is running in reverse direction.
If you press S1 again, the high output of IC2 shifts from Q3 to Q4. Since Q4 is
connected to reset pin 15, it resets decade counter CD4017 and its Q0 output goes
high, so the motor does not rotate. LED1 glows via diode D1 to indicate that the
motor is in stop condition. Thereafter, the cycle repeats. If you dont want to operate the
motor in reverse direction, remove timer IC4 along with resistors R5 and R7 and LED3.
o And connect b terminal of the motor to +Vcc.
Where as in asdc the entire motor control action is taken by relay and the
necessary speed control level is adjusted in the micro control program based on
the distance .here the relay acts as a switch in controlling motor
23
Circuit Diagram:
24
Program of Controller:
#include <REGX51.H>
#include <string.h>
25
while(1)
{
c=P1;
d3=c;
for(d6=0;d6<5;d6++)
{
for(d5=0;d5<10;d5++)
{
d1= P1;
if(d1>d3)
{
d3=d1;
}
}
}
d=260-d3;
if(d<=10)
{P0=0;
}
if(d>=11&&d<40)
{
P0=1;
}
if(d>=41&&d<60)
{
P0=2;
}
if(d>=61)
{
P0=64;
}
a[2]=d%10;
d=d/10;
a[1]=d%10;
d=d/10;
a[0]=d;
j=0;
i=12;
for(j=0;j<3;j++)
{
Cmd_Write(0xc0 + i);
SDelay(100);
Dta_Write(0x30+(a[j]));
SDelay(100);
26
i++;
Delay_MS(20);
}
}
}
void LCD_Init(void)
{
LCD_WR = 0;
Cmd_Write(0x38);
Cmd_Write(0x0c);
Cmd_Write(0x01);
Cmd_Write(0x80);
}
27
void Welcome_Note(void)
{
// 1 1
strcpy(msg,"OBSTRACLE AT ");
for(i=0;i<16;i++)
{
Cmd_Write(0x80 + i);
SDelay(100);
Dta_Write(msg[i]);
SDelay(100);
}
}
Output:
For this test to be performed certain assumptions are considered and this
circuit is connected on the wheels in form of a toy car and this test is
performed
When the obstacle is detected depending upon the distance the requisite
relay is operated and the appropriate led glows to indicate which relay is
being operated
29
At the end of the project, the circuit module and mechanical structure for the system of Adaptive
Safe Distance Control has been successfully constructed and demonstrated.
The ultrasonic transceiver is able to detect object as in required range. The D.C. Motor and motor
driver are working in a fine condition as specified.
Based on software and algorithms support, the ASDC could operate well within an expected
performance
outputs proportional to the ASDC drivingmodel situations based on distance detected from
ASDC system to the lead car.
Distance
ASDC driving-model
(ASDC system - Lead car) Output / Control condition
situations
30
Advantages:
Cost is economic
Applications:
This can be installed for most of the vehicles for safety automation control
Road accidents can be reduced to a major extent with the help of this
Even the transceivers used here can also detect the noise of the animals so if
incase any dog is running in our cars path on the road as soon as it barks
the obstacle gets detected
31
Softwares used :
What is Vision3?
Vision3 is an IDE (Integrated Development Environment) that helps you write, compile, and
debug embedded programs. It encapsulates the following components:
A project manager.
A make facility.
Tool configuration.
Editor.
A powerful debugger.
32
To create a new project in Vision2, you must:
1. Select Project - New Project.
2. Select a directory and enter the name of the project file.
3. Select Project - Select Device and select an 8051, 251, or C16x/ST10 device from the
Device Database.
4. Create source files to add to the project.
5. Select Project - Targets, Groups, Files. Add/Files, select Source Group1, and add the
source files to the project.
6. Select Project - Options and set the tool options. Note when you select the target device
from the Device Database all special options are set automatically. You typically only
need to configure the memory map of your target hardware. Default memory model
settings are optimal for most applications.
7. Select Project - Rebuild all target files or Build target.
33
Conclusions:
ASDC functioning and operation are checked by the following tests and the
performance is analyzed
The performance of each and every component can also be tested in this
circuit
34
35