DEPTT. OF ELECTRONICS & COMMUNICATION ENGINEERING DOABA WOMEN INSTITUTE OF ENGINEERING & TECHNOLOGY KHARAR 2008-2012
Candidates Declaration
We hereby declare that the major project which is presented in this report entitled Passive Keyless Lock submitted in the partial fulfillment of the requirements for the award of the degree of Bachelor of Technology in ECE to the PTU, Jalandhar, is an authentic record of our own work carried out at DWIET campus. The material embodied in this project work has not been submitted to any other university or institute for the award of any degree. PRITIKA BHATT RAJWANT KAUR SHEENU RANA SUKHMANI BAJWA Place: Date:
This is to certify that above statement made by the candidate(s) is correct to the best of my knowledge. Guided by: Er. Pardeep Kaur Er. Priya Department of ECE Approved by: HOD (ECE) DWIET
Acknowledgement
Technology is like an ocean & engineer is like a pearl driver in search of a treasure beneath the sea. Today technology is very vast and there is no end of technical studies. We are submitting our report on the project entitled Passive Keyless Lock. We are very thankful to all the persons who with their views and participation helped us to carry this project and report successfully. It is with pleasure that we find ourselves penning down these lines to express my sincere thanks to various people to help me along the way in completing the project. With deep sense of gratitude, we express our sincere thanks to Ms. Pardeep Kaur for her precious guidance and for taking extra pain to seek through our problems. We are also thankful to Er. Parminder Singh, Er. Priya, Er. Karamjit Kaur. They were always a pillar of strength to infuse encouragement during our disheartening failures. I thank all my friends who helped me readily and most gladly as when requires.
Abstract
Though now-a-days, radar finds its application in many fields, the basic radar was used to detect the presence of target, its distance, location and velocity if moving. Radar can detect the target even in conditions like rain, snow, haze, fog and darkness. MCU based Ultrasonic based Radar and Distance Finder is a system of gathering information about distant objects (target) by transmitting Electromagnetic Waves towards target and receiving back and analyzing echoes. It will calculate: Distance Time Angle
Contents
PAGE NO. Candidates Declaration Acknowledgement Abstract Contents
Chapter 1: Introduction Chapter 2: Hardware Description Chapter 3: Sensors Chapter 4: Optocoupler Chapter 5: LCD interfacing Chapter 6: MAX232 Chapter 7: Interfacing of switiches with microcontroller Chapter 8: Optoisolators and optointerrupters Chapter 9: LCD interfqacing with microcontroller Chapter 10: LED interfacing Chapter 11: Stepper Motor Chapter 12:Flow chart Chapter 13:Key Coding Chapter 14:Vechile coding Conclusion
INTRODUCTION
Hardware blocks on the passive keyless lock The system works by having a series of LF (low frequency 125 kHz) transmitting antennas both inside and outside the vehicle. The external antennas are located in the door handles. When the vehicle is triggered either by pulling the handle or touching the handle an LF signal is transmitted from the antennas to the key. The key becomes activated if it is sufficiently close and it transmits its ID back to the vehicle via RF (Radio frequency >300 MHz) to a receiver located in the vehicle. If the key has the correct ID the PASE module unlocks the vehicle. The hardware blocks of passive keyless lock are based on its functionality: transmitting low frequency LF signals via the 125 kHz power amplifier block receiving radio frequency RF signals (> 300 MHz) from the built-in receiver block encrypting and decrypting all relevant data signals (security) communicating relevant interface signals with other electronic control units microcontroller
CHAPTER-1
BLOCK DIAGRAM OF PROJECT a. TRANSPONDER CIRCUIT b. BASE STATION
CIRCUIT DIAGRAM
10
S.NO
1
Name
Transreciver chip
Quantity
2
Colour
Green
Pins
Buzzer
black
Led
Transparent
4 5 6 7
1 22 2 1
Opto-coupler
Black
9 10
1 2 Black
11
12 13 14 15 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29.
Nut-Bolt Pair Jumper Wire ( Single Stand Wire) IC Base ( 8,14,16,40 pin) Cermic capacitor Electrolytic Capacitor Bridge Rectifier Crystal Oscilattor Reset button 10k ohm resistance 10 microfarad capacitor 33 picofarad capacitor Crystal 11.0592 MHz Transistor Ribbon wires General purpose PCB Buzzer DIPTRACE PCB SOFTWARE KEIL COMPILER
3 13 6 1 2 2 1 1 1 1 4
2 2 2 2 2 2
Black
1 1 Black 2
12
30.
Burner
Black
HARDWARE PARTS
The project consists of three main parts:
8051 microcontroller
Power Supply (Regulated) Clock Generator LCD Stepper motor Isolation Circuit Opto-Coupler Buzzer
1).SOFTWARES USEDx:
1.
Some of the softwares available in the market for pcb designing are: Protal Orcad Dip trace
But due to its more availability in the market, we are going to use dip trace software.
2.
there are many types of microcontrollers available in the market, some of them are: PIC microcontroller 13
But, we have planned to continue our project using Atmel 89c51 microcontroller, as it is the most easily available in the market
also, this is the most economical and easy to understand and has all its functions limited to 40 pins. Also, for programming the microcontroller, we require useful software. Many types of software are available but we are going to use the keil software because of its more availability, flexibility and easy operations
14
Figure 2.2: Every-Day Examples of Devices that Contain Microcontrollers Atmel 89c51 microcontroller module shown in Figure 4 has a microcontroller built onto it. Its the black chip with lettering on it that reads Atmel 89c51. The rest of the components on the microcontroller module are also found in consumer appliances you use every day. All together, they are correctly called an embedded computer system. This Name is almost always shortened to just embedded system. Frequently, such modules are commonly just called microcontrollers.
Fig 2.3: 40 Pins Atmel 89c51 microcontroller module (Internal structure) ( copy right protected)
15
16
2.3 AMAZING INVENTIONS WITH MICROCONTROLLERS:1. Consumer appliances arent the only things that contain microcontrollers. Robots, machinery, aerospace designs and other high-tech devices are also built with microcontrollers. Lets take a look at some examples that were created with Atmel 89c51 microcontroller module. Robots have been designed to do everything from helping students learn more about microcontrollers, to mowing the lawn, to solving complex mechanical problems. Figure1-4 shows two example robots. On each of these robots, students use the Atmel 89c51 microcontroller module to read sensors, control motors, and communicate with other computers.
17
Fig 2.5: Applications of microcontroller 2. Microcontrollers are also used in scientific, high technology, and aerospace projects. The weather station shown on the left of Figure 1-7 is used to collect environmental data related to coral reef decay. The Atmel 89c51 microcontroller inside it gathers this data from a variety of sensors and stores it for later retrieval by scientists. The submarine in the center is an undersea exploration vehicle, and its thrusters, cameras and lights are all controlled by Atmel 89c51 microcontroller. The rocket shown on the right is one that was part of a competition to launch a privately owned rocket into space. Nobody won the competition, but this rocket almost made it! Atmel 89c51 microcontroller controlled just about every aspect of the launch sequence.
18
Figure 2.6: High-tech and Aerospace Microcontroller Examples Ecological data collection by EME Systems (left), undersea research by Harbor Branch Institute
3.)From common household appliances all the way through scientific and aerospace applications, the microcontroller basics you will need to get started on projects like these are introduced here. By working through the activities in this book, you will get to experiment with and learn how to use a variety of building blocks found in all these hightech inventions. You will build circuits for displays, sensors, and motion controllers. You will learn how to connect these circuits to the Atmel 89c51 microcontroller, and then write computer programs that make it control displays, collect data from the sensors, and control motion. Along the way, you will learn many important electronic and computer programming concepts and techniques. By the time youre done, you might find yourself well on the way to inventing a gizmo of your own design.
ROM
P1 P0
P3
P2
20
Fig 2.8: Pin Description 2.6 Pin Description: 1.)VCC: Supply voltage.
21
2.)GND: Ground.
3.) Port 1:
Port 1 is an 8-bit bi-directional I/O port. Port pins P1.2 to P1.7 provide internal pull-ups. P1.0 and P1.1 require external pull-ups. P1.0 and P1.1 also serve as the positive input (AIN0) and the negative input (AIN1), respectively, of the on-chip precision analog comparator. The Port 1 output buffers can sink 20 mA and can drive LED displays directly. When 1s are written to Port 1 pins, they can be used as inputs. When pins P1.2 to P1.7 are used as inputs and are externally pulled low, they will source current (IIL) because of the internal pull-ups. Port 1 also receives code data during Flash programming and verification.
4.)Port 3:
Port 3 pins P3.0 to P3.5, P3.7 are seven bi-directional I/O pins with internal pull-ups. P3.6 is hard-wired as an input to the output of the on-chip comparator and is not accessible as a general-purpose I/O pin. The Port 3 output buffers can sink 20 mA. When 1s are written to Port 3 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull-ups. Port 3 also serves the functions of various special features of the AT89S2051/S4051 as listed below: Port 3 also receives some control signals for Flash programming and verification.
5.) RST:Reset input. Holding the RST pin high for two machine cycles while the is
running resets the device. Each machine cycle takes 6 or clock cycles. 22
6.) XTAL1: Input to the inverting amplifier and input to the internal clock operating circuit. 7.) XTAL2: Output from the inverting amplifier. Characteristics:
XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier which can be configured for use as an on-chip . Either a quartz crystal or ceramic resonator may be used. To drive the device from an extern al clock source, XTAL2 should be left unconnected while XTAL1 . There are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high and low time specifications
TRANSFO
BRIDGE RECTIFIER
SHUNT CAPACITOR
VOLTAGE REGULATOR 23
The power supply circuit comprises of four basic parts: The transformer steps down the 220 V a/c. into 12 V a/c. The transformer work on the principle of magnetic induction, where two coils: primary and secondary are wound around an iron core. The two coils are physically insulated from each other in such a way that passing an a/c. current through the primary coil creates a changing voltage in the primary coil and a changing magnetic field in the core. This in turn induces a varying a/c. voltage in the secondary coil.
The a/c. voltage is then fed to the bridge rectifier. The rectifier circuit is used in most electronic power supplies is the single-phase bridge rectifier with capacitor filtering, usually followed by a linear voltage regulator. A rectifier circuit is necessary to convert a signal having zero average value into a non-zero average value. A rectifier transforms alternating current into direct current by limiting or regulating the direction of flow of current. The output resulting from a rectifier is a pulsating D.C. voltage. This voltage is not appropriate for the components that are going to work through it.
24
1000uF TRANSFORMER
The ripple of the D.C. voltage is smoothened using a filter capacitor of 1000 microF 25V. The filter capacitor stores electrical charge. If it is large enough the capacitor will store charge as the voltage rises and give up the charge as the voltage falls. This has the effect of smoothing out the waveform and provides steadier voltage output. A filter capacitor is connected at the rectifier output and the d.c voltage is obtained across the capacitor. When this capacitor is used in this project, it should be twice the supply voltage. When the filter is used, the RC charge time of the filter capacitor must be short and the RC discharge time must be long to eliminate ripple action. In other words the capacitor must charge up fast, preferably with no discharge.
When the rectifier output voltage is increasing, the capacitor charges to the peak voltage Vm. Just past the positive peak, the rectifier output voltage starts to fall but at this point the capacitor has +Vm voltage across it. Since the source voltage becomes slightly less than Vm, the capacitor will try to send current back through the diode of rectifier. This reverse biases the diode. The diode disconnects or separates the source the source form load. The capacitor starts to discharge through load. This prevents the load voltage from falling to zero. The capacitor continues to discharge until source voltage becomes more than capacitor voltage. The diode again starts conducting and the capacitor is again charged to peak value Vm. When capacitor is charging the rectifier supplies the charging through capacitor branch as well as load current, the capacitor sends currents through the 25
load. The rate at which capacitor discharge depends upon time constant RC. The longer the time constant, the steadier is the output voltage. An increase in load current i.e. decrease in resistance makes time constant of discharge path smaller. The ripple increase and d.c output voltage V dc decreases. Maximum capacity cannot exceed a certain limit because the larger the capacitance the greater is the current required to charge the capacitor,The voltage regulator regulates the supply if the supply if the line voltage increases or decreases. The series 78xx regulators provide fixed regulated voltages from 5 to 24 volts. An unregulated input voltage is applied at the IC Input pin i.e. pin 1 which is filtered by capacitor. The out terminal of the IC i.e. pin 3 provides a regular output. The third terminal is connected to ground. While the input voltage may vary over some permissible voltage range, and the output voltage remains constant within specified voltage variation limit. The 78xx ICs are positive voltage regulators whereas 79xx ICs are negative voltage regulators. These voltage regulators are integrated circuits designed as fixed voltage regulators for a wide variety of applications. These regulators employ current limiting, thermal shutdown and safe area compensation. With adequate heat sinking they can deliver output currents in excess of 1 A. These regulators have internal thermal overload protection. It uses output transistor safe area compensation and the output voltage offered is in 2% and 4% tolerance.
CHAPTER-4
RELAY:A relay is an electrically operated switch. Many relays use an electromagnet to operate a
switching mechanism, but other operating principles are also used. Relays find applications where it is necessary to control a circuit by a low-power signal, or where several circuits must be controlled by one signal. The first relays were used in long distance telegraph circuits, repeating the signal coming in from one circuit and re-transmitting it to another. Relays found extensive use in telephone exchanges and early computers to perform logical operations. A type of relay that can handle the high power required to directly drive an electric motor is called a contactor. Solid-state relays control power circuits with no moving parts, instead using a semiconductor device triggered by light to perform switching. Relays with calibrated operating characteristics and sometimes multiple operating coils are used to protect electrical 26
circuits from overload or faults; in modern electric power systems these functions are performed by digital instruments still called "protection relays".
to operate quickly. In a low voltage application, this is to reduce noise. In a high voltage or high current application, this is to reduce arcing. If the coil is energized with DC, a diode is frequently installed across the coil, to dissipate the energy from the collapsing magnetic field at deactivation, which would otherwise generate a voltage spike dangerous to circuit components. Some automotive relays already include that diode inside the relay case. Alternatively a contact protection network, consisting of a capacitor and resistor in series, may absorb the surge. If the coil is designed to be energized with AC, a small copper ring can be crimped to the end of the solenoid. This "shading ring" creates a small out-of-phase current, which increases the minimum pull on the armature during the AC cycle.[1] By analogy with the functions of the original electromagnetic device, a solid-state relay is made with a thyristor or other solid-state switching device. To achieve electrical isolation an optocoupler can be used which is a light-emitting diode (LED) coupled with a photo transistor.
Types
Latching relay, dust cover removed, showing pawl and ratchet mechanism. The ratchet operates a cam, which raises and lowers the moving contact arm, seen edge-on just below it. The moving and fixed contacts are visible at the left side of the image. A latching relay has two relaxed states (bistable). These are also called "impulse", "keep", or "stay" relays. When the current is switched off, the relay remains in its last state. This is achieved with a solenoid operating a ratchet and cam mechanism, or by having two opposing coils with an over-center spring or permanent magnet to hold the armature and contacts in position while the coil is relaxed, or with a remanent core. In the ratchet and cam example, the first pulse to the coil turns the relay on and the second pulse turns it off. In the two coil example, a pulse to one coil turns the relay on and a pulse to the opposite coil turns the relay off. This type of relay has the advantage that it consumes power only for an instant, while it is being switched, and it retains its last setting across a power outage. A remanent core latching relay requires a current pulse of opposite polarity to make it change state.
28
Reed relay
A reed relay has a set of contacts inside a vacuum or inert gas filled glass tube, which protects the contacts against atmospheric corrosion. The contacts are closed by a magnetic field generated when current passes through a coil around the glass tube. Reed relays are capable of faster switching speeds than larger types of relays, but have low switch current and voltage ratings. See also reed switch.
Mercury-wetted relay
A mercury-wetted reed relay is a form of reed relay in which the contacts are wetted with mercury. Such relays are used to switch low-voltage signals (one volt or less) because of their low contact resistance, or for high-speed counting and timing applications where the mercury eliminates contact bounce. Mercury wetted relays are position-sensitive and must be mounted vertically to work properly. Because of the toxicity and expense of liquid mercury, these relays are rarely specified for new equipment. See also mercury switch.
Polarized relay
A polarized relay placed the armature between the poles of a permanent magnet to increase sensitivity. Polarized relays were used in middle 20th Century telephone exchanges to detect faint pulses and correct telegraphic distortion. The poles were on screws, so a technician could first adjust them for maximum sensitivity and then apply a bias spring to set the critical current that would operate the relay.
Contactor relay
A contactor is a very heavy-duty relay used for switching electric motors and lighting loads. Continuous current ratings for common contactors range from 10 amps to several hundred amps. High-current contacts are made with alloys containing silver. The unavoidable arcing causes the contacts to oxidize; however, silver oxide is still a good conductor.[2] Such devices are often used for motor starters. A motor starter is a contactor with overload protection devices attached. The overload sensing devices are a form of heat operated relay where a coil heats a bi-metal strip, or where a solder pot melts, releasing a spring to operate auxiliary contacts. These auxiliary contacts are in series with the coil. If the overload senses excess current in the load, the coil is de-energized. 29
Contactor relays can be extremely loud to operate, making them unfit for use where noise is a chief concern.
Solid-state relay
25 A or 40 A solid state contactors A solid state relay (SSR) is a solid state electronic component that provides a similar function to an electromechanical relay but does not have any moving components, increasing long-term reliability. With early SSR's, the tradeoff came from the fact that every transistor has a small voltage drop across it. This voltage drop limited the amount of current a given SSR could handle. As transistors improved, higher current SSR's, able to handle 100 to 1,200 Amperes, have become commercially available. Compared to electromagnetic relays, they may be falsely triggered by transients.
30
Buchholz relay
A Buchholz relay is a safety device sensing the accumulation of gas in large oil-filled transformers, which will alarm on slow accumulation of gas or shut down the transformer if gas is produced rapidly in the transformer oil.
Circuit symbols of relays. "C" denotes the common terminal in SPDT and DPDT types.
31
The diagram on the package of a DPDT AC coil relay Since relays are switches, the terminology applied to switches is also applied to relays. A relay will switch one or more poles, each of whose contacts can be thrown by energizing the coil in one of three ways:
Normally-open (NO) contacts connect the circuit when the relay is activated; the circuit is disconnected when the relay is inactive. It is also called a Form A contact or "make" contact. Normally-closed (NC) contacts disconnect the circuit when the relay is activated; the circuit is connected when the relay is inactive. It is also called a Form B contact or "break" contact. Change-over (CO), or double-throw (DT), contacts control two circuits: one normally-open contact and one normally-closed contact with a common terminal. It is also called a Form C contact or "transfer" contact ("break before make"). If this type of contact utilizes a "make before break" functionality, then it is called a Form D contact.
SPST Single Pole Single Throw. These have two terminals which can be
connected or disconnected. Including two for the coil, such a relay has four terminals in total. It is ambiguous whether the pole is normally open or normally closed. The terminology "SPNO" and "SPNC" is sometimes used to resolve the ambiguity. SPDT Single Pole Double Throw. A common terminal connects to either of two others. Including two for the coil, such a relay has five terminals in total. DPST Double Pole Single Throw. These have two pairs of terminals. Equivalent to two SPST switches or relays actuated by a single coil. Including two for the coil, such a relay has six terminals in total. The poles may be Form A or Form B (or one of each). DPDT Double Pole Double Throw. These have two rows of change-over terminals. Equivalent to two SPDT switches or relays actuated by a single coil. Such a relay has eight terminals, including the coil.
The "S" or "D" may be replaced with a number, indicating multiple switches connected to a single actuator. For example 4PDT indicates a four pole double throw relay (with 14 terminals).
Applications
32
Control a high-voltage circuit with a low-voltage signal, as in some types of modems or audio amplifiers, Control a high-current circuit with a low-current signal, as in the starter solenoid of an automobile, Detect and isolate faults on transmission and distribution lines by opening and closing circuit breakers (protection relays),
Isolate the controlling circuit from the controlled circuit when the two are at different potentials, for example when controlling a mains-powered device from a low-voltage switch. The latter is often applied to control office lighting as the low voltage wires are easily installed in partitions, which may be often moved as needs change. They may also be controlled by room occupancy detectors in an effort to conserve energy, Logic functions. For example, the boolean AND function is realised by connecting normally open relay contacts in series, the OR function by connecting normally open contacts in parallel. The change-over or Form C contacts perform the XOR (exclusive or) function. Similar functions for NAND and NOR are accomplished using normally closed contacts. The Ladder programming language is often used for designing relay logic networks. o Early computing. Before vacuum tubes and transistors, relays were used as logical elements in digital computers. See ARRA (computer), Harvard Mark II, Zuse Z2, and Zuse Z3. o Safety-critical logic. Because relays are much more resistant than semiconductors to nuclear radiation, they are widely used in safety-critical logic, such as the control panels of radioactive waste-handling machinery. Time delay functions. Relays can be modified to delay opening or delay closing a set of contacts. A very short (a fraction of a second) delay would use a copper disk between the armature and moving blade assembly. Current flowing in the disk maintains magnetic field for a short time, lengthening release time. For a slightly longer (up to a minute) delay, a dashpot is used. A dashpot is a piston filled with fluid that is allowed to escape slowly. The time period can be varied by 33
increasing or decreasing the flow rate. For longer time periods, a mechanical clockwork timer is installed.
Several 30-contact relays in "Connector" circuits in mid 20th century 1XB switch and 5XB switch telephone exchanges; cover removed on one Selection of an appropriate relay for a particular application requires evaluation of many different factors:
Number and type of contacts normally open, normally closed, (double-throw) Contact sequence "Make before Break" or "Break before Make". For example, the old style telephone exchanges required Make-before-break so that the connection didn't get dropped while dialing the number. Rating of contacts small relays switch a few amperes, large contactors are rated for up to 3000 amperes, alternating or direct current Voltage rating of contacts typical control relays rated 300 VAC or 600 VAC, automotive types to 50 VDC, special high-voltage relays to about 15 000 V Coil voltage machine-tool relays usually 24 VAC, 120 or 250 VAC, relays for switchgear may have 125 V or 250 VDC coils, "sensitive" relays operate on a few milliamperes Coil current Usually in the range of 40200 mA for 024 VDC coils.[3] Package/enclosure open, touch-safe, double-voltage for isolation between circuits, explosion proof, outdoor, oil and splash resistant, washable for printed circuit board assembly Assembly Some relays feature a sticker that keeps the enclosure sealed to allow PCB post soldering cleaning agents. Which is removed once assembly is complete. Mounting sockets, plug board, rail mount, panel mount, through-panel mount, enclosure for mounting on walls or equipment 34
Switching time where high speed is required "Dry" contacts when switching very low level signals, special contact materials may be needed such as gold-plated contacts Contact protection suppress arcing in very inductive circuits Coil protection suppress the surge voltage produced when switching the coil current Isolation between coil circuit and contacts Aerospace or radiation-resistant testing, special quality assurance Expected mechanical loads due to acceleration some relays used in aerospace applications are designed to function in shock loads of 50 g or more Accessories such as timers, auxiliary contacts, pilot lamps, test buttons Regulatory approvals Stray magnetic linkage between coils of adjacent relays on a printed circuit board.
Protective relay
A protective relay is a complex electromechanical apparatus, often with more than one coil, designed to calculate operating conditions on an electrical circuit and trip circuit breakers when a fault was found. Unlike switching type relays with fixed and usually illdefined operating voltage thresholds and operating times, protective relays had wellestablished, selectable, time/current (or other operating parameter) curves. Such relays were very elaborate, using arrays of induction disks, shaded-pole magnets, operating and restraint coils, solenoid-type operators, telephone-relay style contacts, and phase-shifting networks to allow the relay to respond to such conditions as over-current, over-voltage, reverse power flow, over- and under- frequency, and even distance relays that would trip for faults up to a certain distance away from a substation but not beyond that point. An important transmission line or generator unit would have had cubicles dedicated to protection, with a score of individual electromechanical devices. The various protective functions available on a given relay are denoted by standard ANSI Device Numbers. For example, a relay including function 51 would be a timed over current protective relay. These protective relays provide various types of electrical protection by detecting abnormal conditions and isolating them from the rest of the electrical system by circuit breaker operation. Such relays may be located at the service entrance or at major load centers. Design and theory of these protective devices is an important part of the education of an electrical engineer who specializes in power systems. Today these devices are nearly entirely replaced (in new designs) with microprocessor-based instruments (numerical relays) that emulate their electromechanical ancestors with great precision and convenience in application. By combining several functions in one case, numerical relays also save capital cost and maintenance cost over electromechanical relays. However, due to their very long life span, tens of thousands of these "silent sentinels" are still protecting transmission lines and electrical apparatus all over the world. Protective Device Coordination. 35
Overcurrent relay
An "Overcurrent Relay" is a type of protective relay which operates when the load current exceeds a preset value. The ANSI Device Designation Number is 50 for an Instantaneous OverCurrent (IOC), 51 for a Time OverCurrent (TOC). In a typical application the overcurrent relay is used for overcurrent protection, connected to a current transformer and calibrated to operate at or above a specific current level. When the relay operates, one or more contacts will operate and energize a trip coil in a Circuit Breaker and trip (open) the Circuit Breaker.
Therefore in an overcurrent condition a value of current will be reached that overcomes the control spring pressure on the spindle and the breaking magnet causing the metal disc to rotate moving towards the fixed contact. This initial movement of the disc is also held off to a critical positive value of current by small slots that are often cut into the side of the disc. The time taken for rotation to make the contacts is not only dependent on current but also the spindle backstop position, known as the time multiplier (tm). The time multiplier is divided into 10 linear divisions of the full rotation time. Providing the relay is free from dirt, the metal disc and the spindle with its contact will reach the fixed contact, thus sending a signal to trip and isolate the circuit, within its designed time and current specifications. Drop off current of the relay is much lower than its operating value, and once reached the relay will be reset in a reverse motion by the pressure of the control spring governed by the braking magnet.
Distance relay
The most common form of protection on high voltage transmission systems is distance relay protection. Power lines have set impedance per kilometre and using this value and comparing voltage and current the distance to a fault can be determined. The ANSI standard device number for a distance relay is 21. The main types of distance relay protection schemes are:
Three step distance protection Switched distance protection Accelerated or permissive intertrip protection Blocked distance protection
In three step distance protection, the relays are separated into three separate zones of impedance measurement to accommodate for over reach and under reach conditions. Zone 1 is instantaneous in operation and has a purposely set under reach of 80% of the total line length to avoid operation for the next line. This is due to measurements of impedance of lines not being entirely accurate, errors in voltage and current transformers and relay tolerances. These errors can be up to 20% of the line impedance, hence the zones 80% reach. Zone 2 covers the last 20% of the feeder line length and provides backup to the next line by having a slight over reach. To prevent mal-operation the zone has a 0.5 second time delay. Zone 3 provides backup for the next line and has a time delay of 1 second to grade with zone 2 protection of the next line.
Railway signalling
37
General
Railway signalling relays are very big and cumbersome compared to the mostly small voltages and currents that they switch. Contacts are widely spaced to prevent dangerous flashovers and short circuits over a lifetime that may exceed fifty years. The Q-series of plug-in relays are widely used on railways following English practice. These are 120mm high, 180mm deep and 56mm wide and weigh about 1400 g.
Double switching
In railway signalling, relays energise to give a green light, so that if the power fails or a wire breaks, the signal goes to red. This is called "fail-safe". To protect against false feeds relay circuits are often cut on both the positive and negative side, so that two false feeds are needed to cause a false green.
Proving
In railway signalling, many relays are proved down before a signal is allowed to show green. For example, before a point's normal detector is allowed to pick up (and allow that signal to show green) the corresponding point's reverse detector must be proved in the deenergized position. Not all relays can be proved, for example repeat relays in distant locations, so there is reliance on other features such as carbon to silver contacts to resist lightning induced contact welding and AC immunity
38
39
Pin No. Pin no. 1 Pin no. 2 Pin no. 3 Pin no. 4
Description Power supply (GND) Power supply (+5V) Contrast adjust 0 = Instruction input 1 = Data input 0 = Write to LCD module 1 = Read from LCD module Enable signal Data bus line 0 (LSB) Data bus line 1 Data bus line 2 Data bus line 3 Data bus line 4 Data bus line 5 Data bus line 6 Data bus line 7 (MSB)
Pin no. 5 Pin no. 6 Pin no. 7 Pin no. 8 Pin no. 9 Pin no. 10 Pin no. 11 Pin no. 12 Pin no. 13 Pin no. 14
R/W EN D0 D1 D2 D3 D4 D5 D6 D7
Features:1.16 Characters x 2 Lines 2. 5x7 Dot Matrix Character + Cursor 3. HD44780 Equivalent LCD Controller/driver Built-In 4. 4-bit or 8-bit MPU Interface 5. Uses HD44780 Controller. 6. Works with almost any Microcontroller. 7. Low cost 5.2 INTERFACING Liquid Crystal Display also called as LCD is very helpful in providing user interface as well as for debugging purpose. These LCD's are very simple to interface with the controller as well as are cost effective. The most commonly used ALPHANUMERIC displays are 1x16 (Single Line & 16 characters), 2x16 (Double Line & 16 character per line) & 4x20 (four lines & Twenty characters per line). 41
The LCD requires 3 control lines (RS, R/W & EN) & 8 (or 4) data lines. The number on data lines depends on the mode of operation. If operated in 8-bit mode then 8 data lines + 3 control lines i.e. total 11 lines are required. And if operated in 4-bit mode then 4 data lines + 3 control lines i.e. 7 lines are required. How do we decide which mode to use? Its simple if you have sufficient data lines you can go for 8 bit mode & if there is a time constrain i.e. display should be faster then we have to use 8-bit mode because basically 4bit mode takes twice as more time as compared to 8-bit mode. When RS is low (0), the data is to be treated as a command. When RS is high (1), the data being sent is considered as text data which should be displayed on the screen. When R/W is low (0), the information on the data bus is being written to the LCD. When RW is high (1), the program is effectively reading from the LCD. Most of the times there is no need to read so this line can connected to one controller from the LCD directly be Gnd thus saving line.
The EN pin is used to latch the data present on the data pins. A HIGH - LOW signal is required to latch the data. The LCD interprets and executes our command at the instant 42
the EN line is brought low. If you never bring EN low, your instruction will never be executed.
CHAPTER-6 BUZZER:
A buzzer or beeper is a signalling device, usually electronic, typically used in automobiles, household appliances such as a microwave oven, or game shows. It most commonly consists of a number of switches or sensors connected to a control unit that determines if and which button was pushed or a preset time has lapsed, and usually illuminates a light on the appropriate button or control panel, and sounds a warning in the form of a continuous or intermittent buzzing or beeping sound. Initially this device was based on an electromechanical system which was identical to an electric bell without the metal gong (which makes the ringing noise). Often these units were anchored to a wall or ceiling and used the ceiling or wall as a sounding board. Another implementation with some AC-connected devices was to implement a circuit to make the AC current into a noise loud enough to drive a loudspeaker and hook this circuit up to a cheap 8-ohm speaker. Nowadays, it is more popular to use a ceramic-based piezoelectric sounder like a Sonalert which makes a high-pitched tone. Usually these were hooked up to "driver" circuits which varied the pitch of the sound or pulsed the sound on and off. In game shows it is also known as a "lockout system," because when one person signals ("buzzes in"), all others are locked out from signalling. Several game shows have large buzzer buttons which are identified as "plungers". The word "buzzer" comes from the rasping noise that buzzers made when they were electromechanical devices, operated from stepped-down AC line voltage at 50 or 60 43
cycles. Other sounds commonly used to indicate that a button has been pressed are a ring or a beep.
CHAPTER-7
44
45
Requirement Turn-Off requirement 0.1 ++ 12 20 10 1000 10 3 + + + + 0.1 ++ 20 10 10 1000 100 5 (--) (-) + + 5 200 0.5 1 5000 5000 15 1 100 1.5 0.3 4000 3000 10 + + 2 50 3 10 1000 400 3 + + 0.5 50 10 10 1000 400 3 Drive circuit complexity Technology Complexity + Device Protection Delay time (ts, tq) Switching Losses Current Density Max dv/dt (Vin = 0) dl/dt Vmax Imax Over Current factor 2 50 3 1 1500 1000 5
implement + = Simple to implement - = complex - = complex + = Simple to implement ms +=good A/cm2 V/ns A/ns V A
FIGURE : Electrical block diagram and physical layout of a typical opto-coupler. The optocoupler is also called an optoisolator and it is usually packaged as a six-pin 1C chip. (Copyright of Motorola, Used by Permission.)
47
The simple solution to this problem is to combine an LED with a phototransistor. The new device is totally encapsulated so that the light from the LED is focused directly on the opening in the phototransistor, and no other forms of light could be detected. The input signal is connected to the LED and the output signal is connected to the transistor. The device is called an optocoupler or optoisolator. Fig. 3-25 shows a block diagram of an optocoupler that shows an LED shining light directly on a photodector, which is usually a phototransistor. The second diagram in the figure shows how the LED is located so its light is focused directly on the phototransistor. Fig. 3-26 shows the six-pin 1C package for an optocoupler and the electronic diagram of its pin outline. The 1C package may also be called an 1C or a chip. From this diagram you can see that the anode of the LED is pin 1 and the cathode is pin 2. The emitter of the phototransistor is pin 4, the collector is pin 5, and the base is pin 6. It is important to note that each type of optocoupler may use different pin assignments, so you must be sure to check the manufacturer's pin outline diagrams.
FIGURE : Pin outline for an optocoupler for a six-pin 1C. A sketch of a six-pin 1C is also shown. (Copyright of Motorola, Used by Permission.)
48
FIGURE : Electrical diagram of an optocoupler used to interface an annunciator horn to a computer. The relay coil is connected to the output stage of the optocoupler.
side of the optocoupler is connected to the input bus of the PLC. Since the signal emitted by the LED is transferred by light, the high and low voltages of the circuit are isolated.
49
FIGURE 3-28 Optocoupler used in a PLC input module. When the switch closes, 110 volts AC is provided to terminal 1. The phototransistor in the Optocoupler is connected to the PLC input bus.
50
FIGURE 3-29 (a-f) Examples of solid-state relays and their electrical diagrams. The diagrams show pnp and npn transistors used in the output stage Figure 6-21c shows a typical load connected to the relay. (Courtesy of Opto 22, Remecula, CA.)
FIGURE 3-30 Typical rack with solid-state relays mounted in it. A wide variety of relays is available to provide interfaces to dc, ac, and analog signals. (Courtesy of Opto 22, Remecula, CA.) 51
Since the SSRs are available as stand-alone or plug-in devices, they provide the advantage of being removed and replaced very quickly. If they are the plug-in type, they can be removed and replaced by someone with minimal technical knowledge, since the wiring for this type is connected to the socket which is soldered directly to a printed circuit board. You will find SSRs in a variety of applications, such as in microprocessor controlled systems like the high-speed weighing system and the single-point temperature controllers where they provide a simple interface for alarms and other outputs. Fig. 3-30 shows the relays plugged into a module board.
FIGURE 3-31 (a) Electrical diagram of typical solid-state relay used to interface input signals. The diagram shows the terminals in the rack allow for either ac or dc signals to be connected. If an ac signal is used, an ac relay must be installed in the rack, and if a dc signal is used, a dc relay must be used. (b) The diagram for an ac relay, (c) The diagram for a dc relay. (Courtesy of Opto 22, Remecula, CA.) 52
FIGURE 3-32 Electrical diagram of the solid-state relay used as an output module. Notice that the output circuit includes an optocoupler and a transistor that is used as an amplifier. (Courtesy of Opto 22, Remecula, CA.)
A large variety of Optocouplers has been designed to meet the demands of numerous applications. For example, Optocouplers are available that are specifically designed for high-gain signals that use darlington pairs and for high-speed switching where Schmitt triggers are used. Other conditions such as common-mode rejection, ac/dc voltage to logic-level signal interfaces, low-current applications, TTL applications, high-gain applications, and for multiplexing data applications require special types of Optocouplers. Fig. 3-33 shows example circuits of the low-input current logic gate optocoupler. Fig. 334 shows examples of specialty types of Optocouplers that use transistors with a base terminal where bias can be added, darlington pair transistors that are used for higher gain, and Schmitt triggers that are used for high-speed switching. Fig. 3-35 shows the diagram for a shunt drive circuit for optocoupler interface between TTL and CMOS signals, and Fig. 3-36 shows an optocoupler that allows ac or dc voltage as the input and the output is converted to a logic-level signal.
53
FIGURE 3-33 Schematic diagram and pin outline for a low-power optocoupler. This type of device is used where the input signal is a low-power signal. (Copyright of Motorola, Used by Permission.) In Fig. 3-34 you can see the diagram of the low-input power logic gate optocoupler. This optocoupler combines a GaAsP LED with an integrated high-gain photon detector. The detector portion of the device provides a three-state output stage and has a detector threshold with hysteresis. The need for pull-up resistors is negated by the three-state output. The hysteresis provides differential-mode noise immunity and prevents the possibility of chatter in the output signal. Chatter may occur if the contacts of the input device bounce during closure. The contact bounce may appear as more than one signal transistion, and the hysteresis in the circuit ensures the input signal only represents the intial contact closure. This optocoupler is specifically designed to switch at small current thresholds as low as 1.6-2.2 mA. A truth table is also provided for this circuit. Fig. 3-35 shows the diagram for a shunt drive circuit that uses an optocoupler to provide an interface between TTL/LSTTL/CMOS logic circuits. The LED in this circuit can be enabled by as little as 0.5 mA at a frequency of 5 megabaud (5 million pulses per second). This makes the circuit usable as a logic-level translator or for microprocessor I/O isolation. This circuit also eliminates several problems and increases common-mode rejection, since the path for leak current in the LED is eliminated.
54
FIGURE 3-34 Diagrams of optocouplers that use transistors, darlington transistors, and Schmitt triggers for their output stage. (Courtesy of Hewlett Packard Company.)
FIGURE 3-35 Electrical diagram of a shunt driver circuit that utilizes an optocoupler to provide an interface between TTL and CMOS logic circuits. (Courtesy of Hewlett Packard Company.)
SCHOTTKY DIODE (HP 5082 2800, OR EQUIVALENT) AND 20 pF CAPACITOR ARE NOT REQUIRED FOR UNITS WITH OPEN COLLECTOR OUTPUT.
55
FIGURE 3-36 Electrical diagram of optocouplers specifically designed for AC input signals. (Copyright of Motorola, Used by Permission.) Other types of specialty optocouplers nave been developed 10 handle problems that occur when optocouplers are used in ac circuits. One circuit is shown in the first part of Fig. 338 where a phototriac is used instead of a phototransistor. Since the triac is used, ac voltages can be controlled directly. The second diagram in this figure shows a triac connected to a zero-crossing circuit. The zero-crossing circuit is used to ensure that the triac switches ac voltage on and off exactly when the ac sine wave is at 0 volts. This means that the triac is only turned on when the sine wave is at 0 or at 180, which means that voltage and current are minimal when the triac allows current to flow to the remainder of the circuit. This allows circuit components such as lamp filaments to last much longer, since they are not subjected to high-voltage transients from switching ac voltage and current when the sine wave is at a peak. FIGURE 3-37 Electrical diagram of an optocoupler specifically designed to accept an AC or DC voltage input. (Courtesy of Hewlett Packard Company.)
=======================================
56
Line INO-IN7 A B C ALE CLOCK START EOC OE D0-D7 REF (-), (+) V ec
Clocks address of INO-IN7 into multiplexer address register Clock signal (640-1280 kHz) Start conversion Interrupt upon completion of conversion Output enable (acknowledge) Data output lines Reference voltage Supply voltage
57
AT KEYBOARD
The IBM keyboard can be a cheap alternative to a keyboard on a Microprocessor development system. Or maybe you want a remote terminal, just couple it with a LCD Module. PC Keyboard Theory The IBM keyboard you most probably have sitting in front of you, sends scan codes to your computer. The scan codes tell your Keyboard Bios, what keys you have pressed or released. Take for example the 'A' Key. The 'A' key has a scan code of 1C (hex). When you press the 'A' key, your keyboard will send 1C down it's serial line. If you are still holding it down, for longer than its typematic delay, another 1C will be sent. This keeps occurring until another key has been pressed, or if the 'A' key has been released. However your keyboard will also send another code when the key has been released. Take the example of the 'A' key again, when released, the keyboard will send F0 (hex) to tell you that the key with the proceeding scan code has been released. It will then send 1C, so you know which key has been released. Your keyboard only has one code 58
for each key. It doesn't care it the shift key has been pressed. It will still send you the same code. It's up to your keyboard BIOS to determine this and take the appropriate action. Your keyboard doesn't even process the Num Lock, Caps Lock and Scroll Lock. When you press the Caps Lock for example, the keyboard will send the scan code for the cap locks. It is then up to your keyboard BIOS to send a code to the keyboard to turn on the Caps lock LED. Now there are 101 keys and 8 bits make 256 different combinations, thus you only need to send one byte per key. Unfortunately a handful of the keys found on your keyboard are extended keys, and thus require two scan code. These keys are preceded by an E0 (hex). But it doesn't stop at two scan codes either. How about E1,14,77,E1,F0,14,F0,77! Now that can't be a valid scan code? Wrong again. It's happens to be sent when you press the Pause/break key. Don't ask me why they have to make it so long! Maybe they were having a bad day or something? When an extended key has been released, it would be expect that F0 would be sent to tell you that a key has been released. Then you would expect E0, telling you it was an extended key followed by the scan code for the key pressed. However this is not the case. E0 is sent first, followed by F0, when an extended key has been released.
Scan Codes
The diagram below shows the Scan Code assigned to the individual keys. The Scan code is shown on the bottom of the key. E.g. The Scan Code for ESC is 76. All the scan codes are shown in Hex.
59
As you can see, the scan code assignments are quite random. In many cases the easiest way to convert the scan code to ASCII would be to use a look up table. Below is the scan codes for the extended keyboard & Numeric keypad.
The Keyboard's Connector The PC's AT Keyboard is connected to external equipment using four wires. These wires are shown below for the 5 Pin DIN Male Plug & PS/2 Plug.
5 Pin DIN
A fifth wire can sometimes be found. This was once upon a time implemented as 60
a Keyboard Reset, but today is left disconnected on AT Keyboards. Both the KBD Clock and KBD Data are Open Collector bi-directional I/O Lines. If desired, the Host can talk to the keyboard using these lines.
Ked to Host Communication As mentioned before, the PC's keyboard implements a bi-directional protocol. The keyboard can send data to the Host and the Host can send data to the Keyboard. The Host has the ultimate priority over direction. It can at anytime (although the not recommended) send a command to the keyboard. The keyboard is free to send data to the host when both the KBD Data and KBD Clock lines are high (Idle). The KBD Clock line can be used as a Clear to Send line. If the host takes the KBD Clock line low, the keyboard will buffer any data until the KBD Clock is released, ie goes high. Should the Host take the KBD Data line low, then the keyboard will prepare to accept a command from the host. The transmission of data in the forward direction, ie Keyboard to Host is done with a frame of 11 bits. The first bit is a Start Bit (Logic 0) followed by 8 data bits (LSB First), one Parity Bit (Odd Parity) and a Stop Bit (Logic 1). Each bit should be read on the falling edge of the clock.
The above waveform represents a one byte transmission from the Keyboard. The keyboard may not generally change it's data line on the rising edge of the clock 61
as shown in the diagram. The data line only has to be valid on the falling edge of the clock. The Keyboard will generate the clock. The frequency of the clock signal typically ranges from 20 to 30 Khz. The Least Significant Bit is always sent first. Reading Bytes from the Keyboard If the KBD Clock line is taken low, the keyboard will buffer any keys pressed. The Keyboard will only attempt to send when both the Data and Clock lines are idle (high). As it can take considerable time to decode the keys pressed, we must stop the keyboard from sending data. If not, some of the data may be lost or corrupted. So we have to keep the KBD Clock line low, unless keyboard is ready to accept data. We will use a loop to retrieve the data bits from the keyboard, thus we will load index register X with the number of bits be want to receive. PAR will be used to verify the parity bit at the end of the transmission. We must clear this first. We can then place the KBD Clock line in the idle state so that the keyboard will start transmitting data if a key has been pressed. The program then loops while the clock line is Idle. If the KBD clock goes low, the loop is broken and the KBD Data pin is read. This should be the start bit which should be low. If not we branch to the start of the receive routine and try again. Once the start bit has been detected, the 8 data bits must follow. The data is only valid on the falling edge of the clock. After the falling edge we can read the level of the KBD Data line. If it is high we can set the MSbit of the byte or if it is clear, we can clear it. You will notice if the bit is set, we also increment PAR. This keeps track of the number of 1's in the byte and thus can be used to verify the Parity Bit. Index register X is decremented as we have read a bit. It then repeats the above process, until the entire 8 bits have been read. After the 8 data bits, comes the dreaded parity bit. We could ignore it if we wanted to, but we may as well do something about it. We have been keeping a tally of the number of 1's in PAR. The keyboard uses odd parity, thus the parity bit should be the complement of the LSbit in memory location, PAR. By exclusive OR-ing PAR with the Parity Bit, we get a 1 if both the bits are different. I.e. a '1' if the parity bit checks out. As we are only interested in the LSbit we can quite happy XOR the accumulator with PAR. Then we single out the LSb using the AND function. If the resultant is zero, then a parity error has occurred and the program branches to r_error. After the Parity Bits comes the Stop Bit. Once again we can ignore it if we desire. However we have chosen to branch to an error routine if this occurs. The stop bit should be set, thus an error occurs when it is clear. When an error occurs in the Parity or Stop Bit we should assume that the rest of the byte could have errors as well. We could ignore the error and process the received byte, but it could have unexpected results. Instead the keyboard has a resend command. If we issue a resend (FE) to the keyboard, the keyboard should send the byte back again. This is what occurs here.
62
Reading a byte doesn't really require bi-directional data and clock lines. If you can process the byte fast enough then no handshaking (RTS) is required.
D L D L D L D L D L D L D L D L E E E E E E E E
1 D 2 D 3 D 4 D 5 D 6 D C 7 D 8 D C C R ? A Y P S N T A P R R 1 1 1 L3 A 3 3 3 3 3 3 3 3 1 2 3 4 5 6 7 8 Y ? U 9 8 7 6 5 4 3 2 P P P P P P P P P P P P P P P P ? 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
V C C
4 0
. . . . . . . . . . . . . . . . 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 / / / / / / / / A A A A A A A A DP DP PD PD PD PD PD PD 20 21 22 23 24 25 26 27 . . . . . . 2 1 . 0 2 / 2A . 1 2 / 3A 2 2/ A 4 3 2/ A 5 4 2/ A 6 5 2/ A 7 6 2/ A 8 7 / A 1 1 1 1 1 1 8 9 0 1 2 3 4 5
1 0 / T P2 3 . 0 /1 R 1 X D / T P2 -3 E . 1X /1 T 2 X D P 3 . 2 / 1 I N3 T O P 3 . 3 /1 I N T 1 4 P 3 . 4 1 / 5T O P 3 . 5 1 / 6T 1 P 3 . 6 1/ W7 R P 3 . 7 / R D 1 2 A P 5 P L P E S E / P 2 3 9 N 0 R O G
9 8 X T A L 9 X T A L R S T 1 E T A 8 9 / V C
22 0
63
common. This type of stepper motor is commonly referred to as a four- phase stepper motor. The center tap allows a change of current direction in each of two coils when a winding is grounded, thereby resulting in a polarity change of the stator. Notice that while a conventional motor shaft runs freely, the stepper motor shaft moves in a fixed repeatable increment which allows one to move it to a precise position. This repeatable
Rotor Alignment fixed movement is possible as a result of basic magnetic theory where poles of the Same polarity repel and opposite poles attract. The direction of the rotation is dictated by the stator poles. The stator poles are determined by the current sent through the wire coils. As the direction of the current is changed, the polarity is also changed causing the reverse motion of the rotor. The stepper motor used here has a total of 5 leads: 4 leads representing the four stator windings and 1 common for the center tapped leads. As the sequence of power is applied to each stator winding, the rotor will rotate. There are several widely used sequences where each has a different degree of precision. Table shows the normal 4-step sequence. For clockwise go for step 1 to 4 & for counter clockwise go for step 4 to 1.
W i n d i n g W i n d i n g A1 2 3 B
W i n d i n g
6 W Ci n d i n g
Step
Winding
A 1 2 3 4 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0
Input Sequence to the Windings Step Angle & Steps per Revolution Movement associated with a single step, depends on the internal construction of the motor, in particular the number of teeth on the stator and the rotor. The step angle is the minimum degree of rotation associated with a single step. Step per revolution is the total number of steps needed to rotate one complete rotation or 360 degrees (e.g., 180 steps * 2 degree = 360) [31]. Since the stepper motor is not ordinary motor and has four separate coils, which have to be energized one by one in a stepwise fashion. We term them as coil A, B, C and D. At a particular instant the coil A should get supply and then after some delay the coil B should get a supply and then coil C and then coil D and so on the cycle continues. The more the delay is introduced between the energizing of the coils the lesser is the speed of the stepper motor and vice versa.
1 2 3 M M G O 2 T O R S T E P P E R
V Q 1
2C
P N P 3 6 9 Q 2 Q 3
Q 4 3 6 9
R 4
R 5
4 7 0
o h m
4 U
1 1 4 2
1 5
3 1 6
4 1 7 5 1 8
6 1 9 7
2 0 8 2 1
9 2 2 1 0 2 3
1 1 2 4 1 2
P C
1 O N N E C T O R D B 2 5
2 5 1 3
66
CHAPTER-12
67
CHAPTER-13 KEY-CODING
68
#INCLUDE<REG52.H> #INCLUDE<INTRINS.H> #INCLUDE<DELAY.H> #INCLUDE<SERIAL.H> #DEFINE LED1 P20 #DEFINE LED2 P26 VOID MAIN() { UNSIGNED CHAR IN; INIT_SERIAL(9600); LED1=LED2=0; SECDELAY(1); LED1=LED2=1; SECDELAY(1); LED1=LED2=0; SECDELAY(1); LED1=LED2=1; SECDELAY(1);
CHAPTER-14
70
VECHILE CODING
#DEFINE RS P35 #DEFINE RW P36 #DEFINE E P37 #DEFINE DATA P1 #DEFINE BUZZ P27 #DEFINE ST1 P20 #DEFINE ST2 P21 #DEFINE ST3 P22 #DEFINE ST4 P23
#INCLUDE<LCDROUT.H> #INCLUDE<SERIAL.H>
BIT S=0; VOID OPEN() //FUNTION FOR OPEN THE DOOR { UNSIGNED CHAR COUNT=6;
ST3=0; ST2=ST1=ST4=1; MS_DELAY(50); ST4=0; ST2=ST3=ST1=1; MS_DELAY(50); ST4=ST2=ST3=ST1=1; COUNT--; } } VOID CLOSE() { UNSIGNED CHAR COUNT=6; WHILE(COUNT>0)
72
CONCLUSION
The PIC16F639 device is an easy-to use ,low cost and secure bidirectional communication transponder.This device can be used for various smart hands-free passive keyless entry applications.A basic configuration of the Passive Keyless Entry(PKE)transponder is shown in fig 2.Example schematics for the transponder and the base station are shown in Appendix B:Transponder and Appendix C:Base Station. The firmware examples for the transponder and the base station are also provided .Users can modify the provided examples for their application purposes.
Candidates Declaration
We hereby declare that the major project which is presented in this report entitled GSM operated accident alert system with alcoholic driver detection submitted in the partial fulfillment of the requirements for the award of the degree of Bachelor of Technology in ECE to the PTU, Jalandhar, is an authentic record of our own work carried out at DWIET campus. The material embodied in this project work has not been submitted to any other university or institute for the award of any degree. PRITIKA BHATT RAJWANT KAUR SHEENU SUKHMANI 81008108079 81008108082 81008108086 81008108091
Place: Date:
This is to certify that above statement made by the candidate(s) is correct to the best of my knowledge. 73
Guided by: Er. Parminder Singh Department of ECE Approved by: HOD (ECE) DWIET
REFERENCES Websites
Make ur own microcontroller projects , Online , 3 August 2008 < http://www.strobotics.blogspot.com >
2.
3.
Robokits World RF Modules (Tx + Rx Pair) 433 MHz ASK [RKI-1064] - The RX ASK is an ASK Hybrid receiver module, Online, 15 August 2008 < http://www.robokitsindia.com > Wireless Made Simple - RF module, antenna and connector solutions offer easily applied remote control functionality to your product, Online, 18 August 2008 < http://8051.com > Datasheet search site, datasheets, Datasheet search site for Electronic Components and Semiconductors, integrated circuits, diodes and other semiconductors. Online, 31 August 2008 < http://www.alldatasheet.com > How Stuff Works explains hundreds of subjects, from car engines to lock-picking to ESP, using clear language and tons of illustrations Online, 11 October 2008 < www.howstuffworks.com > Books 1. Author: Muhammad Ali Mazidi & Janice Gillispie Mazidi The 8051 Microcontroller and Embedded system Publisher: PEARSON, Prentice Hall, 1990 74
4.
5.
2.
75