* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download bidirectional visiter counter using a at89c51
Three-phase electric power wikipedia , lookup
Ground (electricity) wikipedia , lookup
Immunity-aware programming wikipedia , lookup
Pulse-width modulation wikipedia , lookup
Power engineering wikipedia , lookup
Power inverter wikipedia , lookup
Variable-frequency drive wikipedia , lookup
History of electric power transmission wikipedia , lookup
Electrical substation wikipedia , lookup
Electrical ballast wikipedia , lookup
Two-port network wikipedia , lookup
Stray voltage wikipedia , lookup
Semiconductor device wikipedia , lookup
Current source wikipedia , lookup
Schmitt trigger wikipedia , lookup
Voltage optimisation wikipedia , lookup
Voltage regulator wikipedia , lookup
Power MOSFET wikipedia , lookup
Surge protector wikipedia , lookup
Power electronics wikipedia , lookup
Alternating current wikipedia , lookup
Mains electricity wikipedia , lookup
Resistive opto-isolator wikipedia , lookup
Switched-mode power supply wikipedia , lookup
Buck converter wikipedia , lookup
Network analysis (electrical circuits) wikipedia , lookup
“Transforming Live, Inventing Future” A Project Report On BIDIRECTIONAL VISITER COUNTER USING A AT89C51 By 1. Nariya Chirag (106030311050) 2. Padhiyar Manoj (106030311041) DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ATMIYA INSTITUTE OF TECHNOLOGY AND SCIENCE FOR DIPLOMA STUDIES, RAJKOT- 360005. [2012 – 2013] 1 A Project Report On Bidirectional visitor counter using at89c51 In partial fulfillment of requirements for the degree of Diploma of Engineering In EC Engineering Under the Guidance of Submitted By: 1. Nariya Chirag (106030311050) Mr M.C patel 2. Manoj Padhiyar (10030311041) DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ATMIYA INSTITUTE OF TECHNOLOGY AND SCIENCE FOR DIPLOMA STUDIES, RAJKOT- 360005. [2012-2013] 2 CERTIFICATE This is to certify that the project entitled “dew sensor and heater with GSM application” has been carried out by the team under my guidance in partial fulfillment of the Diploma of Engineering in Electronics & Communication in GTU during the academic year 2012-2013 (Semester-5). Team: Chirag Nariya Manoj Padhiyar Date: Place: RAJKOT M .C patel Guide Mr. G.C. joshi Principal Mr. D.M. jethloja Head, EC Department Mr.jay javiya External guide 3 ACKNOWLEDGEMENT I greatly thank my faculty guide of the college Mr. Mayur Patel. I m also thankful to my external guide and chair person of the industry I visited Mr. jay javiya. Mr. jay javiya is a very genuine person and gave me training giving time from his busy schedule. Lastly I heartily thank all my friends and parents who guided and Motivated me to complete my project successfully. Chirag Nariya Manoj Padhiya 4 INDEX Topic Page No. Abstract 7 List of Figures List of Tables List of Abbreviation 1. 2. Introduction 1.1 Industry visited 1.2 Analysis Problem definition 2.1 4. 9 Detailed problem definition 2.2 3. 8 Project scopes Details of controller circuits component 3.1 At 89c51 controller 3.2 Register 3.3 capacitor 3.4 led 3.5 transistors Details of transmitter circuits component 4.1 Ic lm358n 4.2 preset 4.3 Infrared LED 4.4 Photo diode 10 20 5 5. Block diagram of the project 5.1 6. 7. 31 Description of the block diagram Block diagram of transmitter circuit 6.1 introduction 6.2 Operation Project design 33 41 7.1 Software design 8. 9. Programming Advantages and Limitations 9.1 Advantages 9.2 Limitations 9.3 conclution 43 47 6 List of Figures Figure Page No. 1.1 balaji industry……………………………………………..9 3.1 micro controller at89c51………………………………..11 3.2 resister…………………………………………………...14 3.3 capacitor………………………………………………….15 3.4 parallel plates of capacitor……………………………...16 3.5 LED………………………………………………………..18 3.6 Transistor…………………………………………………20 4.1 pin diagram of IC lm358n……………………………….22 4.2 preset……………………………………………………...25 4.3 Infrared LED……………………………………………….26 4.4 photo diode…………………………………………………29 5.1 block diagrams……………………………………………..30 6.1 typical transmitter circuit…………………………………33 6.2 Tx-Rx pair circuitry…………………………………………………36 6.3 Snap taken from a cell phone camera………………………………37 6.4 circuit diagrams……………………………………………38 7 ABSTRACT This project is the most comman and intersting to start with the application is counting the number of persons entering in and exiting out like in delhi metro stations, counting the number of persons entering in and exiting out like in delhi metro stations. Our objective is to count the objects entering and exiting the room so we need some sensor to detect the objects and a control unit which calculatesthe Object.It is clear that the sensor pairs are placed face so that an IR radiations from IRLED arecontinuosly received by photo transistor which makes it’s emitter current (Ic=Ie)assuming base current be negligible hence the voltage at collector node becomes zero which is feed to microcontroller port pin P3.2and P3.3 if any object is placed in between the sensor pair block theIR radiation which in turns put the phototransistor is cut-off mode Ic =Ie(logic 1). 8 Chapter-1 Introduction 1. Introduction The project is acounter that change its state in either direction ,under control of an up down selector input, is known as an up down counter.the circuit can count number from 0 to9999 in up and down modes depennding upon the state of the selector .it can be used to count the number of persons entering a hall in the up mode entrance gate. In the down mode, it can count the number of persons leaving the hallby decrementing the count at exit gate.it can also be used at gates of parking areasand other public place. 1.1 Industry visited For the industrial defined project I visited balagi Engineering Works (Metoda). The industry is located in rajkot. The best part of this industry is the beautiful environment and friendly atmosphere. The people working in this industry are very genuine and down to earth. They cooperated on my visit to this industry. And helped in every possible manner. 1.1 balaji industry balaji was founded in 1992 by Mr. B. N. patel. The company adopted advanced electronic technology. 1.2 Analysis After visiting balagi industry and interacting with the industry persons I discovered following problems: Counting persons. 9 Chapter 2 Problem definition 2. Problem definition 2.1.1 Problem in human counting is more chansis to genrat the errar and low speed counting.becouse using visiting counter solve thise problem. 2.1.2 Project scope Bidirectional visiter counter project scope in a counting car. carparking counting the number of persons entering in and exiting out counting the number of persons entering in and exiting out like in delhi metro stations . multiplex and colleg,school,countig student. 10 Chapter 3 Details of controller circuit component 3.1 89c51microcontroller 11 AT89C51 AT89C651 is a microcontroller IC. It belongs to Atmel family. It is a 8051 controller IC. The program for interfacing LCD display is stored in this IC. AT89C51 is an 8-bit microcontroller and belongs to Atmel's 8051 family. ATMEL 89C51 has 4KB of Flash programmable and erasable read only memory (PEROM) and 128 bytes of RAM. It can be erased and program to a maximum of 1000 times. In 40 pin AT89C51, there are four ports designated as P1, P2, P3 and P0. All these ports are 8bit bi-directional ports, i.e., they can be used as both input and output ports. Except P0 which needs external pull-ups, rest of the ports have internal pull-ups. When 1s are written to these port pins, they are pulled high by the internal pull-ups and can be used as inputs. These ports are also bit addressable and so their bits can also be accessed individually. Port P0 and P2 are also used to provide low byte and high byte addresses, respectively, when connected to an external memory. Port 3 has multiplexed pins for special functions like serial communication, hardware interrupts, timer inputs and read/write operation from external memory. AT89C51 has an inbuilt UART for serial communication. It can be programmed to operate at different baud rates. Including two timers & hardware interrupts, it has a total of six interrupts. 12 3.2 Resistor A linear resistor is a linear, passive two-terminal electrical component that implements electrical resistance as a circuit element. The current through a resistor is in direct proportion to the voltage across the resistor's terminals. Thus, the ratio of the voltage applied across a resistor's terminals to the intensity of current through the circuit is called resistance. This relation is represented by Ohm's law: Resistors are common elements of electrical networks and electronic circuits and are ubiquitous in most electronic equipment. Practical resistors can be made of various compounds and films, as well as resistance wire (wire made of a high-resistivity alloy, such as nickel-chrome). Resistors are also implemented within integrated circuits, particularly analog devices, and can also be integrated into hybrid and printed circuits. The electrical functionality of a resistor is specified by its resistance: common commercial resistors are manufactured over a range of more than nine orders of magnitude. When specifying that resistance in an electronic design, the required precision of the resistance may require attention to the manufacturing tolerance of the chosen resistor, according to its specific application. The temperature coefficient of the resistance may also be of concern in some precision applications. Practical resistors are also specified as having a maximum power rating which must exceed the anticipated power dissipation of that resistor in a particular circuit: this is mainly of concern in power electronics applications. Resistors with higher power ratings are physically larger and may require heat sinks. In a high-voltage circuit, attention must sometimes be paid to the rated maximum working voltage of the resistor. Practical resistors have a series inductance and a small parallel capacitance; these specifications can be important in high-frequency applications. In a low-noise amplifier or pre-amp, the noise characteristics of a resistor may be an issue. The unwanted inductance, excess noise, and temperature coefficient are mainly dependent on the technology used in manufacturing the resistor. They are not normally specified individually for a particular family of resistors manufactured using a particular technology. A family of discrete resistors is also characterized according to its form factor, that is, the size of the device and the position of its leads (or terminals) which is relevant in the practical manufacturing of circuits using them. 13 3.2 resistors 14 3.3 Capacitor 3.3 Capacitor A capacitor (formerly known as condenser) is a passive two-terminal electrical component used to store energy in an electric field. The forms of practical capacitors vary widely, but all contain at least two electrical conductors separated by a dielectric (insulator); for example, one common construction consists of metal foils separated by a thin layer of insulating film. Capacitors are widely used as parts of electrical circuits in many common electrical devices. When there is a potential difference (voltage) across the conductors, a static electric field develops across the dielectric, causing positive charge to collect on one plate and negative charge on the other plate. Energy is stored in the electrostatic field. An ideal capacitor is characterized by a single constant value, capacitance, measured in farads. This is the ratio of the electric charge on each conductor to the potential difference between them. The capacitance is greatest when there is a narrow separation between large areas of conductor; hence capacitor conductors are often called "plates," referring to an early means of construction. In practice, the dielectric between the plates passes a small amount of leakage current and also has an electric field strength limit, resulting in a breakdown voltage, while the conductors and leads introduce an undesired inductance and resistance. Capacitors are widely used in electronic circuits for blocking direct current while allowing alternating current to pass, in filter networks, for smoothing the output of power supplies, in the resonant circuits that tune radios to particular frequencies and for many other purposes. 15 The simplest capacitor consists of two parallel conductive plates separated by a dielectric with permittivity ε (such as air). The model may also be used to make qualitative predictions for other device geometries. The plates are considered to extend uniformly over an area A and a charge density ±ρ = ±Q/A exists on their surface. Assuming that the width of the plates is much greater than their separation d, the electric field near the centre of the device will be uniform with the magnitude E = ρ/ε. The voltage is defined as the line integral of the electric field between the plates. Solving this for C = Q/V reveals that capacitance increases with area and decreases with separation . The capacitance is therefore greatest in devices made from materials with a high permittivity, large plate area, and small distance between plates. We see that the maximum energy is a function of dielectric volume, permittivity, and dielectric strength per distance. So increasing the plate area while decreasing the separation between the plates while maintaining the same volume has no change on the amount of energy the capacitor can store. Care must be taken when increasing the plate separation so that the above assumption of the distance between plates being much smaller than the area of the plates is still valid for these equations to be accurate. 3.4 parallel plates of capacitor 16 3.1.4 LED A light-emitting diode (LED) is a semiconductor light source. LEDs are used as indicator lamps in many devices and are increasingly used for other lighting. Introduced as a practical electronic component in 1962, early LEDs emitted low-intensity red light, but modern versions are available across the visible, ultraviolet, and infrared wavelengths, with very high brightness. When a light-emitting diode is forward-biased (switched on), electrons are able to recombine with electron holes within the device, releasing energy in the form of photons. This effect is called electroluminescence and the color of the light (corresponding to the energy of the photon) is determined by the energy gap of the semiconductor. LEDs are often small in area (less than 1 mm2), and integrated optical components may be used to shape its radiation pattern. LEDs present many advantages over incandescent light sources including lower energy consumption, longer lifetime, improved robustness, smaller size, and faster switching. LEDs powerful enough for room lighting are relatively expensive and require more precise current and heat management than compact fluorescent lamp sources of comparable output. Light-emitting diodes are used in applications as diverse as replacements for aviation lighting, automotive lighting (in particular brake lamps, turn signals, and indicators) as well as in traffic signals. LEDs have allowed new text, video displays, and sensors to be developed, while their high switching rates are also useful in advanced communications technology. Infrared LEDs are also used in the remote control units of many commercial products including televisions, DVD players, and other domestic appliances. Practical use The first commercial LEDs were commonly used as replacements for incandescent and neon indicator lamps, and in seven-segment displays, first in expensive equipment such as laboratory and electronics test equipment, then later in such appliances as TVs, radios, telephones, calculators, and even watches (see list of signal uses). These red LEDs were bright enough only for use as indicators, as the light output was not enough to illuminate an area. Readouts in calculators were so small that plastic lenses were built over each digit to make them legible. Later, other colors grew widely available and also appeared in appliances and equipment. As LED materials technology grew more advanced, light output rose, while maintaining efficiency and reliability at acceptable levels. The invention and development of the high-power white-light LED to use for illumination, which is fast replacing incandescent and fluorescent lighting. (See list of illumination applications). Most LEDs were made in the very common 5 mm T1¾ and 3 mm T1 packages, but with rising power output, it has grown increasingly necessary to shed excess heat to maintain reliability, so more complex packages have been adapted 17 for efficient heat dissipation. Packages for state-of-the-art high-power LEDs bear little resemblance to 3.5 LED 18 3.5 Transistor A transistor is a semiconductor device used to amplify and switch electronic signals and power. It is composed of a semiconductor material with at least three terminals for connection to an external circuit. A voltage or current applied to one pair of the transistor's terminals changes the current flowing through another pair of terminals. Because the controlled (output) power can be much more than the controlling (input) power, a transistor can amplify a signal. Today, some transistors are packaged individually, but many more are found embedded in integrated circuits. The transistor is the fundamental building block of modern electronic devices, and is ubiquitous in modern electronic systems. Following its release in the early 1950s the transistor revolutionized the field of electronics, and paved the way for smaller and cheaper radios, calculators, and computers, among other things. The essential usefulness of a transistor comes from its ability to use a small signal applied between one pair of its terminals to control a much larger signal at another pair of terminals. This property is called gain. A transistor can control its output in proportion to the input signal; that is, it can act as an amplifier. Alternatively, the transistor can be used to turn current on or off in a circuit as an electrically controlled switch, where the amount of current is determined by other circuit elements. There are two types of transistors, which have slight differences in how they are used in a circuit. A bipolar transistor has terminals labeled base, collector, and emitter. A small current at the base terminal (that is, flowing from the base to the emitter) can control or switch a much larger current between the collector and emitter terminals. For a field-effect transistor, the terminals are labeled gate, source, and drain, and a voltage at the gate can control a current between source and drain. The image to the right represents a typical bipolar transistor in a circuit. Charge will flow between emitter and collector terminals depending on the current in the base. Since internally the base and emitter connections behave like a semiconductor diode, a voltage drop develops between base and emitter while the base current exists. The amount of this voltage depends on the material the transistor is made from, and is referred to as VBE. 19 3.6 Transistor 20 Chapter 4 Component details of transmitter 4.1 IC LM358N: The LM358 series consists of two independent, high gains; internally frequency compensated operational amplifiers which were designed specifically to operate from a single power supply over a wide range of voltages. Operation from split power supplies is also possible and the low power supply current drain is independent of the magnitude of the power supply voltage. Application areas include transducer amplifiers, dc gain blocks and all the conventional op amp circuits which now can be more easily implemented in single power supply systems. For example, the LM358 series can be directly operated off of the standard +5V power supply voltage which is used in digital systems and will easily provide the required interface electronics without requiring the additional ±15V power supplies. The LM358 and LM2904 are available in a chip sized package (8-Bump micro SMD) using National's micro SMD pac Unique Characteristics In the linear mode the input common-mode voltage range includes ground and the output voltage can also swing to ground, even though operated from only a single power supply voltage. The unity gain cross frequency is temperature compensated. The input bias current is also temperature compensated. Advantages Two internally compensated op amps Eliminates need for dual supplies Allows direct sensing near GND and V OUT also goes to GND Compatible with all forms of logic Power drain suitable for battery operation 21 pin diagram of IC lm358n 4.1 pin diagram of IC lm358n 22 4.2 Preset Potentiometers comprise a resistive element, a sliding contact (wiper) that moves along the element, making good electrical contact with one part of it, electrical terminals at each end of the element, a mechanism that moves the wiper from one end to the other, and a housing containing the element and wiper. Many inexpensive potentiometers are constructed with a resistive element formed into an arc of a circle usually a little less than a full turn, and a wiper rotating around the arc and contacting it. The resistive element, with a terminal at each end, is flat or angled. The wiper is connected to a third terminal, usually between the other two. On panel potentiometers, the wiper is usually the center terminal of three. For single-turn potentiometers, this wiper typically travels just under one revolution around the contact. The only point of ingress for contamination is the narrow space between the shaft and the housing it rotates in. Another type is the linear slider potentiometer, which has a wiper which slides along a linear element instead of rotating. Contamination can potentially enter anywhere along the slot the slider moves in, making effective sealing more difficult and compromising long-term reliability. An advantage of the slider potentiometer is that the slider position gives a visual indication of its setting. While the setting of a rotary potentiometer can be seen by the position of a marking on the knob, an array of sliders can give a visual impression of, for example, the effect of a multi-channel equaliser. The resistive element of inexpensive potentiometers is often made of graphite. Other materials used include resistance wire, carbon particles in plastic, and a ceramic/metal mixture called cermet. Conductive track potentiometers use conductive polymer resistor pastes that contain hardwearing resins and polymers, solvents, and lubricant, in addition to the carbon that provides the conductive properties. Others are enclosed within the equipment and are intended to be adjusted to calibrate equipment during manufacture or repair, and not otherwise touched. They are usually physically much smaller than user-accessible potentiometers, and may need to be operated by a screwdriver rather than having a knob. They are usually called "preset potentiometers". Some presets are accessible by a small screwdriver poked through a hole in the case to allow servicing without dismantling. Multiturn potentiometers are also operated by rotating a shaft, but by several turns rather than less than a full turn. Some multiturn potentiometers have a linear resistive element with a slider which moves along it moved by a worm gear; others have a helical resistive element and a wiper that turns through 10, 20, or more complete revolutions, moving along the helix as it rotates. Multiturn potentiometers, both user-accessible and preset, allow finer adjustments; rotation through the same angle changes the setting by typically a tenth as much as for a simple rotary potentiometer. A string potentiometer is a multi-turn potentiometer operated by an attached reel of wire turning against a spring, enabling it to convert linear position to a variable resistance. User-accessible rotary potentiometers can be fitted with a switch which operates usually at the anticlockwise extreme of rotation. Before digital electronics became the norm such a component was 23 used to allow radio and television receivers and other equipment to be switched on at minimum volume with an audible click, then the volume increased, by turning a knob. Multiple resistance elements can be ganged together and controlled by the same shaft, for example, in stereo audio amplifiers for volume control. Theory of operation A potentiometer with a resistive load, showing equivalent fixed resistors for clarity. The potentiometer can be used as a voltage divider to obtain a manually adjustable output voltage at the slider (wiper) from a fixed input voltage applied across the two ends of the potentiometer. This is the most common use of them. The voltage across can be calculated by: If is large compared to the other resistances (like the input to an operational amplifier), the output voltage can be approximated by the simpler equation: (dividing throughout by and cancelling terms with as denominator) As an example, assume , , , and Since the load resistance is large compared to the other resistances, the output voltage will be approximately: Due to the load resistance, however, it will actually be slightly lower: ≈ 6.623 V. One of the advantages of the potential divider compared to a variable resistor in series with the source is that, while variable resistors have a maximum resistance where some current will always flow, dividers are able to vary the output voltage from maximum ( ) to ground (zero volts) 24 as the wiper moves from one end of the potentiometer to the other. There is, however, always a small amount of contact resistance. In addition, the load resistance is often not known and therefore simply placing a variable resistor in series with the load could have a negligible effect or an excessive effect, depending on the load. 4.2 preset 25 4.3 Infrared LED , Features · High reliability · High radiant intensity · Peak wavelength λp=940nm · 2.54mm Lead spacing · Low forward voltage · Pb free Descriptions · EVERLIGHT’S Infrared Emitting Diode(IR323/H0-A) is a high intensity diode , molded in a blue transparent plastic package. · The device is spectrally matched with phototransistor , photodiode and infrared receiver module. 4.3 IR LED Applications · Free air transmission system · Infrared remote control units with high power requirement · Smoke detector · Infrared applied system 26 4.4 Photodiode A photodiode is a p-n junction or PIN structure. When a photon of sufficient energy strikes the diode, it excites an electron, thereby creating a free electron (and a positively charged electron hole). This mechanism is also known as the inner photoelectric effect. If the absorption occurs in the junction's depletion region, or one diffusion length away from it, these carriers are swept from the junction by the built-in field of the depletion region. Thus holes move toward the anode, and electrons toward the cathode, and a photocurrent is produced. This photocurrent is the sum of both the dark current (without light) and the light current, so the dark current must be minimized to enhance the sensitivity of the device.[3] Photovoltaic mode When used in zero bias or photovoltaic mode, the flow of photocurrent out of the device is restricted and a voltage builds up. This mode exploits the photovoltaic effect, which is the basis for solar cells – a traditional solar cell is just a large area photodiode. Photoconductive mode In this mode the diode is often reverse biased (with the cathode positive), dramatically reducing the response time at the expense of increased noise. This increases the width of the depletion layer, which decreases the junction's capacitance resulting in faster response times. The reverse bias induces only a small amount of current (known as saturation or back current) along its direction while the photocurrent remains virtually the same. For a given spectral distribution, the photocurrent is linearly proportional to the illuminance (and to the irradiance).[4] Although this mode is faster, the photoconductive mode tends to exhibit more electronic noise.[citation needed] The leakage current of a good PIN diode is so low (<1 nA) that the Johnson– Nyquist noise of the load resistance in a typical circuit often dominates. Other modes of operation Avalanche photodiodes have a similar structure to regular photodiodes, but they are operated with much higher reverse bias. This allows each photo-generated carrier to be multiplied by avalanche breakdown, resulting in internal gain within the photodiode, which increases the effective responsivity of the device. A phototransistor is in essence a bipolar transistor encased in a transparent case so that light can reach the base-collector junction. It was invented by Dr. John N. Shive (more famous for his wave machine) at Bell Labs in 1948,[5]:205 but it wasn't announced until 1950.[6] The electrons that are generated by photons in the base-collector junction are injected into the base, and this photodiode current is amplified by the transistor's current gain β (or hfe). If the emitter is left unconnected, the phototransistor becomes a photodiode. While phototransistors have a higher responsivity for light they are not able to detect low levels of light any better than photodiodes.[citation needed] Phototransistors also have significantly longer response times 27 Features Response of a silicon photo diode vs wavelength of the incident light Critical performance parameters of a photodiode include: Responsivity The ratio of generated photocurrent to incident light power, typically expressed in A/W when used in photoconductive mode. The responsivity may also be expressed as a Quantum efficiency, or the ratio of the number of photogenerated carriers to incident photons and thus a unitless quantity. Dark current The current through the photodiode in the absence of light, when it is operated in photoconductive mode. The dark current includes photocurrent generated by background radiation and the saturation current of the semiconductor junction. Dark current must be accounted for by calibration if a photodiode is used to make an accurate optical power measurement, and it is also a source of noise when a photodiode is used in an optical communication system. Noise-equivalent power (NEP) The minimum input optical power to generate photocurrent, equal to the rms noise current in a 1 hertz bandwidth. NEP is essentially the minimum detectable power. The related characteristic "detectivity" (D) is the inverse of NEP, 1/NEP. There is also the "specific detectivity" ( ) which is the detectivity multiplied by the square root of the area (A) of the photodetector, ( ) for a 1 Hz bandwidth. The specific detectivity allows different systems to be compared independent of sensor area and system bandwidth; a higher detectivity value indicates a low-noise device or system.[8] Although it is traditional to give ( ) in many catalogues as a measure of the diode's quality, in practice, it is hardly ever the key parameter. When a photodiode is used in an optical communication system, these parameters contribute to the sensitivity of the optical receiver, which is the minimum input power required for the receiver to achieve a specified bit error rate. Applications P-N photodiodes are used in similar applications to other photodetectors, such as photoconductors, charge-coupled devices, and photomultiplier tubes. They may be used to generate an output which is dependent upon the illumination (analog; for measurement and the like), or to change the state of circuitry (digital; either for control and switching, or digital signal processing). 28 Photodiodes are used in consumer electronics devices such as compact disc players, smoke detectors, and the receivers for infrared remote control devices used to control equipment from televisions to air conditioners. For many applications either photodiodes or photoconductors may be used. Either type of photosensor may be used for light measurement, as in camera light meters, or to respond to light levels, as in switching on street lighting after dark. Photosensors of all types may be used to respond to incident light, or to a source of light which is part of the same circuit or system. A photodiode is often combined into a single component with an emitter of light, usually a light-emitting diode (LED), either to detect the presence of a mechanical obstruction to the beam (slotted optical switch), or to couple two digital or analog circuits while maintaining extremely high electrical isolation between them, often for safety (optocoupler). Photodiodes are often used for accurate measurement of light intensity in science and industry. They generally have a more linear response than photoconductors. They are also widely used in various medical applications, such as detectors for computed tomography (coupled with scintillators), instruments to analyze samples (immunoassay), and pulse oximeters. PIN diodes are much faster and more sensitive than p-n junction diodes, and hence are often used for optical communications and in lighting regulation. P-N photodiodes are not used to measure extremely low light intensities. Instead, if high sensitivity is needed, avalanche photodiodes, intensified charge-coupled devices or photomultiplier tubes are used for applications such as astronomy, spectroscopy, night vision equipment and laser rangefinding. 4.4photo diode 29 Chapter 5 Block Diagram of the project 5.1 Block diagram of counter 5.1 Descriptions of block diagram This project is the most common and interesting to start with. The application is counting the number of persons entering in and exiting out like in Delhi Metro stations, Industries, offices, lift, car parking, and many moreOur objective is to count the objects (persons) entering and exiting the room so we need some sensors to detect the objects and a control unit which calculates the object, below you can find the block diagram and circuit diagram which illustrate the solution and the Embedded ‘C’ source code which calculate the object. Remember that this circuit is used with GP_KIT_MCS51-2.02 from BISD Labs, New Delhi; the kit contains rest 30 of circuit like 8051 microcontroller, interfacing two digit seven segments, on board voltage regulator to provide +5V D.C, ISP circuit, and a lot. Also refer the user manual of this kit. From the block diagram it is clear that the sensor pairs are placed face to face so that an IR radiations from IR LED are continuously received by phototransistor which makes its emitter base junction forward and collector current Ic equals to emitter current Ie (i.e, Ic=Ie) assuming base current to be negligible. Hence the voltage at collector node becomes zero (logic 0) which is feed to microcontroller port pin P3.2 and P3.3, if any object is placed in between the sensor pair blocks the IR radiation which in turns put the phototransistor in cut-off mode and Ic!=Ie, this makes collector voltage to +5V (logic 1) In our program we have to poll both the inputs from both the sensors at port pin P3.2 and P3.3 to detect for the entry or exit, if sensor pair one is been obstructed (P3.2 becomes one) first, implies persons entry and second pair is obstructed (P3.3 becomes one) first shows exit. After obstructed any one sensor we have to poll for the next sensor to determine a complete entry or exit. 31 Chapter 6 Block Diagram of the transmitter circuit 6.1introduction infra red sensors are the most often used sensor by amateur roboteers. Understanding how they behave can help address many of your requirements and would suffice to address most of the problem statements for various robotics events in India. Be it a typical white/black line follower, a wall follower, obstacle avoidance, micro mouse, an advanced flavor of line follower like red line follower, etc, all of these problem statements can be easily addressed and granular control can be exercised upon your robots performance if you have a good operational understanding of Infra red sensors. Infra red sensors are in the form of diodes with 2 terminals. You can buy a pair of such diode (one transmitter and one receiver) at a very low cost of about 5 - 7 rupees only. Here onwards, we will use Tx to refer to a transmitter and Rx to refer to a receiver diode. Upon careful observation, you will notice that amongst the two ‘legs’, one has a much wider base within the diode. That is normally the cathode (negative) whereas the leg having a smaller base would be the anode (positive terminal). 6.2 Operation: When the Tx is forward biased, it begins emitting infra red. Since it’s not in visible spectrum, you will not be able to see it through nakedeyes but you will be able to view it through an ordinary cell phone camera. 32 6.1A typical transmitter circuit. The resistance R1 in the above circuit can vary. It should not be a very high value (~ 1Kohm) as then the current flowing through the diode would be very less and hence the intensity of emitted IR would be lesser. By increasing the current flowing in the circuit, you can increase the effective distance of your IR sensor. However, there are drawbacks of reducing the resistance. Firstly, it would increase the current consumption of your circuit and hence drain the battery (one of the few ‘precious’ resources for any embedded system) faster. Secondly, increasing the current might destroy the Tx. So, the final choice should be a calculated trade off between these various factors. You can also modulate the IR to achieve better distance and immunity.The receiver diode has a very high resistance, typically of the order of mega Ohms when IR is not incident upon it. However, when IR is incident upon it, the resistance decreases sharply to the order of a few kilo Ohms or even lesser. This feature forms the basis of using IR as a sensor. You will need to connect a resistance of the order of a few mega Ohm in series with the Rx. Then tap the output voltage at the point of connectivity of these two resistors. A complete Tx-Rx circuit is given below. 33 4.2 A Tx-Rx pair circuitry. Remember, the value of R2 can vary depending upon the Rx diode you are working with. You are advised to first check the resistance of Rx diode with no IR incident upon it and then select the value of R2 for decent performance. Case1: when no IR is incident upon the Rx Rx would be of the order of mega ohms and hence the output voltage would be around 2.6v – 3v depending upon your choice of R2 and the Rx. Case2: when IR is incident upon the Rx The resistance of Rx will sharply fall and hence the output voltage would be around 1.8v 1.5v depending upon your choice of Rx and R2. Once you obtain a neat difference between the output voltages in case1 and case2, your sensor is ready. How to use this IR sensor? So far, we had just prepared the sensor. Now, we will see 2 different methods of using this in your machine. Method1: The output voltage is in the form of analog voltage. You would need to convert it into digital format so that whenever IR is incident upon the Rx, the final conditioned output voltage is a logic high (binary 1) and whenever IR is not incident upon the Rx, the conditioned output voltage should be a logic low (binary 0). You can use a comparator IC to serve this purpose. A comparator IC compares 2 input voltages using an op-amp and gives a logic high or a logic low as the final output. LM324 is one such comparator. Lets see how it can be used here: 34 It has 4 separate channels meaning it can compare 4 pairs of voltages. For a single IR sensor, only one channel is enough. Here we would be using pin 1,2 and 3 for our sensor. Input voltage at pin2 > input voltage at pin3 ; Output1=> logic 0 Input voltage at pin2 logic 1 Connect the output of our sensor circuit to pin2 of this IC. Generate 2v from a potential divider circuit of multiple resistance and feed that 2v to pin3 of the IC. Therefore, Vin at pin3 = 2v (constant). Case1: when IR is not incident upon the Rx. When the IR Tx is above a black line, the black line will absorb all the IR and will not reflect an appreciable amount of IR for the Rx to receive. If you are making an obstacle avoiding robot, then when there is no obstacle in front of the IR Tx, Rx will not receive back the transmitted IR. However, when an obstacle comes in front of the Tx, it will reflect the IR incident upon it and hence Rx will receive the IR. In this case, the output voltage of the sensor = 2.5v. Hence the input voltage at pin2 =2.5v. Input voltage at pin2 > input voltage at pin3 ; Output1=> logic 0 Case2: when IR is incident upon the Rx, the output voltage of the sensor = 1.8v. Hence the input voltage at pin2 =1.8v. Input voltage at pin2 logic 1 35 Now you can easily use the digital logic level outputs to drive any logic circuit as well as couple it with a microcontroller to decide the future course of action. Method2: Using ADC to convert the analog output voltage from sensor into a digital format. This is a little tedious way of implementing the similar logic but can give you great granular control over the distance/range of your IR sensor. You can use the built in ADC channels of a microcontroller also. The program section in the tutorial of robosense covers the program required to use the adc channels of a microcontroller as well as program for implementing a simple line follower or obstacle avoiding robot. Troubleshooting: What happens if you are in the middle of a crucial competition and suddenly your robot begins to malfunction? The once reliable IR sensor seems to have ditched you just when it’s needed the most. Being sound in quickly troubleshooting a IR sensor circuit is as crucial as developing the sensor itself. Here are some of the recommended steps you can adopt to troubleshoot your sensor circuit: 36 Step1: first check if the Tx is glowing or not. You will not be able to view IR through naked eyes but a typical cell phone camera should be a good useful tool here. 6.3 Snap taken from a cell phone camera. Step2: Once you have verified that the IR TX are working fine, check if the output at the receiver side is showing correct expected voltages when IR is incident upon it and when it is absent. Step3: if the Tx and Rx are behaving correctly, please check the LM324 comparator and check if it is giving correct outputs in different scenarios. 37 6.4 Circuit diagram of counter 38 Chapter 7 Project design 7.1 Software design I found my dew sensor circuit and heater circuit from the internet as I said in the above chapter. I have made my complete project on a special purpose PCB. I prepared the layout of both of these circuits using dip trace software. I learned dip trace software in my college. Then I installed the software from the internet and started working on it. Given below is he detailed description on dip trace software. 7.2 Dip trace Dip Trace is EDA software for creating schematic diagrams and printed circuit boards. The first version of Dip Trace was released in August, 2004. The latest version as of September 2011 is Dip Trace version 2.2. Interface has been translated to many languages and new language can be added by user. There are tutorials in English, Czech, Russian and Turkish. Starting from February 2011 Dip Trace is used as project publishing standard by Parallax. Modules Schematic Design Editor PCB Layout Editor Component Editor Pattern Editor Shape-Based Auto router 3D PCB Preview 39 Freeware and Non-Profit versions A version of Dip Trace that is freely available with all the functionality of the full package except it is limited to 300 pins and 2 signal layers. Other sources Dip Trace at Seattle Robotics Society meeting Dip Trace at Nuts and Volts – October 2006 Review at C Net Some hobby and educational groups such as the PICAXE forum members have developed libraries specific to the PICAXE range of microcontroller as produced by Revolution Education including many of the frequently used associated integrated circuits. PICAXE related libraries can be found here: DIP TRACE Libraries by and for PICAXE microcontroller users External links DipTrace official Website in English DipTrace Website in Italian DipTrace Website in Turkish Novarm Ltd. Official Website in English . 40 Chapter 8 Project program // Program to make a bidirectional visitor counter using IR sensor #include <reg51.h> #define msec 1 unsigned int num=0; sbit dig_ctrl_4=P1^3; //declare the control pins of seven segments sbit dig_ctrl_3=P1^2; sbit dig_ctrl_2=P1^1; sbit dig_ctrl_1=P1^0; unsigned int digi_val[10]={0x40,0xF9,0x24,0x30,0x19,0x12,0x02,0xF8,0x00,0x10}; unsigned int dig_1,dig_2,dig_3,dig_4,test=0; unsigned char dig_disp=0; sbit up=P3^5; sbit down=P3^6; void init() //up pin to make counter count up //down pin to make counter count down // to initialize the output pins and Timer0 { up=down=1; dig_ctrl_4 = 0; dig_ctrl_3 = 0; dig_ctrl_2 = 0; dig_ctrl_1 = 0; TMOD=0x01; TL0=0xf6; TH0=0xFf; IE=0x82; 41 TR0=1; } void delay() //To provide a small time delay { TMOD=0x01; TL0=0x36; TH0=0xF6; TR0=1; while(TF0==0); TR0=0; TF0=0; } void display() interrupt 1 // Function to display the digits on seven segment. For more details refer seven segment multiplexing. { TL0=0x36; TH0=0xf6; P2=0xFF; dig_ctrl_1 = dig_ctrl_3 = dig_ctrl_2 = dig_ctrl_4 = 0; dig_disp++; dig_disp=dig_disp%4; switch(dig_disp) { case 0: P2= digi_val[dig_1]; dig_ctrl_1 = 1; break; 42 case 1: P2= digi_val[dig_2]; dig_ctrl_2 = 1; break; case 2: P2= digi_val[dig_3]; dig_ctrl_3 = 1; break; case 3: P2= digi_val[dig_4]; dig_ctrl_4 = 1; break; } } void main() { init(); while(1) { if(up==0&&down==1) //check if up pin is pressed { test++; num=test; dig_4=num%10; num=num/10; dig_3=num%10; num=num/10; 43 dig_2=num%10; dig_1=num/10; if(test==9999) test=0; } if(up==1&&down==0) //check if down pin is pressed { test--; num=test; dig_4=num%10; num=num/10; dig_3=num%10; num=num/10; dig_2=num%10; dig_1=num/10; if(test==0) test=9999; } } } 44 Chapter 9 Advantages and limitation and conclusion 12.1 Advantages This project is used to count the no. of persons in moll, metro station, car parking counting easy. By use of this project we not require any person in counting process 12.2 limitation This project is on trial bases and not yet used by the industry. This project is only count 9999 persons 45 CONCLUSION Thus by using this project the IR transmitter can be sensed and gendreted signal And given the ricever i. My project will help to remove humen works counting pertion. facility to this project we also ensure the security of the industry . 46