Vous êtes sur la page 1sur 17

AUTOMATIC ROOM LIGHT CONTROLLER WITH VISITOR COUNTER

CONTENTS
1.
2. 3. 4. 5.

ABSTRACT BLOCK DIAGRAM SCHEMATIC DIAGRAM CIRCUIT DESCRIPTION MICROCONTROLLER INTRODUCTION

6.
7. 8. 9. 10.

INTRODUCTION TO IR PAIRS.
INTRODUCTION TO LCD COMPONENTS DESCRIPTION CIRCUIT OPERATION CODING

ABSTRACT
Aim:
The aim of the project is to build the visitor count and display system using IR.

Description:
Now a days the visitor systems place an important role for all organizations.

In this design the IR transmitter and IR receiver is used to detect the person entry and person exit. If IR transmission is present, means no person has been enter in to the auditorium. If there is no IR transmission means the one person entered into the room For every absence of IR, entry count is incremented by one. For every absence of IR between exit pairs the exit count is incremented by one. Base on the existence count (entry count-exit count) in auditorium is displayed on LCD.

Technically known as "infrared radiation", infrared light is part of the electromagnetic spectrum located just below the red portion of normal visible light. The frequency of infrared ranges from 0.003 - 4 x 1014 Hz or about 300 gigahertz to 400 terahertz. A small infrared LED (light emitting diode) i.e. infrared Transmitter at the front of the remote beams out pulses of light at high speed to all of your equipment. When the infrared receivers (photo diode or phototransistor) equipment recognizes the signal as its own, it responds to the command. All of which have infrared receivers positioned on the front. For the faithful communication, good alignment of the emitter (IR TX) and detector (IR RX) i important for good operation, especially if the gap is large.

BLOCK DIAGRAM

POWER SUPPLY (5V)


MICRO CONTROLLER

LCD

AT89S52

TX

Rx

RX

TX

TRANSMITTER

RECEIVER

RECEIVER

TRANSMITTER

ENTRANCE

EXIT

SCHEMATIC DIAGRAM

CIRCUIT DESCRIPTION
POWER SUPPLY SECTION: In-order to work with any components basic requirement is power supply. In this section there is a requirement of two different voltage levels. Those are 5V DC power supply. 9V DC power supply. Now the aim is to design the power supply section which converts 230V AC in to 5V DC. Since 230V AC is too high to reduce it to directly 5V DC, therefore we need a step-down transformer that reduces the line voltage to certain voltage that will help us to convert it in to a 5V DC. Considering the efficiency factor of the bridge rectifier, we came to a conclusion to choose a transformer, whose secondary voltage is 3 to 4 V higher than the required voltage i.e. 5V. For this application 0-9V transformers is used, since it is easily available in the market. The output of the transformer is 9V AC; it feed to rectifier that converts AC to pulsating DC. Here we short listed to use Bridge rectifier, because half wave rectifier has we less in efficiency. Even though the efficiency of full wave and bridge rectifier are the same, since there is no requirement for any negative voltage for our application, we gone with bridge rectifier. Since the output voltage of the rectifier is pulsating DC, in order to convert it into pure DC we use a high value (1000UF/1500UF) of capacitor in parallel that acts as a filter. The most easy way to regulate this voltage is by using a 7805 voltage regulator, whose output voltage is constant 5V DC irrespective of any fluctuation in line voltage.

INTRODUCTION TO MICROCONTROLLER

Basic 8051 family is enough for our application; hence we are not concentrating on higher end controller families.
In order to fulfill our application basic that is AT89C51 controller is enough. But still we selected AT89S52 controller because of inbuilt ISP (in system programmer) option. There are minimum six requirements for proper operation of microcontroller. Those are: power supply section pull-ups for ports (it is must for PORT 0) Reset circuit Crystal circuit ISP circuit (for program dumping) EA/VPP pin is connected to Vcc . PORT0 is open collector thats why we are using pull -up resistor which makes PORT0 as an I/O port. Reset circuit is used to reset the microcontroller. Crystal circuit is used for the microcontroller for timing pluses. In this project we are not using external memory thats why EA/VPP pin in the microcontroller is connected to Vcc that indicates internal memory is used for this application .

SELECTION OF IR PAIR: IR PAIRS are available in IR TX & IR RX. Here we are using it only for Detecting and sending information to the microcontroller. This is wireless applications, these IR TX is sending information upto 1 feet & this signal is received by IR RX .

SELECTION OF LCD: A liquid crystal display (LCD) is an electrically modulated optical device shaped into a thin, flat panel made up of any number of color or filled monochrome pixels with liquid crystals and arrayed in front of a light source(backlight) or reflector. In this project l LCD is used to display the GSM status.

CONNECTIONS OF LCD:

We can connect LCD in 8 bit mode or 4 bit mode, if use 8 bit mode more pins necessary to interface LCD, so we can use 4 bit mode to reduce pins .In this project i used 4 bit mode and it is connected to P0.

:
FEATURES

MICROCONTROLLER 89S52

8K Bytes of In-System Reprogrammable Flash Memory Endurance: 1,000 Write/Erase Cycles Fully Static Operation: 0 Hz to 24 MHz 256 x 8-bit Internal RAM 32 Programmable I/O Lines Three 16-bit Timer/Counters Eight Interrupt Sources Programmable Serial Channel Low-power Idle and Power-down Modes DESCRIPTION: The AT89S52 is a low-power, high-performance CMOS 8-bit microcomputer with 8Kbytes of Flash programmable and erasable read only memory (PEROM). 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 AT89S52 is a powerful microcomputer, which provides a highly flexible and costeffective solution to many embedded control applications

IR PAIRS

INTRODUCTION TO LIQUID CRYSTAL DISPLAY (LCD)


Liquid crystal display is a type of display which used in digital watches and many portable computers. LCD displays utilize two sheets of polarizing material with a liquid crystal solution between them. An electric current passed through the liquid causes the crystals to align so that light cannot pass through them. Each crystal, therefore, is like a shutter, either allowing light to pass through or blocking the light. The liquid crystals can be manipulated through an applied electric voltage so that light is allowed to pass or is blocked. By carefully controlling where and what wavelength (color) of light is allowed to pass, the LCD monitor is able to display images. A back light provides LCD monitors brightness. Other advances have allowed LCDs to greatly reduce liquid crystal cell response times. Response time is basically the amount of time it takes for a pixel to change colors. In reality response time is the amount of time it takes a liquid crystal cell to go from being active to inactiv e.

PIN DESCRIPTION OF LCD:

CIRCUIT OPERATION:
In this design the IR transmitter and IR receiver is used to detect the person entry and person exit. If IR transmission is present, means no person has been enter in to the room. If there is no IR transmission means the one person entered in to the room. For every absence of IR, entry count is incremented by one. For every absence of IR between exit pairs, the exit count is incremented by one. Base on the existence count in room the lights are fans are operated trough relay.

CODING
#include<reg51.h> #include<lcd.h> sbit exit_detect = P0^1; sbit entry_detect = P0^0; void htd(unsigned char xx); void delay(unsigned int ); unsigned char dat,dat1,one,hund,ten,hund_r; unsigned int entry_count,exit_count,in_count; void main(void) { entry_detect = 1; exit_detect = 1; entry_count=exit_count=in_count=0; init_lcd(); cmd_lcd(0x01); cmd_lcd(0x80); display_lcd("VISITOR COUNTER"); delay(250); cmd_lcd(0x01); cmd_lcd(0x80); display_lcd("No.Persons: "); while(1) {

in_count = entry_count - exit_count; delay(1); if(entry_detect == 1) { while(entry_detect == 1); entry_count++; } if(exit_detect == 1) { while(exit_detect == 1); exit_count++; } htd(in_count); cmd_lcd(0x8B); write_lcd(hund+0x30); cmd_lcd(0x8C); write_lcd(ten+0x30); cmd_lcd(0x8D); write_lcd(one+0x30); } while(1); } void htd(unsigned char xx) { hund=xx/100; hund_r=xx%100; ten=hund_r/10; one=hund_r%10; } void delay(unsigned int n) { unsigned int i,j; for(i=0;i<n;i++) for(j=0;j<1275;j++); }

THANK YOU

Vous aimerez peut-être aussi