You are on page 1of 56

DIGITAL VISITOR COUNTER 1

1. INTRODUCTION
Man has come a long way in the terms of development over a period of time .In olden days man used kerosene lamps and handheld fans in his house .The invention of electricity was the major breakthrough in technology ,which has enabled man to simply many jobs .After the invention of electricity came the electric lamp and the electric fan. The increase preference for commercial energy has led to sharp increase in demand for electricity and fossil fuels. Use of fossil fuels resulted in the emission of huge quantity of CO2. There is still a considerable potential for adopting energy efficiency methods in various sectors of country. About a billion consumers and the world depend on nuclear electricity for some of their power needs. Electricity is an important commodity and as the world population grows the need for electricity will grow. World consumption of electricity is actually expected to double our next 30 years. Electricity is used in industry commerce public transport and of course in homes although many countries around the world use nuclear energy to generate electricity there are still about 2 billion people being underdeveloped countries who have no electricity at all. Electrical energy being an important element of infrastructure has to be

ensured its availability on sustainable basic .on the other hand, demand for energy is growing manifold and energy resources are becoming scarce and costlier.

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 2

Among the various strategies involved for meeting energy demand efficient use of energy and its conversion emerges out to be least cost option in any given strategies apart from being environmentally benign.

Saving power is the mantra of the times now, again to ensure the power is utilized /saved per necessity and not wasted is still yet another exercise which needs human intervention and presence of mind .it is impossible to stick to this and there is no mechanism that human can adopt physically to increase or decrease the light based on the number of people. Our project aim at the automated process of counting the number of people who are in the room, who have exited, along with the automated process of controlling room light. Digital visitor counter with room light controller is a reliable circuit that takes over the task of controlling the room lights as well as counting number of persons in the room .Main concept behind this project is to measure and display the number of persons entering in any room like seminar hall, conference 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. The total number of persons inside the room is also displayed on LCD .Here microcontroller used is 89C52 which is compatible with MCS-51 products .and other main components are IR Sensor ,which have wide coverage and provide interference free audio ,LCD used to display the number of persons in the room ,buzzer and relay is also used
COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

is

DIGITAL VISITOR COUNTER 3

2. COMPONENTS USED

MICROCONTROLLER (AT89C52) RELAY TRANSISTORS 16*2 LCD CAPACITORS RESISTORS DIODE PULL UP RESISTOR BRIDGE RECTIFIER VOLTAGE REGULATOR CRYSTAL 11.059Mhz BUZZER LOAD

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 4

3. BLOCK DIAGRAM

LCD 16X2

IR TX1

IR RECE IVER 1

MICRO CONTR OLLER 89C52

BUZZER

IR TX2

IR RECE IVER 2

RELAY DRIVER

AC IN

RELAY

LOAD

FIGURE 1:Block Diagram

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 5

BLOCK DESCRIPTION

MICROCONTROLLER (AT89C52): It is the heart of the project. Microcontroller is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. Most Microcontrollers are general purpose which have additional parts that allow them to control external devices. Microcontroller is used to Gather input from various sensors and Process this input into a set of actions LCD DISPLAY (16X2): A liquid crystal display (LCD) is a thin, flat electronic visual display that uses the light modulating properties of liquid crystals (LCs). Its low electrical power consumption enables it to be used in battery-powered electronic equipment .it is used to display the number of persons in the room and who have exited the room RELAY: A relay is an electrically operated switch. Many relays use an electromagnet to operate a switching mechanism mechanically, but other operating principles are also used. Relays are used where it is necessary to control a circuit by a low-power sign or where several circuits must be controlled by one signal. relay is used to turn on /off the load according to the number of persons in the room. BUZZER: Buzzer or beeper is an audio signaling device .typical uses of buzzers include alarm devices, timers and confirmation of user input such as mouse click or keystroke.
COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 6

the function of buzzer is to ring according to the entry and exit of persons.

IR SENSOR:

An infrared sensor is a device (usually with supporting circuitry) that can detect infrared light (which is below the optical spectrum) for use to a purpose. Most of the remote controls for TVs and other entertainment equipment use infrared energy as the transmission medium to carry information between the control and the equipment to be operated. Infrared sensors also have important scientific, military, security and rescue applications since they can "see" the "radiant heat energy" which is infrared radiation. This electromagnetic energy is in the wavelengths from about 750 nm, which is the lower end of thet well over 10,000 nm, deep in the infrared. The "heart" of the system per the question is a photo detector or photo sensor. And it does its thing based on black body radiation, which it the emission of energy based on the temperature of the object. As the radiant energy is a direct function of temperature, even the slightest difference in temperature results in the radiation of a slightly different wavelength of infrared light

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 7

WORKING OF BLOCK DIAGRAM

When the persons enters ,the path is obstructed ,it is sensed by the IR sensor ,it is transmitted and received then fed to the microcontroller, the counter is incremented by one and the buzzer rings and the count is displayed on the LCD. Relay act as electric switch. When the person enters the room the count is incremented by one and the buzzer rings once, when the person leaves the room the count is decremented by one and the buzzer rings twice.

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 8

4. CIRCUIT DIAGRAM

Figure 2: Circuit Diagram


COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 9

CIRCUIT DIAGRAM DESCRIPTION

In this circuit, it contains mainly five components. The micro controller is the central part of the circuit. Here we use 89C52 IC. It is a 40 pin IC. In these 8 pins are required for the working of this micro controller. There are mainly 4 ports for the input and the output interfacing namely P0, P1, P2, P3 ,in each port there are 8 pins. For the sensing, we use an IR sensor namely TSOP1738. It is a 3 Pin IC. Pin 1 is used as output pin. Pin2 is used for Vcc. 5V is required for the working of this sensor. Pin 3 used as ground. Sensor can sense the interrupt, when any one cross the path, then the output from the sensor become Low. This input is given to the port1. The capacitors connected to this sensor become grounded. This helps us to avoid the repairs from the transmitter. The transmitter produces high-low variations continuously. As result of this produces repels, this affect the micro controller by producing wrong results. The resistor connected to the transistor for arranging the suitable base voltage. The voltage required for the base for proper working is 6V. Thus the resistor used as 4.7K-15k. When the output from the sensor becomes High, there is no drive for the base, collector-Emitter junction become switched OFF. The emitter ground do not get in to the connector also. The transmitter connected to the sensor can act as a switch. The resistor connected to the collector as a pull up resister. Its value ranges from 4.7K-10K.
COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 10

The capacitor grounded used for the repels avoidance from the collector. Here we use 2 sensor for separating the increment and decrement. If only one sensor can be placed then the person can enter or leaving, the count can be decremented that leads to the wrong result. Hence 2 sensors can be used to count properly by incrementing or decrementing. The resistors and capacitors connected to this 2 sensors are same. The buzzer connected to the micro controller, for produce a sound, when anyone entering in to a room it produces a single sound, when anyone exit from the room it produces twice the sound. Here the transistor acts as a switch. When the base got a voltage the emitters become grounded and this can get in the collector also. In this way the buzzer got the ground and externally 5V from the power supply. The diode connected helps to protect the buzzer from 12V in the micro controller. The base resistor, its value from 4.7K to 10K helps to keep the base voltage .6V. Liquid Crystal Display helps to display the count very accurately. It is a 16 pin device. There we use a 16X2 LCD namely HD44780. 16 characters can be printed in two rows. The first pin for ground, second pin is or externally +5V power supply. The third pin is for controlling the brightness of the display. Then the next 3 pins used for commands. They are read/write pin, Register select and enable pin. The seventh pin to 14th pin used as data pins. The next pin stands for the voltage behind the display. The last pin for Vcc. The resister connected to the third pin for controlling the brightness. Its values are 270 the value of the resister R is 2.2K. The resistor connected between the LCD and the microcontroller is a pull up resistor, its value is 10K array resister.

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 11

Relay, is an electrically controlled switch. When a high output from the micro controller gets, the diode become forward biased and transistor become ON. The transistor act as a switch. The resistor connected between is used for controlling the base voltage .6V. At that time the LED become glow, the LED got the ground and the power supply +5V Vcc. Thus the common pin and normally closed pin get magnetized and Relay become ON. The diode connected in reverse biased to the collected is used to avoid the emf produced by the coils in the relay. The resistor connected to the LED, to control the voltage. Its value is 1K. For the working of 89C52 Micro controller, it requires +5V power supply, Thus 5V is also used for sensor, buzzer and LCD for relay, it requires a 12V power supply. For this, external voltages first the AC is converted in to DC by using full wave bridge rectifier, this DC is given to the voltage regulators. LM 7805 is used to regulate 5V and LM7812 is used to regulate 12V for the circuits. The capacitors used in this circuit is to avoid the AC repels.

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 12

5. COMPONENT ANALYSIS

MICROCONTROLLER:

Microcontroller is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. Program memory in the form of NOR flash or OTP ROM is also often included on chip, as well as a typically small amount of RAM. Microcontrollers are designed for embedded applications, in contrast to the microprocessors used in personal computers or other general purpose applications. Microcontrollers are used in automatically controlled products and devices, such as automobile engine control systems, implantable medical devices, remote controls, office machines, appliances, power tools, toys and other embedded systems. By reducing the size and cost compared to a design that uses a separate microprocessor, memory, and input/output devices, microcontrollers make it economical to digitally control even more devices and processes. Mixed signal microcontrollers are common, integrating analog components needed to control non-digital electronic systems. Some microcontrollers may use four-bit words and operate at clock rate frequencies as low as 4 kHz, for low power consumption (milli watts or microwatts). They will generally have the ability to retain functionality while waiting for an event such as a button press or other interrupt; power consumption
COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 13

while sleeping (CPU clock and most peripherals off) may be just nano watts making many of them well suited for long lasting battery applications. Other microcontrollers may serve performance-critical roles, where they may need to act more like a digital signal processor (DSP), with higher clock speeds and power consumption Most Microcontrollers are general purpose which have additional parts that allow them to control external devices. We often use the terms Microcontroller and Microprocessor interchangeably. A designer will use a Microcontroller to Gather input from various sensors Process this input into a set of actions Use the output mechanisms on the Microcontroller to do something useful

The 'general purpose' attribute of a Microcontroller is very significant, and shouldn't be overlooked. A general purpose Microcontroller is a very powerful tool that allows a designer to create a special purpose design. The design becomes partially hardware and partially software. There is great flexibility in the software end, as the designer can create practically unlimited variations on the design by changing the software

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 14

BLOCK DIAGRAM OF MICROCONTROLLER

Figure 3: Block Diagram Of Microcontroller

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 15

89c52 PIN DIAGRAM:

FIGURE 4: PINOUT OF 89C52

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 16

Pin Description:

VCC Supply voltage. GND Ground. Port 0 Port 0 is an 8-bit open drain bi-directional I/O port. As an output port, each pin can sink eight TTL inputs. When 1sare written to port 0 pins, the pins can be used as high impedance inputs .Port 0 can also be configured to be the multiplexed low order address/data bus during accesses to external program and data memory .In this mode, P0 has internal pull-ups .Port 0 also receives the code bytes during Flash programming and outputs the code bytes during program verification. External pull-ups are required during Port 1 Port 1 is an 8-bit bi-directional I/O port with internal pull-ups .The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by the internal pull ups and can be used as inputs. As inputs ,Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull ups. In addition, P1.0 and P1.1 can be configured to be the timer/counter2 external count input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively, as shown in the following table .Port 1 also receives the low-order address bytes during Flash programming and verification.
COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 17

Port 2 Port 2 is an 8-bit bi-directional I/O port with internal pull-ups .The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the internal pull ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull ups .Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that use 16-bit addresses (MOVX @DPTR). In this application, Port 2 uses strong internal pull-ups when emitting 1s. During accesses to external data memory that use8-bit addresses (MOVX @ RI), Port 2emits the contents of the P2 Special Function Register .Port 2 also receives the high-order address bits and some control signals during Flash programming and verification. Port 3 Port 3 is an 8-bit bi-directional I/O port with internal pullups.The Port 3 output buffers can sink/source four TTL inputs.When 1s are written to Port 3 pins, they are pulled high by the internal pull ups and can be used as inputs. As inputs, Port pins that are externally being pulled low will source current (IIL) because of the pull ups. Port 3 also serves the functions of various special features of the AT89C51, as shown in the following table. Port 3 also receives some control signals for Flash programming and verification. RST Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device.

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 18

ALE/PROG

Address Latch Enable is an output pulse for latching the low byte of the address during accesses to external memory .This pin is also the program pulse input (PROG) during Flash programming .In normal operation, ALE is emitted at a constant rate of 1/6the oscillator frequency and may be used for external timing or clocking purposes. However, that one ALE pulse is skipped during each access to external data memory If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALEdisable bit has no effect if the microcontroller is in external execution mode. PSEN Program Store Enable is the read strobe to external program memory. When the AT89C52 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory. EA/VPP External Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H upto FFFFH. However , that if lock bit 1 is programmed, EA will be Internally latched on reset .EA should be strapped to VCC for internal program executions.

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 19

This pin also receives the 12-volt programming enable voltage(VPP) during Flash programming when 12-voltprogramming is selected. XTAL1 Input to the inverting oscillator amplifier and input to the internal clock operating circuit. XTAL2 Output from the inverting oscillator amplifier

89C52 MICRONTROLLER

The AT89C52 is a low-power, high-performance CMOS 8-bit microcomputer with 8Kbytes 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 industry-standard 80C51 and 80C52 instruction set and pinout.The on-chip Flash allows the program memory to be reprogrammed in-system or by aconventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C52 is a powerful microcomputer which provides a highly-flexible and costeffective solution to many embedded control

Features: Compatible with MCS-51 Products


COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 20

8K Bytes of In-System Reprogrammable Flash Memory Endurance: 1,000 Write/Erase Cycles Fully Static Operation: 0 Hz to 24 MHz Three-level Program Memory Lock 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

Data Memory

The AT89C52 implements 256 bytes of on-chip RAM. The upper 128 bytes occupy a parallel address space to the Special Function Registers. That means the upper128bytes have the same addresses as the SFR space but are physically separate from SFR space .When an instruction accesses an internal location above address 7FH, the address mode used in the instruction specifies whether the CPU accesses the upper 128 bytes of RAM or the SFR space. Instructions that use direct addressing access SFR space .For example, the following direct addressing instruction accesses the SFR at location 0A0H (which is P2). MOV 0A0H, #data
COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 21

Instructions that use indirect addressing access the upper128 bytes of RAM. For example, the following indirect addressing instruction, where R0 contains 0A0H, accesses the data byte at address 0A0H, rather than P2 (whose address is 0A0H). MOV @R0, #data

FIGURE 5:Hardware platform

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 22

IR SENSOR

An infrared sensor is a device (usually with supporting circuitry) that can detect infrared light (which is below the optical spectrum) for use to a purpose. Most of the remote controls for TVs and other entertainment equipment use infrared energy as the transmission medium to carry information between the control and the equipment to be operated. Infrared sensors also have important scientific, military, security and rescue applications since they can "see" the "radiant heat energy" which is infrared radiation. This electromagnetic energy is in the wavelengths from about 750 nm, which is the lower end of the to well over 10,000 nm, deep in the infrared. The "heart" of the system per the question is a photo detector or photo sensor. And it does its thing based on black body radiation, which it the emission of energy based on the temperature of the object. As the radiant energy is a direct function of temperature, even the slightest difference in temperature results in the radiation of a slightly different wavelength of infrared light

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 23

APPLICATIONS OF IR SENSOR
Infrared sensors are used in a wide variety of applications and can be used in any situation that requires thermal energy detection. Infrared detectors are most commonly used in conjunction with an infrared emitter in order to transfer infrared light. This involves data transfer through a narrow beam of infrared light that is invisible to the human eye. For example, television remotes emit infrared light in order to change channels and the television itself has a built-in infrared detector to receive the remotes signals. Infrared sensors are also used as motion detectors in order to open doors, track objects, or activate specific systems based on the thermal energy that is irradiated from people, animals, and moving objects. They are also used in night-vision applications, laser range finding, and heat-seeking missiles.

ADVANTAGES OF IR SENSOR

Infrared sensors have several advantages. They can receive infrared light that is irradiated from both living and non-living objects. This is essential for many of the applications that infrared detectors are used for. In fact, infrared detectors can detect infrared light from far distances over a large area, much like the human eye is capable of detecting visible light. Infrared detectors operate in real-time and detect movement, making them ideal for security purposes. Likewise, infrared detectors help humans see what other devices do not allow them to see, such as leaks in underground pipes
COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 24

LCD DISPLAY

A liquid crystal display (LCD) is a thin, flat electronic visual display that uses the light modulating properties of liquid crystals (LCs). LCs do not emit light directly. They are used in a wide range of applications including: computer monitors, television, instrument panels, aircraft cockpit displays, signage etc. They are common in consumer devices such as video players, gaming devices, clocks, watches, calculators, and telephones. LCDs have displaced cathode ray tube (CRT) displays in most applications .A liquid crystal display (LCD) is an electro-optical amplitude modulator realized as a thin, flat display device made up of any number of color or monochrome pixels arrayed in front of a light source or reflector. It is often utilized in battery-powered electronic devices because it uses very small amounts of electric power .Each pixel of an LCD typically consists of a layer of molecules aligned between two transparent electrodes, and two polarizing filters, the axes of transmission of which are (in most of the cases) perpendicular to each other. With no liquid crystal between the polarizing filters, light passing through the first filter would be blocked by the second (crossed) polarizer. The surfaces of the electrodes that are in contact with the liquid crystal material are treated so as to align the liquid crystal molecules in a particular direction. This treatment typically consists of a thin polymer layer that is unidirectional rubbed using, for example, a cloth. The direction of the liquid crystal alignment is then defined by the direction of rubbing. Electrodes are made of a
COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 25

transparent conductor called Indium Tin Oxide (ITO). Before applying an electric field, the orientation of the liquid crystal molecules is determined by the alignment at the surfaces. In a twisted nematic device, the surface alignment directions at the two electrodes are perpendicular to each other, and so the molecules arrange themselves in a helical structure, or twist. Because the liquid crystal material is bire fringent, light passing through one polarizing filter is rotated by the liquid crystal helix as it passes through the liquid crystal layer, allowing it to pass through the second polarized filter. Half of the incident light is absorbed by the first When a voltage is applied across the electrodes, a torque acts to align the liquid crystal molecules parallel to the electric field, distorting the helical structure (this is resisted by elastic forces since the molecules are constrained at the surfaces). This reduces the rotation of the polarization of the incident light, and the device appears grey. If the applied voltage is large enough, the liquid crystal molecules in the center of the layer are almost completely untwisted and the polarization of the incident light is not rotated as it passes through the liquid crystal layer.

This light will then be mainly polarized perpendicular to the second filter, and thus be blocked and the pixel will appear black. By controlling the voltage applied across the liquid crystal layer in each pixel, light can be allowed to pass through in varying amounts thus constituting different levels of gray. The optical effect of a twisted nematic device in the voltage-on state is far less dependent on variations in the device thickness than that in the voltageoff state. Because of this, these devices are usually operated between crossed

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 26

polarizers such that they appear bright with no voltage (the eye is much more sensitive to variations in the dark state than the bright state). These devices can also be operated between parallel polarizers, in which case the bright and dark states are reversed. The voltage-off dark state in this configuration appears blotchy, however, because of small variations of thickness across the device. Both the liquid crystal material and the alignment layer material contain ionic compounds. If an electric field of one particular polarity is applied for a long period of time, this ionic material is attracted to the surfaces and degrades the device performance. This is avoided either by applying an alternating current or by reversing the polarity of the electric field as the device is addressed (the response of the liquid crystal layer is identical, regardless of the polarity of the applied field). When a large number of pixels are needed in a display, it is not technically possible to drive each directly since then each pixel would require independent electrodes. Instead, the display is multiplexed. In a multiplexed display, electrodes on one side of the display are grouped and wired together (typically in columns), and each group gets its own voltage source. On the other side, the electrodes are also grouped (typically in rows), with each group getting a voltage sink. The groups are designed so each pixel has a unique, unshared combination of source and sink. The electronics, or the software driving the electronics then turns on sinks in sequence, and drives sources for the pixels of each sink.

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 27

Passive-matrix and active-matrix addressed LCDs LCDs with a small number of segments, such as those used in digital watches and pocket calculators, have individual electrical contacts for each segment. An external dedicated circuit supplies an electric charge to control each segment. This display structure is unwieldy for more than a few display elements. Small monochrome displays such as those found in personal organizers, or older laptop screens have a passive-matrix structure employing super-twisted nuematic (STN) or double-layer STN (DSTN) technologythe latter of which addresses a color-shifting problem with the formerand color-STN (CSTN)wherein color is added by using an internal filter. Each row or column of the display has a single electrical circuit. The pixels are addressed one at a time by row and column addresses. This type of display is called passive-matrix addressed because the pixel must retain its state between refreshes without the benefit of a steady electrical charge. As the number of pixels (and, correspondingly, columns and rows) increases, this type of display becomes less feasible. Very slow response times and poor contrast are typical of passive-matrix addressed LCDs. High-resolution color displays such as modern LCD computer monitors and televisions use an active matrix structure. A matrix of thin-film transistors (TFTs) is added to the polarizing and color filters. Each pixel has its own dedicated transistor, allowing each column line to access one pixel. When a row line is activated, all of the column lines are connected to a row of pixels and the correct voltage is driven onto all of the column lines. The row line is then deactivated and the next row line is activated. All of the row lines are activated in sequence during
COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 28

a refresh operation. Active-matrix addressed displays look "brighter" and "sharper" than passive-matrix addressed displays of the same size, and generally have quicker response times, producing much better images. LCD Operation: In recent years the LCD is finding widespread use replacing LEDs (sevensegment LEDs or other multi segment LEDs). This is due to the following reasons: The declining prices of LCDs. The ability to display numbers, characters, and graphics. This is in contrast to LEDs, which are limited to numbers and a few characters. Incorporation of a refreshing controller into the LCD, thereby relieving the CPU of the task of refreshing the LCD. In contrast, the LED must be refreshed by the CPU (or in some other way) to keep displaying the data. Ease of programming for characters and graphics. LCD pin descriptions: The LCD discussed in this section has 14 pins. The function of each pin is given in the table below. VCC, VSS, and VEE: While VCC and
VSS

provide +5V and ground, respectively, VEE is used for

controlling LCD contrast. RS, Register Select:


COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 29

There are two very important registers inside the LCD. The RS pin is used for their selection as follows. If RS=0, the instruction command code register is selected, allowing the user to send a command such as clear display, cursor at home, etc. If RS=1 the data register is selected, allowing the user to send data to be displayed on the LCD. R/W, Read/Write: R/W input allows the user to write information to the LCD or read information from it. R/W=1 when reading; R/W=0 when writing.

E, Enable: The enable pin is used by the LCD to latch information presented to its data pins. When data is supplied to data pins, a high-to-low pulse must be applied to this pin in order for the LCD to latch in the data present at the data pins. This pulse must be a minimum of 450ns wide. D0-D7: The 8-bit data pins, D0-D7, are used to send information to the LCD or read the contents of the LCDs internal registers.

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 30

To display letters and numbers, we send ASCII codes for the letters A-Z, az, and numbers 0-9 to these pins while making RS=1. There are also instruction command codes that can be sent to the LCD to clear the display or force the cursor to the home position or blink the cursor. We also use RS=0 to check the busy flag bit to see if the LCD is ready to receive information. The busy flag is D7 and can be read when R/W=1 and RS=0, as follows: if R/W=1, RS=0. When D7=1 (busy flag=1), the LCD is busy taking care of internal operations and will not accept any new information.

FIGURE 6-LCD Interface

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 31

Code Hex ) 1 2 4 6 5 7 8 A C E F 10 14 18 1C 80 C0 38

( Command to LCD Instruction Register Clear display screen Return home Decrement cursor ( shift cursor to left ) Increment cursor ( shift cursor to right ) Shift display right Shift display left Display off, cursor off Display off, cursor on Display on, cursor off Display on, cursor blinking Display off, cursor blinking Shift cursor position to left Shift cursor position to right Shift the entire display to the left Shift the entire display to the right Force cursor to beginning of 1st line Force cursor to beginning of 2nd line 2 lines and 5x7 matrix

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 32

Pin No 1 2 3 4

Name Vss Vdd Vee RS

Function Ground +ve Supply Contrast Register Set

USE

5v Volts Regulated DC This is used to set the contrast1 Register select signal 0:Instruction register (when writing) Busy flag & address counter (When reading) 1:Data register (when writing & reading) Read/write select signal 0 for writing , 1 for reading Operation (data read/write) enable signal

5 6 7 8 9 10 11 12 13 14 15 16

R/W E D0 D1 D2 D3 D4 D5 D6 D7 A K

Read / Write Enable Data Bit 0 Data Bit 1 Data Bit 2 Data Bit 3 Data Bit 4 Data Bit 5 Data Bit 6 Data Bit 7 +4.2 for Back light Power supply Back light ( 0V)

Positive supply for back light if available

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 33

LCD Advantages 1. Sharpness - Image is perfectly sharp at the native resolution of the panel. 2. Geometric Distortion - Zero geometric distortion at the native resolution of the panel. 3. Brightness - High peak intensity produces very bright images. 4. Screen Shape - Screens are perfectly flat. 5. Physical - Thin, with a small footprint. Consume little electricity and produce little heat

CRYSTAL OSCILATOR:
11.0592 MHz crystals are often used because it can be divided to give you exact clock rates for most of the common baud rates for the UART, especially for the higher speeds (9600, 19200). Despite the "oddball" value, these crystals are readily available and commonly used.

VOLTAGE REGULATOR [7805] :


The 78xx (also sometimes known as LM78xx) series of devices is a family of selfcontained fixed linear voltage regulator integrated circuits. The 78xx family is a very popular choice for many electronic circuits which require a regulated power

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 34

supply, due to their ease of use and relative cheapness. When specifying individual ICs within this family, the xx is replaced with a two-digit number, which indicates the output voltage the particular device is designed to provide (for example, the 7805 has a 5 volt output, while the 7812 produces 12 volts). The 78xx lines are positive voltage regulators, meaning that they are designed to produce a voltage that is positive relative to a common ground. There are related line of79xx devices which are complementary negative voltage regulators. 78xx and 79xx ICs can be used in combination to provide both positive and negative supply voltages in the same circuit, if necessary. FEATURES Output Current up to 1A Output Voltages of 5, 6, 8, 9, 10, 11, 12, 15, 18, 24V Thermal Overload Protection Short Circuit Protection Output Transistor SOA Protection

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 35

FIGURE 7: Voltage Regulator

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 36

POWER SUPPLY

A power supply provides a constant output regardless of voltage variations. "Fixed" three-terminal linear regulators are commonly available to generate fixed voltages of plus 3 V, and plus or minus 5 V, 9 V, 12 V, or 15 V when the load is less than about 7 amperes. The "78xx" series (7805, 7812, etc.) regulate positive voltages while the "79xx" series (7905, 7912, etc.) regulate negative voltages. Often, the last two digits of the device number are the output voltage; eg, a 7805 is a +5 V regulator, while a 7915 is a -15 V regulator. The 78xx series ICs can supply up to 1.5 Amperes depending on the model. Features 1. Output Current up to 1A 2. Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24 3. Thermal Overload Protection 4. Short Circuit Protection 5. Output Transistor Safe Operating Area Protection When you have a requirement for a project of say 12V, or even 5V if it's a digital project, then these are the types you use. 7805 or 7812 are the types. There are of course negative voltage regulators with the numbers 79XX which are substantially
COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 37

the same as those discussed here excepting they are negative. We will not consider them further..

The basic power supply schematic FIGURE 8: Power Supply

In a typical linear power supply, AC line voltage is first down-converted to a smaller peak voltage using a transformer which is then rectified using a full wave bridge rectifier circuit. A capacitor filter is then used to smoothen the obtained sinusoidal signal. The residual periodic variation or ripple in this filtered signal is eliminated using an active regulator.

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 38

To obtain a DC power supply with both positive and negative output voltages, a center-tapped transformer is used, where a third wire is attached to the middle of the secondary winding and it is taken as the common ground point. Then voltages from the opposite ends of the winding will be positive or negative with respect to this point.
Circuit description of power supply

This circuit is a small +5V power supply, which is useful when experimenting with digital electronics. Small inexpensive wall transformers with variable output voltage are available from any electronics shop and supermarket. Those transformers are easily available, but usually their voltage regulation is very poor, which makes then not very usable for digital circuit experimenter unless a better regulation can be achieved in some way. The following circuit is the answer to the problem. This circuit can give +5V output at about 150 mA current, but it can be increased to 1 A when good cooling is added to 7805 regulator chip. The circuit has over overload and terminal protection.

The

capacitors must have enough high voltage rating to safely handle the input

voltage feed to circuit. The circuit is very easy to build for example into a piece of Vero board.

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 39

Figure 9:Pinout of the 7805 regulator IC.

1. Unregulated voltage in 2. Ground 3. Regulated voltage out

RELAY
A relay is an electrically operated switch. Many relays use an electromagnet to operate a switching mechanism mechanically, but other operating principles are also used. Relays are used where it is necessary to control a circuit by a low-power signal (with complete electrical isolation between control and controlled circuits), or where several circuits must be controlled by one signal. The first relays were used in long distance telegraph circuits, repeating the signal coming in from one circuit and re-transmitting it to another. Relays were used extensively in telephone exchanges and early computers to perform logical operations. A type of relay that can handle the high power required to directly control an

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 40

electric motor or other loads is called a contractor. Solid-state relays control power circuits with no moving parts, instead using a semiconductor device to perform switching. Relays with calibrated operating characteristics and sometimes multiple operating coils are used to protect electrical circuits from overload or faults; in modern electric power systems these functions are performed by digital instruments still called "protective relays".

FIGURE 10:Relay

WORKING OF RELAY
A simple electromagnetic relay consists of a coil of wire wrapped around a soft iron core, an iron yoke which provides a low reluctance path for magnetic flux, a movable iron armature, and one or more sets of contacts (there are two in the relay pictured). The armature is hinged to the yoke and mechanically linked to one or more sets of moving contacts. It is held in place by a spring so that when the relay is de-energized there is an air gap in the magnetic circuit. In this condition, one of
COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 41

the two sets of contacts in the relay pictured is closed, and the other set is open. Other relays may have more or fewer sets of contacts depending on their function. The relay in the picture also has a wire connecting the armature to the yoke. This ensures continuity of the circuit between the moving contacts on the armature, and the circuit track on the printed circuit board (PCB) via the yoke, which is soldered to the PCB.

When an electric current is passed through the coil it generates a magnetic field that activates the armature, and the consequent movement of the movable contact(s) either makes or breaks (depending upon construction) a connection with a fixed contact. If the set of contacts was closed when the relay was de-energized, then the movement opens the contacts and breaks the connection, and vice versa if the contacts were open. When the current to the coil is switched off, the armature is returned by a force, approximately half as strong as the magnetic force, to its relaxed position. Usually this force is provided by a spring, but gravity is also used commonly in industrial motor starters. Most relays are manufactured to operate quickly. In a low-voltage application this reduces noise; in a high voltage or current application it reduces arcing.

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 42

When the coil is energized with direct current, a diode is often placed across the coil to dissipate the energy from the collapsing magnetic field at deactivation, which would otherwise generate a voltage spike dangerous to semiconductor circuit components. Some automotive relays include a diode inside the relay case. Alternatively, a contact protection network consisting of a capacitor and resistor in series (snubber circuit) may absorb the surge. If the coil is designed to be energized with alternating current (AC), a small copper "shading ring" can be crimped to the end of the solenoid, creating a small out-of-phase current which increases the minimum pull on the armature during the AC cycle.

BUZZER
buzzer or beeper is a signaling device, usually electronic, typically used in automobiles, household appliances such as a microwave oven, or game shows.It most commonly consists of a number 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 the 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 electric bell without the metal gong (which makes the ringing noise). 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

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 43

enough to drive a loudspeaker and hook this circuit up to a cheap 8-ohm speaker. Nowadays, it is more popular to use a ceramic-based piezoelectric sounder like a Son alert which makes a high-pitched tone. Usually these were hooked up to "driver" circuits which varied the pitch of the sound or pulsed the sound on and off. PULL UP RESISTOR Pull-up resistor are used in electronic logic input to ensure that inputs to logic systems settle at expected logic levels if external devices are disconnected or highimpedance. They may also be used at the interface between two different types of logic devices, possibly operating at different power supply voltages. A pull-up resistor weakly "pulls" the voltage of the wire it is connected to towards its voltage source level when the other components on the line are inactive. When all other connections on the line are inactive, they are high-impedance and act like they are disconnected. Since the other components act as though they are disconnected, the circuit acts as though it is disconnected, and the pull-up resistor brings the wire up to the high logic level. When another component on the line goes active, it will override the high logic level set by the pull-up resistor. The pull-up resistor assures that the wire is at a defined logic level even if no active devices are connected to it.

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 44

6.FEATURES OF PROJECT RELIABLE


With the use of more practical sensors and microcontrollers this project is quite reliable.here we have used IR sensor and 89c52 microcontroller.

FASTER REPONSE
A cycle is, in reality, 12 pulses of the crystal. That is to say, if an instruction takes one machine cycle to execute, it will take 12 pulses of the crystal to execute. Since we know the crystal is pulsing 11,059,000 times per second and that one machine cycle is 12 pulses, we can calculate how many instruction cycles the 8051 can execute per second: AUTOMATIC Once programmed the microcontroller takes the responsibilities of operating the system

CHEAPER Now easily available cost of electric goods has decrease dramatically Applicable to small as well as larger levels

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 45

7. PCB FABRICATION AND LAY OUT

The PCB must be fabricated first. Then the components are soldered carefully to PCB. We should keep in mind that the quality of soldering affects the quality of output. The procedure for fabricating the PCB for setting up the circuit of any multipurpose Project is described below PCB Making: The making of printed circuit boards (PCBs) is as much art on a technique particularly so when they are to fabricated in very small numbers. There are several ways of drawing PCB patterns and making the final boards. The making of PCB patterns and making PCB essentially involves two steps. 1. Preparing the PCB drawing and 2. Fabricating the PCB itself from the drawing PCB Drawing: Making of PCB drawing involves some preliminary consideration such as placement of components on a piece of paper. Locating holes, deciding the diameter of various holes, the optimum area of each component should occupy the shape and location lands for connecting two or more components at a place, full space utilization and prevention of overcrowding of components at a particular place. There is no other way to arrive at the conclusion than by trial and error. For anchoring leads of components 1 mm diameter and for fixing PCB holding screws
COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 46

to the 3 mm diameter holes can be made. Following these hints, a sketch of PCB is made. PCB Fabrication: The copper clad PCB laminate is now prepared by rubbing away the oxide. With fine sand paper on this, the final PCB drawing by traced by using a Carbon paper. Clips are used to prevent the carbon paper from slipping while PCB pattern is being traded on the laminate The marked hole in PCB again may be drilled using 1 mm or 3 mm drill bits and the traced PCB pattern created with black, quick drilling enamel paint, using a thin brush or a small metal case. In case, if there is any shorting of lines due to spilling of paint, there may be removed by scrapping with a blade or knife, after the paint has dried. After drying, 20-30 gms of Ferric Chloride in 75 ml of water may be heated to about 60 degree over the PCBs placed with its copper side upwards in a plastic tray. The dissolution of unwanted copper would take about 45 minutes. If etching takes longer, the solution may be heated again and the process is repeated. The paint on the pattern can be removed by rubbing with a turpentine or acetone. The PCB may be washed and dried. Depending on the diagram the resistors are taken care at first and then the ICs are soldered.

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 47

PCB LAYOUT

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 48

8.PROGRAM
sbit LCD_RS at P2_6_bit; sbit LCD_EN at P2_4_bit; sbit LCD_D7 at P2_3_bit; sbit LCD_D6 at P2_2_bit; sbit LCD_D5 at P2_1_bit; sbit LCD_D4 at P2_0_bit; unsigned char ct[4],count,k; void check2(); void check1(); void main(){ p0 = 0; p2 = 0; P3 = 00001100; //set p3 as input and output

//check2(); delay_ms(100); lcd_init(); Lcd_Cmd(_LCD_CLEAR);

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 49

lcd_cmd(_LCD_CURSOR_OFF); // Clear display count = 0; lcd_out(1,1,"COUNT: 0"); while(1){ if(P3_2_bit == 0)check2(); if(P3_3_bit == 0)check1(); p3_6_bit = 1; p3_7_bit = 1; delay_ms(18); } } //***************************************************************** ***** //--------subroutine--------------------------------------------------------//**********************************************************************

//check sensor1

void check2(){ p3_6_bit = 0; p0_3_bit = 1; p0_2_bit = 0; delay_ms(3000);


COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 50

p0_3_bit = 0; p0_2_bit = 0; p0_2_bit = 0; //for(d=0;d<9000;d++) // for(k=0;k<100;k++) //{ while(P3_2_bit ==1){ delay_us(50);

} if(count < 1)count = 1,P0=0;

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 51

9.ADVANTAGES

Low power consumption Life of load increases. Maintenance work is less Cost is less More reliable

DISADVANTAGES It should be used to count only one type of items. Eg. In this situation, the counter is counting number of persons entering or leaving the room. But when any object is brought into the room or moved out of the room then the counter is automatically incremented or decremented which gives false results.

Simultaneously , two or more persons cannot enter or leave the room as they will be counted as one single person , thus giving false results.

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 52

10.APPLICATIONS

1)This project is implemented in temples like Tirupathi, pali etc. to count the number of devotees in the temple. 2)It can be used in industries to count the number of processed products. 3)it can be used in parking areas to count the number of vehicles and the number of vacant parking spaces available for parking. 4)It can also be used as counter in shopping malls to count the number of goods purchased by the customer. 5)It is used in most offices ,shopping malls and airports to count the number of persons within. 6)Instead of using a room light ,if we use an alarm in the system, this project gets modified into a burglar alarm.

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 53

11.CONCLUSION

Energy conservation should be achieved by the proper usage of energy,power should be properly utilized. The increase preference for commercial energy has led to sharp increase in demand for electricity and fossil fuels electricity is used in industry commerce public transport and of course in homes although many countries around the world use nuclear energy to generate electricity there are still about 2 billion people being underdeveloped countries who have no electricity at all. This project can help to save power, the effective utilization of power along with the counting of persons. The applications and the advantages of the project itself show that how effective it would be if its implemented with a motto to save power. The components used in the project are affordable, so this system can be implemented from small places to big.

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 54

REFERENCES

www.wikipedia.com www.google.com www.datasheet4u.com

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 55

APPENDIX

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

DIGITAL VISITOR COUNTER 56

COLLEGE OF APPLIED SCIENCE(IHRD),CHELAKKARA

You might also like