Vous êtes sur la page 1sur 99

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

TABLE OF CONTENTS
PAGE NO: CHAPTER-1 1: INTRODUCTION OF PROJECT 2: PROJECT OVERVIWE CHAPTER-2 BLOCK DIAGRAM AND ITS DESCRIPTION 1: BASIC BLOCK DIAGRAM 2: BLOCK DIAGRAM DISCRIPTION CHAPTER-3 SCHEMATIC DIAGRAM TRANSMISION CIRCUIT RECEIVER CIRCUIT CIRCUIT DISCRIPTION CHAPTER-4 HARDWARE DESIGN & DESCRIPTION LIST OF COMPONENT COMPONENT DESCRIPTION 1: MICROCONTROLLER 2: ULN 2003 7805 3: VOLTAGE REGULTAR 4: POWER SUPPLY (24) (39) (42) (44) (20) (23) (14) (15) (16) (10) (11) (7) (8)

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER


5: BRIDGE RECTIFIER 6: TRANSFORMER (45) (45) (46) (47) (50) (52) (54) (56) (66)

7: DIODES
8: RESISTER 9: CAPECITOR 10: LED 11: BUZZER 555 TIMER POWER SUPPLY A: TRANSFORMER B: BASIC PART OF TRASFORMER C: COMPONENT OF TRASFORMER BRIDGE RECTIFIER IR SENSOR 7- SEGMENT DISPLAY VOLTAGE REGULATOR RELAY CIRCUIT CHAPTER-5 SOFTWARE DESIGN CHAPTER-6 TESTING AND RESULT CHAPTER-7 FUTURE EXPANSION CHAPTER-8 APPLICATION, ADVANTAGE & DISADVANTAGE CHAPTER-9 BIBLOGRAPHY

(69) (75) (78) (80) (81)

(91)

(94)

(97)

(99)

(102)

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

CHAPTER :- 1 Project Overview

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

1. Introduction Of Project
1.1 Project Definition:

Project title is AUTOMATIC ROOM LIGHT CONTROLLER WITH BIDIRECTIONAL 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.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

1.2 Project Overview

This Project Automatic Room Light Controller with Visitor Counter using Microcontroller is a reliable circuit that takes over the task of controlling the room lights as well us counting number of persons/ visitors in the room very accurately. 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. The total number of persons inside the room is also displayed on the seven segment displays.

The microcontroller does the above job. It receives the signals from the sensors, and this signal is operated under the control of software which is stored in ROM. Microcontroller AT89S52 continuously monitor the Infrared Receivers, When any object pass through the IR Receiver's then the IR Rays falling on the receiver are obstructed , this obstruction is sensed by the Microcontroller

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

CHAPTER :- 2 BLOCK DIAGRAM AND ITS DESCRIPTION

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

2.1 Basic Block Diagram

Enter
Enter Sensor Signal Conditioning

Exit

A T

Relay Driver

Exit Sensor

8
Signal Conditioning Power Supply

9 S 5 2

Light

Fig. 2.1 Basic Block Diagram

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

2.2

Block Diagram Description


The basic block diagram of the bidirectional visitor counter with automatic light controller is shown in the above figure. Mainly this block diagram consist of the following essential blocks. 1. Power Supply 2. Entry and Exit sensor circuit 3. AT 89S52 micro-controller 4. Relay driver circuit

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

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

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

3. 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-51TM 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.

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

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

CHAPTER :- 3 SCHEMATIC DIAGRAM

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

Transmission Circuit:-

Fig. 3.1 Transmitter circuit

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

Receiver Circuit:-

Fig. 3.2 Receiver circuit

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

CIRCUIT DESCRIPTION:
There are two main parts of the circuits. 1. Transmission Circuits (Infrared LEDs) 2. Receiver Circuit (Sensors)

1. Transmission Circuit:

Fig. 3.3 Transmitter 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

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

that only one of its output states is stable. It is also known as a 'oneshot'. 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.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

2. Receiver Circuit:

Fig. 3.4 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

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

when counter will be 00 that time Relay will be turned off. Reset button will reset the microcontroller.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

CHAPTER :- 4 HARDWARE DESIGN & DESCRIPTIONS

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

Hardware Design:-

Infrared Sensor TSOP1738

Microcontroller AT89S52

7-Segment Timer IC Display 555 Fig. 4.1 Snap of the entire circuit

Relay

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

4.1 Procedure Followed While Designing:

In the beginning I designed the circuit in DIPTRACE software. Dip trace is a circuit designing software. After completion of the designing circuit I prepared the layout. Then I programmed the microcontroller using KEIL software using hex file. Then soldering process was done. After completion of the soldering process I tested the circuit. Still the desired output was not obtained and so troubleshooting was done. In the process of troubleshooting I found the circuit aptly soldered and connected and hence came to conclusion that there was error in programming section which was later rectified and the desired results were obtained.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

4.2 List of Components:

Following is the list of components that are necessary to build the assembly of the Digital Speedometer Cum Odometer:

Microcontroller AT89S52 IC 7805 Sensor TSOP 1738 (Infrared Sensor) Transformer 12-0-12, 500 mA Preset 4.7K Disc capacitor 104,33pF Reset button switch Rectifier diode IN4148 Transistor BC 547, CL 100 7-Segment Display

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

COMPONENT DESCRIPTION

1)MICRO-CONTROLLER 8051 DESCRIPTION


The IC 8051 is a low-power; high-performance CMOS 8-bit microcomputer with 4K bytes of Flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmels highdensity nonvolatile memory technology and is compatible with the industry-standard MCS-51 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 chip, the Atmel IC 8051 is a powerful microcomputer which provides a highly-flexible and costeffective solution to many embedded control applications. The IC 8051 provides the following standard features: 4K bytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16-bit timer/counters, a five vector two-level interrupt architecture, full duplex serial port, on-chip oscillator and clock circuitry. In addition, the IC 8051 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue functioning.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

Pin Description of the 8051


P1.0 P1.1 P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 RST (RXD)P3.0 (TXD)P3.1 (INT0)P3.2 (INT1)P3.3 (T0)P3.4 (T1)P3.5 (WR)P3.6 (RD)P3.7 XTAL2 XTAL1 GND 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21

8051 (8031)

Vcc P0.0(AD0) P0.1(AD1) P0.2(AD2) P0.3(AD3) P0.4(AD4) P0.5(AD5) P0.6(AD6) P0.7(AD7) EA/VPP ALE/PROG PSEN P2.7(A15) P2.6(A14) P2.5(A13) P2.4(A12) P2.3(A11) P2.2(A10) P2.1(A9) P2.0(A8)

Figure No. 1.1: Pin Diagram of 8051

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

PROCESSOR
A processor is an electronic device capable of manipulating data in a way specified by a sequence of instructions.

INSTRUCTIONS
Instructions in a computer are binary numbers just like data. Different numbers, when read and executed by a processor, cause different things to happen. The instructions are also called opcodes or machine codes. Different bit patterns activate or deactivate different parts of the processing core. Every processor has its own instruction set varying in number, bit pattern and functionality.

PROGRAM
The sequence of instructions is what constitutes a program. The sequence of instructions may be altered to suit the application.

ASSEMBLY LANGUAGE
Writing and understanding such programs in binary or hexadecimal form is very difficult ,so each instructions is given a symbolic notation in English language called as mnemonics. A program written in mnemonics Form is called an assembly language program. But it must be converted into machine language for execution by processor.

ASSEMBLER
An assembly language program should be converted to machine language for execution by processor. Special software called ASSEMBLER

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

converts a program written in mnemonics to its equivalent machine opcodes.

HIGH LEVEL LANGUAGE


A high level language like C may be used to write programs for processors. Software called compiler converts this high level language program down to machine code. Ease of programming and portability.

PIN DESCRIPTION
VCC (Pin 40) Provides voltage to the chip . +5V GND (Pin 20) Ground XTAL1 (Pin 19) and XTAL2 (Pin 18) Crystal Oscillator connected to pins 18, 19.Two capacitors of 30pF value. Time for one machine cycle:11.0592/12=1.085 secs

RST (Pin 9) RESET pin

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

1.Active high. On applying a high pulse to this pin, microcontroller will reset and terminate all activities. 2.INPUT pin 3.Minimum 2 machine cycles required to make RESET 4.Value of registers after RESET

External Access: EA 31
Connected to VCC for on chip ROM Connected to Ground for external ROM containing the code Input Pin

Program Store Enable: PSEN 29


Output Pin In case of external ROM with code it is connected to the OE pin of the ROM

Address Latch Enable: ALE 30


Output Pin. Active high In case of external ROM ,ALE is used to de multiplex (PORT 0) the address and data bus by connecting to the G pin of 74LS373 chip

I/O Port Pins and their Functions:


Four ports P0,P1,P2,P3 with 8 pins each, making a total of 32 input/output pins

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

On RESET all ports are configured as output. They need to be programmed to make them function as inputs

PORT 0
Pins 32-39 Can be used as both Input or Output External pull up resistors of 10K need to be connected Dual role: 8051 multiplexes address and data through port 0 to save pins .AD0-AD7 ALE is used to de multiplex data and address bus

PORT 1
Pins 1 through 8 Both input or output No dual function Internal pull up registers On RESET configured as output

PORT 2
Pins 21 through 28 No external pull up resistor required Both input or output Dual Function: Along with Port 0 used to provide the 16-Bit address for external memory. It provides higher address A8-A16

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

PORT 3
Pins 10 through 17 No external pull up resistors required

PROCESSOR ARCHITECTURE

Block Diagram
External interrupts Interrupt Control On-chip ROM for program code
Timer/Counter

On-chip RAM

Timer 1 Timer 0

Counter Inputs

CPU Serial Port

OSC

Bus Control

4 I/O Ports

P0 P1 P2 P3

TxD RxD

Address/Data

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

Figure No. 1.3: Block Diagram of Microcontroller

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

ALU
The Arithmetic Logic Unit (ALU) performs the internal arithmetic manipulation of data line processor. The instructions read and executed by the processor decide the operations performed by the ALU and also control the flow of data between registers and ALU. Operations performed by the ALU are Addition , Subtraction , Not , AND , NAND , OR , NOR , XOR , Shift Left/Right , Rotate Left/right , Compare etc. Some ALU supports Multiplication and Division. Operands are generally transferred from two registers or from one register and memory location to ALU data inputs. The result of the operation is the placed back into a given destination register or memory location from ALU output.

REGISTERS
Registers are the internal storage for the processor. The number of registers varies significantly between processor architectures. WORKING REGISTERS Temporary storage during ALU Operations and data transfers. INDEX REGISTERS Points to memory addresses.

STATUS REGISTERS
Stores the current status of various flags denoting conditions resulting from various operations.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

CONTROL REGISTERS
Contains configuration bits that affect processor operation and the operating modes of various internal subsystems.

Memory Organization
Program Memory

Data Memory
The right half of the internal and external data memory spaces available on Atmels Flash microcontrollers. Hardware configuration for accessing up to 2K bytes of external RAM. In this case, the CPU executes from internal Flash. Port 0 serves as a multiplexed address/data bus to the RAM, and 3 lines of Port 2 are used to page the RAM. The CPU generates RD and WR signals as needed during external RAM accesses. You can assign up to 64K bytes of external data memory. External data memory addresses can be either 1 or 2 bytes wide. One-byte addresses are often used in conjunction with one or more other I/O lines to page the RAM. Two-byte addresses can also be used, in which case the high address byte is emitted at Port 2. Internal data memory addresses are always 1 byte wide, which implies an address space of only 256 bytes. However, the addressing modes for internal RAM can in fact accommodate 384 bytes. Direct addresses higher than 7FH access one memory space, and indirect addresses higher than 7FH access a different

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

memory space. Thus, the Upper 128 and SFR space occupying the same block of addresses, 80H through FFH, although they are physically separate entities. The lowest 32 bytes are grouped into 4 banks of 8 registers. Program instructions call out these registers as R0 through R7. Two bits in the Program Status Word (PSW) select which register bank is in use. This architecture allows more efficient use of code space, since register instructions are shorter than instructions that use direct addressing.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

Programming Status Word:

The Instruction Set


All members of the Atmel microcontroller family execute the same instruction set. This instruction set is optimized for 8- bit control applications and it provides a variety of fast addressing modes for accessing the internal RAM to facilitate byte operations on small data structures. The instruction set provides extensive support for 1-bit variables as a separate data type, allowing direct bit manipulation in control and logic systems that require Boolean processing. The following overview of the instruction set gives a brief description of how certain instructions can be used.

Program Status Word


The Program Status Word (PSW) contains status bits that reflect the current state of the CPU. The PSW, shown in Figure 11, resides in SFR space. The PSW contains the Carry bit, the Auxiliary Carry (for BCD operations), the tworegister bank select bits, the Overflow flag, a Parity bit, and two user-definable status flags. The Carry bit, in addition to serving as a Carry bit in arithmetic operations, also serves as the Accumulator for a number of Boolean operations.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

The bits RS0 and RS1 select one of the four register banks shown in Figure 8. A number of instructions refer to these RAM locations as R0 through R7. The status of the RS0 and RS1 bits at execution time determines which of the four banks is selected. The Parity bit reflects the number of 1s in the Accumulator: P=1 if the Accumulator contains an odd number of 1s, and P=0 if the Accumulator contains an even number of 1s. Thus, the number of 1s in the Accumulator plus P is always even. Two bits in the PSW are uncommitted and can be used as general purpose status flags.

Addressing Modes
The addressing modes in the Flash microcontroller instruction set are as follows.

Direct Addressing
In direct addressing, the operand is specified by an 8-bit address field in the instruction. Only internal data RAM and SFRs can be directly addressed.

Indirect Addressing
In indirect addressing, the instruction specifies a register that contains the address of the operand. Both internal and external RAM can be indirectly addressed. The address register for 8-bit addresses can be either the Stack Pointer or R0 or R1 of the selected register bank. The address register for 16-bit addresses can be only the 16-bit data pointer register, DPTR.

Register Instructions
The register banks, which contain registers R0 through R7, can be accessed by instructions whose opcodes carry a 3- bit register specification. Instructions that access the registers this way make efficient use of code, since this mode eliminates an address byte. When the

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

instruction is executed, one of the eight registers in the selected bank is accessed. One of four banks is selected at execution time by the two bank select bits in the PSW.

Register-Specific Instructions
Some instructions are specific to a certain register. For example, some instructions always operate on the Accumulator, so no address byte is needed to point to it. In these cases, the opcode itself points to the correct register. Instructions that refer to the Accumulator as A assemble as Accumulator-specific opcodes.

Indexed Addressing
Program memory can only be accessed via indexed addressing. This addressing mode is intended for reading look-up tables in program memory. A 16-bit base register (either DPTR or the Program Counter) points to the base of the table, and the Accumulator is set up with the table entry number. The address of the table entry in program memory is formed by adding the Accumulator data to the base pointer. Another type of indexed addressing is used in the case jump instruction. In this case the dest ination address of a jump instruction is computed as the sum of the base pointer and the Accumulator data.

SRAM
Volatile, fast, low capacity, expensive, requires lesser external support circuitry.

DRAM
Volatile, relatively slow, highest capacity needs continuous refreshing. Hence require external circuitry.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

OTP ROM
One time programmable, used for shipping in final products.

EPROM
Erasable programmable, UV Erasing, Used for system development and debugging.

EEPROM
Electrically erasable and programmable, can be erased programmed in- circuit, Used for storing system parameters.

FLASH
Electrically programmable & erasable, large capacity, organized as sectors.

BUSES
A bus is a physical group of signal lines that have a related function. Buses allow for the transfer of electrical signals between different parts of the processor

Processor buses are of three types: Data bus


Address bus Control bus

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

CONTROLLER LOGIC
Processor brain decodes instructions and generate control signal for various sub units. It has full control over the clock distribution unit of processor.

I/O Peripherals
The I/O devices are used by the processor to communicate with the external world Parallel Ports. Serial Ports. ADC/DAC.

2)ULN 2003 7805

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

Figure No. 1.4: ULN 2003

FEATURES
- Output current 500mA per driver (600mA peak) - Output voltage 50V Integrated suppression diodes for inductive loads - Outputs can be paralleled for higher current - TTL/CMOS/PMOS/DTL Compatible inputs - Inputs pinned opposite outputs to simplify Layout

DESCRIPTION
The ULN2001, ULN2002, ULN2003 and ULN2004 are high voltage, high current Darlington Arrays each contain seven open collector Darlington pairs with common emitters. Each Channel rated at 500mA and can withstand peak currents of 600mA. Suppression diodes are Included for inductive load driving and the inputs are pinned opposite the outputs to simplify board

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

MAXIMUM RATING Table No. 1.2: Maximum Rating of ULN Table :-1 Absolute max ratings Symbol V Vi Ic Ib Ta Parameter Output voltage Input voltage Countinuous collector current Countinuous base current Operating ambient tempreture range Storage tempreture range Junction tempreture Value 50 30 500 25 -20 - 85 Unit V V Ma Ma

Tstg

-55 - 155

Tj

150

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

Table :-2 Thermal Data Symbol R th.ra Parameter Thermal resistance junction ambient - max Dip -16 70 So -16 120 Unit C/w

WHY WE USE ULN 2003?


Digital system and microcontroller pins lack sufficient current to drive the relay.

(3)VOLTAGE REGULATOR
Voltage regulator ICs are available with fixed (typically 5, 12 and 15V) or variable output voltages. The maximum current they can pass also rates them. Negative voltage regulators are available, mainly for use in dual supplies. Most regulators include some automatic protection from excessive current (over load protection) and overheating (thermal protection). Many of fixed voltage regulator ICs has 3 leads. They include a hole for attaching a heat sink if necessary.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

Figure No. 1.5: 7805 Voltage Regulator

DESCRIPTION
These voltage regulators are monolithic circuit integrated circuit designed as fixed voltage regulators for a wide variety of applications including local, on card regulation. These regulators employ internal current limiting, thermal shutdown, and safe-area compensation. With adequate heat sinking they can deliver output current in excess of 1.0 A. Although designed primarily as a fixed voltage regulator, these devices can be used with external components to obtain adjustable voltage and current.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

FEATURES Output current in Excess of 1.0 A


No external component required Internal thermal overload protection Internal short circuit current limiting Output transistor safe-area compensation Output voltage offered in 2% and 4% tolerance Available I n surface mount D2PAK and standard 3-lead transistor packages Previous commercial temperature range has been extended to a junction temperature range of -40 degree C to +125 degree C.

(4)POWER SUPPLY

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

(5) BRIDGE RECTIFIER


Bridge rectifier circuit consists of four diodes arranged in the form of a bridge as shown in figure.

OPERATION
During the positive half cycle of the input supply, the upper end A of the transformer secondary becomes positive with respect to its lower point B. This makes Point1 of bridge Positive with respect to point 2. The diode D1 & D2 become forward biased & D3 & D4 become reverse biased. As a result a current starts flowing from point1, through D1 the load & D2 to the negative end. During negative half cycle, the point2 becomes positive with respect to point1. Diodes D1 & D2 now become reverse biased. Thus a current flow from point 2 to point1.

(6)TRANSFORMER
Transformer is a major class of coils having two or more windings usually wrapped around a common core made from laminated iron sheets. It has two cols

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

named primary and secondary. If the current flowing through primary is fluctuating, then a current will be inducted into the secondary winding. A steady current will not be transferred from one coil to other coil.

Transformers are of two types:


1.Step up transformer 2.Step down transformer In the power supply we use step down transformer. We apply 220V AC on the primary of step down transformer. This transformer step down this voltages to 6V AC. We Give 6V AC to rectifier circuit, which convert it to 5V DC.

(7)DIODE
The diode is a p-n junction device. Diode is the component used to control the flow of the current in any one direction. The diode widely works in forward bias.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

Diode When the current flows from the P to N direction. Then it is in forward bias. The Zener diode is used in reverse bias function i.e. N to P direction. Visually the identification of the diode`s terminal can be done by identifying he silver/black line. The silver/black line is the negative terminal (cathode) and the other terminal is the positive terminal (cathode).

APPLICATION
Diodes: Rectification, free-wheeling, etc Zener diode: Voltage control, regulator etc. Tunnel diode: Control the current flow, snobbier circuit, etc

(8)RESISTORS
The flow of charge through any material encounters an opposing force similar in many respects to mechanical friction .this opposing force is called resistance of the material .in some electric circuit resistance is deliberately introduced in form of resistor. Resistor used fall in three categories , only two of which are color coded which are metal film and carbon film resistor .the third category is the wire wound type ,where value are generally printed on the vitreous paint finish of the component. Resistors are in ohms and are represented in Greek letter omega, looks as an upturned horseshoe. Most electronic circuit require resistors to make them work properly and it is obliviously important to find out something about the different types of resistors available. Resistance is measured in ohms, the

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

symbol for ohm is an omega ohm. 1 ohm is quite small for electronics so resistances are often given in kohm and Mohm. Resistors used in electronics can have resistances as low as 0.1 ohm or as high as 10 Mohm.

FUNCTION
Resistor restrict the flow of electric current, for example a resistor is placed in series with a light-emitting diode(LED) to limit the current passing through the LED.

TYPES OF RESISTORS FIXED VALUE RESISTORS


It includes two types of resistors as carbon film and metal film .These two types are explained under

1. CARBON FILM RESISTORS


During manufacture, at in film of carbon is deposited onto a small ceramic rod. The resistive coating is spiraled away in an automatic machine until the resistance between there two ends of the rods is as close as possible to the correct value. Metal leads and end caps are added, the resistors is covered with an insulating coating and finally painted with colored bands to indicate the resistor value

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

Figure No. 1.15: Carbon Film Resistors


Another example for a Carbon 22000 Ohms or 22 Kilo-Ohms also known as 22K at 5% tolerance: Band 1 = Red, 1st digit Band 2 = Red, 2nd digit Band 3 = Orange, 3rd digit, multiply with zeros, in this case 3 zero's Band 4 = Gold, Tolerance, 5%

2.METAL FILM RESISTORS


Metal film and metal oxides resistors are made in a similar way, but can be made more accurately to within 2% or 1% of their nominal vale there are some difference in performance between these resistor types, but none which affects their use in simple circuit.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

3.WIRE WOUND RESISTOR


A wire wound resistor is made of metal resistance wire, and because of this, they can be manufactured to precise values. Also, high wattage resistors can be made by using a thick wire material. Wire wound resistors cannot be used for high frequency circuits. Coils are used in high frequency circuit. Wire wound resistors in a ceramic case, strengthened with special cement. They have very high power rating, from 1 or 2 watts to dozens of watts. These resistors can become extremely hot when used for high power application, and this must be taken into account when designing the circuit.

TESTING
Resistors are checked with an ohm meter/millimeter. For a defective resistor the ohm-meter shows infinite high reading.

(9)CAPACITORS
In a way, a capacitor is a little like a battery. Although they work in completely different ways, capacitors and batteries both store electrical energy. If you have read How Batteries Work , then you know that a battery has two terminals. Inside the battery, chemical reactions produce electrons on one terminal and absorb electrons at the other terminal.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

BASIC
Like a battery, a capacitor has two terminals. Inside the capacitor, the terminals connect to two metal plates separated by a dielectric. The dielectric can be air, paper, plastic or anything else that does not conduct electricity and keeps the plates from touching each other. You can easily make a capacitor from two pieces of aluminum foil and a piece of paper. It won't be a particularly good capacitor in terms of its storage capacity, but it will work. In an electronic circuit, a capacitor is shown like this:

Figure No. 1.17: Symbol of Capacitor

When you connect a capacitor to a battery, heres what happens:

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

The plate on the capacitor that attaches to the negative terminal of the battery accepts electrons that the battery is producing. The plate on the capacitor that attaches to the positive terminal of the battery loses electrons to the battery.

TESTING
To test the capacitors, either analog meters or specia l digital meters with the specified function are used. The non-electrolyte capacitor can be tested by using the digital meter. Multi meter mode : Continuity Positive probe : One end Negative probe : Second end Display : `0`(beep sound occur) `OL` Result : Faulty OK

(10)LED
LED falls within the family of P-N junction devices. The light emitting diode (LED) is a diode that will give off visible light when it is energized. In any forward biased P-N junction there is, with in the structure and primarily close to the junction, a recombination of hole and electrons. This recombination requires that the energy possessed by the unbound free electron be transferred to another state. The process of giving off light by applying an electrical source is called electroluminescence.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

LED is a component used for indication. All the functions being carried out are displayed by led .The LED is diode which glows when the current is being flown through it in forward bias condition. The LEDs are available in the round shell and also in the flat shells. The positive leg is longer than negative leg.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

(11)BUZZER
Buzzer is a device used for beep signal. This will help us to make understand information or message. A buzzer is usually electronic device used in automobiles, household applications etc.

It mostly consists 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 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 electrical bell without the metal gong. 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 derive a loudspeaker and hook this circuit to a cheap 8-ohm speaker. These buzzers do not make a sound or turn on a light, they stop a nearby digital clock, briefly fire two smoke cannons on each side of the stage exit and open the exit. However, at the end of the Heartbreaker in Viking, the buzzer is replaced with a sword that, when removed, causes two

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

contacts to touch, closing the circuit and causing the latter two actions above to occur.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

555 TIMER

Definition of Pin Functions

Refer to the internal 555 schematic of Fig. 1

Pin 1 (Ground): The ground (or common) pin is the most-negative supply
potential of the device, which is normally connected to circuit common (ground) when operated from positive supply voltages.

Pin 2 (Trigger): This pin is the input to the lower comparator and is used to set

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

the latch, which in turn causes the output to go high. This is the beginning of the timing sequence in monostable operation. Triggering is accomplished by taking the pin from above to below a voltage level of 1/3 V+ (or, in general, one-half the voltage appearing at pin 5). The action of the trigger input is level-sensitive, allowing slow rate-of-change waveforms, as well as pulses, to be used as trigger sources. The trigger pulse must be of shorter duration than the time interval determined by the external R and C. If this pin is held low longer than that, the output will remain high until the trigger input is driven high again. One precaution that should be observed with the trigger input signal is that it must not remain lower than 1/3 V+ for a period of time longer than the timing cycle. If this is allowed to happen, the timer will re-trigger itself upon termination of the first output pulse. Thus, when the timer is driven in the monostable mode with input pulses longer than the desired output pulse width, the input trigger should effectively be shortened by differentiation. The minimum-allowable pulse width for triggering is somewhat dependent upon pulse level, but in general if it is greater than the 1uS (micro-Second), triggering will be reliable. A second precaution with respect to the trigger input concerns storage time in the lower comparator. This portion of the circuit can exhibit normal turn-off delays of several microseconds after triggering; that is, the latch can still have a trigger

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

input for this period of time after the trigger pulse. In practice, this means the minimum monostable output pulse width should be in the order of 10uS to prevent possible double triggering due to this effect. The voltage range that can safely be applied to the trigger pin is between V+ and ground. A dc current, termed the trigger current, must also flow from this terminal into the external circuit. This current is typically 500nA (nano-amp) and will define the upper limit of resistance allowable from pin 2 to ground. For an astable configuration operating at V+ = 5 volts, this resistance is 3 Mega-ohm; it can be greater for higher V+ levels.

Pin 3 (Output): The output of the 555 comes from a high-current totem-pole
stage made up of transistors Q20 - Q24. Transistors Q21 and Q22 provide drive for source-type loads, and their Darlington connection provides a high-state output voltage about 1.7 volts less than the V+ supply level used. Transistor Q24 provides current-sinking capability for low-state loads referred to V+ (such as typical TTL inputs). Transistor Q24 has a low saturation voltage, which allows it to interface directly, with good noise margin, when driving current-sinking logic. Exact output saturation levels vary markedly with supply voltage, however, for both high and low states. At a V+ of 5 volts, for instance, the low state Vce(sat) is

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

typically 0.25 volts at 5 mA. Operating at 15 volts, however, it can sink 200mA if an output-low voltage level of 2 volts is allowable (power dissipation should be considered in such a case, of course). High-state level is typically 3.3 volts at V+ = 5 volts; 13.3 volts at V+ = 15 volts. Both the rise and fall times of the output waveform are quite fast, typical switching times being 100nS. The state of the output pin will always reflect the inverse of the logic state of the latch. Since the latch itself is not directly accessible, this relationship may be best explained in terms of latch-input trigger conditions. To trigger the output to a high condition, the trigger input is momentarily taken from a higher to a lower level. [see "Pin 2 Trigger"]. This causes the latch to be set and the output to go high. Actuation of the lower comparator is the only manner in which the output can be placed in the high state. The output can be returned to a low state by causing the threshold to go from a lower to a higher level [see "Pin 6 - Threshold"], which resets the latch. The output can also be made to go low by taking the reset to a low state near ground [see "Pin 4 - Reset"]. The output voltage available at this pin is approximately equal to the Vcc applied to pin 8 minus 1.7V.

Pin 4 (Reset): This pin is also used to reset the latch and return the output to a
low state. The reset voltage threshold level is 0.7 volt, and a sink current of 0.1mA

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

from this pin is required to reset the device. These levels are relatively independent of operating V+ level; thus the reset input is TTL compatible for any supply voltage. The reset input is an overriding function; that is, it will force the output to a low state regardless of the state of either of the other inputs. It may thus be used to terminate an output pulse prematurely, to gate oscillations from "on" to "off", etc. Delay time from reset to output is typically on the order of 0.5 S, and the minimum reset pulse width is 0.5 S. Neither of these figures is guaranteed, however, and may vary from one manufacturer to another. In short, the reset pin is used to reset the flip-flop that controls the state of output pin 3. The pin is activated when a voltage level anywhere between 0 and 0.4 volt is applied to the pin. The reset pin will force the output to go low no matter what state the other inputs to the flip-flop are in. When not used, it is recommended that the reset input be tied to V+ to avoid any possibility of false resetting.

Pin 5 (Control Voltage): This pin allows direct access to the 2/3 V+ voltagedivider point, the reference level for the upper comparator. It also allows indirect access to the lower comparator, as there is a 2:1 divider (R8 - R9) from this point to the lower-comparator reference input, Q13. Use of this terminal is the option of the user, but it does allow extreme flexibility by permitting modification of the

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

timing period, resetting of the comparator, etc. When the 555 timer is used in a voltage-controlled mode, its voltage-controlled operation ranges from about 1 volt less than V+ down to within 2 volts of ground (although this is not guaranteed). Voltages can be safely applied outside these limits, but they should be confined within the limits of V+ and ground for reliability. By applying a voltage to this pin, it is possible to vary the timing of the device independently of the RC network. The control voltage may be varied from 45 to 90% of the Vcc in the monostable mode, making it possible to control the width of the output pulse independently of RC. When it is used in the astable mode, the control voltage can be varied from 1.7V to the full Vcc. Varying the voltage in the astable mode will produce a frequency modulated (FM) output. In the event the control-voltage pin is not used, it is recommended that it be bypassed, to ground, with a capacitor of about 0.01uF (10nF) for immunity to noise, since it is a comparator input. This fact is not obvious in many 555 circuits since I have seen many circuits with 'no-pin-5' connected to anything, but this is the proper procedure. The small ceramic cap may eliminate false triggering.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

Pin 6 (Threshold): Pin 6 is one input to the upper comparator (the other being
pin 5) and is used to reset the latch, which causes the output to go low. Resetting via this terminal is accomplished by taking the terminal from below to above a voltage level of 2/3 V+ (the normal voltage on pin 5). The action of the threshold pin is level sensitive, allowing slow rate-of-change waveforms. The voltage range that can safely be applied to the threshold pin is between V+ and ground. A dc current, termed the threshold current, must also flow into this terminal from the external circuit. This current is typically 0.1A, and will define the upper limit of total resistance allowable from pin 6 to V+. For either timing configuration operating at V+ = 5 volts, this resistance is 16 Mega-ohm. For 15 volt operation, the maximum value of resistance is 20 MegaOhms.

Pin 7 (Discharge): This pin is connected to the open collector of a npn


transistor (Q14), the emitter of which goes to ground, so that when the transistor is turned "on", pin 7 is effectively shorted to ground. Usually the timing capacitor is connected between pin 7 and ground and is discharged when the transistor turns "on". The conduction state of this transistor is identical in timing to that of the output stage. It is "on" (low resistance to ground) when the output is low and "off" (high resistance to ground) when the output is high. In both the monostable

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

and astable time modes, this transistor switch is used to clamp the appropriate nodes of the timing network to ground. Saturation voltage is typically below 100mV (milli-Volt) for currents of 5 mA or less, and off-state leakage is about 20nA (these parameters are not specified by all manufacturers, however). Maximum collector current is internally limited by design, thereby removing restrictions on capacitor size due to peak pulse-current discharge. In certain applications, this open collector output can be used as an auxiliary output terminal, with current-sinking capability similar to the output (pin 3).

Pin 8 (V +): The V+ pin (also referred to as Vcc) is the positive supply voltage
terminal of the 555 timer IC. Supply-voltage operating range for the 555 is +4.5 volts (minimum) to +16 volts (maximum), and it is specified for operation between +5 volts and +15 volts.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

The buffer circuit's input has a very high impedance (about 1M ) so it requires only a few A, but the output can sink or source up to 200mA. This enables a high impedance signal source (such as an LDR) to switch a low impedance output transducer (such as a lamp). It is an inverting buffer or NOT gate because the output logic state (low/high) is the inverse of the input state: Input low (< 1/3 Vs) makes output high, +Vs Input high (> 2/3 Vs) makes output low, 0V

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

When the input voltage is between 1/3 and 2/3 Vs the output remains in its present state. This intermediate input region is a deadspace where there is no response, a property called hysteresis, it is like backlash in a mechanical linkage. This type of circuit is called a Schmitt trigger. If high sensitivity is required the hysteresis is a problem, but in many circuits it is a helpful property. It gives the input a high immunity to noise because once the circuit output has switched high or low the input must change back by at least 1 /3 Vs to make the output switch back.

Fig: IR Sensor Circuit.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

POWER SUPPLY:

A: TRANSFORMER:
A transformer is a device that transfers electrical energy from one circuit to another through inductively coupled conductors the transformer's coils or "windings". Except for air-core transformers, the conductors are commonly wound around a single iron-rich core, or around separate but magneticallycoupled cores. A varying current in the first or "primary" winding creates a varying magnetic field in the core (or cores) of the transformer. This varying magnetic field induces a varying electromotive force (EMF) or "voltage" in the "secondary" winding. This effect is called mutual induction.

If a load is connected to the secondary circuit, electric charge will flow in the secondary winding of the transformer and transfer energy from the primary circuit to the load connected in the secondary circuit.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

The secondary induced voltage VS, of an ideal transformer, is scaled from the primary VP by a factor equal to the ratio of the number of turns of wire in their respective windings:

By appropriate selection of the numbers of turns, a transformer thus allows an alternating voltage to be stepped up by making NS more than NP or stepped down, by making it

B: BASIC PARTS OF A TRANSFORMER :


In its most basic form a transformer consists of: A primary coil or winding. A secondary coil or winding. A core that supports the coils or windings. Refer to the transformer circuit in figure as you read the following explanation: The primary winding is connected to a 60-hertz ac voltage source. The magnetic field (flux) builds up (expands) and collapses (contracts) about the primary winding. The expanding and contracting magnetic field around the primary winding cuts the secondary winding and induces an alternating voltage into the winding. This voltage causes alternating current to flow through the load. The voltage may be stepped up or down depending on the design of the primary and secondary windings.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

C: THE COMPONENTS OF A TRANSFORMER :


Two coils of wire (called windings) are wound on some type of core material. In some cases the coils of wire are wound on a cylindrical or rectangular cardboard form. In effect, the core material is air and the transformer is called an AIR-CORE TRANSFORMER. Transformers used at low frequencies, such as 60 hertz and 400 hertz, require a core of low-reluctance magnetic material, usually iron. This type of transformer is called an IRON-CORE TRANSFORMER. Most power transformers are of the iron-core type. The principle parts of a transformer and their functions are:

The CORE, which provides a path for the magnetic lines of flux. The PRIMARY WINDING, which receives energy from the ac source.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

The SECONDARY WINDING, which receives energy from the primary winding and delivers it to the load.

The ENCLOSURE, which protects the above components from dirt, moisture, and mechanical damage.

BRIDGE RECTIFIERA bridge rectifier makes use of four diodes in a bridge arrangement to achieve full-wave rectification. This is a widely used configuration, both with individual diodes wired as shown and with single component bridges where the diode bridge is wired internally.

A: Basic operation :
According to the conventional model of current flow originally established by Benjamin Franklin and still followed by most engineers today, current is assumed to flow through electrical conductors from the positive to the negative pole. In actuality, free electrons in a conductor nearly always flow from the negative to the positive pole. In the vast majority of applications, however, the actual direction of current flow is irrelevant. Therefore, in the discussion below the conventional model is retained.In the diagrams below, when the input connected to the left corner of the diamond is positive, and the input connected to the right corner is negative, current flows from the upper supply terminal to the right along the red (positive) path to the output, and returns to the lower supply terminal via the blue (negative) path.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

When the input connected to the left corner is negative, and the input connected to the right corner is positive, current flows from the lower supply terminal to the right along the red path to the output, and returns to the upper supply terminal via the blue path.

In each case, the upper right output remains positive and lower right output negative. Since this is true whether the input is AC or DC, this circuit not only produces a DC output from an AC input, it can also provide what is sometimes called "reverse polarity protection". That is, it permits normal functioning of DCpowered equipment when batteries have been installed backwards, or when the

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

leads (wires) from a DC power source have been reversed, and protects the equipment from potential damage caused by reverse polarity.Prior to availability of integrated electronics, such a bridge rectifier was always constructed from discrete components. Since about 1950, a single four-terminal component containing the four diodes connected in the bridge configuration became a standard commercial component and is now available with various voltage and current ratings.

B: OUTPUT SMOOTHINGO :
For many applications, especially with single phase AC where the full-wave bridge serves to convert an AC input into a DC output, the addition of a capacitor may be desired because the bridge alone supplies an output of fixed polarity but continuously varying or "pulsating" magnitude (see diagram above).

The function of this capacitor, known as a reservoir capacitor (or smoothing capacitor) is to lessen the variation in (or 'smooth') the rectified AC output voltage waveform from the bridge. One explanation of 'smoothing' is that the capacitor provides a low impedance path to the AC component of the output, reducing the

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

AC voltage across, and AC current through, the resistive load. In less technical terms, any drop in the output voltage and current of the bridge tends to be canceled by loss of charge in the capacitor. This charge flows out as additional current through the load. Thus the change of load current and voltage is reduced relative to what would occur without the capacitor. Increases of voltage correspondingly store excess charge in the capacitor, thus moderating the change in output voltage / current. The simplified circuit shown has a well-deserved reputation for being dangerous, because, in some applications, the capacitor can retain a lethal charge after the AC power source is removed. If supplying a dangerous voltage, a practical circuit should include a reliable way to safely discharge the capacitor. If the normal load cannot be guaranteed to perform this function, perhaps because it can be disconnected, the circuit should include a bleeder resistor connected as close as practical across the capacitor. This resistor should consume a current large enough to discharge the capacitor in a reasonable time, but small enough to minimize unnecessary power waste. Because a bleeder sets a minimum current drain, the regulation of the circuit, defined as percentage voltage change from minimum to maximum load, is improved. However in many cases the improvement is of insignificant magnitude. The capacitor and the load resistance have a typical time constant = RC where C and R are the capacitance and load resistance respectively. As long as the load resistor is large enough so that this time constant is much longer than the time of

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

one ripple cycle, the above configuration will produce a smoothed DC voltage across the load. In some designs, a series resistor at the load side of the capacitor is added. The smoothing can then be improved by adding additional stages of capacitorresistor pairs, often done only for sub-supplies to critical high-gain circuits that tend to be sensitive to supply voltage noise. The idealized waveforms shown above are seen for both voltage and current when the load on the bridge is resistive. When the load includes a smoothing capacitor, both the voltage and the current waveforms will be greatly changed. While the voltage is smoothed, as described above, current will flow through the bridge only during the time when the input voltage is greater than the capacitor voltage. For example, if the load draws an average current of n Amps, and the diodes conduct for 10% of the time, the average diode current during conduction must be 10n Amps. This non-sinusoidal current leads to harmonic distortion and a poor power factor in the AC supply. In a practical circuit, when a capacitor is directly connected to the output of a bridge, the bridge diodes must be sized to withstand the current surge that occurs when the power is turned on at the peak of the AC voltage and the capacitor is fully discharged. Sometimes a small series resistor is included before the capacitor to limit this current, though in most applications the power supply transformer's resistance is already sufficient. Output can also be smoothed using a choke and second capacitor. The choke tends to keep the current (rather than the voltage) more constant. Due to the

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

relatively high cost of an effective choke compared to a resistor and capacitor this is not employed in modern equipment. Some early console radios created the speaker's constant field with the current from the high voltage ("B +") power supply, which was then routed to the consuming circuits, (permanent magnets were then too weak for good performance) to create the speaker's constant magnetic field. The speaker field coil thus performed 2 jobs in one: it acted as a choke, filtering the power supply, and it produced the magnetic field to operate the speaker.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

TSOP1738 (INFRARED SENSOR)

Fig. 4.2 Infrared Sensor

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 Improved shielding against electrical field disturbance TTL and CMOS compatibility

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

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:

Fig. 4.3 Block Diagram of TSOP 1738

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

Application Circuit:

Fig. 4.4 Application circuit

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

LTS 542 (7-Segment Display)


Description:
The LTS 542 is a 0.52 inch digit height single digit seven-segment display. This device utilizes Hi-eff. Red LED chips, which are made from GaAsP on GaP substrate, and has a red face and red segment.

Fig. 4.6 7 Segment

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

Features:

Common Anode

0.52 Inch Digit Height Continuous Uniform Segments Low power Requirement Excellent Characters Appearance High Brightness & High Contrast Wide Viewing Angle

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

LM7805 (Voltage Regulator)

Fig. 4.7 Voltage Regulator

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.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

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

RELAY CIRCUIT:

Fig. 4.8 Relay

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

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

standard diode on a mechanical relay to prevent back EMF from damaging Q3 when the relay releases. LED L2 indicates relay on.

THE CAPACITOR FILTER-

The simple capacitor filter is the most basic type of power supply filter. The application of the simple capacitor filter is very limited. It is sometimes used on extremely high-voltage, low-current power supplies for cathode ray and similar electron tubes, which require very little load current from the supply. The capacitor filter is also used where the power-supply ripple frequency is not critical; this frequency can be relatively high. The capacitor (C1) shown in figure 415 is a simple filter connected across the output of the rectifier in parallel with the load.

Full-wave rectifier with a capacitor filter.

When this filter is used, the RC charge time of the filter capacitor (C1) 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 at all.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

Better filtering also results when the input frequency is high; therefore, the fullwave rectifier output is easier to filter than that of the half-wave rectifier because of its higher frequency. For you to have a better understanding of the effect that filtering has on Eavg, a comparison of a rectifier circuit with a filter and one without a filter is illustrated in views A and B of figure 4-16. The output waveforms in figure 4-16 represent the unfiltered and filtered outputs of the half-wave rectifier circuit. Current pulses flow through the load resistance (RL) each time a diode conducts. The dashed line indicates the average value of output voltage. For the half-wave rectifier, Eavg is less than half (or approximately 0.318) of the peak output voltage. This value is still much less than that of the applied voltage. With no capacitor connected across the output of the rectifier circuit, the waveform in view A has a large pulsating component (ripple) compared with the average or dc component. When a capacitor is connected across the output (view B), the average value of output voltage (Eavg) is increased due to the filtering action of capacitor C1.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

A: UNFILTERED :

Half-wave rectifier with and without filtering.

B: FILTERED :

The value of the capacitor is fairly large (several microfarads), thus it presents a relatively low reactance to the pulsating current and it stores a substantial charge.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

The rate of charge for the capacitor is limited only by the resistance of the conducting diode, which is relatively low. Therefore, the RC charge time of the circuit is relatively short. As a result, when the pulsating voltage is first applied to the circuit, the capacitor charges rapidly and almost reaches the peak value of the rectified voltage within the first few cycles. The capacitor attempts to charge to the peak value of the rectified voltage anytime a diode is conducting, and tends to retain its charge when the rectifier output falls to zero. (The capacitor cannot discharge immediately.) The capacitor slowly discharges through the load resistance (RL) during the time the rectifier is non-conducting. The rate of discharge of the capacitor is determined by the value of capacitance and the value of the load resistance. If the capacitance and load-resistance values are large, the RC discharge time for the circuit is relatively long. A comparison of the waveforms shown in figure 4-16 (view A and view B) illustrates that the addition of C1 to the circuit results in an increase in the average of the output voltage (Eavg) and a reduction in the amplitude of the ripple component (Er), which is normally present across the load resistance. Now, let's consider a complete cycle of operation using a half-wave rectifier, a capacitive filter (C1), and a load resistor (RL). As shown in view A of figure 4-17, the capacitive filter (C1) is assumed to be large enough to ensure a small reactance to the pulsating rectified current. The resistance of RL is assumed to be much greater than the reactance of C1 at the input frequency. When the circuit is energized, the diode conducts on the positive half cycle and current flows through the circuit, allowing C1 to charge. C1 will charge to

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

approximately the peak value of the input voltage. (The charge is less than the peak value because of the voltage drop across the diode (D1)). In view A of the figure, the heavy solid line on the waveform indicates the charge on C1. As illustrated in view B, the diode cannot conduct on the negative half cycle because the anode of D1 is negative with respect to the cathode. During this interval, C1 discharges through the load resistor (RL). The discharge of C1 produces the downward slope as indicated by the solid line on the waveform in view B. In contrast to the abrupt fall of the applied ac voltage from peak value to zero, the voltage across C1 (and thus across RL) during the discharge period gradually decreases until the time of the next half cycle of rectifier operation. Keep in mind that for good filtering, the filter capacitor should charge up as fast as possible and discharge as little as possible. Figure. - Capacitor filter circuit (positive and negative half cycles). POSITIVE HALFCYCLE

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

Figure. - Capacitor filter circuit (positive and negative half cycles). NEGATIVE HALF-CYCLE

Since practical values of C1 and RL ensure a more or less gradual decrease of the discharge voltage, a substantial charge remains on the capacitor at the time of the next half cycle of operation. As a result, no current can flow through the diode until the rising ac input voltage at the anode of the diode exceeds the voltage on the charge remaining on C1. The charge on C1 is the cathode potential of the diode. When the potential on the anode exceeds the potential on the cathode (the charge on C1), the diode again conducts, and C1 begins to charge to approximately the peak value of the applied voltage. After the capacitor has charged to its peak value, the diode will cut off and the capacitor will start to discharge. Since the fall of the ac input voltage on the anode is considerably more rapid than the decrease on the capacitor voltage, the

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

cathode quickly become more positive than the anode, and the diode ceases to conduct. Operation of the simple capacitor filter using a full-wave rectifier is basically the same as that discussed for the half-wave rectifier. Referring to figure, you should notice that because one of the diodes is always conducting on alternation, the filter capacitor charges and discharges during each half cycle. (Note that each diode conducts only for that portion of time when the peak secondary voltage is greater than the charge across the capacitor.)
Figure - Full-wave rectifier (with capacitor filter).

Another thing to keep in mind is that the ripple component (E r) of the output voltage is an ac voltage and the average output voltage (Eavg) is the dc component of the output. Since the filter capacitor offers relatively low impedance to ac, the majority of the ac component flows through the filter capacitor. The ac component is therefore bypassed (shunted) around the load resistance, and the

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

entire dc component ( Eavg) flows through the load resistance. This statement can be clarified by using the formula for XC in a half-wave and full-wave rectifier. First, you must establish some values for the circuit. As you can see from the calculations, by doubling the frequency of the rectifier, you reduce the impedance of the capacitor by one-half. This allows the ac component to pass through the capacitor more easily. As a result, a full-wave rectifier output is much easier to filter than that of a half-wave rectifier. Remember, the smaller the XC of the filter capacitor with respects to the load resistance, the better the filtering action. Since

the largest possible capacitor will provide the best filtering. Remember, also, that the load resistance is an important consideration. If load resistance is made small, the load current increases, and the average value of output voltage (Eavg) decreases. The RC discharge time constant is a direct function of the value of the load resistance; therefore, the rate of capacitor voltage discharge is a direct function of the current through the load. The greater the load current, the more rapid the discharge of the capacitor, and the lower the average value of output voltage. For this reason, the simple capacitive filter is seldom used with rectifier circuits that must supply a relatively large load current. Using the simple capacitive filter in conjunction with a full-wave or bridge rectifier provides improved filtering

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

because the increased ripple frequency decreases the capacitive reactance of the filter capacitor.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

CHAPTER :- 5 SOFTWARE DESIGN

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

FLOW CHART:

Fig. 4.7 Flow Chart

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

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

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

CHAPTER :- 6 TESTING AND RESULTS

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

Testing And Results

We started our project by making power supply. That is easy for me but when we turn toward the main circuit, there are many problems and issues related to it, which we faced, like component selection, which components is better than other and its feature and cost wise a We started our project by making power supply. That is easy for me but when I turn toward the main circuit, there are many problems and issues related to it, which are I faced, like component selection, which components is better than other and its feature and cost wise also, then refer the data books and other materials related to its. I had issues with better or correct result, which I desired. And also the software problem. I also had some soldering issues which were resolved using continuity checks performed on the hardware. We had issues with better or correct result, which we desired. And also the software problem. We also had some soldering issues which were resolved using continuity checks performed on the hardware. We started testing the circuit from the power supply. There we got over first trouble. After getting 9V from the transformer it was not converted to 5V and the circuit received 9V.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

As the solder was shorted IC 7805 got burnt. So we replaced the IC7805.also the circuit part around the IC7805 were completely damaged..with the help of the solder we made the necessary paths.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

CHAPTER :- 7 FUTURE EXPANSION

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

FUTURE EXPANSION

By using this circuit and proper power supply we can implement various applications Such as fans, tube lights, etc.

By modifying this circuit and using two relays we can achieve a task of opening and closing the door.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

CHAPTER :- 8 APPLICATION, ADVANTAGES & DISADVANTAGES

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

APPLICATION, ADVANTAGES & DISADVANTAGES

Application
o For counting purposes o For automatic room light control

Advantages o Low cost o Easy to use o Implement in single door

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.

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

CHAPTER :- 9 BIBILOGRAPHY

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

Bibliography
Reference Books Programming in ANSI C: E BALAGURUSAMY The 8051microcontroller and embedded systems: MUHAMMAD ALI
MAZIDI, JANICE GILLISPIE MAZIDI The 8051 microcontroller: KENNETH J. AYALA

Website
www.datasheets4u.com www.8051.com

Vous aimerez peut-être aussi