View
225
Download
0
Category
Preview:
Citation preview
8/9/2019 Accident Avoiding
1/28
Over speed indication andAutomatic accident Avoiding
System for four wheeler
Presented By
8/9/2019 Accident Avoiding
2/28
Components Used:• Microcontroller AT89C51• Crystal Oscillator (11.059 M !"• Ceramic Capacitor (## P$"
• Po%er &'pply (5 "• )eset &%itc• Ultrasonic &ensor(10 meter ran*e"• +eypad • )elay &%itc• ,c Motor • -C /9#d • C, ,isplay (/ 1 "
8/9/2019 Accident Avoiding
3/28
Ad2anta*es o$ Microcontroller
3ased &ystem• As t e perip erals are inte*rated into a sin*le c ip4 t e o2erall
system cost is 2ery less• T e prod'ct is o$ small si!e compared to micro processor 3ased
system• T e system desi*n no% re 'ires 2ery little e$$orts• As t e perip erals are inte*rated %it a microprocessor t e
system is more relia3le• T o'* microcontroller may a2e on c ip )OM4)AM and -6O
ports4 addition )OM4 )AM -6O ports may 3e inter$acede ternally i$ re 'ired
• On c ip )OM pro2ide a so$t%are sec'rity
8/9/2019 Accident Avoiding
4/28
8051 Basic Component
• 7+ 3ytes internal )OM • 1/8 3ytes internal )AM • o'r 8 3it -6O ports (P0 P#".• T%o 1 3it timers 6co'nters• One serial inter$ace
• 7 e ternal memory $or code• 7 e ternal memory $or data• /10 3it addressa3le
Microcontroller
8/9/2019 Accident Avoiding
5/28
5
T e 3asic 8051 Core• 8-bit CPU optimized for control applications• Capability for single bit Boolean operations.• Supports up to 6 ! of program memory.• Supports up to 6 ! of data memory.
• ! bytes of on-c"ip program memory.• #e$er de%ices pro%ide more.
• &'8 or '56 bytes of on-c"ip data ()*• +our 8 bit ports.
• ,$o &6-bit timer counters• U)(,• nterrupts• /n-c"ip cloc0 oscillator
8/9/2019 Accident Avoiding
6/28
Bloc ,ia*ram
CPU
On-chipRAM
On-chipROM forprogramcode
4 !O Ports
"imer #
SerialPortOSC
nterruptControl
$%ternal interrupts
"imer &
"imer!Counter
'us
Control
"%( R%(P# P& P) P*
Address!(ata
Counternputs
8/9/2019 Accident Avoiding
7/28
8051Schematic
Pin out
8/9/2019 Accident Avoiding
8/28
8051
Foot Print
1234567891011121314151617181920
4039383736353433323130292827262524232221
P1.0P1.1P1.2P1.3P1.4P1.5P1.6P1.7RST
(RXD)P3.0(TXD)P3.1
(T0)P3.4(T1)P3.5
XTAL2XTAL1
GND
(INT0 )P3.2(INT1 )P3.3
(RD )P3.7(WR )P3.6
VccP0.0 (AD0)P0.1 (AD1)P0.2 (AD2)P0.3 (AD3)P0.4 (AD4)P0.5 (AD5)P0.6 (AD6)P0.7 (AD7)EA/VPPALE/PROG
PSENP2.7 (A15 )P2.6 (A14)P2.5 (A13)P2.4 (A12)P2.3 (A11 )P2.2 (A10 )P2.1 (A9)P2.0 (A8)
8051(8031)(8751)(8951)
8/9/2019 Accident Avoiding
9/28
Po%er On );&;T Circ'it
12 p+
12 p+
8.' !
&2 u+3
4cc
&&.25 ' * z
7) 4PP&
'
(S,
1&
&
&8
8/9/2019 Accident Avoiding
10/28
Port 0 %it P'll Up )esistors
P2.2P2.&P2.'P2.1P2.P2.5
P2.6P2.9
(S+###
, +&
,.+&
/cc 0
P or
t #
8/9/2019 Accident Avoiding
11/28
IMPORTANT PINS (IO Ports IMPORTANT PINS (IO Ports
• Port 0 Port 0 pins #/ #9 pins #/ #9 P0.0 P0.0 P0.< P0.<
: 8 3it )6= >eneral8 3it )6= >eneral P'rpose -6O P'rpose -6O
: Or Or acts as a m'ltiple edacts as a m'ltiple ed
lo% 3ytelo% 3yte addressaddress andand datadata 3's $or3's $or e ternal e ternal memorymemorydesi*ndesi*n
One of the most useful features of the ,#+& is that it contains
four !O ports 1P# - P*2$ach port can 3e used as input or output 13i-direction2
8/9/2019 Accident Avoiding
12/28
IMPORTANT PINS (IO Ports IMPORTANT PINS (IO Ports
• Port 1 Port 1 pins 1 8 pins 1 8 P1.0 P1.0 P1.< P1.<
: OnlyOnly 8 3it )6= 8 3it )6=
>eneral P'rpose -6O>eneral P'rpose -6O
8/9/2019 Accident Avoiding
13/28
8/9/2019 Accident Avoiding
14/28
IMPORTANT PINS (IO Ports IMPORTANT PINS (IO Ports
• Port # Port #• pins 10 1< pins 10 1< P#.0 P#.0
P#.< P#.<
: >eneral P'rpose -6O>eneral P'rpose -6O
: i$ not 'sin* any o$ t ei$ not 'sin* any o$ t einternal perip eralsinternal perip erals(timers" or e ternal(timers" or e ternal
interr'pts.interr'pts.
8/9/2019 Accident Avoiding
15/28
Port ! A"ternate Functions
8/9/2019 Accident Avoiding
16/28
• A ; Address latc ena3le to select 2alid address• ;A6 pp ; ternal access ena3le
;A 0 e ec'te pro*ram in e ternal memory ;A 1 e ec'te pro*ram in internal memory
pp it recei2es /1 $or on c ip ;P)OM P&;? Pro*ram store ena3lestore to read t e e ternal pro*ram memory
8/9/2019 Accident Avoiding
17/28
Registers
)
B
(2
(&
(1
(
('
(5
(9
(6
;P ;P<
PC
;P,(
PC
Some 825& &6-bit (egister
Some 8-bitt (egisters oft"e 825&
8/9/2019 Accident Avoiding
18/28
;ata memory
*
;**/4 )=6'
*/4 (&=>6'*/4 )?(&
*/4 )=2)'
*/4 (&=>2)'*/4 )?(&
8/9/2019 Accident Avoiding
19/28
Ultrasonic &ensor
8/9/2019 Accident Avoiding
20/28
• P-?> 'ltrasonic distance sensor pro2ides precise distance meas'rements $rom a3o't /cm (0.8 inc es" to 10 meters .
• -t %or s 3y transmittin* an 'ltrasonic 3'rstand pro2idin* an o'tp't p'lse t atcorresponds to t e time re 'ired $or t e 3'rstec o to ret'rn to t e sensor.
• By meas'rin* t e ec o p'lse %idt t edistance to tar*et can easily 3e calc'lated.
8/9/2019 Accident Avoiding
21/28
-nter$acin* a +eypad
1 eys arran*ed as a7@7 matri
Place a 0 on )0 port
)ead C port
-$ t ere is a 0 3itt en t e 3'ttonat t e col'mn6ro%intersection as3een pressed.
Ot er%ise4 try ne t ro% )epeat constantly
C &C '
C 1
C
( &
( '
( 1
(
8/9/2019 Accident Avoiding
22/28
C, -nter$acin* • i 'id Crystal ,isplays ( C,s"
• c eap and easy %ay to display te t
• ario's con$i*'rations (1 line 3y /0 @ c ar 'p to8 lines @ 80"
• -nte*rated controller
• T e display as t%o re*ister
: command re*ister
: data re*ister
• By )& yo' can select re*ister
• ,ata lines (,B< ,B0" 'sed to trans$er data andcommands
8/9/2019 Accident Avoiding
23/28
Alp an'meric
C, -nter$acin*
7
( @
(S
;B9:;B2
8/9/2019 Accident Avoiding
24/28
Pino't 8 data pins ,
8/9/2019 Accident Avoiding
25/28
C, Commands
• T e C, s internal controller can accept se2eral commands andmodi$y t e display accordin*ly. &'c as: : Clear screen
: )et'rn ome : ,ecrement6-ncrement c'rsor
• A$ter %ritin* to t e C,4 it ta es some time $or it to complete itsinternal operations. ,'rin* t is time4 it %ill not accept any ne%commands or data. : =e need to insert time delay 3et%een any t%o commands or
data sent to C,
8/9/2019 Accident Avoiding
26/28
Pin ,escription
8/9/2019 Accident Avoiding
27/28
Command Codes
SAC7,
8/9/2019 Accident Avoiding
28/28
-nter$acin* C, %it 8051
SAC7,
C(
P&5 -P&5#( -(#
R6
RS
$
P*54
P*5+
P*5*
,#+&
Recommended