Professional Documents
Culture Documents
Report
Report
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 efensive riving! Vehicle accidents are "ost co""on if the driving is inade#$ate! These happen on "ost factors if the driver is dro%sy or if he is alcoholic! river dro%siness is recogni&ed as an i"portant factor in the vehicle accidents! 't %as de"onstrated that driving perfor"ance deteriorates %ith increased dro%siness %ith res$lting crashes constit$ting "ore than ()* of all vehicle accidents! B$t the life lost once cannot +e re,%inded! Advanced technology offers so"e hope avoid these $p to so"e e-tent! This project involves "eas$re and controls the eye +link $sing 'R sensor! The 'R trans"itter is $sed to trans"it the infrared rays in o$r eye! The 'R receiver is $sed to receive the reflected infrared rays of eye! 'f the eye is closed "eans the o$tp$t of 'R receiver is high other%ise the 'R receiver o$tp$t is lo%! This to kno% the eye is closing or opening position! This o$tp$t is give to logic circ$it to indicate the alar"! This project involves controlling accident d$e to $nconscio$s thro$gh Eye +link! .ere one eye +link sensor is fi-ed in vehicle %here if any+ody looses conscio$s and indicate thro$gh alar"! A car si"$lator st$dy %as designed to collect physiological data for validation of this technology! /ethodology for analysis of physiological data0 independent assess"ent of driver dro%siness and develop"ent of dro%siness detection algorith" +y "eans of se#$ential fitting and selection of regression "odels is presented!
CHAPTER 2
epart"ent Of Electronics 1 Teleco""$nication Engineering r! Ba+asahe+ A"+edkar Technological University0 2onere!
Page 1
SYSTEM MODEL
2.1 GENERAL BLOCK DIAGRAM:
Discriptio
The Syste"s consist of AVR controller %hich is AT"ega34 fro" At"el l co"pany 'n this project %e are going to developed for a$to"atic detection of the eye +link The %hole set$p consists of /icro controller0 'R sensor and 25 The 'R sensor %o$ld +e $sed for sensing the eye +link! 6henever the 'R pair sensor senses the eye "ove"ent the +$&&er is on!
epart"ent Of Electronics 1 Teleco""$nication Engineering r! Ba+asahe+ A"+edkar Technological University0 2onere!
Page 2
The 5rystal %ill +e $sed for clock fre#$ency 7eneration! The R5 net%ork circ$it %ill +e $sed to generate the po%er on reset for the "icrocontroller! The 25 is 348( $sed to display p$rpose! The relay driver is transistor %hich is $sed for +oosting the c$rrent and controlling the +$&&er
Page 3
%.2 Histor+ o( A&R , ATMEGA%2The AVR is a /odified .arvard architect$re <,+it R'S5 single chip "icrocontroller =>5? %hich %as developed +y At"el in 3@@4! The AVR %as one of the first "icrocontroller fa"ilies to $se on,chip flash "e"ory for progra" storage0 as opposed to One,Ti"e Progra""a+le RO/0 EPRO/0 or EEPRO/ $sed +y other "icrocontrollers at the ti"e!
./+ A&R 0
AVRs have +een $sed in vario$s a$to"otive applications s$ch as sec$rity0 safety0 po%er train and entertain"ent syste"s! At"el has recently la$nched a ne% p$+lication AAt"el A$to"otive 5o"pilationA to help developers %ith a$to"otive applications! So"e c$rrent $sages are in B/60 ai"ler,5hrysler and TR6! Syste" Se"icond$ctor0 'nc prod$ces the /9))) /otor and /otion 5ontrol 5hip0 incorporating an At"el AVR 5ore and an Advanced /otion 5ontroller for $se in a variety of "otion applications! The Be% 9(,Bit AVRsC 'n ())4 At"el released "icrocontrollers +ased on the ne%0 9(,+it0 AVR9( architect$re! They incl$de S'/ and SP instr$ctions0 along %ith other a$dio and video processing feat$res! This 9(, $e to +it fa"ily of devices is intended to co"pete %ith the AR/ +ased processors! lot of feat$res in +$ilt it is very cost effective and easy to +$ild a controller!
Page 4
.igh,perfor"ance0 2o%,po%er AVRD <,+it /icrocontroller Advanced R'S5 Architect$re 393 Po%erf$l 'nstr$ctions E /ost Single,clock 5ycle E-ec$tion 9( - < 7eneral P$rpose 6orking Registers On,chip (,cycle /$ltiplier Bonvolatile Progra" and ata /e"ories 9(F Bytes of 'n,Syste" Self,Progra""a+le :lash End$ranceC 3)0))) 6riteGErase 5ycles 'n,Syste" Progra""ing +y On,chip Boot Progra" Tr$e Read,6hile,6rite Operation 3)(; Bytes EEPRO/H End$ranceC 3))0))) 6riteGErase 5ycles (F Byte 'nternal SRA/ Progra""ing 2ock for Soft%are Sec$rity ITA7 ='EEE std! 33;@!3 5o"pliant? 'nterface
Bo$ndary,scan 5apa+ilities According to the ITA7 Standard
Page 5
One 34,+it Ti"erG5o$nter %ith Separate Prescaler0 5o"pare /ode0 and 5apt$re/ode Real Ti"e 5o$nter %ith Separate Oscillator :o$r P6/ 5hannels <,channel0 3),+it A 5 < Single,ended 5hannels Byte,oriented T%o,%ire Serial 'nterface Progra""a+le Serial USART /asterGSlave SP' Serial 'nterface Progra""a+le 6atchdog Ti"er %ith Separate On,chip Oscillator On,chip Analog 5o"parator Special /icrocontroller :eat$res Po%er,on Reset and Progra""a+le Bro%n,o$t etection 'nternal 5ali+rated R5 Oscillator E-ternal and 'nternal 'nterr$pt So$rces Si- Sleep /odesC 'dle0 A 5 Boise Red$ction0 Po%er,save0 Po%er,do%n0 Stand+y and E-tended Stand+y 'GO and Package ,9( Progra""a+le 'GO 2ines ;),pin P 'P0 ;;,lead TJ:P0 and ;;,pad J:BG/2: Operating Voltages
epart"ent Of Electronics 1 Teleco""$nication Engineering r! Ba+asahe+ A"+edkar Technological University0 2onere!
Page 6
E E
Speed 7rades ) , < /.& for AT"ega9(2 ) , 34 /.& for AT"ega9( Po%er 5ons$"ption at 3 /.&0 9V0 (LM5 for AT"ega9(2 E E E ActiveC 3!3 "A 'dle /odeC )!9L "A Po%er,do%n /odeC N 3 OA
%.3 Pi Di"#r"$
Page 7
Page 8
%.4 Arc/it*ct!r*
Page 9
'n AVR t%o pins =OS53G52F' 1 OS5(G52FO? are provided for connecting a resonant net%ork to for" an oscillator! A #$art& crystal is $sed %ith cera"ic capacitors as sho%n in a+ove
epart"ent Of Electronics 1 Teleco""$nication Engineering r! Ba+asahe+ A"+edkar Technological University0 2onere!
Page 10
circ$it diagra"! The crystal fre#$ency is +asic internal fre#$ency of the "icrocontroller! The crystal that can +e connected to the "icrocontroller is 9(!K4< F.&! 6e have preferred to $se J$art& crystal +eca$se it is ine-pensive and readily availa+le! The capacitors 53 and 5( $sed are each of val$e (Kp:! The capacitors 530 5( are $sed for sta+le fre#$ency operation i!e! in the condition %here is high noise and h$"idity as in the case of factories! .igh noise and h$"idity can affect the oscillator fre#$ency! To avoid this effect0 the capacitors are $sed for sta+le fre#$ency!
operation! To take advantage of the POR circ$itry0 tie the /52R pin thro$gh a resistor =3 kP to ! This %ill eli"inate e-ternal R5 co"ponents $s$ally needed to create a Po%er, is specified =para"eter ));?! :or a slo% rise on Reset delay! A "ini"$" rise rate for V
ti"e0 see :'7! (!e! 6hen the device starts nor"al operation =i!e!0 e-its the Reset condition?0 device operating para"eters =voltage0 fre#$ency0 te"perat$re0 etc!? "$st +e "et to ens$re operation! 'f these conditions are not "et0 the device "$st +e held in Reset $ntil the operating conditions are "et! POR events are capt$red +y the POR +it =R5OBN3Q?! The state of the +it is set to )R %henever a Po%er,on Reset occ$rsS it does not change for any other Reset event! POR is not reset to 3R +y any hard%are event! To capt$re "$ltiple events0 the $ser "an$ally resets the +it to 3R in soft%are follo%ing any Po%er,on Reset!
:ig! Reset circ$it for AVR epart"ent Of Electronics 1 Teleco""$nication Engineering r! Ba+asahe+ A"+edkar Technological University0 2onere!
Page 11
Not* '! 3C E-ternal Po%er,on Reset circ$it is re#$ired only if the V slo%! The diode ''! helps discharge the capacitor #$ickly %hen V po%er,$p slope is too po%ers do%n!
(C R N ;) kP is reco""ended to "ake s$re that the voltage drop across R does not violate the deviceRs electrical specification!
'''!
9C R3 T 3 kP %ill li"it any c$rrent flo%ing into /52R fro" e-ternal capacitor 50 in the event of /52RGVPP pin +reakdo%n0 d$e to Electrostatic Overstress =EOS?! ischarge =ES ? or Electrical
Page 12
4. 1.1 Images
4.1.2 Technical Specification: 'R Based O+stacle etecter Adj$sta+le Range %ith POT Operating Voltage Lv Sesitivity $pto , 9)c",Adj$sta+le 2ogic o$tp$t ,3G) ,Lv Application , 'nd$strial safety devices! 4.1.3 Principle 'R 2E e"its infrared radiation! This radiation ill$"inates the s$rface in front of 2E ! epending on reflectivity of the s$rface0 a"o$nt of light
reflected varies! This reflected light is "ade incident on reverse +iased 'R sensor! 6hen photons are incident on reverse +iased j$nction of this diode0 electron,hole pairs are generated0 %hich res$lts in reverse leakage c$rrent! A"o$nt of electron,hole pairs generated depends on intensity of incident 'R radiation! /ore intense radiation res$lts in "ore reverse leakage c$rrent! This c$rrent can +e passed thro$gh a resistor so as to get proportional voltage! Th$s as intensity of
epart"ent Of Electronics 1 Teleco""$nication Engineering r! Ba+asahe+ A"+edkar Technological University0 2onere!
Page 13
incident rays varies0 voltage across resistor %ill vary accordingly! This voltage can then +e given to OPA/P +ased co"parator! O$tp$t of the co"parator can +e read +y $5! Alternatively0 yo$ can $se on,chip A 5 in AVR "icrocontroller to "eas$re this voltage and perfor" co"parison in soft%are!
'R 2E
is $sed as a so$rce of infrared rays! 't co"es in t%o packages 9"" or L""!
9"" is +etter as it is re#$ires less space! 'R sensor is nothing +$t a diode0 %hich is sensitive for infrared radiation! This infrared trans"itter and receiver is called as 'R T8,R8 pair! 't can +e o+tained fro" any decent electronics co"ponent shop and costs less than 3)Rs! :ollo%ing snap sho%s 9"" and L"" 'R pairs! 5olo$r of 'R trans"itter and receiver is different! .o%ever yo$ "ay co"e across pairs %hich appear e-actly sa"e or even has opposite colo$rs than sho%n in a+ove pic and it is not possi+le to disting$ish +et%een T8 and R8 vis$ally! 'n case yo$ %ill have to take help of "$lti"eter to disting$ish +et%een the"! .ere is ho% yo$ can disting$ish +et%een 'R T8,R8 $sing // C 5onnect cathode of one 2E to Uve ter"inal of // 5onnect anode of the sa"e 2E to co""on ter"inal of // ="eans connect 2E s$ch that 't gets reverse +iased +y // ? Set // to "eas$re resistance $pto (/ Oh"! 5heck the reading! Repeat a+ove proced$re %ith second 2E ! 'n a+ove process0 %hen yo$ get the reading of the fe% h$ndred Filo Oh"s on indicated that 2E that yo$ are testing is 'R sensor! 'n case of 'R trans"itter //0 then it // %ill not
Page 14
connected to it as "entioned a+ove! Second snap sho%s ho% sensorRs resistance increases %hen it is covered +y a finger! Bote that0 these are j$st ill$strative fig$res and they %ill depend $pon sensor as %ell as // that yo$ are $sing!
This /od$le has three pin! Vcc 7B O$tp$t 6hen the o+stacle is detected the o$tp$t is .igh else 2o%!
1.% R*sistors
A resistor is a t%o,ter"inal electronic co"ponent designed to oppose an electric c$rrent +y prod$cing a voltage drop +et%een its ter"inals in proportion to the c$rrent0 that is0 in accordance %ith Oh"Vs la%C V W 'R! The resistance R is e#$al to the voltage drop V across the resistor divided +y the c$rrent ' thro$gh the resistor! The pri"ary characteristics of resistors are their resistance and the po%er they can dissipate! Practical resistors can +e "ade of resistive %ire0 and vario$s co"po$nds and fil"s0 and they can +e integrated into hy+rid and printed circ$its! Si&e0 and position of leads are relevant to e#$ip"ent designersS resistors "$st +e physically large eno$gh not to overheat %hen dissipating their po%er!
epart"ent Of Electronics 1 Teleco""$nication Engineering r! Ba+asahe+ A"+edkar Technological University0 2onere!
Page 15
How transistor works? The essential $sef$lness of a transistor co"es fro" its a+ility to $se a s"all signal applied +et%een one pair of its ter"inals to control a "$ch larger signal at another pair of ter"inals! This property is called AgainA! A transistor can control its o$tp$t in proportion to the inp$t signalS this is called an Aa"plifierA! Or0 the transistor can +e $sed to t$rn c$rrent on or off in a circ$it like an electrically controlled As%itchA0 %here the a"o$nt of c$rrent is deter"ined +y other circ$it ele"ents! The t%o types of transistors have slight differences in ho% they are $sed in a circ$it! A +ipolar transistor has ter"inals la+elled +ase0 collector and e"itter! A s"all c$rrent at +ase ter"inal can control or s%itch a "$chlarger c$rrent +et%een collector and e"itter ter"inals! :or a field,effect transistor0 the ter"inals are la+elled gate0 so$rce0 and drain0 and a voltage at the
epart"ent Of Electronics 1 Teleco""$nication Engineering r! Ba+asahe+ A"+edkar Technological University0 2onere!
Page 16
gate can control a c$rrent +et%een so$rce and drain! The i"age to the right represents a typical +ipolar transistor in a circ$it! 5harge %ill flo% +et%een e"itter and collector ter"inals depending on the c$rrent in the +ase! Since internally the +ase and e"itter connections +ehave like a se"icond$ctor diode0 a voltage drop develops +et%een +ase and e"itter %hile the +ase c$rrent e-ists! The si&e of this voltage depends on the "aterial the transistor is "ade fro"0 and is referred to as V+e!
1.3 LED
A light,e"itting diode =2E ? is an electronic light so$rce! The 2E %as discovered in the early ()th cent$ry0 and introd$ced as a practical electronic co"ponent in 3@4(! All early devices e"itted lo%,intensity red light0 +$t "odern 2E s are availa+le across the visi+le0 $ltraviolet and infra red %avelengths0 %ith very high +rightness! 2E s are +ased on the se"icond$ctor diode! 6hen the diode is for%ard +iased =s%itched on?0 electrons are a+le to reco"+ine %ith holes and energy is released in the for" of light! This effect is called electrol$"ine scence and the color of the light is deter"ined +y the energy gap of the se"icond$ctor! The 2E is $s$ally s"all in area =less than 3 ""(? %ith integrated optical co"ponents to shape its radiation pattern and assist in reflection!
Page 17
2E s present "any advantages over traditional light so$rces incl$ding lo%er energy cons$"ption0 longer lifeti"e0 i"proved ro+$stness0 s"aller si&e and faster s%itching! .o%ever0 they are relatively e-pensive and re#$ire "ore precise c$rrent and heat "anage"ent than traditional light so$rces! Applications of 2E s are diverse! They are $sed as lo%,energy replace"ents for traditional light so$rces in %ell,esta+lished applications s$ch as indicators and a$to"otive lighting! The co"pact si&e of 2E s has allo%ed ne% te-t and video displays and sensors to +e developed0 %hile their high s%itching rates are $sef$l in co""$nications technology! 4.5.1 T pes of !"#s 2E s are prod$ced in an array of shapes and si&es! The L "" cylindrical package =red0 fifth fro" the left? is the "ost co""on0 esti"ated at <)* of %orld prod$ction!Xcitation neededY The color of the plastic lens is often the sa"e as the act$al color of light e"itted0 +$t not al%ays! :or instance0 p$rple plastic is often $sed for infrared 2E s0 and "ost +l$e devices have clear ho$sings! There are also 2E s in S/T packages0 s$ch as those fo$nd on +linkies and on cell phone keypads!
Page 18
An 25
consists of t%o glass panels0 %ith the li#$id crystal "aterial sand %itched in +et%een
the"! The inner s$rface of the glass plates are coated %ith transparent electrodes %hich define the character0 sy"+ols or patterns to +e displayed poly"eric layers are present in +et%een the electrodes and the li#$id crystal0 %hich "akes the li#$id crystal "olec$les to "aintain a defined orientation angle! One each polarisers are pasted o$tside the t%o glass panels! These polarisers %o$ld rotate the light rays passing thro$gh the" to a definite angle0 in a partic$lar direction 6hen the 25 %itho$t any orientation0 and hence the 25 thro$gh the 25 is in the off state0 light rays are rotated +y the t%o polarisers and the li#$id crystal0 s$ch that the light rays co"e o$t of the 25 appears transparent! 6hen s$fficient voltage is applied to the electrodes0 the li#$id crystal "olec$les %o$ld +e aligned in a specific direction! The light rays passing %o$ld +e rotated +y the polarisers0 %hich %o$ld res$lt in activating G highlighting the desired characters! The 25 Rs are light%eight %ith only a fe% "illi"eters thickness! Since the 25 Rs cons$"e less po%er0 they are co"pati+le %ith lo% po%er electronic circ$its0 and can +e po%ered for long d$rations! The 25 Rs donRt generate light and so light is needed to read the display! By $sing +acklighting0 reading is possi+le in the dark! The 25 Rs have long life and a %ide operating te"perat$re range! 5hanging the display si&e or the layo$t si&e is relatively si"ple %hich "akes the 25 Rs "ore c$sto"er friendly!
4.6.1.Introduction
Fig. LCD Display The 25 display consists of t%o lines0 () characters per line that is interfaced %ith the
P'534:K9!The protocol =handshaking? for the display is as sho%n in :ig! The display contains t%o internal +yte,%ide registers0 one for co""ands =RSW)? and the second for characters to +e displayed =RSW3?! 't also contains a $ser,progra""ed RA/ area =the character RA/? that can +e progra""ed to generate any desired character that can +e for"ed $sing a dot "atri-! To disting$ish +et%een these
epart"ent Of Electronics 1 Teleco""$nication Engineering r! Ba+asahe+ A"+edkar Technological University0 2onere!
Page 19
t%o data areas0 the he- co""and +yte <) %ill +e $sed to signify that the display RA/ address ))h %ill +e chosen Port3 is $sed to f$rnish the co""and or data type0 and ports 9!( to 9!; f$rnish register select and readG%rite levels!
+5 v
VD
D
15
16
5 6
10 11 12 13 14
deter"ines if and %hich +$tton 0 %as p$shed or a preset ti"e has lapsed0 and $s$ally ill$"inates a light on the appropriate +$tton or control panel0 and so$nds a %arning in the for" of a contin$o$s or inter"ittent +$&&ing or +eeping so$nd! 'nitially this device %as +ased on an electro"echanical syste" %hich %as identical to an electric +ell %itho$t the "etal gong =%hich "akes the ringing noise?! Often these $nits %ere anchored to a %all or ceiling and $sed the ceiling or %all as a so$nding +oard! Another i"ple"entation %ith so"e A5,connected devices %as to i"ple"ent a circ$it to "ake the A5 c$rrent into a noise lo$d eno$gh to drive a lo$dspeaker and hook this circ$it $p to a cheap <,oh" speaker! Bo%adays0 it is "ore pop$lar to
epart"ent Of Electronics 1 Teleco""$nication Engineering r! Ba+asahe+ A"+edkar Technological University0 2onere!
Page 20
$se a cera"ic,+ased pie&oelectric so$nder like a Sonalert %hich "akes a high,pitched tone! Us$ally these %ere hooked $p to AdriverA circ$its %hich varied the pitch of the so$nd or p$lsed the so$nd on and off!
4.7.2 Circuit description: The ci c!i" i# $e#i%ne$ "o con" o& "he '!((e ) The '!((e *N +n$ *,, i# con" o&&e$ '"he .+i o/ #wi"chin% " +n#i#"o # 012 5473) The '!((e i# connec"e$ in "he 42 " +n#i#"o co&&ec"o "e 5in+&) 6hen hi%h .!&#e #i%n+& i# %iven "o '+#e o/ "he 41 " +n#i#"o #7 "he " +n#i#"o i# con$!c"in% +n$ c&o#e "he co&&ec"o +n$ e5i""e "e 5in+& #o (e o #i%n+&# i# %iven "o '+#e o/ "he 42 " +n#i#"o ) 8ence 42 " +n#i#"o +n$ '!((e i# "! ne$ *,, #"+"e) 6hen &ow .!&#e i# %iven "o '+#e o/ " +n#i#"o 41 " +n#i#"o 7 "he " +n#i#"o i# "! ne$ *,,) Now 12v i# %iven "o '+#e o/ 42 " +n#i#"o #o "he " +n#i#"o i# con$!c"in% +n$ '!((e i# ene %i(e$ +n$ . o$!ce# "he #o!n$ #i%n+&)
Page 21
Vo&"+%e / o5 92 o :2 1 0
T +n#i#"o *1 *N *,,
T +n#i#"o 42 *,, *N
T +n#i#"o *3 *,, *N
Page 22
6hen %orking %ith electronics0 yo$ al%ays need one +asic thingC Po%er! 'n every electronic circ$it po%er s$pply is re#$ired! The proper %orking of each and every co"ponent0 the e-act a"o$nt of voltage and c$rrent to +e s$pplied to it! 'f the po%er e-ceed its li"it0 it can +e fatal! Belo% is the circ$it diagra" of po%er s$pply %hich gives o$tp$t of LV0 as only that "$ch is re#$ired for "icrocontroller! 'ts circ$it diagra" and designing calc$lation are given +elo%!
The UL volt po%er s$pply is +ased on the co""ercial K<)L voltage reg$lator '5! This '5 contains all the circ$itry needed to accept any inp$t voltage fro" < to 3< volts and prod$ce a steady UL volt o$tp$t0 acc$rate to %ithin L* =)!(L volt?! 't also contains c$rrent,li"iting circ$itry and ther"al overload protection0 so that the '5 %onVt +e da"aged in case of e-cessive load c$rrentS it %ill red$ce its o$tp$t voltage instead! The advantage of a +ridge rectifier is yo$ donRt
epart"ent Of Electronics 1 Teleco""$nication Engineering r! Ba+asahe+ A"+edkar Technological University0 2onere!
Page 23
need a centre tap on the secondary of the transfor"er! A f$rther +$t significant advantage is that the ripple fre#$ency at the o$tp$t is t%ice the line fre#$ency=i!e! L).&? and "akes filtering so"e%hat easier! The $se of capacitor c30c(0c9 and c; is to "ake signal ripple free! The t%o capacitor $sed +efore the reg$lator is to "ake ac signal ripple free and then later %hich %e are $sing is for safety0 if incase there is a ripple left after reg$lating0 then c9 and c; %ill re"ove it! 5.1.1 Transformer #esign 6e re#$ire LV at the oGp of the reg$lator! The drop o$t voltage of the reg$lator is (V As per the data sheet? Vdc W LU( W KV
So at the reg$lator inp$t0 the voltage applied sho$ld +e of KV! According to the for"$la0 Vdc W (V"GPi Ass$"ing there is no ripple 5apacitor fro" V"W Vdc !piG( WK - 9!3;?G( W3)!@@V
Page 24
V"W 3)!@@V $ring one cycle 0 t%o diodes are cond$cting ! voltage of t%o diode W 3!;V Vi" W V"U 3!;V W3)!@@U3!;W 3(!9@V Vi"W3(!9@V Vr"s W Vi"Gs#rt=(? W 3(!9@Gs#rt=(? W <!K4V Vr"s W <!K4V So %e select transfor"er of @V! Si"ilarly '"W'dc - piG( '"W;))" - 9!3;G( W 4(<"A! 'r"sW '"Gs#rt=(? W 4(<"AGs#rt=(? W ;;;!)4"A 'r"s W ;;;!)4"A So %e select the transfor"er of c$rrent rating L))"A! 5onsidering the a+ove transfor"er rating! 6e take the transfor"er of ),@VGL))"A Transfor"er E ),@VGL))"A Stepdo%n transfor"er! 5.1.2 %ectifier #esign
epart"ent Of Electronics 1 Teleco""$nication Engineering r! Ba+asahe+ A"+edkar Technological University0 2onere!
rop o$t
Page 25
P'V of diode W V" W 3(!9@V '"W 4(<"A Bridge rectifier ,So0 %e select the +ridge '5 of 3A"pere rating! 5.1.3 &ilter 'apacitor #esign R W VdcG'dc W K G ;))" W 3K!LOh"s!
Vr W (=Vi" E Vdc? W (=3(!9@ E K? W 3)!K<V 5 W VdcG =:-R-Vr? W KG =3))-3K!L-3)!K<? W 9K3!)L$: So for Safe %orking %e select capacitor of 3)))$: 5 W 3)))$: G 9LV
epart"ent Of Electronics 1 Teleco""$nication Engineering r! Ba+asahe+ A"+edkar Technological University0 2onere!
Page 26
53W 3)))$:G9LV Electrolytic 5apacitor! 5(05; W )!3$: 5era"ic 5apacitor! 59 W (()$:G(LV Electrolytic 5apacitor! So the po%er s$pply "ade fro" the a+ove "entioned co"ponents gives the o$tp$t of 3&. :or "aster P5B %e are taking s$pply fro" USB! Thro$gh USB %e get LV0 L))"A s$pply! This is given to P'5 and 2/93K! Using 2/ 93K %e can get 9!9 V o$tp$ts %hich are given to R: "od$le! :or the slave side %e are $sing @V +attery! The o$tp$t of +attery is @V gives 9!9V o$tp$t %hich is given to R: "od$le! 5 is given to K<)L %hich is given to P'5 controller! The o$tp$t of K<)L is f$rther given to the 2/93K %hich
Page 27
"edi$" to high c$rrent loads and the $se of a heat sink is reco""ended to "a-i"i&e the lifespan and po%er,handling capa+ility! 2/99K is the negative voltage co"ple"ent to 2/93K and the specifications and f$nction are essentially identical0 e-cept that the reg$lator "$st receive a control voltage and act on an inp$t voltage that are +elo% the gro$nd reference point instead of a+ove it!
Vo$t range Vin , Vo$t difference Operation a"+ient te"perat$re O$tp$t '"a/ini"$" 2oad 5$rrent"a-
Page 28
CHAPTER 4 SO2T.ARE
P5B 2ayo$t , P5B design %ith easy to $se "an$al ro$ting tools and a$to ro$ter! Sche"atic , creates sche"atic and e-ports net list to P5B! 5O/ Edit , pattern editor!
epart"ent Of Electronics 1 Teleco""$nication Engineering r! Ba+asahe+ A"+edkar Technological University0 2onere!
Page 29
Sche"e Edit , co"ponent editor! ra% parts and attach patterns to the"!
ipTrace provides the follo%ing feat$resC "as to learn (ser interface ) To design a sche"atic0 si"ply select and place co"ponents onto yo$r doc$"ent and connect the" together $sing the %ire and +$s tools! /$ltisheet design is s$pported! Then select the "en$ option VS%itch to BoardV to convert the sche"atic to P5B! 2ayo$t can +e $pdated fro" Sche"atic in a fe% clicks at anyti"e! 6hen yo$ create or edit design o+jects they are highlighted to i"prove yo$r %ork! Step,+y,step t$torial availa+le fro" %e+,site g$ides yo$ thro$gh the design process and allo%s to get started %ith ease! "as to (se man(al an* powerf(l a(tomatic ro(ting ipTrace P5B soft%are incl$des an advanced a$to"atic ro$ter that is a+le to ro$te single, layer and "$lti,layer +oards! 't is availa+le %ith a Vrip,$p and retryV algorith"! A$to ro$ter achieves high co"pletion rates +y going +ack and re,ro$ting nets to "ake space for connections that co$ld not +e ro$ted on a previo$s pass! 'ntelligent "an$al ro$ting tools allo% yo$ to create and edit traces +y @)0 ;L degree or %itho$t any li"itations! Thro$gh0 +lind or +$ried vias can +e $sed in a$to"atic and "an$al ro$ting! Unli"ited +oard si&e is s$pported!
Page 30
so"e of the files re#$ired to r$n AVR St$dio "ay already +e present in the syste"! 'n order to install AVR St$dio $nder 6indo%s@L and 6indo%s BT ;!) '! ''! '''! 'V! 'nsert the diskette la+eled AVR St$dio iskette 3 in drive AC Press the Start +$tton on the Task+ar and select R$n Enter [ACSETUP\ in the Open field and press the OF +$tton :ollo% the instr$ctions in the Set$p progra"
'n order to install AVR St$dio $nder 6indo%s BT 9!L3 '! ''! '''! 'V! 'nsert the diskette la+eled AVR St$dio iskette 3 in drive AC Select R$n fro" the :ile "en$ Enter [ACSETUP\ in the 5o""and 2ine field and press the OF +$tton :ollo% the instr$ctions in the Set$p progra" Once AVR St$dio has +een installed0 it can +e started +y do$+le clicking the AVR St$dio icon! 'f an E"$lator is the desired e-ec$tion target0 re"e"+er to connect the AVR 'n, 5irc$it E"$lator +efore starting AVR St$dio! These are the steps %e are $sing for coding!
CHAPTER 5
epart"ent Of Electronics 1 Teleco""$nication Engineering r! Ba+asahe+ A"+edkar Technological University0 2onere!
Page 31
Page 32
ST"P 2
5lick on the [Be% Project\ +$tton! 6elco"e dialog Bo-
'n this t$torial %e %ill "ake a si"ple progra" that increases the val$e of one of the PORT registers0 "aking a +inary co$nter! To create a ne% project0 click on A5reate Be% ProjectA on the 6elco"e Screen or go to the AProjectA "en$ and select ABe%A! The dialog +o- sho%n in the ne-t fig$re appears! 'n the ne-t dialog +o-0 choose the At"el AVR Asse"+ler as the project typeC
epart"ent Of Electronics 1 Teleco""$nication Engineering r! Ba+asahe+ A"+edkar Technological University0 2onere!
Page 33
5hoose At"el AVR Asse"+ler Type in a project na"e and the initial file na"eC
Type Project and 'nitial file na"e 'n this dialog +o- yo$ sho$ld enter the project na"e! 6e choose the na"e led here0 +$t this co$ld of co$rse +e an ar+itrary na"e! Be-t yo$Vll have to select the project location! This is the location %here AVR St$dio %ill store all files associated %ith the project! 6e have $sed the location .CHco"p39))HpracsH as the folder! 'f the folder does not e-ist0 AVR St$dio %ill ask yo$ %hether to create it or not! Select AAt"el AVR Asse"+lerA as the project type! 5lick ABe-t QQA and yo$ %ill see a %indo% like the follo%ingC
Page 34
Select AAVR Si"$latorA as the de+$g platfor" and AAT/E7A34A as the device to $se0 then click A:inishA! The "ain AVR %indo% %ill no% look like thisC
6e can no% enter the Asse"+ly code of the progra"! =AVR St$dio has opened an editor %indo% called led!as"?! Alternatively yo$ can add or create other asse"+ly lang$age files +y right clicking on AAsse"+lerA in the 6orkspace %indo%C
Page 35
The led!as" file is a$to"atically "arked as AAsse"+ler Entry :ileA =the s"all red arro% on the icon ne-t to the filena"e sho%s this?! This indicates that the asse"+ler %ill start %ith this file %hen asse"+ling the project! The AAsse"+ler :ilesA gro$p can only contain one file "arked as an entry file!
ST"P 3
To assemble the code, we need to build the project. Select "Build" from the Project menu (or press <F !"#
Page 36
ST"P 4
At this point %e have generated the files needed to si"$late the code! To start r$nning the code0 select AStart e+$ggingA fro" the A e+$gA "en$C
ST"P 5
Bo% %e %ant the progra" to co$nt down instead of $p! To "ake this change %eVll have to edit the so$rce code! Place the c$rsor in the so$rce vie%0 and change the inc to a dec instr$ction! 'f yo$ no% press N:LQ =7o? the follo%ing dialog +o- %ill appear! This +o- indicates that one of the so$rce files has +een changed0 and that the project sho$ld +e re+$ilt! Press A]esA!
Page 37
ST"P $
Before e-iting AVR St$dio %e %ill save o$r project! AVR St$dio %ill re"e"+er %here the vie%s are placed and %ill $se this setting %hen opening the project later! To save the project select ASave ProjectA fro" the AProjectA "en$!
Page 38
Page 39
c void lcd_init=void? ` lcd_config=?S _delay_"s=9)?S lcd_ni++le=)-)90)?S lcd_en_tgl=?S _delay_"s=L?S lcd_en_tgl=?S _delay_$s=34)?S lcd_en_tgl=?S _delay_"s=L?S lcd_ni++le=)-)(0)?S _delay_$s=34)?S lcd_c"d=)-(<?S _delay_$s=34)?S lcd_c"d=)-3)?S _delay_$s=34)?S lcd_c"d=)-)4?S _delay_$s=34)?S GGentry "ode W incre"ent GGc$rsor "ove 1 shift left GGset ;,+it "ode and ( lines d L-K GG ena+le ; +it "ode GG %ait after po%er $p GG send )9h 9 ti"es to initiali&e
Page 40
lcd_c"d=)-)5?S _delay_$s=34)?S lcd_c"d=)-)3?S _delay_"s=(?S c void lcd_en_tgl =void? ` PORT aW=3NNEB?S PORT 1Wb=3NNEB?S c void lcd_c"d=$nsigned char letter? ` GG 5o""and :$nction GGThe RS is set to ) to signify this is a co""and $nsigned char te"pS te"pWletterS te"pWte"pQQ;S lcd_ni++le=te"p0)?S te"pWletterS te"pWte"p1)-):S lcd_ni++le=te"p0)?S _delay_$s=3)?S c void lcd_char=$nsigned char letter?
epart"ent Of Electronics 1 Teleco""$nication Engineering r! Ba+asahe+ A"+edkar Technological University0 2onere!
GGEna+le pin
GG te"p Varia+le GG"ove letter to te"p GGshift te"p to right +y ; GGsend o$t higher ni++le GG"ove letter to te"p GGsend o$t lo%er ni++le
Page 41
` GGT ata :$nction GGThe RS is set to 3 to signify this is a co""and $nsigned char te"pS te"pWletterS te"pWte"pQQ;S lcd_ni++le=te"p03?S te"pWletterS te"pWte"p1)-):S lcd_ni++le=te"p03?S _delay_$s=3)?S c void lcd_ni++le=$nsigned char ni+0$nsigned char reg_sel? ` if=reg_sel? PORT aW=3NNRS?S else PORT 1Wb=3NNRS?S ni+W=ni+NN;?S PORT5Wni+S _delay_$s=L?S lcd_en_tgl=?S R6_'B'T=?S %hile=+it_is_set=P'B50K??S lcd_config=?S c
epart"ent Of Electronics 1 Teleco""$nication Engineering r! Ba+asahe+ A"+edkar Technological University0 2onere!
GG te"p Varia+le GG"ove letter to te"p GGshift te"p to right +y ; GGsend o$t higher ni++le GG"ove letter to te"p GGsend o$t lo%er ni++le
GG Toggle E pin =defined in header file? GG+$sy check GGreconfig$re lcd iGo pins
Page 42
void lcd_clr_line=$nsigned char line? ` GG clear line co""and! char tlineS char -S if=lineWW3? tlineW)-<)S if=lineWW(? tlineW)-5)S lcd_c"d=tline?S _delay_$s=34)?S for=-W)-))S-N)-3;S-UU? ` tho 34 are vie%a+le? lcd_char=)-()?S _delay_$s=34)?S c lcd_c"d=tline?S _delay_$s=34)?S c void lcd_string=$nsigned char esenpoint0 $nsigned char line? ` if=lineWW3? lcd_c"d=line3?S if=lineWW(?
epart"ent Of Electronics 1 Teleco""$nication Engineering r! Ba+asahe+ A"+edkar Technological University0 2onere!
GG The line to clear varia+le GG loop varia+le GG Set the varia+le val$e +ased on line GG 3 W 2ine 3 GG ( W 2ine ( GG Send co""and to j$"p to +eggining of line =3G(?
Page 43
lcd_c"d=line(?S %hile=esenpoint fW VH)V? ` lcd_char=esenpoint?S senpointUUS c c lcd_position_char=$nsigned char esenpoint0$nsigned char line0$nsigned char position? ` $nsigned char posS posWpositionS lcd_c"d=)-)9?S position if=lineWW3? lcd_c"d=line3?S if=lineWW(? lcd_c"d=line(?S %hile=posfW)? and last position is 3L ` lcd_c"d=)-3;?S pos,,S c %hile=esenpointfWVH)V? ` lcd_char=esenpoint?S senpointUUS c c
epart"ent Of Electronics 1 Teleco""$nication Engineering r! Ba+asahe+ A"+edkar Technological University0 2onere!
GG 6hile %e havent seen a H) =esc? go on GG Send 3st char to o$r char f$nction GG Send ne-t
GGret$rn
c$rsor
to
ho"e
GG"ove to right
Page 44
^endif
^define :_5PU 3))))))U2 void inco"ing=void?S void o$tgoing=void?S static $nsigned char +$fferX34YS $nsigned char co$ntW)0hiW)0+iW)S int "ain =void? ` RA aW )-f)S PORTA W )-))S lcd_init =?S lcd_clr_line =3?S lcd_clr_line =(?S lcd_string =AAccident Prevention A03?S lcd_string =A Using A0(?S _delay_"s =()))?S
epart"ent Of Electronics 1 Teleco""$nication Engineering r! Ba+asahe+ A"+edkar Technological University0 2onere!
Page 45
lcd_clr_line =3?S lcd_clr_line =(?S lcd_string =A Eye Blink Sensor _delay_"s =()))?S %hile =3? ` lcd_clr_line =3?S lcd_clr_line =(?S lcd_string =A Eye Blink Sensor A03?S lcd_string =A /onitoring if=+it_is_clear=P'BA0)?? ` lcd_string =A:irst 6arning lcd_string =A Scan _delay_"s=9)))?S if=+it_is_clear=P'BA0)?? ` %hile=3? ` lcd_string =A 6arning A03?S lcd_string =A Sleepy State A0(?S PORTA aW=3NN;?S c c c c ret$rn )S
epart"ent Of Electronics 1 Teleco""$nication Engineering r! Ba+asahe+ A"+edkar Technological University0 2onere!
A03?S
A0(?S
A03?S
A0(?S
Page 46
CHAPTER 6 CONCLUSION
The further development of the visual driver monitoring system will be the improvement of the operating speed. Another idea is to include a separating part which will reduce the amount of processed data. Because our main measures are located to the eye regions we can train a classi_er directly for eye detection. The used face detection classi_er is trained for faces looking straight forward into the camera so our experimental results can be improved if we use a classi_er which is trained for pro_le images from faces. Another possible expansion could be the use of a stereo camera system, the Open ! library from "ntel and the #irect$how platform from %icrosoft are pre& pared for the use of two cameras. Our night vision experiments are at the beginning and we achieved auspicious results.
Page 47
RE2ERANCES
3! I$n /i$ra0 /otok$ni 'toh and ]oshiaki Shirai0 [To%ard Vision,Based 'ntelligent BavigatorC 'ts 5oncept and Prototype0\ 'EEE Transactions on 'ntelligent Transportation Syste"s0 vol! 90 no!(0 pp! 394,3;40 I$ne! ())(! (! I! 2y&nicki0 et al! [Sleepiness0 riving0 and /otor vehicle 5rashes0\ IA/A0 vol! (K@0 no! (90 3@@<0 pp 3@)<,3@39! 9! /! Berto&&i et al! [Stereo Vision,Based Vehicle etection0\ Proceedings of 'ntelligent Vehicles Sy"posi$"0 ear+orn0 /'0 ()))0 pp! 9@,;;! ;! .! I$la0 E! B! Fos"atopo$los0 and P! A! 'oanno$0 [5ollision Avoidance Analysis for 2ane 5hanging and /erging0\ 'EEE Transactions on Vehic$lar Technolog0 Vol! ;@0 Bo! 40 pp ((@L,(9)<0 Bov! ()))
Page 48