Escolar Documentos
Profissional Documentos
Cultura Documentos
CHAPTER 1 INTRODUCTION
also studied ho) to interface loads )ith (I! microcontroller, 2elays and 2elay Drivers. visited sites ho) stuff )or-s.com, ))).Microchip.com, ))).)i-ipedia.com. 1.4 SCOPE OF WORK
The project3 INDUSTRIAL AUTOMATION USING I2C PROTOCOL is used in scheduling the process of industrial machines and +y doing this the automation or automatic control over the loads )ere achieved.
its e8istence and functions as a )hole through the interaction of its parts. 9.g. :ody, Man-ind, system is a part of the )orld that a person or group of persons during some time interval and for some purpose choose to regard as a )hole, consisting of interrelated components, each component characteri;ed +y properties that are selected as +eing relevant to the purpose. 9m+edded 'ystem is a com+ination of hard)are and soft)are used to achieve a single specific tas-. 9m+edded systems are computer systems that monitor, respond to, or control an e8ternal environment. 9nvironment connected to systems through sensors, actuators and other I%# interfaces. 9m+edded system must meet timing < other constraints imposed on it +y environment. n em+edded system is a microcontroller7+ased, soft)are driven, relia+le, real7time control system, autonomous, or human or net)or- interactive, operating on diverse physical varia+les and in diverse environments and sold into a competitive and cost conscious mar-et.
FIGS 2.1 BLOCK DIAGRAM OF EMBEDDED SYSTEM CLASSIFICATION 2eal Time 'ystems. 2T' is one )hich has to respond to events )ithin a specified deadline. right ans)er after the dead line is a )rong ans)er
RTS CLASSIFICATION "ard 2eal Time 'ystems 'oft 2eal Time 'ystem
HARD REAL TIME SYSTEM B"ardB real7time systems have very narro) response time. 98ampleC $uclear po)er system, !ardiac pacema-er.
MPLAB FEATURES M(L : Integrated Development 9nvironment ?ID9@ is a free, integrated toolset for the development of em+edded applications employing MicrochipHs (I!I and ds(I!I microcontrollers. M(L : Integrated Development 9nvironment ?ID9@ is a free, integrated toolset for the development of em+edded applications employing MicrochipHs (I!I and ds(I!I microcontrollers. M(L : ID9 runs as a 4,7+it application on M' 1indo)sI, is easy to use and includes a host of free soft)are components for fast application development and super7charged de+ugging. M(L : ID9 also serves as a single, unified graphical user interface for additional Microchip and third party soft)are and hard)are development tools. Moving +et)een tools is a snap, and upgrading from the free soft)are simulator to hard)are de+ug and programming tools is done in a flash +ecause M(L : ID9 has the same user interface for all tools. M(L : ID9Js 'IM, high speed soft)are simulator for (I! and ds(I! ?Digital 'ignal (rocessing (I! Microcontroller@ devices )ith peripheral simulation, comple8 stimulus injection and register logging 2.2.2 INTRODUCTION TO RELAYS
and uses only the follo)ing t)o signals to serially e8change data )ith another deviceC 'D 7 This signal is -no)n as 'erial Data. ny data sent from one device to another goes on this line. '!L 7 This is the 'erial !loc- signal. It is generated +y the master device and controls )hen data is sent and )hen it is read. s mentioned earlier, the signal can +e forced lo) so that no cloc- can occur. This is done +y a device that has +ecome too +usy to accept more data. I,! lines can have only t)o possi+le electrical states. These states are -no)n as float high3 and drive lo)3. I,! )or-s +y having a pull7up resistor on the line and only devices pull the line lo). If no device is pulling on the line, it )ill float high3. This is )hy pull7up resistors are important in I,!. If no pull7up resistor )ere used, the line )ould float to an un-no)n state. If one tried to drive the line high, it might cause contention )ith a device trying to drive the line lo). This contention could damage the either or +oth devices driving the line. To prevent this, the pull7up7drive lo) system controls )hen one device has control of the +us. If another device tried to use the +us )hen it )as +usy, it )ould find the +us to +e driven lo) already and -no) it )as +usy. 9ven if it tried to use the +us accidentally, it )ould only drive it lo) and not damage other devices. LetJs no) discuss the data transfer element. The data +loc- represents the transfer of / +its of information. The data is sent on the 'D line and '!L produces a cloc-. The cloc- can +e aligned )ith the data to is only considered valid )hen '!L is indicate )hether each +it is a 13 or a 63. Data on 'D
16
11
1,
3.1.1 INTRODUCTION TO MICROCONTROLLER computer7on7a7chip is a variation of a microprocessor )hich com+ines the processor core ?!(*@, some memory, and I%# ?input%output@ lines, all on one chip. The computer7on7a7chip is called the microcomputer )hose proper meaning is a computer using a ?num+er of@ microprocessor?s@ as its !(*s, )hile the concept of the microcomputer is -no)n to +e a microcontroller. microcontroller can +e vie)ed as a set of digital logic circuits integrated on a single silicon chip. This chip is used for only specific applications. Most microcontrollers do not reDuire a su+stantial amount of time to learn ho) to efficiently program them, although many of them, )hich have Duir-s, )hich you )ill have to understand +efore you, attempt to develop your first application. long )ith microcontrollers getting faster, smaller and more po)er efficient they are also getting more and more features. #ften, the first version of microcontroller )ill just have memory and digital I%#, +ut as the device family matures, more and more pat num+ers )ith varying features )ill +e availa+le. In this project )e used (I! 1.f/00 microcontroller. &or most applications, )e )ill +e
a+le to find a device )ithin the family that meets our specifications )ith a minimum of e8ternal devices, or an e8ternal +ut )hich )ill ma-e attaching e8ternal devices easier, +oth in terms of )iring and programming. 3.1.2 MICRO CONTROLLER CORE FEATURES "igh7performance 2I'! !(*. #nly 4A single )ord instructions to learn. ll single cycle instructions e8cept for program +ranches )hich are t)o cycle. #perating speedC D! 7 ,6 M"; cloc- input D! 7 ,66 ns instruction cycle. *p to /K 8 15 )ords of &L '" (rogram Memory, *p to 4./ 8 / +ytes of Data Memory ?2 M@ *p to ,A. 8 / +ytes of 99(2#M data memory. (in out compati+le to the (I!1.!04:%05:%0.%00 Interrupt capa+ility ?up to 15 sources@ 9ight level deep hard)are stac-
14
3.1.3 ADVANTAGES OF USING A MICROCONTROLLER OVER MICROPROCESSOR A !"#$%&"' ($)) *#" + M$,'-,-&.'-))"' . >ather input from various sensors (rocess this input into a set of actions *se the output mechanisms on the Microcontroller to do something useful 2 M and 2#M are in+uilt in the M!. !heap compared to M(. Multi machine control is possi+le simultaneously.
15
3.2 PIC MICROCONTROLLER 1/F011A 3.2.1 INTRODUCTION TO PIC MICROCONTROLLER 1/F011A The (I! 1.f/00 microcontroller is a 567pin I!. The first pin of the controller is M!L2 tan- circuit consists of a 5 M"P
pin and the AN dc supply is given to this pin through 16KO resistor. This supply is also given to 11th pin directly. The 1,th pin of the controller is grounded. crystal oscillator and t)o ,,pf capacitors is connected to 14 th and 15th pins of the (I!. 3.2.2 FEATURES OF PIC MICROCONTROLLER 1/F011A #perating freDuencyC D!7,6Mh;. &lash program memory ?15 +it )ords@C/K Data memory ?in +ytes@C 4./ 99(2#M Data memory ?in +ytes@C,A. InterruptsC 1A I%o portsC , :, !, D, 9 TimersC 4 nalog comparatorsC , InstructionsC 4A
1A
1.
FIG 3.2 PIN DIAGRAM OF PIC 1/F014A2011A 3.3 POWER SUPPLY UNIT
CIRCUIT DIAGRAM
10
FIG 3.3 POWER SUPPLY UNIT POWER SUPPLY UNIT COSISTS OF FOLLOWING UNITS 1@ 'tep do)n transformer ,@ 2ectifier unit 4@ Input filter 5@ 2egulator unit A@ #utput filter 3.3.1 STEP DOWN TRANSFORMER The 'tep do)n Transformer is used to step do)n the main supply voltage from ,46N ! to lo)er value. This ,46 ! voltage cannot +e used directly, thus it is stepped do)n. The Transformer consists of primary and secondary coils. To reduce or step do)n the voltage, the transformer is designed to contain less num+er of turns in its secondary core. The output from the secondary coil is also ! )aveform. Thus the conversion from ! to D! is essential. This conversion is achieved +y using the 2ectifier !ircuit%*nit. S."3 !-(& .'+-'5"'# can step do)n incoming voltage, )hich ena+les you to have the correct voltage input for your electrical needs. &or e8ample, if our eDuipment has +een specified for input voltage of 1, volts, and the main po)er supply is ,46 volts, )e )ill need a step down transformer, )hich decreases the incoming electrical voltage to +e compati+le )ith your 1, volt eDuipment. 3.3.2 RECTIFIER UNIT The 2ectifier circuit is used to convert the ! voltage into its corresponding D! voltage. There are "alf71ave, &ull71ave and +ridge 2ectifiers availa+le for this specific function. The
1/
full7)ave rectification. This is a )idely used configuration, +oth )ith individual diodes )ired as sho)n and )ith single component +ridges )here the diode +ridge is )ired internally.
!$-!" 6'$!%" or 6'$!%" '",.$4$"' is an arrangement of four diodes in a +ridge configuration that provides the same polarity of output voltage for either polarity of input voltage. 1hen used in its most common application, for conversion of alternating current ? !@ input into direct current ?D!@ output, it is -no)n as a +ridge rectifier. rectification from a t)o7)ire center7tapped transformer design. The &or)ard :ias is achieved +y connecting the diodeJs positive )ith positive of the +attery and negative )ith +atteryJs negative. The efficient circuit used is the &ull )ave :ridge rectifier circuit. The output voltage of the rectifier is in rippled form, the ripples from the o+tained D! voltage are removed using other circuits availa+le. The circuit used for removing the ripples is called &ilter circuit. 3.3.3 INPUT FILTER !apacitors are used as filter. The ripples from the D! voltage are removed and pure D! voltage is o+tained. nd also these capacitors are used to reduce the harmonics of the input voltage. The primary action performed +y capacitor is charging and discharging. It charges in positive half cycle of the ! voltage and it )ill discharge in negative half cycle. 'o it allo)s only ! voltage and does not allo) the D! voltage. The 1666Qf capacitor serves as a BreservoirB +ridge rectifier provides full7)ave ! input, resulting in lo)er cost and )eight as compared to a
1L
#ne simple electrical circuit that )ill serve as a lo)7pass filter consists of a resistor in series )ith a load, and a capacitor in parallel )ith the load. The capacitor e8hi+its reactance, and +loc-s lo)7freDuency signals, causing them to go through the load instead. t higher freDuencies the reactance drops, and the capacitor effectively functions as a short circuit. The com+ination of resistance and capacitance gives you the time constant of the filter R S RC ?represented +y the >ree- letter tau@. The +rea- freDuency, also called the turnover freDuency or cutoff freDuency ?in hert;@, is determined +y the time constantC or eDuivalently ?in radians per second@C #ne )ay to understand this circuit is to focus on the time the capacitor ta-es to charge. It ta-es time to charge or discharge the capacitor through that resistorC t lo) freDuencies, there is plenty of time for the capacitor to charge up to
practically the same voltage as the input voltage. t high freDuencies, the capacitor only has time to charge up a small amount
+efore the input s)itches direction. The output goes up and do)n only a small fraction of the amount the input goes up and do)n. t dou+le the freDuency, thereHs only time for it to charge up half the amount.
,6
FIG 3.4 1078 REGULATOR 2egulator regulates the output voltage to +e al)ays constant. The output voltage is maintained irrespective of the fluctuations in the input ! voltage. s and then the ! voltage changes, the D! voltage also changes. Thus to avoid this 2egulators are used. lso )hen the
internal resistance of the po)er supply is greater than 46 ohms, the output gets affected. Thus this can +e successfully reduced here. Mean)hile it also contains current7limiting circuitry and thermal overload protection, so that the I! )onHt +e damaged in case of e8cessive load current; it )ill reduce its output voltage instead. The regulators are mainly classified for lo) voltage and for high voltage. &urther they can also +e classified asC 1@ (ositive regulator Input pin >round pin #utput pin
It regulates the positive voltage. ,@ $egative regulator >round pin Input pin #utput pin
,1
The 0/1, fi8ed voltage regulator is a monolithic integrated circuit in a T#,,6 type pac-age designed for use in a )ide variety of applications including local, on+oard regulation. This regulator employs internal current limiting, thermal shutdo)n, and safe area compensation.
1ith adeDuate heat7sin-ing it can deliver output currents in e8cess of 1.6 ampere. lthough designed primarily as a fi8ed voltage regulator, this device can +e used )ith e8ternal components to o+tain adjusta+le voltages and currents.
3.3.8 OUTPUT FILTER The &ilter circuit is often fi8ed after the 2egulator circuit. !apacitor is most often used as filter. The principle of the capacitor is to charge and discharge. It charges during the positive half cycle of the ! voltage and discharges during the negative half cycle. The 16Qf and .61Qf capacitors serve to help -eep the po)er supply output voltage constant )hen load conditions change. The electrolytic capacitor smoothJs out any long7term or lo) freDuency variations. "o)ever, at high freDuencies this capacitor is not very efficient. Therefore, the .61Qf is included to +ypass high7freDuency changes, such as digital I! s)itching effects, to ground. 3.4 LCD DISPLAY LiDuid crystal display ?L!D@ has material )hich com+ines the properties of +oth liDuid and crystals. They have a temperature range )ithin )hich the molecules are almost as mo+ile as they )ould +e in a liDuid, +ut are grouped together in an order form similar to a crystal. LCD DISPLAY:
,,
More microcontroller devices are using Hsmart L!DH displays to output visual information. The follo)ing discussion covers the connection of a "itachi L!D display to a (I! microcontroller. L!D displays designed around "itachiHs L!D "D550/6 module, are ine8pensive, easy to use, and it is even possi+le to produce a readout using the / 8 /6 pi8els of the display. "itachi L!D displays have a standard '!II set of characters plus Gapanese, >ree- and mathematical sym+ols. &or an /7+it data +us, the display reDuires a FAN supply plus 11 I%# lines. &or a 57+it data +us it only reDuires the supply lines plus seven e8tra lines. 1hen the L!D display is not ena+led, data lines are tri7state )hich means they are in a state of high impedance ?as though they are disconnected@ and this means they do not interfere )ith the operation of the microcontroller )hen the display is not +eing addressed. The L!D also reDuires 4 BcontrolB lines from the microcontroller. 9na+le ?9@ This line allo)s access to the display through 2%1 and 2' lines. 1hen this line is lo), the L!D is disa+led and ignores signals from 2%1 and 2'. 1hen ?9@ line is high, the L!D chec-s the state of the t)o control lines and responds accordingly. 2ead%1rite ?2%1@ This line determines the direction of data +et)een the L!D and microcontroller. 1hen it is lo), data is )ritten to the L!D. 1hen it is high, data is read from the L!D. 2egister select ?2'@ 1ith the help of this line, the L!D interprets the type of data on data lines. 1hen it is lo), an instruction is +eing )ritten to the L!D. 1hen it is high, a character is +eing )ritten to the L!D. L-%$, 9 2%1 6 1 6 #.+.*# ccess ccess 1riting -& to to data ,-&.'-) L!D L!D to )$&"#C disa+led ena+led L!D
,4
2ead data from data lines ?if it is reading@. 2eading data from the L!D is done in the same )ay, +ut control line 2%1 has to +e high. 1hen )e send a high to the L!D, it )ill reset and )ait for instructions. Typical instructions sent to L!D display after a reset areC turning on a display, turning on a cursor and )riting characters from left to right. 1hen the L!D is initiali;ed, it is ready to continue receiving data or instructions. If it receives a character, it )ill )rite it on the display and move the cursor one space to the right. The !ursor mar-s the ne8t location )here a character )ill +e )ritten. 1hen )e )ant to )rite a string of characters, first )e need to set up the starting address, and then send one character at a time. !haracters that can +e sho)n on the display are stored in data display ?DD@ 2 M. The si;e of DD2 M is /6 +ytes. The L!D display also possesses .5 +ytes of !haracter7>enerator ?!>@ 2 M. This memory is used for characters defined +y the user. Data in !> 2 M is represented as an /7+it character +it7 map. 9ach character ta-es up / +ytes of !> 2 M, so the total num+er of characters, )hich the user can define, is eight. In order to read in the character +it7map to the L!D display, )e must first set the !> 2 M address to starting point ?usually 6@, and then )rite data to the display. The definition of a HspecialH character is given in the picture. :efore )e access DD 2 M after defining a special character, the program must set the DD 2 M address. 1riting and reading data from any L!D memory is done from the last address )hich )as set up using set7address instruction. #nce the address of DD 2 M is set, a ne) )ritten
,5
,A
10k
1N 4007 1N 4007
V IN GND
VOUT
P% %6f877&
230v
1N 4007 1N 4007
1000uf
LM 7805 3
P O T +5v
1
1 0 3
5v
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
7812
3
+12v OUTPUT
+5v
o o o o o
display &ontC A 8 / dots :uilt7in !ontrollerC"D550/6 or !omp Input DataC5 :its or /7:its Interface (o)er 'upplyC F5N 'ingle (o)er Duty !ycleC 1%1. Duty
,.
,0
FIG 3.8 PIN CONNECTIONS OF A RELAY 3.8.3 RELAYS relay is usually an electromechanical device that is actuated +y an electrical current. The current flo)ing in one circuit causes the opening or closing of another circuit. 2elays are li-e remote control s)itches and are used in many applications +ecause of their relative simplicity, long life, and proven high relia+ility. 2elays are used in a )ide variety of applications throughout industry, such as in telephone e8changes, digital computers and automation systems. "ighly sophisticated relays are utili;ed to protect electric po)er systems against trou+le and po)er +lac-outs as )ell as to regulate and control the generation and distri+ution of po)er. In the home, relays are used in refrigerators, )ashing machines and dish)ashers, and heating and air7 conditioning controls. lthough relays are generally associated )ith electrical circuitry, there are many other types, such as pneumatic and hydraulic. Input may +e electrical and output directly mechanical, or vice versa. ll relays contain a sensing unit, the electric coil, )hich is po)ered +y ! or D!
current. 1hen the applied current or voltage e8ceeds a threshold value, the coil activates the armature, )hich operates either to close the open contacts or to open the closed contacts. 1hen a po)er is supplied to the coil, it generates a magnetic force that actuates the s)itch mechanism. The magnetic force is, in effect, relaying the action from one circuit to another. The first circuit is called the control circuit; the second is called the load circuit.
,/
po)er3 load, such as a compressor Limit !ontrolC 98ampleC Motor 'peed !ontrol, used to disconnect a motor if it runs slo)er or faster than the desired speed L-%$, O3"'+.$-&C 98ampleC Test 9Duipment, used to connect the instrument to a num+er of testing points on the device under test. 3.8.4 ELECTROMECHANICAL RELAYS In our project )e )ill +e using an electromechanical relay, )hich )ill +e a A pin relay and the )or-ing of the relay )ill +e li-e as. The general7purpose relay is rated +y the amount of current its s)itch contacts can handle. Most versions of the general7purpose relay have one to eight poles and can +e single or dou+le thro). These are found in computers, copy machines, and other consumer electronic eDuipment and appliances.
FIG 3./ MECHANICAL RELAY 3.8.4.1 INTERNAL OPERATION OF MECHANICAL RELAYS S.+&!+'!C 'ingle 'ide 'ta+le )ith any of the follo)ing three different methods for closing contactsC 1. F)"9*'" T:3"C The armature actuates the contact spring directly, and the contact is driven into a stationary contact, closing the circuit. ,. L$4.--44 T:3"C The movea+le piece is energi;ed +y the armature, and the contact closes
,L
definite polarity ?F or 7@ is
reDuired +y the relay coil. The latching option ma-es a polari;ed relay dual7)inding, meaning it
3.8.8.4 AC OR DC
46
U U U U U U U U U U U
!ali+rated directly in V !elsius ?!entigrade@ Linear F 16.6 mN%V! scale factor 6.AV! accuracy guaranteea+le ?at F,AV!@ 2ated for full 7AAV to F1A6V! range 'uita+le for remote applications Lo) cost due to )afer7level trimming #perates from 5 to 46 volts Less than .6 Q current drain Lo) self7heating, 6.6/V! in still air $onlinearity only WXV! typical Lo) impedance output, 6.1 #hm for 1 m load
The LM4A series are precision integrated7circuit temperature sensors, )hose output voltage is linearly proportional to the !elsius ?!entigrade@ temperature. More...
( 2 M9T2I! T :L9C Temperature ccuracy ?F%7@ 'upply Min Yuiescent !urrentZ Temperature Min 1, 6.A deg ! 5 Nolt A. u 756, 6, 7AA deg !
41
G"&"'+) D"#,'$3.$-& The LM4A series are precision integrated7circuit temperature sensors, )hose output voltage is linearly proportional to the !elsius ?!entigrade@ temperature. The LM4A thus has an advantage over linear temperature sensors cali+rated in V Kelvin, as the user is not reDuired to su+tract a large constant voltage from its output to o+tain convenient !entigrade scaling. The LM4A does not reDuire any e8ternal cali+ration or trimming to provide typical accuracies of WXV! at room temperature and W[V! over a full 7AA to F1A6V! temperature range. Lo) cost is assured +y trimming and cali+ration at the )afer level. The LM4AHs lo) output impedance, linear output, and precise inherent cali+ration ma-e interfacing to readout or control circuitry especially easy. It can +e used )ith single po)er supplies, or )ith plus and minus supplies. s it dra)s only .6 Q from its supply, it has very lo) self7heating, less than 6.1V! in still air. The LM4A is rated to operate over a 7AAV to F1A6V! temperature range, )hile the LM4A! is rated for a 756V to F116V! range ?7 16V )ith improved accuracy@. The LM4A series is availa+le pac-aged in hermetic T#75. transistor pac-ages, )hile the LM4A!, LM4A! , and LM4AD are also availa+le in the plastic T#7L, transistor pac-age. The LM4AD is also availa+le in an /7lead surface mount small outline pac-age and a plastic T#7,,6 pac-age.
4,
44
LCD display
Keypad
I2C Protocol
I2C Protocol
Temperature sensor
Driver Unit
Driver Unit
Load or Equipment
Fan
Light
45
4A
+5v
+5v
+5v
+5v
+5v %0 T0&*'"%TT(0
+5v %0 T0&*'"%TT(0
,4
,3
,2
,1 +5v +5v
4"#$
22pf
22pf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21
UL* 2003
L"135 +5v
+5v
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21
P% 16+877&
P% 16+877&
P% 16+877&
+5v
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21
1 2 3 4 5 6 7 8
16 15 14 13 12 11 10 9 +12v
+&* * *O
L%2#T * *O
U3 V IN GND VOUT
+5v +5v
1000-f +
LM 7805 3
TR AN S FO R M E R
U4 V IN GND VOUT
L" 7812
3
+12v OUTPUT
1 2 3 4 5 6 7 8
16 15 14 13 12 11 10 9 +12v
LO&! * *O
1 0 3 POT +5v 1 2 3 4 5 6 7
8 9 10 11 12 13 14 15 16
UL* 2003
+5v
4.
FIG 4.3 POWER SUPPLY DIAGRAM 4.8 CIRCUIT DESCRIPTION 4.8.1 POWER SUPPLY (o)er supply unit consists of 'tep do)n transformer, 2ectifier, Input filter, 2egulator unit, #utput filter. The 'tep do)n Transformer is used to step do)n the main supply voltage from ,46N ! to lo)er value. This ,46 ! voltage cannot +e used directly, thus it is stepped do)n. The Transformer consists of primary and secondary coils. To reduce or step do)n the voltage, the transformer is designed to contain less num+er of turns in its secondary core. The output from the secondary coil is also ! )aveform. Thus the conversion from ! to D! is essential. This conversion is achieved +y using the 2ectifier !ircuit%*nit. The 2ectifier circuit is used to convert the ! voltage into its corresponding D!
voltage. There are "alf71ave, &ull71ave and +ridge 2ectifiers availa+le for this specific function. The most important and simple device used in 2ectifier circuit is the diode. The simple function of the diode is to conduct )hen for)ard +iased and not to conduct in reverse +ias. The &or)ard :ias is achieved +y connecting the diodeJs positive )ith positive of the +attery and negative )ith +atteryJs negative. The efficient circuit used is the &ull )ave :ridge rectifier circuit. The output voltage of the rectifier is in rippled form, the ripples from the o+tained D! voltage are removed using other circuits availa+le. The circuit used for removing the ripples is called &ilter circuit.
40
internal resistance of the po)er supply is greater than 46 ohms, the output gets affected. Thus this can +e successfully reduced here. The regulators are mainly classified for lo) voltage and for high voltage. "ere )e used 0/6A positive regulator. It reduces the .N dc voltage to AN dc Noltage. The &ilter circuit is often fi8ed after the 2egulator circuit. !apacitor is most often used as filter. The principle of the capacitor is to charge and discharge. It charges during the positive half cycle of the ! voltage and discharges during the negative half cycle. 'o it allo)s only ! voltage and does not allo) the D! voltage. This filter is fi8ed after the 2egulator circuit to filter any of the possi+ly found ripples in the output received finally. "ere )e used 6.1Q& capacitor. The output at this stage is AN and is given to the Microcontroller In the po)er supply circuit t)o regulators are used. 0/6A regulator is used to produce positive AN dc and 0/1, regulator produces positive 1,N dc voltage. 2elays and *L$ ,664 drivers operates at 1,N dc and microcontroller and sensors are operated at AN dc voltage. The output of the 0/6A regulator is connected to (I! 1.f/00 microcontroller, sensors and the output of the 0/1, regulator is connected to driver I!s and relays. 4.8.2 CONTROLLER CIRCUIT The (I! 1.f/00 microcontroller is a 567pin I!. The first pin of the controller is M!L2 pin and the AN dc supply is given to this pin through 16KO resistor. This supply is also given to 11th pin directly. The 1,th pin of the controller is grounded. tan- circuit consists of a 5 M"P crystal oscillator and t)o ,,pf capacitors are connected to 14 th and 15th pins of the (I!. The circuit consist one driver I! *L$ ,664 is acts as voltage driver. It is a 1.7 pin I!. This is of $($ transistor type. nd this I! is a com+ination of 0 transistors. t a time )e can
4/
4L
56
SOFTWARE RE<UIREMENTS 8.1 SOFTWARE TOOLS M(L : (rotel (ropic "I7Tech (I! ! !ompiler
8.2 MPLAB INTEGRATION M(L : Integrated Development 9nvironment ?ID9@ is a free, integrated toolset for the development of em+edded applications employing MicrochipHs (I! micro and ds(I! microcontrollers. M(L : ID9 runs as a 4,7+it application on M' 1indo)s, is easy to use and includes a host of free soft)are components for fast application development and super7charged de+ugging. M(L : ID9 also serves as a single, unified graphical user interface for additional Microchip and third party soft)are and hard)are development tools. Moving +et)een tools is a snap, and upgrading from the free simulator to M(L : I!D , or the M(L : I!9 emulator is done in a flash +ecause M(L : ID9 has the same user interface for all tools. !hoose M(L : !1/, the highly optimi;ed compiler for the (I!1/ series microcontrollers, or try the ne)est MicrochipHs language tools compiler, M(L : !46, targeted at the high performance (I!,5 and ds(I! digital signal controllers. #r, use one of the many products from third party language tools vendors. They integrate into M(L : ID9 to function transparently from the M(L : project manager, editor and compiler. 8.3INTRODUCTION TO EMBEDDED =C>: E9: H$.", ? ,@ K"$) ? , "I7T9!" 'oft)are ma-es industrial7strength soft)are development tools and ! compilers that help soft)are developers )rite compact, efficient em+edded processor code. &or over t)o decades "I7T9!" 'oft)are has delivered the industryHs most relia+le em+edded soft)are development tools and compilers for )riting efficient and compact code to run on the most popular em+edded processors. *sed +y tens of thousands of customers including
51
5,
54
9rror Messages There are t)o parts of compilation. The analysis part +rea-s up the source program into constant piece and creates an intermediate representation of the source program. The synthesis part constructs the desired target program from the intermediate representation. 8./.8 COUSINS OF THE COMPILER ARE 1. (reprocessor. ,. ssem+ler.
4. Loader and Lin-7editor. naive approach to that front end might run the phases serially. 1. Le8ical analy;er ta-es the source program as an input and produces a long string of to-ens. ,. 'ynta8 naly;er ta-es an out of le8ical analy;er and produces a large tree. 'emantic analy;er ta-es the output of synta8 analy;er and produces another tree. 'imilarly, intermediate code generator ta-es a tree as an input produced +y semantic analy;er and produces intermediate code 8././ PHASES OF COMPILER The compiler has a num+er of phases plus sym+ol ta+le manager and an error handler.
55
'ource
naly;er ^ 'ynta8 naly;er ^ 'ym+ol Ta+le Manager ^ Intermediate !ode >enerator ^ !ode #ptimi;er ^ !ode >enerator ^ #ut (rogram FABRICATION DETAILS The fa+rication of one demonstration unit is carried out in the follo)ing seDuence. &inali;ing the total circuit diagram, listing out the components and sources of procurement. (rocuring the components, testing the components and screening the components. Target 'emantic naly;er 9rror "andler
5A
5.
CHAPTER-/ RESULTS
RESULT
50
5/
CHAPTER-1 CONCLUSION
5L
A6
CHAPTER-0 BIBLIOGRAPHY
BIBLIOGRAPHY BOOKS !ustomi;ing and programming ur pic microcontroller7 M:B" P'"!,B!omplete guide to pic microcontroller 7"-6--B
A1
A,
A4
A5
AA
A.