Documente Academic
Documente Profesional
Documente Cultură
List of Symbols 1. Introduction 2. Project Overview 3. Block Diagram & its Description 4. Schematic Diagram 5. Hardware design & Description 6. Software Design 7. Testing & Resulting 8. Future Expansion 9. Applications, Advantages & Disadvantages 10. References
Page Nos.
2 3 4 5 7 10 22 26 27 28 29
List of symbols
CHAPTER :- 1 INTRODUCTION
1. Introduction Of Project 1.1 Project Definition:
Project title is AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER . The objective of this project is to make a controller based model to count number of persons visiting particular room and accordingly light up the room. Here we can use sensor and can know present number of persons. In todays world, there is a continuous need for automatic appliances with the increase in standard of living, there is a sense of urgency for developing circuits that would ease the complexity of life. Also if at all one wants to know the number of people present in room so as not to have congestion. This circuit proves to be helpful.
Enter
Enter Sensor Signal Conditioning
Exit
Exit Sensor
Signal Conditioning
Power Supply
Transformer
Rectifier
A T 8 9 S 5 2
Relay Driver
Device
Device
16 Segment LCD
Buzzer
a) Power Supply:Here we used +12V and +5V dc power supply. The main function of this block is to provide the required amount of voltage to essential circuits. +12 voltage is given. +12V is given to relay driver. To get the +5V dc power supply we have used here IC 7805, which provides the +5V dc regulated power supply.
b) Enter and Exit Circuits:This is one of the main part of our project. The main intention of this block is to sense the person. For sensing the person and light we are using the light dependent register (LDR). By using this sensor and its related circuit diagram we can count the persons.
c) 89S52 Microcontroller:It is a low-power, high performance CMOS 8-bit microcontroller with 8KB of Flash Programmable and Erasable Read Only Memory (PEROM). The device is manufactured using Atmels high-density nonvolatile memory technology and is compatible with the MCS-51 TM instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic hip, the Atmel AT89S52 is a powerful Microcontroller, which provides a highly flexible and cost effective solution so many embedded control applications.
d) Relay Driver Circuit:This block has the potential to drive the various controlled devices. In this block mainly we are using the transistor and the relays. One relay driver circuit we are using to control the light. Output signal from AT89S52 is given to the base of the transistor, which we are further energizing the particular relay. Because of this appropriate device is selected and it do its allotted function.
d.1
Transmission Circuit:
This circuit diagram shows how a 555 timer IC is configured to function as a basic monostable multivibrator. A monostable multivibrator is a timing circuit that changes state once triggered, but returns to its original state after a certain time delay. It got its name from the fact that only one of its output states is stable. It is also known as a 'one-shot'. 7
In this circuit, a negative pulse applied at pin 2 triggers an internal flipflop that turns off pin 7's discharge transistor, allowing C1 to charge up through R1. At the same time, the flip-flop brings the output (pin 3) level to 'high'. When capacitor C1 as charged up to about 2/3 Vcc, the flip-flop is triggered once again, this time making the pin 3 output 'low' and turning on pin 7's discharge transistor, which discharges C1 to ground. This circuit, in effect, produces a pulse at pin 3 whose width t is just the product of R1 and C1, i.e., t=R1C1. IR Transmission circuit is used to generate the modulated 36 kHz IR signal. The IC555 in the transmitter side is to generate 36 kHz square wave. Adjust the preset in the transmitter to get a 38 kHz signal at the o/p. around 1.4K we get a 38 kHz signal. Then you point it over the sensor and its o/p will go low when it senses the IR signal of 38 kHz.
e) Receiver Circuit:
Fig. 4.2 Receiver circuit The IR transmitter will emit modulated 38 kHz IR signal and at the receiver we use TSOP1738 (Infrared Sensor). The output goes high when the there is an interruption and it return back to low after the time period determined by the capacitor and resistor in the circuit. I.e. around 1 second. CL100 is to trigger the IC555 which is configured as monostable multivibrator. Input is given to the Port 1 of the microcontroller. Port 0 is used for the 7-Segment display purpose. Port 2 is used for the Relay Turn On and Turn off Purpose.LTS 542 (Common Anode) is used for 7-Segment display. And that time Relay will get Voltage and triggered so light will get voltage and it will turn on. And when counter will be 00 that time Relay will be turned off. Reset button will reset the microcontroller.
5.3
FEATURES: 8 KB Reprogrammable flash. 32 Programmable I/O lines. 16 bit Timer/Counter3. 8 Interrupt sources. Power range: 4V 5.5V Endurance : 1000 Writes / Erase cycles 11
Fully static operation: 0 Hz to 33 MHz Three level program memory lock Power off flag Full duplex UART serial channel Low power idle and power down modes Interrupt recovery from power down modes 256 KB internal RAM Dual data pointer
Description:
The TSOP17.. Series are miniaturized receivers for infrared remote control systems. PIN diode and preamplifier are assembled on lead frame, the epoxy package is designed as IR filter. The demodulated output signal can directly be decoded by a microprocessor. TSOP17.. is the standard IR remote control receiver series, supporting all major transmission codes.
Features:
Photo detector and preamplifier in one package Internal filter for PCM frequency 12
Improved shielding against electrical field disturbance TTL and CMOS compatibility Output active low Low power consumption High immunity against ambient light Continuous data transmission possible (up to 2400 bps) Suitable burst length .10 cycles/burst
Block Diagram:
Application Circuit:
13
Description:
The LM555 is a highly stable device for generating accurate time delays or oscillation. Additional terminals are provided for triggering or resetting if desired. In the time delay mode of operation, the time is precisely controlled by one external resistor and capacitor. For astable operation as an oscillator, the free running frequency and duty cycle are accurately controlled with two external resistors and one capacitor. The circuit may be triggered and reset on falling waveforms, and the output circuit can source or sink up to 200mA or drive TTL circuits.
Features:
Direct replacement for SE555/NE555 14
Timing from microseconds through hours Operates in both astable and monostable modes Adjustable duty cycle Output can source or sink 200 mA Output and supply TTL compatible Temperature stability better than 0.005% per C Normally on and normally off output Available in 8-pin MSOP package
Applications:
Precision timing Pulse generation Sequential timing Time delay generation Pulse width modulation Pulse position modulation Linear ramp generator
15
Operation: A crystal is a solid in which the constituent atoms, molecules, or ions are packed in a regularly ordered, repeating pattern extending in all three spatial dimensions. Almost any object made of an elastic material could be used like a crystal, with appropriate transducers, since all objects have natural resonant frequencies of vibration. For example, steel is very elastic and has a high speed of sound. It was often used in mechanical filters before quartz. The resonant frequency depends on size, shape, elasticity, and the speed of sound in the material. High-frequency crystals are typically cut in the shape of a simple, rectangular plate. Low-frequency crystals, such as those used in digital watches, are typically cut in the shape of a tuning fork. For applications not needing very precise timing, a low-cost ceramic resonator is often used in place of a quartz crystal. When a crystal of quartz is properly cut and mounted, it can be made to distort in an electric field by applying a voltage to an electrode near or on the crystal. This property is known as piezoelectricity. When the field is removed, the quartz will generate an electric field as it returns to its previous shape, and this can generate a voltage. The result is that a quartz crystal behaves like a circuit composed of an inductor, capacitor and resistor, with a precise resonant frequency. (See RLC circuit.) Quartz has the further advantage that its elastic constants and its size change in 16
such a way that the frequency dependence on temperature can be very low. The specific characteristics will depend on the mode of vibration and the angle at which the quartz is cut (relative to its crystallographic axes). [5] Therefore, the resonant frequency of the plate, which depends on its size, will not change much, either. This means that a quartz clock, filter or oscillator will remain accurate. For critical applications the quartz oscillator is mounted in a temperature-controlled container, called a crystal oven, and can also be mounted on shock absorbers to prevent perturbation by external mechanical vibrations. Quartz timing crystals are manufactured for frequencies from a few tens of kilohertz to tens of megahertz. More than two billion (2109) crystals are manufactured annually. Most are small devices for consumer devices such as wristwatches, clocks, radios, computers, and cell phones. Quartz crystals are also found inside test and measurement equipment, such as counters, signal generators, and oscilloscopes.
17
5.3.5:- Transistors:
Transistors amplify current, for example they can be used to amplify the small output current from a logic chip so that it can operate a lamp, relay or other high current device. In many circuits a resistor is used to convert the changing current to a changing voltage, so the transistor is being used to amplify voltage. A transistor may be used as a switch (either fully on with maximum current, or fully off with no current) and as an amplifier (always partly on). The amount of current amplification is called the current gain, symbol hFE. For further information please see the Transistor Circuits page.
Fig. 5.5 Transistor circuit Symbols Types of transistor: There are two types of standard transistors, NPN and PNP, with different circuit symbols. The letters refer to the layers of semiconductor material used to make the transistor. Most transistors used today are NPN because this is the easiest type to make from silicon. If you are new to electronics it is best to start by learning how to use NPN transistors. The leads are labeled base (B), collector (C) and emitter(E). The most important properties to look for are the maximum collector current IC and the current gain hFE. To make selection easier most suppliers group their transistors in categories determined either by their typical use or maximum power rating. To make a final choice you will need to consult the tables of technical data which are normally provided in catalogues. They contain a great deal of useful information but they can be difficult to understand if you are not familiar with the abbreviations used. The table below shows the most important technical data for some popular transistors, tables in catalogues and reference books will usually show additional information but this is unlikely to be useful unless you are experienced. The quantities shown in the table are explained below.
18
5.3.6:- TRANSFORMER:
If you have read the page on ELECTROMAGNETISM then you will know that when a current is passed through a coil, the coil becomes surrounded by a magnetic field .This field is made up from lines of force and has the same shape as a bar magnet.
Fig. 5.6 Step down Transformer If the current is increased, the lines of force move outwards from the coil. If the current is reduced, the lines of force move inwards. If another coil is placed adjacent to the first coil then, as the field moves out or in, the moving lines of force will "cut" the turns of the second coil. As it does this, a voltage is induced in the second coil. With the 50 Hz AC mains supply , this will happen 50 times a second. This is called MUTUAL INDUCTION and forms the basis of the transformer. The input coil is called the PRIMARY WINDING, the output coil is the SECONDARY WINDING. The voltage induced in the secondary is determined by the TURNS RATIO. Primary voltage/ Secondary voltage secondary turns For example, if the secondary has half the primary turns, the secondary will have half the primary voltage. Another example is if the primary has 5000 turns and the secondary has 500 turns, then the turns ratio is 10:1. If the primary voltage is 240 volts then the secondary voltage will be x 10 smaller = 24 volts. Assuming a perfect transformer, the power provided by the primary must equal the power taken by a load on the secondary. If a 24 watt lamp is connected across a 24 volt secondary, then the primary must supply 24 watts. If it is a 240 volt primary then the current in it must be 0.1 amp. (Watts = volts x amps). To aid magnetic coupling between 19 = Number of primary turns / Number of
primary and secondary, the coils are wound on a metal CORE. Since the primary would induce power, called EDDY CURRENTS, into this core, the core is LAMINATED. This means that it is made up from metal sheets insulated from each other. Transformers to work at higher frequencies have an iron dust core, or no core at all. Note that the transformer only works on AC which has a constantly changing current and moving field. DC has a steady current and therefore a steady field and there would be no induction. Some transformers have an electrostatic screen between primary and secondary. This is to prevent some types of interference being fed from the equipment down into the mains supply, or in the other direction. Transformers are sometimes used for IMPEDANCE MATCHING. There is a page on this subject.
Features:
Common Anode 0.52 Inch Digit Height Continuous Uniform Segments Low power Requirement Excellent Characters Appearance High Brightness & High Contrast Wide Viewing Angle
20
Description:
The KA78XX/KA78XXA series of three-terminal positive regulator are available in the TO-220/D-PAK package and with several fixed output voltages, making them useful in a wide range of applications. Each type employs internal current limiting, thermal shut down and safe operating area protection, making it essentially indestructible. If adequate heat sinking is provided, they can deliver over 1A output current. Although designed primarily as fixed voltage regulators, these devices can be used with external components to obtain adjustable voltages and currents.
Features:
Output Current up to 1A Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V Thermal Overload Protection Short Circuit Protection Output Transistor Safe Operating Area Protection
21
A single pole dabble throw (SPDT) relay is connected to port RB1 of the microcontroller through a driver transistor. The relay requires 12 volts at a current of around 100ma, which cannot provide by the microcontroller. So the driver transistor is added. The relay is used to operate the external solenoid forming part of a locking device or for operating any other electrical devices. Normally the relay remains off. As soon as pin of the microcontroller goes high, the relay operates. When the relay operates and releases. Diode D2 is the standard diode on a mechanical relay to prevent back EMF from damaging Q3 when the relay releases. LED L2 indicates relay on.
22
");
person--; buzz=0; lcd_cmd(0x01); lcd_cmd(0x80); lcd_put("Persons: "); lcd_val(person); lcd_cmd(0xc0); lcd_put("Exit Detected"); secdelay(2); buzz=1; } else { buzz=0; lcd_cmd(0x01); lcd_cmd(0x80); lcd_put("No person"); secdelay(2); buzz=1; } while(exit==0); secdelay(1); } if (entry==0) { if(person<10) { person++; buzz=0; lcd_cmd(0x01); lcd_cmd(0x80); lcd_put("Persons: "); lcd_val(person); lcd_cmd(0xc0); lcd_put("Entry Detected"); secdelay(2); buzz=1; } else { buzz=0; lcd_cmd(0x01); lcd_cmd(0x80); lcd_put("FULL"); secdelay(2); buzz=1; } 24
while(entry==0); secdelay(1); } if(person>0 ) dev1=0; if(person==0) dev1=1; if(person>5 ) dev2=0; if(person==5) dev2=1; } } // active low so device's are on // active high so device's are off // active low so device's are on // active high so device's are off
25
FLOWCHART:
Fig. 4.7 Flow Chart If the sensor 1 is interrupted first then the microcontroller will look for the sensor 2. And if it is interrupted then the microcontroller will increment the count and switch on the relay, if it is first time interrupted.
26
If the sensor 2 is interrupted first then the microcontroller will look for the sensor 1. And if it is interrupted then the microcontroller will decrement the count. When the last person leaves the room then counter goes to 0 and that time the relay will turn off. And light will be turn off.
27
28
29
Disadvantages o It is used only when one single person cuts the rays of the sensor hence it cannot be used when two person cross simultaneously.
30
CHAPTER:-10 REFERENCES
Reference Books:
Programming in ANSI C: E. BALAGAURUSAMY. The 8051 microcontroller and embedded system: MUHAMMAD ALI MAZIDI JANICE GILLIPIE MAZIDI The 8051 microcontroller: KENNETH J. AYALA.
Website:
www.datas4u.com www.8051.com
31