Anda di halaman 1dari 40

POWER MANAGEMENT FOR SHOPPING MALLS WITH BIDIRECTIONAL VISITOR COUNTING

A Mini Project report submitted In partial fulfillment of the requirements For the award of degree of BACHELOR OF TECHNOLOGY In ELECTRONICS AND COMMUNICATION ENGINEERING By B.PRAGZNA A.VIJAY SIVAJI M.NARESHKUMAR G.NIRANJAN KISHORE Under the esteemed guidance of Prof. R.VENKATARAO Department of ECE M.Tech

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING SRI VAISHNAVI COLLEGE OF ENGINEERING SINGUPURAM, SRIKAKULAM, ANDHRA PRADESH 2011

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING SRI VAISHNAVI COLLEGE OF ENGINEERING SINGUPURAM

CERTIFICATE
This is certify that the mini project work entitled POWER MANAGEMENT FOR SHOPPING MALLS WITH BIDIRECTIONAL VISITOR COUNTING , is a bonafide work done by PRAGZNA.B , NARESH KUMAR .M , VIJAY SIVAJI .A , and NIRANJAN KISHORE .G submitted in partial fulfillment of the requirements for the award of the degree of BACHELOR OF TECHNOLOGY in ELECTRONICS AND COMMUNICATION ENGINNERING .

HEAD OF DEPARTMENT

UNDER GUIDENCE

BHASKAR MURTHI, Head of Department, E.C.E

R.VENKATARAO M.Tech Department of E.C.E

ACKNOWLEDGEMENT
This report would be incomplete without the mention of those who have directly or indirectly helped us during the tenure of this project. We would like to thank Sri L.S.SASTHRY GARU, Principal, and SRI VAISHNAVI COLLEGE OF ENGINEERING for having permitted us to take up this project. We would also like , to Sri express our deepest College sense of of gratitude towards and Sri and Sri.M.V.H.BHASKARAMURTHY , Head of the Department , Electronics communication Engineering Vaishnavi Engineering

T.MANIKYALARAO GARU, the Project co-ordinator , E.C.E Department, Sri Vaishnavi College of Engineering for their invaluable help during this project. Their guidance has been instrumental and has proved to be of immense help at every stage of the project. We would like to thank our internal guide Sri R.VENKATARAO GARU, Assistant Professor, Electronics and communication Engineering , Sri Vaishnavi College of Engineering for constantly monitoring our progress and suggesting improvements at various stages in the project We would like to thank all the other staff members of Electronics and communication Engineering Department, Sri Vaishnavi College of Engineering, for cooperating with us all through the period of project. We would like to express our heartfelt gratitude towards Sri MOHAMMED IRFAN of PRECISION INFOMATICS PRIVATE LTD. for his continuous support throughout the tenure of the project. We are grateful to him for spending some of his precious time in helping us out in solving the problems during the project. Lastly, we would like to thank everyone who has been involved in the progress of the project, whose contributions, have added a lot of value.

PRAGZNA BALIVADA NARESHKUMAR MOYYI VIJAY AGURU NIRANJAN KISHORE GUDLA

ABSTRACT
Now-a-days with the increase of electronic appliances the power consumption increases. We can conserve power in home with our personal interest. But it is different in case of public malls and halls. Hence we need to seek the assistance of some external setup viz. visitors counter. The Bidirectional visitor counter is designed for shopping malls to reduce the power usage according to the count of persons in the hall. A unique architecture of occupancy sensors includes entry/exit sensors for detecting movement through doorways. The bidirectional sensors are used to sense the entry and exit. This project is designed around a microcontroller which forms the control unit of the project. The central embedded controller controls the devices according to the number of persons entered into the shopping mall in response to the entry/exit sensors. The counter section consists of two IR LEDs, two photodiode detectors. The movement of objects including the direction of their movement is detected by the arrangement of the IR LED and photodiode detector pairs. The photodiode of each pair is mounted opposite to its corresponding IR LED fall directly on the photodiode detector. The Software for Visitor counter is written in Embedded C language and compiled using AVR STUDIO .This Software allows for historic data analysis, data aggregation and time plotting performing precise calculations such as the average time an individual spends inside a particular zone. The hardware includes Atmel series (ATMEGA8 ) micro controller and LCD(Seven segment Display).Night -clubs, museums, entertainment

venues and other places where many people gather, are often subject to maximum occupancy regulations.

LIST OF FIGURES

Figure number
1

Name
Block Diagram Basic Layout of Microcontroller A simple 5V DC Regulated Power Supply System Step-down Transformer Block Diagram of Microcontroller-ATMEGA8 Architecture of ATMEGA8 Pin Diagram of ATMEGA8 Electromagnetic Spectrum A radio frequency energy wave superimposed upon an infrared energy wave

Page number

2 3 4 5 6 7 8 9

10 11 12 13

Liquid Crystal Display

Pin diagram of 2x16 LCD Display Transmitter &Receiver Setup Schematic Diagram of ATMEGA8

CONTENTS Pg.No 1.
EMBEDDED SYSTEM 1.1 1.2 1.3 1.4 1.5 Introduction to Embedded Systems Examples of Embedded Systems Microcontrollers and Microprocessors Typical Microcontroller Architecture and Features The UART: What it is and how it works 1.5.1 1.5.2 2. Synchronous Serial Transmission Asynchronous Serial Transmission

REGULATED POWER SUPPLY 2.1 2.2 2.3 2.4 2.5 2.6 What is a power supply? Recommended specifications Power Requirements Power Source Regulators TRANSFORMER

3.

MICRO CONTROLLER 3.1 Features

3.2 3.3

Micro Controller A.V.R Description Pg.No

3.4 3.5 3.5 4.

Architecture PinDiagram Pin Description

INFRARED RANGE SENSORS 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 Introduction Wireless Communication Infrared Technology IR Advantages IR Disadvantages Health Risks Security Importance of Standards

5.

LIQUID CRYSTAL DISPLAY 5.1 5.2 5.3 5.4 5.5 Introduction Interfacing LCD to the Microcontroller Features DIAGRAM PIN DIAGRAM

6.

VISITORS COUNTER 6.1 Introduction

6.2
6.3 6.4

How the People Counter Works?


Unparalleled Accuracy >99% Easy Installation and Integration

6.5 6.6

Advantages Schematic Diagram

INTRODUCTION Mall management has been identified as a critical factor for the success of malls and the retail industry across the world. One of the key management parameters is the POWER MANAGEMENT. Power management in shopping malls is not a small issue as it they are the most crowded places. We need to conserve power in malls using some sophisticated instruments like BIDIRECTIONAL VISITORS COUNTER. Developing an accurate understanding of the precise number of people currently present in a building or moving through high-traffic areas is an invaluable asset for safety and security professionals, as well as for marketing intelligence initiatives, and staff and energy optimization. The Visitors Counter delivers real-time data which allows for the following applications: Occupancy monitoring to:
control maximum or minimum occupancy. support evacuation measures. trigger demand-controlled ventilation (DCV). Wrong-way detection and bi-directional counting. Wait time determination and queue management.

Occupancy monitoring and analysis solution:


Performs bi-directional count at each entrance and exit Offers >99% accuracy. Runs on embedded software. Based on IR Sensor technology. is the block diagram of POWER MANAGEMENT WITH

The

following

BIDIRECTIONAL VISITORS COUNTER. Each block in the diagram are explained in the following briefly.

BLOCK DIAGRAM:

Regulate d Power supply ro Hall with IR sensors

Mic Control ler

Liquid crystal display

Devic es

CHAPTER-1 EMBEDDED SYSTEMS


1.1 Introduction to Embedded Systems An embedded system is a special-purpose computer system designed to perform a dedicated function. Unlike a general-purpose computer, such as a personal computer, an embedded system performs one or a few pre-defined tasks, usually with very specific requirements, and often includes task-specific hardware and mechanical parts not usually found in a general-purpose computer. Since the system is dedicated to specific tasks, design engineers can optimize it, reducing the size and cost of the product. Embedded systems are often mass-produced, benefiting from economies of scale. Physically, embedded systems range from portable devices such as digital watches and MP3 players, to large stationary installations like traffic lights, factory controllers, or the systems controlling nuclear power plants. In terms of complexity, embedded systems run from simple, with a single microcontroller chip, to very complex with multiple units, peripherals and networks mounted inside a large chassis or enclosure. 1.2 Examples of Embedded Systems An embedded system typically has a specialized function with programs stored on ROM. Examples of embedded systems are chips that monitor automobile functions, including engine controls, antilock brakes, air bags, active suspension systems, environmental systems, security systems, and entertainment systems. Everything needed for those functions is custom designed into specific chips. No external operating system is required. Network managers will need to manage more and more embedded systems devices, ranging from printers to scanners, to handheld computing devices, to cell phones. All of these have a need to connect with other devices, either directly or through a wireless or direct-connect network.

1.3 Microcontrollers and Microprocessors A microcontroller (or MCU) is a computer-on-a-chip. It is a type of microprocessor emphasizing self-sufficiency and cost-effectiveness, in contrast to a general-purpose microprocessor (the kind used in a PC). A microprocessor is a programmable digital electronic component that incorporates the functions of a central processing unit (CPU) on a single semi conducting integrated circuit (IC). The microprocessor was born by reducing the word size of the CPU from 32 bits to 4 bits, so that the transistors of its logic circuits would fit onto a single part. One or more microprocessors typically serve as the CPU in a computer system or embedded system 1.4 Typical Microcontroller Architecture and Features: The basic internal designs of microcontrollers are pretty similar. Figure1 shows the block diagram of a typical microcontroller. All components are connected via an internal bus and are all integrated on one chip. The modules are connected to the outside world via I/O pins. The following list contains the modules typically found in a microcontroller

Figure 2: Basic Layout of Microcontroller

Processor Core: The CPU of the controller. It contains the arithmetic logic unit, the control unit, and the registers (stack pointer, program counter, accumulator register, register file . . .).

Memory: The memory is sometimes split into program memory and data memory. In larger controllers, a DMA controller handles data transfers between peripheral components and the memory.

Interrupt Controller: Interrupts are useful for interrupting the normal program flow in case of (important) external or internal events. In conjunction with sleep modes, they help to conserve power.

Timer/Counter: Most controllers have at least one and more likely 2-3 Timer/Counters, which can be used to timestamp events, measure intervals, or count events. Many controllers also contain PWM (pulse width modulation) outputs, which can be used to drive motors or for safe breaking (antilock brake system, ABS). Furthermore the PWM output can, in conjunction with an external filter, be used to realize a cheap digital/analog converter.

Digital I/O: Parallel digital I/O ports are one of the main features of microcontrollers. The number of I/O pins varies from 3-4 to over 90, depending on the controller family and the controller type.

Analog I/O: Apart from a few small controllers, most microcontrollers have integrated analog/digital converters, which differ in the number of channels (2-16) and their resolution (8-12 bits). The analog module also generally features an analog comparator. In some cases, the microcontroller includes digital/analog converters.

1.5 The UART: What it is and how it works The Universal Asynchronous Receiver/Transmitter (UART) controller is the key component of the serial communications subsystem of a computer. The UART takes bytes of data and transmits the individual bits in a sequential fashion. At the destination, a second UART re-assembles the bits into complete bytes.

Serial transmission is commonly used with modems and for non-networked communication between computers, terminals and other devices. There are two primary forms of serial transmission: Synchronous and Asynchronous. 1.5.1 Synchronous Serial Transmission Synchronous serial transmission requires that the sender and receiver share a clock with one another, or that the sender provide a strobe or other timing signal so that the receiver knows when to read the next bit of the data. In most forms of serial Synchronous communication, if there is no data available at a given instant to transmit, a fill character must be sent instead so that data is always being transmitted. Synchronous communication is usually more efficient because only data bits are transmitted between sender and receiver, and synchronous communication can be more costly if extra wiring and circuits are required to share a clock signal between the sender and receiver. 1.5.2 Asynchronous Serial Transmission Asynchronous transmission allows data to be transmitted without the sender having to send a clock signal to the receiver. Instead, the sender and receiver must agree on timing parameters in advance and special bits are added to each word which is used to synchronize the sending and receiving units. When a word is given to the UART for Asynchronous transmissions, a bit called the "Start Bit" is added to the beginning of each word that is to be transmitted. The Start Bit is used to alert the receiver that a word of data is about to be sent, and to force the clock in the receiver into synchronization with the clock in the transmitter. These two clocks must be accurate enough to not have the frequency drift by more than 10% during the transmission of the remaining bits in the word. After the Start Bit, the individual bits of the word of data are sent, with the Least Significant Bit (LSB) being sent first. Each bit in the transmission is transmitted for exactly the same amount of time as all of the other bits, and the receiver looks at the wire at approximately halfway through the period assigned to each bit to determine if the bit is a 1 or a 0.The sender does not know when the receiver has looked at the value of the bit. The sender only knows when the clock says to begin transmitting the next bit of the word. When the entire data word has

been sent, the transmitter may add a Parity Bit that the transmitter generates. The Parity Bit may be used by the receiver to perform simple error checking. Then at least one Stop Bit is sent by the transmitter.

CHAPTER - 2 REGULATED POWER SUPPLY


Small general purpose micros like PICs and Atmel Chips, mostly operating from 5V and requiring 10 to 50 mA. Some may operate from lower voltages such as 3.3V or 2.5V. The principles are mostly the same. 2.1 What is a power supply? Its a simple source of reliable low voltage power for the micro and associated circuitry. The goal is to provide a stable, low voltage supply to the micro. The operation of the micro must not be affected by the power supply. The power supply itself must be reliable and stable. The

power supply should not cause problems during development.

Figure3: A simple 5V DC Regulated Power Supply System 2.2 Recommended specifications For a small micro project, for development and experimenting, use a 12V DC 500mA plug-pack supplying a 3-terminal voltage regulator such as a 78L05 or 7805. The regulator should not be too much larger than you actually need. So, for a 50mA load use a 78L05 which is rated at 100mA but will deliver a bit more. Put a series diode in the positive line before the input capacitor. This protects it when the plug-pack is connected the wrong way round (it happens). The input capacitor should be close to the regulator and at least 100uF at 25V. On the output side of the regulator you should have a 10uF capacitor.If the regulator gets too hot to hold comfortably for a few seconds securely between thumb and finger you need a larger regulator or add a heat sink. The capacitors must be close to the regulator so

don't run long skinny wires from the board to the regulator to get to the heat sink. It is required to dot a few 0.1uF decoupling capacitors around the circuit. 2.3 Power Requirements The micro will require 5 volts DC probably no more than 5 to 50 mA. The associated circuitry may require more current but can generally be run from the same +ve 5V supply rail as the micro. Remember that small micros are mostly CMOS devices and although the average current requirement is maybe a few milliamps, the power supply must be able to deliver peaks of many 10s or even 100s of milliamps for continued reliable operation. 2.4 Power Source The power will typically come from a mains power supply or batteries. The power supply as a whole can be divided into two sections; the power source and the local regulator. If the local regulator is properly designed and constructed, the power source is not that critical. The power source can be as simple as a AC or DC plug-pack or a transformer-rectifier-capacitor or a battery. So; for a 5V regulator it should be fed with a measured 10V DC or more. A typical 12V DC unregulated plug-pack will put out 15 to 18 volts with no load connected. 2.5 Regulators The common 7800 series voltage regulators are reasonably priced and produce simple and reliable power supplies if used correctly. The 78L05 and 7805 are good regulators for simple micro projects. If variable or different voltage is required, the LM317 is available. These are all linear regulators. They require input and output capacitors located close to the regulator in order to operate reliably. Without these capacitors or if they are too small or too far away, the regulator can oscillate at high frequencies depending on the load etc. A series diode on the input +ve side can be included. This prevents reverse polarity of the incoming supply damaging the regulator or other circuitry. Usually a common 1N4007 is used. 2.6 TRANSFORMER:

The transformer is a device that transfers electrical energy from one electrical circuit to another electrical circuit through the medium of magnetic field and without a change in the frequency .The electric circuit which receives energy from the supply mains is called primary winding and the other circuit which delivers electric energy to the load is called the secondary winding. This is a very useful device, indeed. With it, we can easily multiply or divide voltage and current in AC circuits,. Indeed, the transformer has made long-distance transmission of electric power a practical reality, as AC voltage can be stepped up and current stepped down for reduced wire resistance power losses along power lines connecting generating stations with

loads. Figure 4 Step down transformer

CHAPTER 3

MICRO CONTROLLER
3.1 Micro Controller : Microprocessors and microcomtrollers step from basic idea .the contrast between a micro controller and a microprocessor is best exemplified bt the fact that most microprocessors have many operational codes (opcodes) for moving data from external memory to the CPU ; microcontrollers will have many.The microrocessor is concerned with rapid movment of code and data from external addresses to the chip;the microcontroller is concerned with the rapid movment if bits within the chip;The microcontroller can function as a computer with the addition of no external digital parts;the picroprocessor must have additional parts to be operational 3.2 Features:
High-performance, Low-power AVR 8-bit Microcontroller.

Advanced RISC Architecture


130 Powerful Instructions Most Single-clock Cycle Execution 32 x 8 General Purpose Working Registers

Fully Static Operation Up to 16 MIPS Throughput at 16 MHz On-chip 2-cycle Multiplier.


High Endurance Non-volatile Memory segments.

8K Bytes of In-System Self-programmable Flash program memory 512 Write/Erase Cycles: 10,000 Flash/100,000 EEPROM Data
Optional Boot Code Section with Independent Lock Bits In-

Bytes EEPROM ,1K Byte Internal SRAM retention: 20 years at 85C/100 years at 25C (1) System Programming by On-chip Boot Program.
True Read-While-Write Operation. Programming Lock for Software Security.

Peripheral Features.

One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture Mode

Real Time Counter with Separate Oscillator Three PWM Channels 8-channel ADC in TQFP and QFN/MLF package
6-channel

ADC

in

PDIP package

Six

Channels10-bit Accuracy Byte-oriented Twowire Serial Interface Programmable Serial USART Programmable Watchdog Timer with Separate On-chip Oscillator On-chip Analog Comparator

Special Microcontroller Features Power-on Reset and Programmable Brown-out Detection Internal External and Internal Interrupt Sources Five Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, and

Calibrated RC Oscillator

Standby I/O and Packages 23 Programmable I/O Lines 28-lead PDIP, 32-lead TQFP, and 32-pad QFN/MLF

Operating Voltages

2.7 - 5.5V (ATmega8L) 4.5 5.5V


Power Consumption at 4 MHz, 3V, 25C

(ATmega8) Active: 3.6 mA Idle Mode: 1.0 mA Power-down Mode: 0.5 A

3.3 A.V.R Description: The AVR core combines a rich instruction set with 32 general purpose working registers.

All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU), allowing two independent registers to be accessed in one single instruction executed in one clock cycle. The resulting architecture is more code efficient while achieving throughputs up to ten times faster than conventional CISC microcontrollers. The device is manufactured using Atmels high density non-volatile memory technology. The Flash Program memory can be reprogrammed In-System through an SPI serial interface, by a conventional non-volatile memory programmer, or by an On-chip boot program running on the AVR core. By combining an 8-bit RISC CPU with In-System Self-Programmable Flash on a monolithic chip, the Atmel ATmega8 is a powerful microcontroller that provides a highlyflexible and cost-effective solution to many embedded control applications. The ATmega8 AVR is supported with a full suite of program and system development tools, including C compilers, macro assemblers, program debugger/simulators, In-Circuit Emulators, and evaluation kits. BLOCK DIAGRAM:

Figure5: Block Diagram of Microcontroller-ATMEGA8 3.4 Architecture:

Figure6 : Architecture of ATMEGA8

3.5 PinDiagram:

Figure7: Pin Diagram of ATMEGA8 3.6 Pin Description VCC GND AREF ADC7.6 Digital supply voltage. Ground. AREF is the analog reference pin for the A/D Converter In the TQFP and QFN/MLF package, ADC7..6 serve as analog inputs to the A/D converter These pins are powered from the analog supply and serve as 10-bit ADC channel

AVCC

AVCC is the supply voltage pin for the A/D Converter, Port C (3.0), and ADC (7.6). It should be externally connected to VCC, even if the ADC is not used. If the ADC is used, it should be connected to VCC through a low-pass filter. Note that Port C (5.4) use digital supply voltage, VCC.

RESET

It is input. A low level on this pin for longer than minimum pulse generates input. Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). Port B output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port B pins that are externally pulled low will source current if the pullup resistors are activated. The Port B pins are tri-stated when a reset condition becomes active, even if the clock is not running .Depending

Port B (PB7..PB0)

on the clock selection fuse settings, PB6 can be used as input to the

XTAL1/XTAL2/TOSC1/TOS2 inverting. Port C is an 7-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port C output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port C pins that are externally pulled low will source current if the pull-up resistors are activated. The Port C pins are tri-stated when Port C (PC5..PC0) a reset condition becomes active, even if the clock is not running If PC6/RESET the RSTDISBL Fuse is programmed, PC6 is used as an I/O pin Port D (PD7..PD0) Port C output buffers have symmetrical drive characteristics with both high sink and source

CHAPTER 4 IR SENSORS
4.1 Introduction: As next-generation electronic information systems evolve, it is critical that all people have access to the information available via these systems. Examples of developing and future information systems include interactive television, touch screen-based information kiosks, and advanced Internet programs. Infrared technology, increasingly present in mainstream applications, holds great potential for enabling people with a variety of disabilities to access a growing list of information resources. Already commonly used in remote control of TVs, VCRs and CD players, infrared technology is also being used and developed for remote control of environmental control systems, personal computers, and talking signs.
For individuals using augmentative and alternative communication (AAC) devices, infrared or other wireless technology can provide an alternate, more portable, more independent means of accessing computers and other electronic information systems.

4.2 Wireless Communication: Wireless communication, as the term implies, allows information to be exchanged between two devices without the use of wire or cable. Information is being transmitted and received using electromagnetic energy, also referred to as electromagnetic radiation. One of the most familiar sources of electromagnetic radiation is the sun; other common sources include TV and radio signals, light bulbs and microwaves. The electromagnetic spectrum classifies electromagnetic energy according to frequency or wavelength (both described below). As shown in Figure 1, the electromagnetic spectrum ranges from energy waves having extremely low frequency (ELF) to energy waves having much higher frequency, such as x-rays.

Figure 8 Electromagnetic Spectrum In Figure 8 ,A horizontal bar represents a range of frequencies from 10 Hertz (cycles per second) to 10 to the 18th power Hertz. Some familiar allocated frequency bands are labeled on the spectrum. Approximate locations are as follows. (Exponential powers of 10 are abbreviated as 10exp.) 10 Hertz: extremely low frequency or ELF. 10exp5 Hertz: AM radio. 10exp8 Hertz: FM radio. 10exp16 Hertz: Infrared (frequency range is below the visible light spectrum). 10exp16 Hertz: Visible Light. 10exp16 Hertz: Ultraviolet (frequency range is above the visible light spectrum). 10exp18 Hertz: X-rays.] 4.3 Infrared Technology: Infrared radiation is the region of the electromagnetic spectrum between microwaves and visible light. In infrared communication, an LED transmits the infrared signal as bursts of non-visible light. At the receiving end a photodiode or photoreceptor detects and captures the light pulses, which are then processed to retrieve the information they contain. Figure 9 depicts an infrared energy wave and a radio energy wave, and illustrates the two different energy wavelengths. As is expected based on the electromagnetic spectrum, the infrared wave is higher frequency and therefore shorter wavelength than the radio wave. Conversely, the radio wave is lower frequency and therefore longer wavelength than the infrared wave.

Figure 9 A radio frequency energy wave superimposed upon an infrared energy wave The above illustrates the inverse relationship between frequency and wavelength. The infrared energy wave completes nearly 5 and a half cycles in the time that the radio frequency wave completes 2 cycles. ] Infrared technology is highlighted because of its increasing presence in mainstream applications, its current and potential usage in disability-related applications, and its advantages over other forms of wireless communication. Some common applications of infrared technology are listed below. 1. Augmentative communication devices 2. Car locking systems
3. Computers, Headphones

4. Emergency response systems 5. Environmental control systems 6. Home security systems 4.4 IR Advantages:
1. Low power requirements: therefore ideal for laptops, telephones, personal digital

assistants.
2. Low circuitry costs: $2-$5 for the entire coding/decoding circuitry .

3. Simple circuitry: no special or proprietary hardware is required, can be incorporated into the integrated circuit of a product

4. Higher security: directionality of the beam helps ensure that data isn't leaked or spilled to nearby devices as it's transmitted 5. Few international regulatory constraints: IrDA (Infrared Data Association) functional devices will ideally be usable by international travelers, no matter where they may be 6. High noise immunity: not as likely to have interference from signals from other devices 4.5 IR Disadvantages: 1. Line of sight: transmitters and receivers must be almost directly aligned (i.e. able to see each other) to communicate 2. Blocked by common materials: people, walls, plants, etc. can block transmission 3. Short range: performance drops off with longer distances 4. Light, weather sensitive: direct sunlight, rain, fog, dust, pollution can affect transmission 5. Speed: data rate transmission is lower than typical wired transmission

4.6

Health Risks: Any time electric current travels through a wire, the air, or runs an appliance, it produces

an electromagnetic field. It is important to remember that electromagnetic fields are found everywhere that electricity is in use. While researchers have not established an ironclad link between the exposure to electromagnetic fields and ailments such as leukemia, the circumstantial evidence concerns many people. In scientific terms, human body can act as an antenna, as it has a higher conductivity for electricity than air. Therefore, when conditions are right human body may have experienced a small "tingle" of electric current from a poorly grounded electric appliance. As long as these currents are very small there isn't much danger from electric fields, except for potential shocks. , Human body also has permeability almost equal to air, thus allowing a magnetic field to easily enter the body. Unfortunately body cannot detect the presence of a strong magnetic field, which could potentially do much more harm. In terms of wireless technology, there are no confirmed health risks or scientific dangers from infrared or radio frequency, with two known exceptions:

1. point-to-point lasers which can cause burns or blindness 2. prolonged microwave exposure which has been linked to cancer and leukemia Therefore, most health concerns related to electromagnetic fields are due to electricity in day-today use, such as computer monitors and TVs. These dangers, if any, are already in the home and work place, and the addition of wireless technology should not be seen as an exceptional risk. The strength of the electromagnetic field (EMF) decreases as the square of the distance from the field source. 4.7 Security: Electromagnetic frequencies currently have little legal status for protection and as such, can be freely intercepted by motivated individuals. As presented earlier in the advantages and disadvantages of infrared versus radio frequency transmission, what might be considered an advantage to one method for transmission could turn out to be a disadvantage for security? For example, because infrared is line-of-sight it has less transmission range but is also more difficult to intercept when compared to radio frequency. Radio frequency can penetrate walls, making it much easier to transmit a message, but also more susceptible to tapping.
A possible solution to security issues will likely be some form of data encryption. Data encryption standards (DES) are also being quickly developed for the exchange of information over the Internet, and many of these same DES will be applied to wireless technology.

4.8 Importance of Standards: Several of the wireless devices demonstrated during the presentation have benefited to some degree from standardization. For example, a universal IR remote was once priced at roughly $100.00.The X10 devices that were demonstrated in the presentation not only rely on but have benefited from the 60 HZ AC standard which applies to most of North America. As a result these devices are now numerous and inexpensive. One final example demonstrating the importance of standards is the relationship of augmentative alternative communication (AAC) devices to the General Input Device Emulating Interface (GIDEI) standard. Any AAC device programmed to use the GIDEI protocol can access any PC or Macintosh running the DOS, Windows, or Macintosh version of Serial Keys.

CHAPTER 5 LIQUID CRYSTAL DISPLAY


5.1 Introduction: The most common application of liquid crystal technology is in liquid crystal displays (LCDs). From the ubiquitous wrist watch and pocket calculator to an advanced VGA computer screen, this type of display has evolved into an important and versatile interface. A liquid crystal display consists of an array of tiny segments (called pixels) that can be manipulated to present information. This basic idea is common to all displays, ranging from simple calculators to a full color LCD television. Why are liquid crystal displays important? The first factor is size. As will be shown in the following sections, an LCD consists primarily of two glass plates with some liquid crystal material between them. There is no bulky picture tube. This makes LCDs practical for applications where size (as well as weight) is important. In general, LCDs use much less power than their cathode-ray tube (CRT) counterparts. Many LCDs are reflective, meaning that they use only ambient light to illuminate the display. Even displays that do require an external light source (i.e. computer displays) consume much less power than CRT devices. Liquid crystal displays do have drawbacks, and these are the subject of intense research. Problems with viewing angle, contrast ratio, and response time still need to be solved before the LCD replaces the cathode-ray tube. However with the rate of technological innovation, this day may not be too far into the future. 5.2 Interfacing LCD to the Microcontroller: This is the first interfacing example for the parallel port .This is example does not use the Bi-directional feature found on newer ports, thus it should work with most, if no all parallel ports .It however does not show the use of the status port as an input . So what are we interfacing? A 16 character X2 line LCD Module to the Parallel port .These LCD modules are very common these days , and are quite simple to work with ,as all the logic required them is on board

5.3 Features: Interfacing with either 4 bit or 8 bit microprocessor Display data RAM 80 X 8 bits( 80 characters) 160 different 5 X 7 dot-matrix character patterns 8 different user programmed 5 X 7 dot- matrix patterns Display data RAM and character generator RAM may be accessed by the microprocessor. Numerous instructions like Clear, Display, Cursor Home, Display ON/OFF, Cursor. 5.4 DIAGRAM:

Figure 10 Liquid Crystal Display 5.5 PIN DIAGRAM:

Figure 11 Pin diagram of 2x16 LCD Display

CHAPTER 6 VISITORS COUNTER


6.1 Introduction: Visitors counting is not limited to the entry/exit point of a company but has a wide range of applications that provide information to management on the volume and flow of people throughout a location. A primary method for counting the visitors involves hiring human auditors to stand and manually tally the number of visitors who pass by a certain location. But humanbased data collection comes at great expense. Here is a low-cost microcontroller based visitor counter that can be used to know the number of persons at a place. All the components required are readily available in the market and the circuit is easy to build..

Enter TX1

T1
Logic control circuit Microcontrolle r Supply

TX2 Exit

T2

Figure 12 Transmitter &Receiver Setup Fig. 12 shows the transmitter-receiver set-up at the entrance-cum-exit of the passage along with block diagram two similar sections detect interruption of the IR beam and generate clock pulse for the microcontroller. The microcontroller controls counting and displays the number of persons present inside the hall. Two IR transmitter-receiver pairs are used at the passage: one pair comprising IR transmitter IR TX1 and receiver phototransistor T1 is installed at the entry point of the passage, while the other pair comprising IR transmitter IR TX2 and phototransistor T2 is installed at the exit of the passage. The IR signals from the IR LEDs should continuously fall on the respective phototransistors, so proper orientation of the transmitters and phototransistors is necessary.

6.2How the People Counter Works?


IR technology is based on the optical time of flight (TOF) principle, whereby an active, nonscanning light source emits modulated near-infrared light. The phase shift between the light emitted by the source and the light reflected by the persons and objects in the field of view is measured to create a real-time topographic image of the monitored area. By means of time-of-flight measurement and sophisticated embedded algorithms, IRsensor measures and processes 3D data, in order to detect and count the number of people in a specific area and track the direction of their movements.

6.3 Unparalleled Accuracy >99%


Sophisticated algorithms and extensive testing ensure reliable segmentation, tracking and counting of people in order to minimize counting errors which commonly occur with most other people counting systems on the market, and which result in unreliable data. The People Counters unique segmentation and tracking ability allows for highly accurate and more reliable data than passive infrared imager, scanner or video-based 2D systems on the market. 6.4 Easy Installation and Integration: The People Counter requires only minimal changes to the existing infrastructure. Typically installed above entrance doors or turnstiles, the People Counter reliably detects and counts each person entering and exiting the room or building in real-time, and provides accurate occupancy monitoring data. For queue management and wait time determination applications, multiple People Counters are installed onto the ceiling to determine queue duration.

6.5Advantages:
Embedded Software The sensor does not require any additional controllers to process the data it captures for most of its applications. For occupancy monitoring applications, the data provided by the People Counter can automatically trigger energy saving or climate control measures. Semi-Automatic Calibration After configuring basic data such as detection area and mounting height, the sensor calibrates the detection area within a few seconds. During this calibration the sensor surveys the empty detection zone and captures the presence of fixed objects and walls. Self-Diagnostics A self-diagnostic routine runs at start-up and is regularly repeated to detect any sensor malfunction. The results are provided through a web interface, status LEDs and digital outputs.

Reliability in Changing Light Conditions Since the sensor emits its own illumination, the detection area can be lit normally, or be pitch black without influencing its measurement.

6.4 Schematic Diagram:

Figure13: Schematic Diagram APPENDIX SOURCE CODE # define F_CPU 800000UL #include<avr/io.h> #include<stdio.h> #include<avr/interrupt.h> #include<util/delay.h> int count=0; static int usart_putchar(char c, FILE *stream); static FILE mystdout = FDEV_SETUP_STREAM(usart_putchar,

NULL,_FDEV_SETUP_WRITE); static int usart_putchar(char c, FILE *stream) { if (c == '\r') usart_putchar(' ', stream); loop_until_bit_is_set(UCSRA, UDRE); UDR = c; return 0; } int a=0,b=0;

ISR(INT0_vect) { a=1; printf(" INTERRUPT \n\r"); } ISR(INT1_vect) { b=1; // } void port_init(void) { PORTB = 0x00; DDRB = 0xFF; //MISO line i/p, rest o/p PORTC = 0x00; DDRC = 0xFF; PORTD = 0xff; DDRD = 0b00000010; } //UART0 initialize // desired baud rate: 19200 printf(" INTERRUPT \n\r");

// actual: baud rate:19231 (0.2%) // char size: 8 bit // parity: Disabled void uart0_init(void) { UCSRB = 0x00; //disable while setting baud rate UCSRA = 0x00; UCSRC = (1 << URSEL) | 0x06; UBRRL = 0x33; //set baud rate lo UBRRH = 0x00; //set baud rate hi UCSRB = 0x18; //UCSRB=0x98;//enabling receiving interrupts } //call this routine to initialize all peripherals void init_devices(void) { cli(); port_init(); uart0_init(); //INT1.INT0.-.-.-.-.-.-.-IVSEL.IVCE GICR=0b11000000;

MCUCR=0b00001010; sei(); } int main() { init_devices(); stdout = &mystdout; printf(" HOME AUTOMATION USING ZIGBEE \n\r"); sei(); while(1) { if(a==1) { count++; //printf("%d",count); _delay_ms(20); a=0; } else { a=0;

_delay_ms(20); } if(b==1) { count--; //printf("%d",count); _delay_ms(20); b=0; } else { b=0; _delay_ms(20); }

if(count>=1) { PORTB=0xFF; printf("TOTAL COUNT=%d\n\r",count); printf("STATUS::LAMPS AND FANS ON\n\r"); _delay_ms(2000);

} else { PORTB=0x00; printf("TOTAL COUNT=%d\n\r",count); printf("STATUS::LAMPS AND FANS OFF\n\r"); _delay_ms(2000); } } }

RESULT:
By using this we can implement a power management system for shopping malls with bidirectional visitors counting.