Вы находитесь на странице: 1из 86

A TECHNICAL REPORT ON

POWER SAVER FOR STREET LIGHTS


Submitted in partial fulfillment of the requirements for the Award of the degree of BACHELOR OF TECHNOLOGY In ELECTRICAL & ELECTRONICS ENGINEERING By

M.SRAVANTHI B.SRAVANI T.DAVALESHWAR N.KONDAL REDDY

(08271A0244) (08271A0242) (08271A0203) (08271A0213)

DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING

JYOTHISHMATHI INSTITUTE OF TECHNOLOGY & SCIENCE


NUSTULAPUR, KARIMNAGAR - 505481

JYOTHISHMATHI INSTITUTE OF TECHNOLOGY & SCIENCE


(Recognized by AICTE and Affiliated to J.N.T. University, Hyderabad)

A PROJECT ON

POWER SAVER FOR STREET LIGHTS


Submitted AS A PART OF PROJECT TRAINING PROGRAME BY

M.SRAVANTHI B.SRAVANI T.DAVALESHWAR N.KONDAL REDDY

08271A0244 08271A0242 08271A0203 08271A0213

UNDER THE ESTEEMED GUIDANCE OF SRI.MADHURI, Assistant prof. In EEE dept.

JYOTHISHMATHI INSTITUTE OF TECHNOLOGY & SCIENCE


(Recognized by AICTE and Affiliated to J.N.T.U, Hyderabad) DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING

CERTIFICATE
This is to certify that the mini project report entitled POWER SAVER FOR STREET LIGHTS being submitted by M.SRAVANTHI(08271A0244), B.SRAVANI(08271A0242), T.DAVALESHWAR(08271A0203), and N.KONDAL REDDY (08271A0213) in partial fulfillment of the requirements for the award of the degree of Bachelor of Technology in Electrical and Electronics Engineering, to the Jyothishmathi Institute of Technology & Science, karimnagar is a bonafide work carried out by them under my guidance and supervision.

PROJECT GUIDE DEPARTMENT SRI. MADHURI Asst. prof. in EEE.DEPT

HEAD OF THE Prof. V. Bugga Rao (B.E., M.S., F.I.E,F.I.E.T.E (MISE.., MSEMCI)), JITS.

ACKNOLEDGEMENT
The satisfaction that accomplishes the successful completion of any task would be incomplete without the mention of the people who make it possible and whose constant guidance and encouragement crown all the efforts with success. We sincerely extend my thanks to Dr.A.R.NASEER, Principal, JYOTHISHMATHI
INSTITUTE OF TECHNOLOGY & SCIENCE, KARIMNAGAR.

We wish to express my deep gratitude to Sri. V.BUGGA RAO, professor & H.O.D., Department of EEE, JITS, Karimnagar for his cooperation and encouragement, in addition to providing necessary facilities throughout the project work. We sincerely extend my thanks to Sri. MADHURI, Assistant prof. in EEE dept. We would like to thank all the staff and all my friends for their good wishes, their helping hand and constructive criticism. , which led the successful completion of this project. We immensely indebted to my parents, brother and sisters for their love and unshakable belief in me and the understanding and ever-decreasing grudges for not spending time more often.We will now, since the excuse is in the process of vanishing by being printed on these very pages. Finally, we thank all those who directly and indirectly helped me in this regard we apologize for not listing everyone here.
M.SRAVANTHI B.SRAVANI T.DAVALESHWAR N.KONDAL REDDY 08271A0244 08271A0242 08271A0203 08271A0213

Power Saver for Street Lights

ABSTRACT
Abstract: This project report details the design, construction and test information on power saver for street lights. In this system we have used the method of turning the lights full on or dim. A micro controller is used to switch on or off the lights. A movement sensor is used in the system which detects the movement of the traffic on the road accordingly the lights are controlled. We have built the Board and tested its performance. The system is working perfectly.

TABLE OF CONTENTS

ABSTRACT 1. INTRODUCTION ..1 2. DESIGN PROCEDURE ....2 2.1 Power Supply ............................................................................................................................................ .2 2.1.1 Transformer ........................................................................................................................................ 3 2.1.2 Rectifier ......................................................................................................................................... ..... 4 2.1.3 Smoothing ......................................................................................................................................... .4 2.1.4 Regulator ......................................................................................................................................... .. 5 2.2 Current Limiting Resistor for LED ............................................................................................................. 6 3. CIRCUIT DESCRIPTION ..................................................................................................................................... 7 3.1 Hardware ............................................................................................................................................ ....... 7 3.2 Software Tools ........................................................................................................................................... 7 4. MAJOR COMPONENTS INFORMATION.......................................................................................................... 10 4.1 AVR Microcontroller ................................................................................................................................10 4.1.1 I/O Port ......................................................................................................................................... .... 10 4.1.2 AVR Micro Block Diagram ................................................................................................................ 12

4.1.3 AVR Micro Controller Internal Architecture ..................................................................................... 14 4.1.4 Pin Descriptions ............................................................................................................................... 15 4.2 PIR Sensor Circuit.................................................................................................................................. .. 21 4.3 LED, Light Emitting Diodes....................................................................................................................... 25 4.4 Capacitor............................................................................................................................. ..................... 28 5. TESTING PROCESS................................................................................................................................ .......... 37 6. CONCLUSION ............................................................................................................................................... .. 40 7. CODING.................................................................................................................................. ........................ 41 8. REFERENCE ............................................................................................................................................... ..... 44

LIST OF FIGURES
PAGE NO 1 3 4 5 1.1 2.1.1(a) 2.1.2(a) 2.1.3(a) 2.1.4(a) FIG NO. DESCRIPTION Block Diagram For power saver for street lights Transformer and AC Waveform Bridge Rectifier Circuit and Waveform Of DC Charging And Discharging Of Capacitor Three Terminal Of Regulator

5 7 11 12 14 18 18 24 24 26 37 3(a) 4.1.1(a) 4.1.2(a) 4.1.3(a) 4.1.4(a) 4.1.4(b) 4.2(a) 4.2(b) 4.3(a) 5.a Circuit For Power Saver for street Lights Pin Diagram AVR Micro Block Diagram AVR Microcontroller Internal Architecture Oscillator Connections External Clock Drive Configuration PIR Motion Sensor Field View of PIR sensor Internal Structure of LED Circuit Diagram of Power supply

LIST OF TABLES

TABLE NO. 5.1 5.2

DESCRIPTION Features Of 1N4001 Features of LM7805

PAGE NO 39 40

1. INTRODUCTION
We use electricity for several applications. The demand for electricity is never met with the requirement. Hence, there is a lot of emphasis is placed on power save. One such application where electricity is used is street lights. These lights are on at sunset and off in the morning. At times, we notice that the lights are ON even in the day time. Also, they are ON throughout night irrespective of the on road traffic. We have developed a system which saves power for the street light application in two ways. First we wish to turn ON the lights during night time with low intensity secondly we want to control the intensity of the lights as per the on road traffic. When there is on road traffic the lights are on with full intensity, when there is no traffic, the street lights are ON with DIM. Whenever the traffic is there the lights are ON with full intensity. We have covered the complete design details including designing a will regulated power supply. The construction and test details are also presented in the later chapters. We have also presented the information on the important components which are used in the system.

230Vac Light s

Rectifi er

Regulat or

Micro Controll er

Control circuit Switch

Traffic Sensor

1.1 Block Diagram for Power Saver for Street Lights

The block diagram for the Power saver for street lights is shown in the above figure, in system level. The 230V ac is rectified, the regulator provides a constant 5V DC which is required for the Micro controller and control circuit. Based on the input the micro controller controls the switching either ON or OFF. In the night time, depending on the traffic flow the lights are switched between full ON and DIM mode. 1

2. DESIGN PROCEDURE
Our design consists of, a power supply, a transistor, a relay, resistors, capacitors and LEDs. In this design section we will go step by step on how different components are used in our system, how they perform, and their features. For any electronic device we require power supply in it, which is very essential requirement for any circuit. Here we are using a 5V regulated dc supply in our circuit. To obtain 5V dc supply procedure is as following.

2.1 Power Supply


Power supply is a supply of electrical power. A device or system that supplies electrical or other types of energy to an output load or group of loads is called a power supply unit or PSU. The term is most commonly applied to electrical energy supplies, less often to mechanical ones, and rarely to others. A power supply may include a power distribution system as well as primary or secondary sources of energy such as: Conversion of one form of electrical power to another desired form and voltage, typically involving converting AC line voltage to a well-regulated lower-voltage DC for electronic devices. Low voltage, low power DC power supply units are commonly integrated with the devices they supply, such as computers and household electronics; for other examples, see switched-mode power supply, linear regulator, rectifier and inverter (electrical). Batteries Chemical fuel cells and other forms of energy storage systems Solar power Generators alternators or

A brief description: Transformer - steps down high voltage AC mains to low voltage AC.

Rectifier - converts AC to DC, but the DC output is varying. Smoothing - smooth the DC from varying greatly to a small ripple. Regulator - eliminates ripple by setting DC output to a fixed voltage.

2.1.1
Transformer
Transformer is a device which can efficiently transform the electric energy. Major use of transformer is in power distribution. Which is used in electrical devices, control systems, communication system devices etc. Step-up transformers increase voltage, step-down transformers reduce voltage. Most power supplies use a stepdown transformer to reduce the dangerously high mains voltage (230V) to a safer low voltage. The input coil is called the primary and the output coil is called the secondary. There is no electrical connection between the two coils; instead they are linked by an alternating magnetic field created in the soft-iron core of the transformer. The two lines in the middle of the circuit symbol represent the core. Transformers waste very little power so the power out is (almost) equal to the power in. Note that as voltage is stepped down current is stepped up. The ratio of the number of turns on each coil, called the turns ratio, determines the ratio of the voltages. A step-down transformer has a large number of turns on its primary (input) coil which is connected to the high voltage mains supply, and a small number of turns on its secondary (output) coil to give a low output voltage.

Turns ratio == VP = primary (input) voltage; Vs = secondary (output) voltage NP = number of turns on primary coil NS = number of turns on secondary coil

2.1.1(a) Transformer and AC waveform The low voltage AC output is suitable for lamps, heaters and special AC motors. It is not suitable for electronic circuits unless they include a rectifier and a smoothing capacitor.

2.1.2 Rectifier
There are several ways of connecting diodes to make a rectifier to convert AC to DC. The bridge rectifier is the most important and it produces full-wave varying DC. A full-wave rectifier can also be made from just two diodes if a centre-tap transformer is used, but this method is rarely used now that diodes are cheaper. A single diode can be used as a rectifier but it only uses the positive (+) parts of the AC wave to produce half-wave varying DC. Bridge rectifier: A bridge rectifier can be made using four individual diodes, but it is also available in special packages containing the four diodes required. It is called a full-wave rectifier because it uses all entire AC wave (both positive and negative sections). 1.4V is used up in the bridge rectifier because each diode uses 0.7V when conducting and there are always two diodes conducting, as shown in the diagram below. Bridge rectifiers are rated by the maximum current they can pass and the maximum reverse voltage they can withstand (this must be at least three times the supply RMS voltage so the rectifier can withstand the peak voltages). Please see the Diodes page for more details, including pictures of bridge rectifiers.

of DC

2.1.2(a) Bridge Rectifier Circuit and Waveform

2.1.3 Smoothing Smoothing is performed by a large value electrolytic capacitor connected across the DC supply to act as a reservoir, supplying current to the output when the varying DC voltage from the rectifier is falling. The diagram shows the unsmoothed varying DC (dotted line) and the smoothed DC (solid line). The capacitor charges quickly near the peak of the varying DC, and then discharges as it supplies current to the output.

Smoothing is not perfect due to the capacitor voltage falling as little as it discharges, giving a small ripple Voltage .For many circuits a ripple which is 10% of the supply voltage is satisfactory and the equation 4

Below gives the required value for the smoothing capacitor. A larger capacitor will give less ripple .The Capacitor value must be doubled when smoothing half-wave DC.

2.1.3(a) Charging and Discharging of Capacitor From figure 4, we can observe that when waveform is rising it is getting charged and when it is decaying it will discharge. 2.1.4 Regulator Voltage regulator ICs are available with fixed (typically 5, 12 and 15V) or variable output voltages. They are also rated by the maximum current they can pass. Negative voltage regulators are available, mainly for use in dual supplies. Most regulators include some automatic protection from excessive current ('overload protection') and overheating ('thermal protection'). Many of the fixed voltage regulator ICs have 3 leads and look like power transistors, such as the 7805 +5V 1A regulator shown on the right.

2.1.4(a) Three Terminal of Regulator From the above figure we can see that regulator consists of three terminals, one is input, second is output and third one is grounded.

2.2 Current Limiting Resistor for LED


A suitable value for a current limiting resistor is calculated as follows.

5V

1.5 V I = 5mA

V= IR

0V

The supply voltage is 5 volts. The current that we want to flow through the LED is 5mA. Assume that the forward voltage drop will be 1.5 V. BY KVL, the voltage drop across the resistor must be 5 -1.5=3V. By Ohms Law, this voltage drop

equals IR. Therefore: 5- 1.5 = R*5mA Rearranging terms gives: R = (51.5)/5mA R = 3.5/5mA = 0.7 K = 700 . So, if we select R value as 700 , then the current flowing through the LED is limited to 5mA.

3. CIRCUIT DESCRIPTION
The following Hardware and software is used in this system. Detailed explanation of these components follow in the later sections.

3.1 Hardware
1) 2) 3) 4) Micro Controller Power Supply 5V PIR Sensor Diodes

3.2 Software Tools


1) 2) Express PCB/Pads C cross compiler for AVR micro

The complete Circuit for the system is shown in the below figure.

3(a) Circuit for Power Saver for Street Lights


7

Circuit Operation
Some of the components in this system require DC5V for their operation, for example the movement sensor. Hence we have designed a 5V regulator. The major power source for us is mains 230V ac. For the regulator design we need a lower ac voltage. We have used a transformer to accomplish this task. The transformer stepped down the 230v ac to an acceptable level. This stepped down AC voltage was converted to DC with the help of a bridge rectifier. The output of the regulator is DC. However this DC has some ac contents in it. This ac content is called as ripples. With the help of a smoothing capacitor these ripples are removed. Now we have a DC voltage. However this DC voltage is not a regulated DC. Means this voltage is not constant. This gets varied depending on the load and the mains supply voltage. We have used a regulator IC which provides us constant DC with constant current. The DC voltage is 5V with a current of 1A. The major circuit element is the movement sensor. The output of this sensor changes whenever it detects some movement with-in its proximity. The output of the sensor is given as input to the control circuit. The control circuit consists of a micro controller, AVR ATmega8. This Micro receives the information from the movement sensor Based on the information the micro sends output to turn on/off of the lights. Depending on the traffic flow the lights are toggled between full intensity and low intensity. For this system we have used a total of 7 lights and one sensor. The detailed operation is explained in the next page.

Assume it is midnight and no traffic on the road. In this case, all the 7 lights are turned dim, i.e. with low intensity. We will number the lights from 1 to 7. At the instance a vehicle is on the road, the movement sensor will detect this and pass the information to the micro. Micro will take the following action. Sequnce1 a) c) Turn on lights 1 to 3,all Wait few SECS Turn on at once b) light #4 d) Wait few SECS e) Turn on Wait few SECS g) Turn h) on light#6 light#5 f)

Wait few SECS i) Turn on light#7 The lights are ON with full intensity as long as there is traffic on the road. Now let us assume that no more traffic on the road. The movement sensor passes this information to the micro. Micro will take the following action. Sequnce2 a) b) c) d) Turn off light#1 Wait few SECS, check for any movement on the road, no movement go to next step else go to sequence1. Turn off light#2 Wait few SECS, check for any movement on the road, no movement go to next step else go to sequence1.

The above process is continued until all the lights are back to dim. In reality if no traffic lights are dim, if the on road traffic is continuous, the lights are full ON. The next section presents important information on the major components that we have used in our system. 9

4. MAJOR COMPONENTS INFORMATION


In this section we present detailed information on the major components that we have used in our system.

4.1 AVR Microcontroller


A quick look on the market reveals there are tons of micros available. Some of them which we have narrowed down are 1) AVR ATMEGA8 microcontroller Series 2) 8051 Series 3) PIC microcontroller Series 4) ARM Series AVR instructions Those are: 1) Power supply section 2) Ports 3) Reset circuit 4) Crystal circuit 5) ISP circuit (for program dumping) has got advanced features combined with rich and architecture. Hence we have used AVR as the controller.

There are minimum six requirements for proper operation of microcontroller.

For this project we are using AVR microcontroller. We can use transistors instead of microcontroller and even transistors are cheap also in comparison to microcontroller but the reason behind using the microcontroller is we are in learning phase. One reason also stand for using microcontroller is that if we have used transistor, circuit would have been very complex. This is because we prefer to use microcontroller.

4.1.1 Port

I/O

Microcontrollers usually have special hardware for dealing with outside world. These are called I\O ports. We normally use I\O ports to interface the microcontrollers to sensors, actuators etc.

10

Microcontroller input\output is always logic high or logic low in terms of voltage. If logic high, it means +5 V and if logic low, it means 0 V. All AVR ports have true Read-Modify-Write functionality when used as general digital I/O ports. This means that the direction of one port pin can be changed without unintentionally changing direction of any other pins. Each output buffer has symmetrical drive characteristics with both high sink and source capability. The pin driver is strong enough to drive LED displays directly. All port pins have individually selectable pull-up resistors with a supply-voltage invariant resistance.

4.1.1( a) Pin Diagram

In AVR microcontroller there are three I\O ports named B, C & D. The port B & D has 8 pins or bits and the port C has 7 pins. All the bits of any these said ports, we can use as both I\O port. In this above said system well use port D as input and port B as output. This is shown in the circuit diagram.

11

4.1.2 AVR Micro Block Diagram

4.1.2(a) AVR Micro Block Diagram


12

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 ATmega8 provides the following features: 8K bytes of In-System Programmable Flash with Read- While-Write capabilities, 512 bytes of EEPROM, 1K byte of SRAM, 23 general purpose I/O lines, 32 general purpose working registers, three flexible Timer/Counters with compare modes, internal and external interrupts, a serial programmable USART, a byte oriented Two wire Serial Interface, a 6-channel ADC (eight channels in TQFP and QFN/MLF packages) with 10-bit accuracy, a programmable Watchdog Timer with Internal Oscillator, an SPI serial port, and five software selectable power saving modes. The Idle mode stops the CPU while allowing the SRAM, Timers/Counters, SPI port, and interrupt system to continue functioning. The Power down mode saves the register contents but freezes the Oscillator, disabling all other chip functions until the next Interrupt or Hardware Reset. In Power-save mode, the asynchronous timer continues to run, allowing the user to maintain a timer base while the rest of the device is sleeping.

The ADC Noise Reduction mode stops the CPU and all I/O modules except asynchronous timer and ADC, to minimize switching noise during ADC conversions. In Standby mode, the crystal/resonator Oscillator is running while the rest of the device is sleeping. This allows very fast start-up combined with low-power consumption.

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. The boot program can use any interface to download the application program in the Application Flash memory. Software in the Boot Flash Section will continue to run while the Application Flash Section is updated,

13

providing a true Read-While-Write operation. 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 highly-flexible and costeffective 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.

4.1.3 AVR Micro Controller Internal Architecture

4.1.3(a) AVR Micro Controller Internal Architecture


14

4.1.4 Pin Descriptions


VCC Digital Supply Voltage . GND Ground Port B (PB7-PB0) XTAL1/XTAL2/TOSC1/TOSC2 Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The 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 pull-up resistors are activated. The Port B pins are tri-stated when a reset condition becomes active, even if the clock is not running. Depending on the clock selection fuse settings, PB6 can be used as input to the inverting Oscillator amplifier and input to the internal clock operating circuit. Depending on the clock selection fuse settings, PB7 can be used as output from the inverting Oscillator Amplifier If the Internal Calibrated RC Oscillator is used as chip clock source, PB7-6 is used as TOSC2-1 input for the Asynchronous Timer/Counter2 if the AS2 bit in ASSR is set. Port C (PC5-PC0) Port C is a 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 a reset condition becomes active, even if the clock is not running.

15

PC6/RESET If the RSTDISBL Fuse is programmed, PC6 is used as an I/O pin. Note that the electrical characteristics of PC6 differ from those of the other pins of Port C. If the RSTDISBL Fuse is unprogrammed.PC6 is used as a Reset input. A low level on this pin For longer than the minimum pulse length will generate a Reset, even if the clock is not running. Shorter pulses are not guaranteed to generate a Reset. Port D (PD7-PD0) Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port D output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port D pins that are externally pulled low will source current if the pull-up resistors are activated. The Port D pins are tri-stated when a reset condition becomes active, even if the clock is not running. Port D also serves the functions of various special features of the ATmega8. . RESET Reset input. A low level on this pin for longer than the minimum pulse length will generate a reset, even if the clock is not running. Shorter pulses are not guaranteed to generate a reset. 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. AREF AREF is the analog reference pin for the A/D Converter.

Configuring the Pin Each port pin consists of 3 Register bits: DDXN, PORTXN, and PINXN .The DDXN bits are accessed at the DDRX I/O address, the PORTXN bits at the PORTX I/O address, and the PINXN bits at the PINX I/O address.

16

The DDXN bit in the DDRX Register selects the direction of this pin. If DDXN is written logic one, PXN is configured as an output pin. If DDXN is written logic zero, PXN is configured as an input pin. If PORTXN is written logic one when the pin is configured as an input pin, the pull-up resistor is activated. To switch the pull-up resistor off, PORTXN has to be written logic zero or the pin has to be configured as an output pin. The port pins are tri-stated when a reset condition becomes active, even if no clocks are running. If PORTXN is written logic one when the pin is configured as an output pin, the port pin is driven high (one). If PORTXN is written logic zero when the pin is configured as an output pin, the port pin is driven low (zero). When switching between tri-state ({DDXN, PORTXN} = 0b00) and output high ({DDXN, PORTXN} = 0b11), an intermediate state with either pull-up enabled ({DDXN, PORTXN} = 0b01) or output low ({DDXN, PORTXN} = 0b10) must occur. Normally, the pull-up enabled state is fully acceptable, as a high-impudent environment will not notice the difference between strong high drivers.

Reading the Pin Value Independent of the setting of Data Direction bit DDXN, the port pin can be read through the PINXN Register Bit. The PINXN Register bit and the preceding latch constitute a synchronizer. This is needed to avoid met stability if the physical pin changes value near the edge of the internal clock, but it Also introduces a delay.

17

4.1.4(a) OSCILLATOR CONNECTIONS:


Note: C1, C2 = 30 pF 10 pF for Crystals = 40 pF 10 pF for Ceramic Resonators

4.1.4(b) External Clock Driver Configuration.

18

INTRODUCTION TO MICROCONTROLLER

Microcontrollers as the name suggests are small controllers. They are like single chip computers that are often embedded into other systems to function as processing/controlling unit. For example the remote control you are using probably has microcontrollers inside that do decoding and other controlling functions. They are also used in automobiles, washing machines, microwave ovens, toys ... etc, where automation is needed. Micro-controllers are useful to the extent that they communicate with other devices, such as sensors, motors, switches, keypads, displays, memory and even other micro-controllers. Many interface methods have been developed over the years to solve the complex problem of balancing circuit design criteria such as features, cost, size, weight, power consumption, reliability, availability, manufacturability. Many microcontroller designs typically mix multiple interfacing methods. In a very simplistic form, a microcontroller system can be viewed as a system that reads from (monitors) inputs, performs processing and writes to (controls) outputs. Embedded system means the processor is embedded into the required application. An embedded product uses a microprocessor or microcontroller to do one task only. In an embedded system, there is only one application software that is typically burned into ROM. Example: printer, keyboard, video game player Microprocessor - A single chip that contains the CPU or most of the computer Microcontroller - A single chip used to control other devices Microcontroller differs from a microprocessor in many ways. First and the most important is its functionality. In order for a microprocessor to be used, other components such as memory, or components for receiving and sending data must be added to it. In short that means that microprocessor very heart of the computer. On the other is the hand, microcontroller is

designed to be all of that in one. No other external components are needed for its application because all necessary peripherals are already built into it. Thus, we save the

Time and space needed to construct devices.

19

MICROPROCESSOR VS MICROCONTROLLER
Microprocessor: CPU is stand-alone, RAM, ROM, I/O, timer are separate Designer can decide on the amount of ROM, RAM and I/O ports. Expensive Versatility general-purpose

Microcontroller:

CPU, RAM, ROM, I/O and timer are all on a single chip fix amount of on-chip ROM, RAM, I/O ports For applications in which cost, power and space are critical Single-Purpose

20

4.2 PIR Sensor Circuit


A PIR (Passive Infrared) sensor detects infrared light that is emitted from objects within its field of view. PIR sensors differ from other infrared sensors because they can only receive infrared waves. Because all objects emit Infrared waves (electromagnetic waves that travel with heat), PIR sensors can detect objects that are in front of them. In fact, PIR sensors can detect many things that humans cannot. PIR sensors are used in many applications, such as night vision, motion detection, and laser range finding. PIR detector is a motion-detecting sensor that functions based on passive infrared technology. The passive infrared technology is the most advanced form of technology, which is widely used in defense and wireless video surveillance systems. It is usually mounted onto a wall and positioned to focus the motion activities within that area. The motion sensors of PIR detector emit streaks of infrared in a covered area. Among the streaks of rays emitted, the topmost layer of rays can reach up to 60ft in height and 35ft on either side. The rays emanating from the center covers the area that is closest to the sensor alarms. The rays detect the foreign intrusion by noting the difference between the temperatures of the individual beams that strikes the foreign body. For example, when the rays from the PIR detector strike your furniture, the motion sensor can easily detect its temperature. Likewise when somebody passes through the furniture, the motion sensor can detect even the temperature of the person. So, the PIR detector can now analyze the temperature difference between the furniture and the person and will let you know the intrusion. Moreover, the microchip present inside the motion sensor is capable of adjusting according to the changing room temperature gradually. Some specific kinds of PIR motion detectors are designed to provide a 360-viewing field downward. Hence, it is not easy to compromise with the PIR detectors that function with passive infrared motion sensor technology. How PIR Sensors Work PIR sensors are made of piezoelectric (or thermoelectric) materials and usually contain lenses or mirrors in order to focus the infrared light for maximum reception.

As infrared light comes in contact with the piezoelectric material, which is usually a thin sheet, it creates an electrical current that can be measured To determine the intensity of the infrared light (depth perception) and the direction that it came from. 21

Because of these properties, PIR sensors are able to determine how far away someone is and whether he/she is approaching the sensor. Applicati ons PIR sensors are used in many applications. They are used on television sets and television accessory devices, such as VCRs and DVD players, to detect infrared light coming from a television remote. PIR sensors are also used as motion detectors at most public doorways in grocery stores, hospitals, and libraries. PIR sensors can also be used for military purposes such as laser range-finding, night vision, and heatseeking missiles. Advanta ges PIR sensors have several important advantages. They detect infrared light from several feet/yards away, Depending on how the device is calibrated. PIR sensors are generally compact and can be fitted into virtually any electronic device. Also, they do not need an external power source because they generate electricity as they absorb infrared light. The unit is passive and it is not possible for intruders to locate their place of installation. They consume less power than IR or radar based systems. They are not affected by light and thus can work well both in day and night. Some of the high-end detectors are provided with precision optics that can detect narrow areas accurately. The detectors work coherently with the cameras, which limits the number of cameras being used in a particular area. The small designs of detectors can beautifully blend in confined spaces. Disadvant ages Although PIR sensors can be advantageous, they also have several disadvantages. PIR sensors can only receive infrared light and cannot emit it like other types of infrared sensors. They can be expensive to purchase, install, and calibrate as well. The passive infrared rays from the PIR detector cannot pass through doors, windows or walls within the rooms. The rays emanating from the motion sensors cannot curve around in the corners. So, when you place the PIR detector in a room that has an open door, the motion sensor cannot detect intrusions when the door is closed. Apart from that, a single PIR motion detecting camera cannot cover every square inch of space in your room. Moreover someone who moves rapidly or slow can

fool these detectors at times. The PIR detector is more ideal for installing in places that are prone to more intrusions and invasion of burglars or other types of intruders. Presently, manufacturers are concentrating in combining the technologies and features to offer good and reliable detectors to the areas that require high-end security. In addition 22

to combining video and detectors in one place, you can also find detectors that offer wireless transmission for distances up to 1000 feet. Motion sensors are integral part of home automation and security systems motion sensor lighting is also widely used to switch off lights when not needed and light up a passage or rooms when there is a need. Turning off the lights in such circumstances can save substantial amounts of energy. In lighting practice occupancy sensors are sometime also called "presence sensors" or "vacancy sensors". Today wireless motion sensors, microwave motion sensor and infrared motion sensor alarms are gaining huge popularity. There are many types of motion sensors from the simplest infrared detectors to the most sophisticated laser beams. These sensors serve mainly one purpose that is to detect the presence of some motion or some body in the area it operates. This 'sensing' can be of something that happens at a specific location or one that occurs within a larger area. The field of view of the sensor must be carefully selected/ adjusted so that it responds only to motion in the space served by the controlled lighting. For example: an occupancy sensor controlling lights in an office should not detect motion in the corridor outside the office. Sensors and their placement are never perfect, therefore most systems incorporate a delay time before switching. This delay time is often user-selectable, but a typical default value is 15 minutes. This means that the sensor must detect no motion for the entire delay time before the lights are switched. Most systems switch lights off at the end of the delay time, but more sophisticated systems with dimming technology reduce lighting slowly to a minimum level. If lights are off and an occupant re-enters a space, most current systems switch lights back on when motion is detected. However, systems designed to switch lights off automatically with no occupancy, and that require the occupant to switch lights on when they re-enter are gaining in popularity due to their potential for increased energy savings. These savings accrue because in a space with access to daylight the occupant may decide on their return that they no longer require supplemental electric light.

23

4.2(a) PIR motion sensor detects motion.


The working of this sensor completely depends upon the height at which it is fixed in the room and the angle of coverage that the sensor can make. The below figure shows a motion sensor fixed to the ceiling of a room at a height of 5 to 7 meters from the ground and the angle of coverage is about 35 to 155. The motion sensor senses the movement of the person in this area.

4.2(b) Field View of PIR sensor

24

4.3 LED, Light Emitting Diodes


A light-emitting diode (LED) is a semiconductor diode that emits incoherent narrow spectrum light when electrically biased in the forward direction of the PNjunction, as in the common LED circuit. This effect is a form of electroluminescence. While sending a message in the form of bits such as 1,the data is sent to the receiver side correspondingly the LED glows representing the data is being received simultaneously when we send 8 as a data the LED gets off .

As in the simple LED circuit, the effect is a form of electroluminescence where incoherent and narrow- spectrum light is emitted from the p-n junction. LEDs are widely used as indicator lights on electronic devices and increasingly in higher power applications such as flashlights and area lighting. An LED is usually a small area (less than 1 mm ) light source, often with optics added to the chip to shape its radiation pattern and assist in reflection. The color of the emitted light depends on the composition and condition of the semi conducting material used, and can be infrared, visible, or ultraviolet. Besides lighting, interesting applications include using UV-LEDs for sterilization of water and disinfection of devices, and as a grow light to enhance Photo synthesis in plants .
2

25

COLOR PD:

Vs

Color Difference Infrared V Red -

Potential

1.6

1.8 V to

2.1 V Orange - 2.2 V Yellow V Green V Blue 3.0 V to 2.4 2.6

3.5 V White 3.5 V

- 3.0 V to -

Ultraviolet 3.5V

(Close-up of a typical LED in its case showing the internal structure) ADVANTAG ES: LEDs have many advantages over other technologies like lasers. As compared to laser diodes or IR sources LEDs are conventional incandescent lamps. For one thing, they don't have a filament that will

Burn out, so they last much longer. Additionally, their small plastic bulb makes them a lot more durable. They also fit more easily into modern electronic circuits. 26

The Main advantage is efficiency. In conventional incandescent bulbs, the lightproduction process involves generating a lot of heat (the filament must be warmed). Unless you're using the lamp light. as a heater, because a huge portion of the available electricity isn't going toward producing visible

LEDs Generate very little heat. A much higher percentage of the electrical power is going Directly for generating light, which cuts down the Electricity demands Considerably. LEDs offer advantages such as low cost and long service life. Moreover LEDs have very low Power consumption and are easy to maintain. DISADVANTAGES OF LEDS: LEDs performance largely depends on the ambient temperature of the operating environment. LEDs must be supplied with the correct current.

LEDs do not approximate a "point source" of light, so cannot be used in applications needing a Highly collimated Beam . But the disadvantages are quite negligible as the negative properties of LEDs do not apply and the Advantages far exceed the limitations.

27

4.4 Capacitor
A Capacitor (formerly known as condenser) is a device for storing electric charge. the forms of practical capacitors vary widely, but all contain at least two Capacitors used as parts of electrical systems, for example, consist of metal Capacitor is a passive electronic component consisting of a pair of When there is a potential difference (voltage) across the conductors, a static conductors separated by a non-conductor. foils separated by a layer of insulating film. conductors separated by a dielectric (insulator). electric field develops across the dielectric, causing positive charge to collect on one plate and negative charge on the other plate. Energy is stored in the electrostatic field.

An Ideal Capacitor is characterized by a single constant value, capacitance, measured in farads. this is the ratio of the electric charge on each conductor to the potential Capacitors are widely used in electronic circuits for blocking direct difference between them. current while allowing alternating current to pass, in filter networks, for smoothing the output of power supplies, in the resonant circuits that tune radios to particular frequencies. Theory of operation: A Capacitor consists of two conductors separated by a non-conductive region. The Non-conductive region is called the dielectric or sometimes the dielectric

Medium .In simpler terms, the dielectric is just an electrical insulator. Examples of dielectric mediums are glass, air, paper, vacuum, and even a semiconductor depletion region chemically identical to the conductors. A Capacitor is assumed to be self-contained and isolated, with no net electric charge and no Influence from any external electric field.

28

The Conductors thus hold equal and opposite charges on their facing surfaces In SI units, a capacitance of one farad means that one coulomb of charge

and the dielectric develops an electric field. on each conductor causes a voltage of one volt across the device.

The Capacitor is a reasonably general model for electric fields within electric circuits. them. An Ideal capacitor is wholly characterized by a constant capacitance C, defined as the ratio of charge Q on each conductor to the voltage V between

Sometimes charge build-up affects the capacitor mechanically, causing its

capacitance to vary. In this case, capacitance is defined in terms of incremental changes:

Energy storage: Work must be done by an external influence to "move" charge between the

conductors in a capacitor. When the external influence is removed the charge separation persists in the electric field and Energy is stored to be released when the charge is allowed to return to its equilibrium position.

29

The Work done in establishing the electric field, and hence the amount of

energy stored, is given by:

Current-Voltage relation:

The current I (t) through any component in an electric circuit is

defined as the rate of flow of a charge q (t) passing through it, but actual charges, electrons cannot pass through the dielectric layer of a capacitor rather an electron accumulates on the negative plate for each one that leaves the positive plate, resulting in an electron depletion and consequent positive charge on one electrode that is equal and opposite to the accumulated negative charge on the other. The Charge on the electrodes is equal to the integral of the as with any ant derivative, a constant of integration is added to This is the integral form of the capacitor equation: current as well as proportional to the voltage as discussed above. represent the initial voltage v (t0).

. Taking the derivative of this, and multiplying by C, yields the derivative form

30

DC Circuits:
A Series circuit containing only a resistor, a capacitor, a switch and a constant DC source of voltage V0 is known as a charging circuit. If the capacitor is initially uncharged while the switch is open, and the switch is closed at t = 0, it Follows from Kirchhoff's voltage law that

Taking the derivative and multiplying by C, gives a first-order differential equation,

At t = 0, the voltage across the capacitor is zero and the voltage across the

resistor is V0. The Initial current is then I (0) =V0 /R. With this assumption, the differential equation yields

Where t0 = RC is the time constant of the system.

As the Capacitor reaches equilibrium with the source voltage, the voltage

across the resistor and the current through the entire circuit decay exponentially. The Case of discharging a charged capacitor likewise demonstrates exponential decay, but with The initial capacitor voltage replacing V0 and the final voltage being zero

31

AC circuit:
Impedance, the vector sum of reactance and resistance, describes the phase difference and the ratio of amplitudes between sinusoid ally varying voltage and sinusoid ally varying current at a given frequency. Fourier analysis allows any signal to be constructed from a spectrum of frequencies, whence the circuit's reaction to the various frequencies may be found. The reactance and impedance of a capacitor are respectively

Where j is the imaginary unit and is the angular velocity of the sinusoidal signal.

The-j phase indicates that the AC voltage V = Z I lags the AC current by 90:

the positive current phase corresponds to increasing voltage as the capacitor charges; zero current corresponds to instantaneous constant voltage, etc. Note that impedance decreases with increasing capacitance and increasing frequency. This implies that a higher-frequency signal or a larger capacitor results in a lower voltage amplitude per current amplitudean AC "short circuit" or AC coupling. Conversely, for very low frequencies, the reactance will be high, so that a capacitor is nearly an open circuit in AC analysisthose frequencies have been "filtered out". Capacitors are different from resistors and inductors in that the impedance is inversely Proportional to the defining characteristic, I.e ; Capacitance .

For capacitors in parallel:


Capacitors in a parallel configuration each have the same applied voltage. Their capacitances add up. Charge is apportioned among them by size. Using the schematic diagram to visualize parallel plates, it is apparent that each capacitor contributes to the total surface area.

32

For capacitor in series:


Connected in series, the schematic diagram reveals that the separation The Capacitors each store instantaneous charge build-up equal to that of The Total voltage difference from end to end is apportioned to each capacitor The Entire series acts as a capacitor smaller than any of its components. distance, not the plate area, adds up. every other capacitor in the series. according to the inverse of its capacitance.

Capacitors are combined in series to achieve a higher working voltage, The Voltage ratings, which are based on plate separation, add up. in such an application, several series connections may in turn be connected in

for example for smoothing a high voltage power supply.

parallel, forming a matrix. The Goal is to maximize the energy storage utility of each capacitor without overloading it.

Applicati on
Energy storage: A Capacitor can store electric energy when disconnected from its charging

circuit, so it can be used like a temporary battery. Capacitors are commonly used in electronic devices to maintain power supply while batteries Are being changed .(This prevents loss of information in volatile memory.)

33

Conventional capacitors provide less than 360 joules per kilogram of

energy density, while capacitors using developing technologies could provide more than 2.52 kilojoules per kilogram.

Pulsed power and weapons


Groups of large, specially constructed, low-inductance high-voltage

capacitors are used to supply huge pulses of current for many pulsed power applications. These include electromagnetic forming, Marx generators, pulsed lasers (especially TEA lasers), and pulse forming networks, radar, fusion research, and particle accelerators.

Power conditioning

A 10,000 microfarad capacitor in a TRM-800 amplifier Reservoir capacitors are used in power supplies where they smooth the

output of a full or half wave rectifier. They can also be used in charge pump circuits as the energy storage element in the generation of higher voltages than the input voltage. Capacitors are connected in parallel with the power circuits of most electronic devices and larger systems (such as factories) to shunt away and conceal current fluctuations from the primary power source to provide a "clean" power supply for signal or control circuits. Power factor correction In Electric power distribution, capacitors are used for power factor correction.

Such Capacitors often come as three capacitors connected as a three phase load. Usually, the values of these capacitors are given not in farads but rather as a

reactive power in volt-amperes reactive (VAR).

34

The Purpose is to counteract inductive loading from devices like

electric motors and transmission lines to make the load appear to be mostly resistive. Signal coupling: Capacitors pass AC but block DC signals (when charged up to the applied dc This Method is known as AC coupling or "capacitive coupling". Here, a large voltage), they are often used to separate the AC and DC components of a signal. value of capacitance, whose value need not be accurately controlled, but whose reactance is small at the signal frequency, is employed. Decoupling: A decoupling capacitor is a capacitor used to protect one part of a circuit Noise caused by other circuit elements is shunted through the capacitor, it is most commonly used between the power supply and ground. An from the effect of another, for instance to suppress noise or transients. reducing the effect they have on the rest of the circuit. alternative name is bypass capacitor as it is used to bypass the power supply or other high impedance component of a circuit. Noise filters and Snubbers When an inductive circuit is opened, the current through the inductance

collapses quickly, creating a large voltage across the open circuit of the switch or relay. If the inductance is large enough, the energy will generate a spark, causing the contact points to oxidize, deteriorate, or sometimes weld together, or destroying a solid-state switch. A snubber Capacitor across the newly opened circuit creates a path for this impulse to bypass the contact points, thereby preserving their life; these were commonly found in contact breaker ignition systems, for instance. Similarly, in smaller scale circuits, the spark may not be enough to damage the switch but will still radiate undesirable radio frequency interference (RFI), which a filter capacitor absorbs. Snubber Capacitors are usually employed with a low-value resistor in series, Such Resistor-capacitor combinations are available in a single package. to dissipate energy and minimize RFI.

35

Tuned circuits: Capacitors and inductors are applied together in tuned circuits to select

information in particular frequency bands. For example, radio receivers rely on variable capacitors to tune the station frequency. Speakers use passive analog crossovers, and analog equalizers use capacitors to select different audio bands. The Resonant frequency f of a tuned circuit is a function of the inductance (L) and capacitance (C) in series, and is given by:

Where L is in henries and C is in farads.

36

5. TESTING PROCESS
In this section we will check our all components so far used. We will also discuss about it working conditions, problems faced across its testing.

Testing of Power Supply


To Design 5V, 500mA Power supply.

5(a) Circuit Diagram of Power Supply

1. TRANSFORMER : Here, AC mains 230V step down transformer is used. Hence, no. of turns in primary coil is more than in secondary coil. Since, it is step down transformer, so, it will reduce the voltage. Since, we cannot apply ideal transformer in practical uses. So, according to variations in input voltage, output voltage is calculated further. 2. RECTIFIER: Here, full wave bridge rectifier is used to convert AC to DC because four diodes are spent to make full wave bridge rectifier where two conduct on the positive half cycle, and the other two conducts on the negative half cycle. Hence, this said rectifier is used instead of half wave bridge rectifier.

37

1N4001 features: In our design we require voltage of 5V and current of 500mA, so from the following datasheet we can see that 4001 is giving us 50V as reverse voltage and rest are giving higher voltage which is not required, and also giving us sufficient current(1 amp) required by us.

Table 4: Features of 1N4001

Low forward voltage drop High surge (sudden increment) current capability

3. CAPACITOR: For this design an electrolytic capacitor of value 470F (calculated) is applied. This capacitor is applied for the smoothing purpose. We can use more than one capacitor but that is optional and based on our Requiremen t

38

4. REGULATOR: Voltage regulator is an electrical regulator designed to automatically maintain a constant voltage level. Now from the given datasheet we can see that we are obtaining 5V and current of 500mA from this regulator. This (LM 7805) is most common voltage regulator that is still used in embedded designs. The features are listed below:-

Table 5: Features of LM7805 LM78XX Series: 3-Terminal 1A positive voltage regulators Feature s: 1. 2. 3. 4. 5. 6. 7. 8. Output current up to 1A Output voltages of 5, 6,8,9,10,12,15,18,24 Thermal overload protection Short circuit protection Output transistor safe operating area protection Output voltage tolerance = Operating temperature = -40 Input voltage range = 7V 20V

39

6. CONCLUSION
we started collecting information on various components that are required to be used in our system.

We have used movement sensor for detecting the movement of the traffic, as it is best suited for our application. this system has used 7 lights (LEDs) to simulate the street lights. A well regulated power supply was designed. This power Supply produces 5V with 1 A current. A micro controller was used to process the information. We have gained the design techniques We have developed testing skills We practiced the art of soldering Finally, we thank the college and the university for providing us an excellent opportunity to transform our theoretical knowledge in to practical application We have gained the confidence to handle similar projects in the future.

40

7. CODING
# include <avrio.h> # include <util/delay.h> Unsigned int i=0; Int main() { DDRB=0XFF; DDRD=0X00; PORTD=0X00; PORTB=0XFF; While(1) { If ((PIND & 0X01)==1) { i++;} Switch(i) { Case1: PORTB=0XFB; -delay_ms(2000); PORTB=0XF0; -delay_ms(2000); PORTB=0XE0; -delay_ms(2000); PORTB=0XC0; -delay_ms(2000); PORTB=0X80; -delay_ms(2000); 41

If((PIND & 0X01)==0) { PORTB=0X81; -delay_ms(2000); } Else i=1; If((PIND & 0X01)==0) { PORTB=0X83; -delay_ms(2000); } Else i=1; If((PIND & 0X01))=0) { PORTB=0X87; -delay_ms(2000); } Else i=1; If((PIND & 0X01)==0) { PORTB=0X8F; -delay_ms(2000); } Else i=1; If((PIND & 0X01)==0)

42

{ PORTB=0X9F; -delay_ms(2000); } Else i=1; If((PIND & 0X01)==0) { PORTB=0XBF; -delay_ms(2000); } Else i=1; PORTB=0XFF; I=0; Case 2 : PORTB=0XF8; I=1; } } }

43

8. REFERENCE
1.www.google.com
2.www.wikipedia.com

Datasheet we Refered: 1. Fairchild semiconductor/1N4001-1N4007 general purpose rectifiers 2. Fairchild semiconductor/LM78XX 3-terminal 1A positive voltage regulator 3. ATMEL/ATMega8 datasheet Books we refered: 1.Analog Electronics, L.K Maheshwari, M.M.S Anand, Prentice-Hall of india pvt. Ltd., Third edition, 2. Microelectronic Circuits, Sedra/Smith, Oxford university press,Fifth edition.

44

Вам также может понравиться