You are on page 1of 27

INTRODUCTION

This Project Automatic Room Light Controller with Visitor Count using Microcontroller is a reliable circuit that takes over the task of controlling the room lights automatically based on the number of visitors present in the room.

When somebody enters into the room then the counter is incremented by one and the light in the room will be switched ON and when any one leaves the room then the counter is decremented by one. The light will be only switched OFF until all the persons in the room go out.

Block Diagram

Requirements(Hardware)
Power Supply LED IR Led Switches DB-107 Rectifier circuit Crystal Oscillator Resistor Ladder Micro Controller Voltage Regulator Capacitors Resistors Connectors Bread Board

Requirements(Software)

Keil Compiler Orcad

Working
In this project we have placed an IR sensor at the entrance of the room. When a person is passing through this entrance the invisible rays are abstracted, then these sensing signals are passed to the micro controller. On each entry a beep sound is heard from the buzzer. When the visitor count reaches ten, then the light glows. Also there is a sensor employed at the exit. The distractions in this sensor indicates that a person has left the room. The led is on until the room is empty i.e., when the exit counter reaches from ten to zero then the led automatically gets off.

Power Supply
Here a 230 volt 50 Hz AC current is converted to a 5volt DC using 1. A 12-0-12 step-down transformer 2. A DB-107 rectifier circuit 3. A 7805 voltage regulator

Buzzer
y A buzzer or beeper is an audio signaling device, which may

be mechanical, electromechanical, or piezoelectric. Typical uses of buzzers and beepers include alarm devices, timers and confirmation of user input such as a mouse click or keystroke. Uses: Game shows Microwave ovens and other household appliances Sporting events such as basketball games Alarm Clock

IR LED
y An IR LED, also known as IR transmitter, is a special purpose LED that transmits

infrared rays in the range of 760 nm wavelength. Such LEDs are usually made of gallium arsenide or aluminium gallium arsenide. They, along with IR receivers, are commonly used as sensors.
y

The appearance is same as a common LED. Since the human eye cannot see the infrared radiations, it is not possible for a person to identify whether the IR LED is working or not, unlike a common LED. To overcome this problem, the camera on a cell phone can be used. The camera can show us the IR rays being emanated from the IR LED in a circuit.

IR LED
Infrared (IR) light is electromagnetic radiation with a wavelength longer than that of visible light. Its wavelength has a range of 0.74 micrometers (m), and extending conventionally to 300 m and a frequency range of 1 to 400 THz.

USES:
Infrared light is used in industrial, scientific, and medical applications. Night-vision: Night-vision devices using infrared illumination allow people or animals to be observed without the observer being detected. Astronomy: In astronomy, imaging at infrared wavelengths allows observation of objects obscured by interstellar dust. Medical & Other: Infrared imaging cameras are used to detect heat loss in insulated systems, observe changing blood flow in the skin, and overheating of electrical apparatus.

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.

Working:
y Light is a form of energy that can be released by an atom. It is made up of many small particlelike packets that have energy and momentum but no mass. These particles, called photons, are the most basic units of light. y Photons are released as a result of moving electrons. In an atom, electrons move in orbitals around the nucleus. Electrons in different orbitals have different amounts of energy. Generally speaking, electrons with greater energy move in orbitals farther away from the nucleus. y

An electron releases energy when it drops from a higher orbital to a lower one. This energy is released in the form of a photon. A greater energy drop releases a higher-energy photon, which is characterized by a higher frequency.

Uses:
In general, all the LED products can be divided into two major parts, the public lighting and indoor lighting. LED uses fall into four major categories:
y Visual signals where light goes more or less directly from the source to the human

eye, to convey a message or meaning. y Illumination where light is reflected from objects to give visual response of these objects. y Measuring and interacting with processes involving no human vision. y Narrow band light sensors where LEDs operate in a reverse-bias mode and respond to incident light, instead of emitting light.

Switch
y In electronics, a switch is an electrical component that can break an electrical circuit,

interrupting the current or diverting it from one conductor to another. y The most familiar form of switch is a manually operated electromechanical device with one or more sets of electrical contacts, which are connected to external circuits. Each set of contacts can be in one of two states: Either closed meaning the contacts are touching and electricity can flow between them, or open, meaning the contacts are separated and the switch is non conducting. The mechanism actuating the transition between these two states open or closed can be either a "toggle" (flip switch for continuous "on" or "off") or "momentary" (push-for "on" or push-for "off") type.

Push Button Switch

On-off Switch

DB 107
DB 107 is a single phase 1.0 amp bridge rectifier. Its voltage range is 50 volts to 1000 volts and has a Current of 1 ampere Bridge Rectifier:

Bridge Rectifier:

For most alternative energy applications, we require a direct current (DC) voltage to be generated . The AC voltage generated is passed through a circuit of four diodes arranged as shown below and emerged converted into a more useful DC output.

Diodes allow electricity to flow in only one direction, but there is a small voltage lost across the a diode of 0.7V called the forward voltage drop. If the diode is wired in the wrong direction then no current (actually a very tiny current) flows across the diode. However, if the voltage is too high and goes over the diode's maximum reverse voltage, the diode will breakdown and fail.

Crystal Oscillators
A crystal oscillator is an electronic oscillator circuit that uses the mechanical resonance of a vibrating crystal of piezoelectric material to create an electrical signal with a very precise frequency. This frequency is commonly used to keep track of time (as in quartz wristwatches), to provide a stable clock signal for digital integrated circuits.

Resistor Ladder
A resistor ladder is an electrical circuit made of repeating units of resistors.

An R-2R Ladder is a simple and inexpensive way to perform digital-to-analog conversion, using repetitive arrangements of precision resistor networks in a ladderlike configuration.

Micro Controller
Microcontroller is a microprocessor designed specifically for control applications, and is equipped with ROM, RAM and facilities I / O on a single chip. AT89S52 is one of the family MCS-51/52 equipped with an internal 8 Kbyte Flash EPROM (Erasable and Programmable Read Only Memory), which allows memory to be reprogrammed. Features of AT89s52:
A CPU (Central Processing Unit) 8 Bit. 256 bytes of RAM (Random Access Memory) internally. Four-port I / O, which each consist of eight bits the internal oscillator and timing circuits. Two timer / counters 16 bits Five interrupt lines (two fruits and three external interrupt internal interruptions). A serial port with full duplex UART (Universal Asynchronous Receiver Transmitter). Able to conduct the process of multiplication, division, and Boolean. the size of 8 KByte EPROM for program memory. Maximum speed execution of instructions per cycle is 0.5 s at 24 MHz clock frequency. If the microcontroller clock frequency used is 12 MHz, the speed is 1 s instruction execution

y y y y y y y y y y y y y y y

Pin out Description:


Pins 1-8: Port 1 Each of these pins can be configured as an input or an output. Pin 9: RS A logic one on this pin disables the microcontroller and clears the contents of most registers. In other words, the positive voltage on this pin resets the microcontroller. By applying logic zero to this pin, the program starts execution from the beginning. Pins 10-17: Port 3 Similar to port 1, each of these pins can serve as general input or output. Besides, all of them have alternative functions: Pin 10: RXD Serial asynchronous communication input or Serial synchronous communication output. Pin 11: TXD Serial asynchronous communication output or Serial synchronous communication clock output. Pin 12: INT0 Interrupt 0 input. Pin 13: INT1 Interrupt 1 input. Pin 14: T0 Counter 0 clock input. Pin 15: T1 Counter 1 clock input. Pin 16: WR Write to external (additional) RAM. Pin 17: RD Read from external RAM. Pin 18, 19: X2, X1 Internal oscillator input and output. A quartz crystal which specifies operating frequency is usually connected to these pins. Instead of it, miniature ceramics resonators can also be used for frequency stability. Later versions of microcontrollers operate at a frequency of 0 Hz up to over 50 Hz. Pin 20: GND Ground. Pin 21-28: Port 2 If there is no intention to use external memory then these port pins are configured as general inputs/outputs. In case external memory is used, the higher address byte, i.e. addresses A8-A15 will appear on this port. Even though memory with capacity of 64Kb is not used, which means that not all eight port bits are used for its addressing, the rest of them are not available as inputs/outputs. Pin 29: PSEN If external ROM is used for storing program then a logic zero (0) appears on it every time the microcontroller reads a byte from memory. Pin 30: ALE Prior to reading from external memory, the microcontroller puts the lower address byte (A0-A7) on P0 and activates the ALE output. After receiving signal from the ALE pin, the external register (usually 74HCT373 or 74HCT375 add-on chip) memorizes the state of P0 and uses it as a memory chip address. Immediately after that, the ALU pin is returned its previous logic state and P0 is now used as a Data Bus. As seen, port data multiplexing is performed by means of only one additional (and cheap) integrated circuit. In other words, this port is used for both data and address transmission. Pin 31: EA By applying logic zero to this pin, P2 and P3 are used for data and address transmission with no regard to whether there is internal memory or not. It means that even there is a program written to the microcontroller, it will not be executed. Instead, the program written to external ROM will be executed. By applying logic one to the EA pin, the microcontroller will use both memories, first internal then external (if exists). Pin 32-39: Port 0 Similar to P2, if external memory is not used, these pins can be used as general inputs/outputs. Otherwise, P0 is configured as address output (A0-A7) when the ALE pin is driven high (1) or as data output (Data Bus) when the ALE pin is driven low (0). Pin 40: VCC +5V power supply.

y y

y y

Voltage Regulator
A voltage regulator is an electrical regulator designed to automatically maintain a constant voltage level. Voltage Regulator (regulator), usually having three legs, converts varying input voltage and produces a constant regulated output voltage. They are available in a variety of outputs. The most common part numbers start with the numbers 78 or 79 and finish with two digits indicating the output voltage. The number 78 represents positive voltage and 79 negative one. The 78XX series of voltage regulators are designed for positive input. And the 79XX series is designed for negative input. Examples: 5V DC Regulator Name: LM7805 or MC7805 -5V DC Regulator Name: LM7905 or MC7905 6V DC Regulator Name: LM7806 or MC7806 -9V DC Regulator Name: LM7909 or MC7909

Capacitors
A capacitor is a little like a battery. Although they work in completely different ways, capacitors and batteries both store electrical energy. We know that a battery has two terminals. Inside the battery, chemical reactions produce electrons on one terminal and absorb electrons on the other terminal. A capacitor is much simpler than a battery, as it can't produce new electrons -- it only stores them. Inside the capacitor, the terminals connect to two metal plates separated by a nonconducting substance, or dielectric such as mica, ceramic, cellulose, porcelain, Mylar, Teflon and even air are some of the non-conductive materials used.

Uses:
y Air - Often used in radio tuning circuits y Mylar - Most commonly used for timer circuits

like clocks, alarms and counters y Glass - Good for high voltage applications y Ceramic - Used for high frequency purposes like antennas, X-ray and MRI machines y Super capacitor - Powers electric and hybrid cars.

Resistors
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.

Color Coding:

Clue : B.B.ROY of Great Britain was a Very Good Worker. Additional Colours: A gold band in the multiplier position means 0.1, but means a 5% tolerance in the tolerance position. A silver band in the multiplier position means 0.01, but means 10% in the tolerance position.

Composition
y The most common resistor is the Carbon resistor. Inside a carbon resistor is a 'ceramic 'core' on which is deposited a spiral carbon 'track'. The track may have been machined, or 'burnt' away with a laser beam.

A wire wound resistor

A cut-away showing the inside of a carbon resistor

A 'cut-away' showing the inside of a Carbon Resistor. High-power "wire-wound" resistors have a spiral of high-resistance wire wound around the ceramic core.

Connectors, IC Bases, Bread board


Connectors: These are the devices for removably connecting electrically operated devices to the power supply. IC Base: ICs (chips) are easily damaged by heat when soldering and their short pins cannot be protected with a heat sink. Instead we use an IC holder, strictly called a DIL socket (DIL = Dual InLine), which can be safely soldered onto the circuit board. The IC is pushed into the holder when all soldering is complete. Bread Board: A breadboard (protoboard) is a construction base for prototyping of electronics. Because the solder less breadboard does not require soldering, it is reusable. This makes it easy to use for creating temporary prototypes and experimenting with circuit design.

Applications:
y Museums y Visitors counting y Cinema theaters y Shopping malls y Sports venue

Advantages:
y Highly sensitive y Low cost and reliable circuit y Directional counting y Reduces Power Consumption

Any Queries???

You might also like