You are on page 1of 32

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

ABSTRACT
This project deals with Development of an embedded system for Automatic Street light controlling while obstacle passing using micro controller 168f77A. IR transmitter and receiver are used for informing obstacle passing on road and corresponding front lights are glowing, while obstacle passed away back street lights are off. LDR is used for light intensity if light intensity is low when the obstacles passing on the road corresponding light will be ON. If light intensity is high all lights are off. In our daily life we are observing street lights still on night even if obstacles are not presented, in this type of conditions are more affected the electricity board by electricity. This project deals the how to avoid this condition using embedded. The project presented here to on/off the street lights automatically when the obstacle moving in nights automatically. Here we are mainly using the sensor for detect the IR (Infrared rays). The Microcontroller was used to control the whole system, it monitors the sensor out put and according to the sensor condition the street lights operated. The whole program written in embedded c and burned into the microcontroller ROM.

HARDWARE REQUIREMENTS:
1. Microcontroller 2. LDR 3. IR Sensors 4. LEDS 5. Transistor CL100

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

SIMULATION: TOOL: KEIL MICROVISION EMBEDDED C

LANGUAGE:

BLOCK DIAGRAM:

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

CHAPTER 1
1.1 INTRODUCTION:
This project deals with Development and embedded systems for automatic street light controlling while obstacle passing using PIC micro controller 16f877. In our daily life we are observing street lights still ON night even if obstacle is not presented, in this type of conditions are more affected the electricity board by electricity. The main objective of this project is power saving. The microcontroller was used to control the whole system, it monitors the sensors output and according to the sensor condition the street lights are operated. The whole program written in embedded C and burned into the microcontroller ROM. Always the radiation between IR transmitter and receiver continuous until any obstacle comes. When an obstacle comes the radiation between them breaks then IR Transmitter sends the information to the receiver are used for informing obstacle passing on road and corresponding front lights are glowing, while obstacle passed away back street lights are off. LDR is used for light intensity if light intensity is low when the obstacle passing on the road corresponding ON. If light intensity is high all lights are off. .

1.2 AIM:
The project presented here to ON/OFF the street lights automatically when the obstacle moving in nights automatically.

1.3 HARDWARE EQUIPMENTS:


1. PIC Micro controller 2. LDR 3. LEDs 4. IR Sensors

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

1.4 BLOCK DIAGRAM:

Fig 1.4.1 block diagram

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

CHAPTER 2
POWER SUPPLY UNIT 2.1 INTRODUCTION:
Power supply unit provides 5v regulates power supply to the systems .It consists of two parts mainly 1. Rectifier 2. Regulater

2.2 BLOCK DIAGRAM:

Fig 2.1.1 power supply unit

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

2.2.1 RECTIFIER:
Here the step down transformer 230-0v/9-0-9 and gives the secondary current up to 500mA, to the rectifier. Is provided with a centre tap. Hence the voltage v1 and v2 are equal and having a phase difference of 180 deg. So it is anode of diode of D1 is positive with respect to centre tap, the anode of diode D2 will be negative with respect to centre tap. During the positive half cycle of the supply D1 conducts and current flows through the centre tap D1 and load. During this period D2 will not conduct as its anode is at a negative potential. During the negative half cycle of the supply voltage, the voltage on the diode D2 will b positive and hence D2 conducts. The current flows through the transformer winding. Diode D2 and load. It Is to be noted that the current i1 and i2 are flowing in the same direction in load. The average of the two currents i1 and i2 flows through the load producing a voltage drop. This is a dc output voltage of the rectifier. Using a capacitor filter the ripple in the output waveform can be minimized. The voltage can be regulated by using monitor IC voltage regulations.

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

A voltage regulator is a circuit that supplies a constant voltage regardless of changes in, load currents. Although voltage regulators can be designed using op-amps. It is quicker and easier to use IC voltage regulators are versatile and relatively inexpensive and are available with features such as programmable output current/voltage boosting, internal short circuit current limiting, thermal shut down and floating operation for high voltage applications. Here we are using 7800 series voltage regulators .The 7800 series consists of 3 terminal positive voltage regulators with 7 voltage options. These ICs are designed as fixed voltage regulators and with adequate heat sinking can deliver output currents in excess of 1 Amp. Although these devices do not require external components such components can be used to obtain adjustable voltages and currents. For proper operation a common between input and output voltages is required. In addition the difference between input and output voltages (V1-V0) called drop out voltage must be typically 1.5V even during the low point as the input ripple voltage. Further more the capacitor C1 is required if the regulator is located an appreciable distance from a power supply filter. Even though C0 is not needed. It may be used to improve the transient response of the regulator. Typical performance parameters for voltage regulators are line regulation. Load regulation, temperature stability and ripple rejection. Line regulation is defined as the change in output voltage for a change in the input voltage and is usually expressed in mille volts or as a percentage of V0.Temperature stability or average temperature coefficient of output voltage (TCV0) is the change in output voltage per unit change in temperature and is expressed in either mille volts/oCOr parts per million (PPM/oC) ripple rejection is the measure of a regulators ability to reject ripple vloltage. It is usually expressed in decibels. The smaller the values of line regulation, load regulation and temperature stability the better the regulation.

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

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

Fig 2.2.2

2.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 a 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 below gives the required value for the smoothing capacitor. A larger capacitor will give fewer ripples. The capacitor value must be doubled when smoothing half-wave DC. The smoothing block smoothes the DC from varying greatly to a small ripple and the ripple voltage is defined as the deviation of the load voltage from its DC value
8

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

CHAPTER 3 PIC MICROCONTROLLER 16F877A


3.1 INTRODUCTION:
Most of the engineering projects are done with the help of microcontrollers.In this series, here we would like to share the micro controller pic 16F877A, features, pin diagram and pin description and so. 256bytes This powerful(200 nano second instruction execution)yet easy toprogram(only 35 us single word instructions)CMOS FLASH-based 8-bit microcontroller packs Microchips powerful PIC architecture into an 40-or 44- pin package and is upwards compatible with the pic 16C55X ,PIC 12CXXX and PIC16C7X devices. The PIC16F877a features 256bytes of EEPROM memory, self programming, an ICD,2 comparators, 8 channels of 10-bit Analog-to-digital converter,2 capture/compare/PWM functions, the synchronous serial port can be configured either 3-wire serial peripheral interface or the 2wire inter-integrated circuit and a Universal Asynchronous Receiver

Transmitter(USART).All of these features make it ideal for more advanced level A/D applications in automotive, industrial, appliances and consumer applications.

3.1.1 Structure of pic microcontroller


9

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

High performance FLASH Microcontroller that can be erased and reprogrammed without having to use a UV light source. This development as well as production. The 16F877A has 8K of code space, 368 bytes of RAM and 256 bytes of EEPROM. allows the same to used for prototype

3.2 FEATURES OF PIC MICROCONTROLLER:


- High speed: DC-20MHZ clock input, DC-200ns instruction cycle. - Flash program memory is available up to 8K*14 words. - EEPROM data memory is available up to 256*8 bytes. - Power saving sleeping mode. - Selectable oscillator options. - Low power, high speed CMOS EPROM/EEPROM Technology. - Programmable code protection. - Only single only 5V source needed for programming capability. - Fully static design. - Processor read /writes access to program memory. - Wide operating voltage rang: 2.5V to 5.5V.

10

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

3.3 PIN DIAGRAM:

Fig 3.3.1 pin diagram of 16f877A

This PIC micro controller having 40 pin packages. It is fully static design. It requires only 5V power supply is needed for programming and debugging of the program is easy in these micro controller programming.

11

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

3.4. MEMORY CAPABILTY: 3.4.1 168f77A:


1. Program memory-8K 2. RAM-368 bytes 3. EEPROM-256 bytes 4. I/O -33pins 5.Oscillator-4modes

3.4.1.1. PERIPHERALS: 1. Timers-3 2. usart-1 3. mssp-1 4. ccp-2 5. psp-1 6. adc input-8 7. analog comparator-2

12

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

Fig.3.4.1 peripherals

13

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

3.4.1.1.1 PERIPHERAL FEATURES:


Timer0: 8-bit timer/counter with 8-bit prescaler Timer1: 16-bit timer/counter with prescaler,can be incremented during SLEEP via external crystal/clock Timer2: 8-bit timer/counter with 8-bit periodregister, prescaler and postscaler Two Capture, Compare, PWM modules - Capture is 16-bit, max. resolution is 12.5 ns - Compare is 16-bit, max. resolution is 200 ns - PWM max. resolution is 10-bit 10-bit multi-channel Analog-to-Digital converter (Master/Slave) Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI) with 9-bit address detection Parallel Slave Port (PSP) 8-bits wide, with external RD, WR and CS controls (40/44-pin only) Brown-out detection circuitry for Brown-out Reset (BOR) 3.5 PIN DESCRIPTION: Osc1/clk1: oscillator crystal or external clock i/p Osc2/clk0: oscillator crystal or clock o/p. MCLR/Vpp: master clear (i/p) or programming voltage (o/p/0. RA0/AN0: digital i/o or analog i/p 0. RA1/AN1: digital i/o or analog i/p 1 RA2/AN2/Vref/CVref: digital i/o or analog i/p 2 or a/d reference voltage (low) i/p or comparator Vref o/p.
14

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

RA3/AN3/Vref+: digital i/o or analog i/p 3 or a/d reference voltage (high)i/p RA4/TOCK1/C1 OUT: digital i/o or timero external clk i/p or comparator1 o/p. RA5/AN4/SS/C2OUT: digital i/o or analog i/p4 or slave select i/p or comparator 2 output. RB0/INT: RB0 can also be used as interrupt pin. RB3/PGM: RB3 can also be the low voltage programming i/p. RB4: interrupt on change. RB5: interrupt on change. RB6/PGC: interrupt on change pin or in circuit debugging pin serial programming clock. RB7/PGD: interrupt on change pin or in circuit debugging pin serial programming date. RC0/T1OSO/TICK1: RC0 can also be the timer1 oscillator o/p or a timer1 clk i/p. RC1/T1OS1/CCP2: RC1 can be also be used as oscillator i/p or capture2 i/p or comparator 2 o/p or pwm 2 o/p. RC2/CCP1: RC2 can also be the capture1 i/p or compare 1 o/p or pwm1 o/p. RC3/SCK/SCL: RC3 can also be the synchronous serial clock i/p or o/p . RC4/SDI/SDA: RC4 can also be the SPI data in (SPI mode) or data o/p. RC5/SDO: RC5 can also be the SPI data o/p. RC6/TX/CLK: RC6 can also be the USART transmitter clk. RC7/RX/DT: RC7 can also be the USART receiver data. RDn/PSDn: port d is a bidirectional i/o port or parallel slave port when interface to a microprocessor bus. RE0/RD/AN5: RE0 can also be read control for the parallel slave port or analog i/p5. RE1/WR/AN6: RE1 can also be write control for the parallel slave port or analog i/p6.
15

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

RE2/CS/AN7: RE2 can be select control for the parlell slave port or analog i/p7. Vss: ground reference for logic and i/o pins. Vdd: positive supply for logic and i/o pins.

16

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

CHAPTER 4 LIGHT EMMITING DIODE


4.1 INTRODUCTION:
A light emitting diode (LED) is a semiconductor device that emits incoherent narrow spectrum light when electrically biased in the forward direction of the p-n junction. This effect is a form of electroluminescence An LED is usually a small area source, often with extra optics added to the chip to shape its radiation pattern [10]. The color of the emitted light depends on the composition and condition of the semiconducting material used, and can be infrared, visible, or nearultraviolet.

Fig 4.1.1LED

17

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

4.1.1 Type of colors:


1. RED 2. GREEN 3. YELLOW

4.1.2 INSIDE A LIGHT EMITTING DIODE:

Fig 4.1.2 LED

4.1.3 ADVANTAGES:
Low working voltages and currents Less power consumption Very fast action Small size and weight

18

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

CHAPTER 5 LDR
5.1 INTRODUCTION:
An LDR (Light dependent resistor), as its name suggests, offers resistance in response to the ambient light. The resistance decreases as the intensity of incident light increases, and vice versa. In the absence of light, LDR exhibits a resistance of the order of mega-ohms which decreases to few hundred ohms in the presence of light. It can act as a sensor, since a varying voltage drop can be obtained in accordance with the varying light. It is made up of cadmium sulphide (CdS). An LDR has a zigzag cadmium sulphide track. It is a bilateral device, i.e., conducts in both directions in same fashion.

Fig 5.1.1 LDR

19

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

5.2 PIN DIAGRAM:


5.2.1 LDRs or Light Dependent Resistors are very useful especially in light/dark sensor circuits. Normally the resistance of an LDR is very high, sometimes as high as 1000 000 ohms, but when they are illuminated with light resistance drops dramatically.

Fig 5.2.1 pin diagram of LDR

When the light level is low the resistance of the LDR is high. This prevents current from flowing to the base of the transistors. Consequently the LED does not light. However, when light shines onto the LDR its resistance falls and current flows into the base of the first transistor and then the second transistor. The LED lights. The preset resistor can be turned up or down to increase or decrease resistance, in this way it can make the circuit more or less sensitive.
20

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

CHAPTER 6 IR SENSORS
6.1 INTRODUCTION:
A sensor is a device that measures a physical quantity and converts it into a signal which can be read by an observer or by an instrument. For example, a mercury-in-glass thermometer converts the measured temperature into expansion and contraction of a liquid which can be read on a calibrated glass tube. A thermocouple converts temperature to an output voltage which can be read by a voltmeter. For accuracy, most sensors are calibrated against known standards.

Use: Sensors are used in everyday objects such as touch-sensitive elevator buttons (tactile sensor) and lamps which dim or brighten by touching the base. There are also innumerable applications for sensors of which most people are never aware. Applications include cars, machines, aerospace, medicine, manufacturing and robotics. A sensor is a device which receives and responds to a signal. A sensor's sensitivity indicates how much the sensor's output changes when the measured quantity changes. For instance, if the mercury in a thermometer moves 1 cm when the temperature changes by 1 C, the sensitivity is 1 cm/C (it is basically the slope Dy/Dx assuming a linear characteristic). Sensors that measure very small changes must have very high sensitivities. Sensors also have an impact on what they measure; for instance, a room temperature thermometer inserted into a hot cup of liquid cools the liquid while the liquid heats the thermometer. Sensors need to be designed to have a small effect on what is measured, making the sensor smaller often improves this and may introduce other advantages. Technological progress allows more and more sensors to be manufactured on a microscopic scale as micro sensors using MEMS technology. In most cases, a micro sensor reaches a significantly higher speed and sensitivity compared with macroscopic approaches.
21

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

An IR LED, also known as IR transmitter, is a special purpose LED that transmits infrared rays in the range of 760 nm wavelength. Such LEDs are usually made of gallium arsenide or aluminum gallium arsenide. They, along with IR receivers, are commonly used as sensors. The appearance is same as a common LED. Since the human eye cannot see the infrared radiations, it is not possible for a person to identify whether the IR LED is working or not, unlike a common LED. To overcome this problem, the camera on a cell phone can be used. The camera can show us the IR rays being emanated the IR LED.

Fig 6.1.1 IR SENSORS

22

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

Fig 6.1.2 pin diagram of IR sensors

23

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

CHAPTER 7 TRANSISTER
7.1 INTRODUCTION:
In this project we are using transistor CL100.This transistor is used to switch the circuit. Hence the transistor is used as a switch. These transistors suitable for a wide range of medium voltage and current amplifier applications

Fig 7.1.1 transistor

24

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

CHAPTER 8 CRYSTAL OSCILLATOR


8.1 INTRODUCTION:
A crystal oscillator is an electronic oscillator circuit that uses the mechanical resonance of a vibrating crystal of piezoelectric material to create an electrical signal with a very precise frequency. This frequency is commonly used to keep track of time (as in quartz wristwatches), to provide a stable clock signal for digital integrated circuits, and to stabilize frequencies for radio transmitters and receivers. The most common type of piezoelectric resonator used is the quartz crystal, so oscillator circuits designed around them became known as "crystal oscillators." Quartz crystals are manufactured for frequencies from a few tens of kilohertz to tens of megahertz. More than two billion (2109) crystals are manufactured annually. Most are used for consumer devices such as wristwatches, clocks, radios, computers, and cell phones. Quartz crystals are also found inside test and measurement equipment, such as counters, signal generators, and oscilloscopes. Clock signal is used to generate the clock signal for the PIC micro controller

Fig 8.1.1 crystal oscillator

25

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

CHAPTER 9 CODING
9.1 PROGRAM:
# include<reg5.1.h> Sbit ldr-p1^0; Sbit tr=p1^1;

Sbit ir1=p1^0; Sbit ir2=p2^1; Sbit ir3=p2^2; Sbit ir4=p2^3; Sbit ir5=p2^4; Sbit ir6=p2^5; Sbit ir7=p2^6; Sbit ir8=p2^7;

Sbit light1=p3^0; Sbit light2=p3^1; Sbit light3=p3^2; Sbit light4=p3^3; Sbit light5=p3^4; Sbit light6=p3^5; Sbit light7=p3^6; Sbit light8=p3^7;

26

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

Void times(void)interrupt { mill_count++; if(milli_count>14) milli_count_0; } }


Void main(void)

{
Ldr=1; P2=0; P3=0; P1=0; TMOD=0*01; //model of timer0 THO=0*3C; IE=0*32; TR0=1; While(1) // initial values loaded to timer // enable interrupt // start timer

{ If(ldr==1) { Tr=1; } Else { tr=0;


27

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

} If (ir1=1) { Light1=1 I1=0; } If(ir2=1) { Light2=1; I2=0; } Else { If(i2>=t=1) Light2=0; } If(ir3==1) { Light3=1; I3=0; If(ir4==1) { Light4=1; I4=0; }
28

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

If(ir5==1) { Light5=1; I5=0; } If(ir6==1) { Light6=1; I6=0; } If(ir7==1) { Light7=1; I7=0; } If(ir8==1) { Light8=1; I8=0; } } }

29

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

FUTURE SCOPE
We can save 80% of electricity of all the energy-saving tips out there, probably the one we hear most often is to not leave lights on when we leave a room. Its good advice, yet cities around the world are not following it in one key way their streetlights stay on all night long, even when no one is on the street. However, in which motion sensor-equipped streetlights dim to 20 percent power when no people or moving vehicles are near them. The system is said to reduce energy consumption and CO2 emissions by up to 80 percent, plus it lowers maintenance costs and reduces light pollution. A lamp that changes colours to match surroundings while child plays. When Electricity is unavailable, By using less amount of solar energy also we can apply this concept.

30

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

CONCLUSION
Finally, we are going to conclude that it is to reduce the power consumption in the streets. According to the existing system, power consumption is more due to the irregular functionalities of the street lights. By using our proposed system, we can control the consumption of power. initially, the light will be in dim condition, whenever the vehicle crosses the sensor(controller),light starts to increase .brightness of the light is depends on the number of vehicles which crosses the sensor. if one vehicle crosses the sensor, the light will be in minimum bright. More than 3 vehicles crosses the sensor, the light will be in maximum bright. by this proposed system we can control the power consumption of the street light.

31

INTELLIGENT STREET LIGHT CONTROL WHILE OBSTACLE PASSING

REFERENCES
1. Embedded system design By Arnold s.Berger 2001 Amazon.com 2. Art of designing embedded systems By Jack Ganssle 1991

3. Website: www.engineers gargage.com 4. Website: www.microchip.com

32

You might also like