Automatic street light control using LDR.

65
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman I Project Report On Automatic Street Light Control Using Light Dependent Resistor This project paper has been submitted to the Eastern University of Bangladesh in partial fulfillment of the requirements for the award of the degree of Bachelor of Science in Electrical and Electronics Engineering. Submitted by Md. Fazlur Rahman ID: 091800101 Supervised by Prof. Dr. Mirza Golam Rabbani Chairperson Department of Electrical and Electronic Engineering. Faculty of Engineering & Technology EASTERN UNIVERSITY. Dhanmondi, Dhaka-1205, Bangladesh December, 2013

Transcript of Automatic street light control using LDR.

Page 1: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

I

Project Report On

Automatic Street Light Control Using Light

Dependent Resistor

This project paper has been submitted to the Eastern University of Bangladesh

in partial fulfillment of the requirements for the award of the degree of

Bachelor of Science in Electrical and Electronics Engineering.

Submitted by

Md. Fazlur Rahman

ID: 091800101

Supervised by

Prof. Dr. Mirza Golam Rabbani Chairperson

Department of Electrical and Electronic Engineering.

Faculty of Engineering & Technology EASTERN UNIVERSITY.

Dhanmondi, Dhaka-1205, Bangladesh

December, 2013

Page 2: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

II

DECLARATION

It is hereby declared that the work presented in this project report is done by the

authors under the supervision of Prof. Dr. Mirza Golam Rabbani, Chairperson,

Department of Electrical and Electronic Engineering, Eastern University. We hereby

declare that the content of this report is the result of work done by us and has not been

submitted to any other University or Institution for a higher degree or any other

purpose.

………………………. Md. Fazlur Rahman ID: 091800101

Supervisor: ………………………………………………

Prof. Dr. Mirza Golam Rabbani Chairperson

Department of Electrical & Electronic Engineering, Faculty of Engineering & Technology

Eastern University, Dhaka, Bangladesh.

Page 3: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

III

EASTERN UNIVERSITY OF BANGLADESH

CERTIFICATE

This is to certify that the Project report of “Automatic Street Light Control Using

Light Dependent Resistor” is a bona fide record of project work done by Md. Fazlur

Rahman, ID No: 091800101 and others for partial fulfillment of the requirements for

the award of the degree of B.Sc. in Electrical and Electronics Engineering from the

Eastern University of Bangladesh (EU).

This report has been carried out under my guidance and is a record of the bona fide

work has been complete successfully.

I wish their every success in life.

Supervisor

Prof. Dr. Mirza Golam Rabbani

Chairperson

Department of Electrical and Electronic Engineering

Eastern University of Bangladesh

Dhaka, Bangladesh.

Page 4: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

IV

ACKNOWLEDGMENT

At first, we would like to thank and all praise to “Almighty Allah” the most merciful,

the most gracious, the source of knowledge and wisdom endowed to mankind, who

conferred us with the power mind and capability to take this study of exciting ocean

of knowledge.

We express our sincere thanks to our supervisor, Prof. Dr. Mirza Golam Rabbani for

his constant support, motivation and encouragement without which it would have

been very difficult for us to complete the project. He gave us the freedom to think and

made open all the resources he had in his personal capacity.

We are grateful to our honorable Vice Chancellor .Prof. Dr. Nurul Islam and also our

Dean Prof. Dr. Nurul Islam & chairman, Prof. Dr. Mirza Golam Rabbani for

providing golden opportunity for achieving our degree of Bachelor of Science in

Electrical and Electronics Engineering and their best cooperation.

We would also like to thanks Kazi Saiful Alam and all teachers in the Department of

Electrical and Electronics Engineering for their constant support, motivation, sacrifice

and their encouragement.

Above all we would like to thank our parents who gave us the moral support.

Authors,

Md. Fazlur Rahman

Page 5: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

V

ABSTRACT

The theme of the project is to design the automatic control of street light with change

of the intensity of sunlight i.e. as the intensity of sunlight decreases, intensity of street

light increases. LDR is used to detect light intensity. Triac controlled circuit is used to

control the intensity of light. In this project there is the necessity of getting

synchronized firing pulses for the gate of the Thyristor. Out of many variety of firing

circuits available, phase angle controls scheme is used. In this interesting scheme, the

supply voltage is first integrated to obtain a sine wave. The sine wave so obtained is

compared with a reference D.C voltage. The signal at output terminal is synchronized

with the pulse and is delayed from the supply zero crossing signal.

Instrumentation Triac is used to provide a reference voltage to a firing circuit. And

this reference voltage is totally dependent on LDR resistance whose value change

with intensity of light.

This circuit is analyzed and tested in various conditions and it provides an absolute

result which shows the reliability of this circuit. Usually street light remain ON in

morning time due to manual operation, which cause loss of energy and therefore this

project is very beneficial for saving power and energy by automatic control. This

circuit also provides the idea of developing the driver circuit of LED lamp which is

widely used nowadays.

Page 6: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

VI

INDEX Page No.

Declaration ……………………………………………………………………………. II

Examination Committee ……………………………………………………………. III

Certificate ……………………………………………………………………………… IV

Acknowledgement ……………………………………………………………………... V

Abstract ………………………………………………………………………… VI

CONTENTS

Chapter 1

LITERATURE REVIEW Page No.

1.1 Introduction …………………………………………………………… 01

1.2 Scope of This Project . ………………………………………………… 02

1.3 Objectives ……………………………………………………………... 02

Chapter 2

THEORY OF THE PROJECT

2.1 Introduction …………………………………………………………. 03

2.2 Required Components ………………………………………………. 03

2.3 Light Dependent Resistor (LDR) ……………………………………. 04

2.3.1 Recovery Rate ……………………………………………………… 06

2.4 Micro-controller ……………………………………………………… 07

2.5 The PIC16F676 ………………………………………………………… 08

2.5.1 Block Diagram Of PIC16F676 ………………………………………… 09

2.5.2 Specification of Microcontroller ………………………………………… 09

2.5.3 Pin Layout …………………………………………………………… 11

2.5.4 Pin Description ……………………………………………………….. 12

Page 7: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

VII

Chapter 3

THYRISTOR

3.1 Thyristor ……………………………………………………………… 13

3.1.1 Typical Thyristor Characteristics ………………………………………… 13

3.1.2 Firing Techniques of Thyristor ………………………………………… 14

3.2 Popular Methods of Generating firing Pulses ………………………………... 15

3.3 Phase Angle Control ……………………………………………………… 16

3.4 Introduction of Triac …………………………………………………… 17

3.4.1Constructionof a Triac ………………………………………………… 18

3.4.2 Operation of a Triac …………………………………………………….. 18

3.5 Gate Threshold Current …………………………………………………. 20

3.6 Latching Current …………………………………………………………. 20

3.7 Holding Current ………………………………………………………… 20

3.8 Phase Angle Control by Triac ……………………………………………. 21

3.9 Generate Zero-Crossing signal ……………………………………………. 22

3.10 Pulse Width Modulation (PWM) ………………………………………… 23

Chapter 4

OPTOCOUPLER

4.1 Optocoupler …………………………………………………………... 24

4.1.1 Photo Transistor Optocoupler …………………………………………. 24

4.1.2 Optocoupler Types …………………………………………………... 25

4.1.3 Optocoupler Application ……………………………………………… 26

4.2 Optocoupler Triac Control ………………………………………………. 27

4.3 Bi-Polar junction Transistor ……………………………………………... 27

4.4 power Supply …………………………………………………………... 29

4.5 Step down Transformer …………………………………………………. 29

Page 8: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

VIII

4.6 Rectifier ……………………………………………………………….. 30

4.6.1 Full Wave Rectifier …………………………………………………… 31

4.7 Capacitor ……………………………………………………………… 31

4.8 Resistor ……………………………………………………………….. 32

4.9 Light Emitting Diode (LED) …………………………………………….. 33

4.10 Diode (IN 4007) ……………………………………………………… 34

4.11 Zener Diode ………………………………………………………….. 35

4.12 Rc Snubber …………………………………………………………… 36

4.13 Voltage Regulator (7805) ………………………………………………. 37

4.14 Push Button Switch ……………………………………………………. 38

4.15 Fuse ………………………………………………………………….. 39

Chapter 5

Design & Fabrication

5.1 Introduction … …………………………………………………… 41

5.2 Circuit Diagram ………………………………………………………… 41

5.3 PCB Board Connection Diagram …………………………………………. 42

5.4 Circuit Descriptions ……………………………………………………... 43

5.5 Flow Chart of this Project Program ………………………………………... 44

Chapter 6

Result Analysis

6.1 Result …………………………………………………………………. 45

6.2 Image of This Project ……………………………………………………. 45

6.3 Advantages & Disadvantages …………………………………………….. 46

6.4 Applications …………………………………………………………….. 46

Page 9: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

IX

Chapter 7

Conclusion

7.1 Conclusion ……………………………………………………………... 47

7.2 Future Scope …………………………………………………………… 47

Appendix ……………………………………………………………… 48

Program Code ………………………………………………………... 48

Reference ……………………………………………………………… 55

Page 10: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

X

Figures List

SL No Fig. No Figure Name Page No

1 2.1 Light Dependent Resistor 05

2 2.2 Symbol of LDR 05

3 2.3 LDR and its characteristic graph 05

4 2.4 The Microcontroller 08

5 2.5 Block Diagram of PIC16F676 09

6 2.6 Pin Layout (PIC16F676) 12

7 3.1 Structure on the physical and electronic level and thyristor symbol 13

8 3.2 Characteristics of SCR 14

9 3.3 Basic Idea of Ramp Signal 15

10 3.4 Basic Idea of Sine Scheme 16

11 3.5 Voltage Phage Angle Control 16

12 3.6 Basic Structure of Triac 17

13 3.7 Triac Construction 18

14 3.8 Operation of Triac 19

15 3.9 Phase angle control 21

16 3.10 Generating Zero-crossing Signal 22

17 3.11 Zero-crossing signal Circuit 22

18 3.12 Duty Cycle 23

19 4.1 Optocoupler 24

20 4.2 Photo-Transistor Optocoupler 25

21 4.3 Different Types of Optocoupler 25

22 4.4 Rigid Plastic Tube 26

23 4.5 Optocoupler Triac Control Circuit 27

24 4.6 Pin Diagram and Symbol of Transistor 28

25 4.7 Step Down Transformer 29

26 4.8 Full-wave Rectifier 31

27 4.9 Capacitor 32

Page 11: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

XI

SL No Fig. No Figure Name Page No

28 4.10 Resistor 33

29 4.11 Light Emitting Diode 34

30 4.12 Diode (IN4007) 35

31 4.13 Zener Diode 36

32 4.14 RC Snubbers 36

33 4.15 LM 7805 Pinout Diagram 37

34 4.16 Push-button Switch 38

35 4.17 Fuse 39

36 5.1 Circuit Diagram 41

37 5.2 PCB Board Diagram 42

38 6.1 Image of the Project 45

Page 12: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 1 -

Chapter 1

LITERATURE REVIEW

1.1 INTRODUCTION

We need to save or conserve energy because most of the energy sources we depend

on, like coal and natural gas can't be replaced. Once we use them up, they're gone

forever. Saving power is very important, instead of using the power in unnecessary

times it should be switched off. In any city “STREET LIGHT” is one of the major

power consuming factors. Most of the time we see street lights are ON even after

sunrise thus wasting lot of energy. Over here we are avoiding the problem by having

an automatic system which turns ON & OFF the street lights at given time or when

the ambient light falls below a specific intensity. Each controller has an LDR which is

used to detect the ambient light. If the ambient light is below a specific value the

lights are turned ON.

A light dependent sensor is interfaced to the pic16f676 microcontroller it is used to

track the sun light and when the sensors goes dark the led will be made on and when

the sensor founds light the led will be made OFF.

It clearly demonstrates the working of transistor in saturation region and cut-off

region. The working of relay is also known Microcontroller and the code is written in

c. Automatic Street Light Control System is a simple yet powerful concept, which

uses transistor as a switch. By using this system manual works are 100% removed. It

automatically switches ON lights when the sunlight goes below the visible region of

our eyes. This is done by a sensor called Light Dependent Resistor (LDR) which

senses the light actually like our eyes. It automatically switches OFF lights whenever

the sunlight comes.

Page 13: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 2 -

Aim of this project is to control the street light using LDR. When the light falling

occur means resistance value will be change. There is no light then the resistance

value is change. From this resistance change the voltage variation can be obtained this

value is given to ADC of PIC. PIC is stand for peripheral interface controller.

1.2 SCOPE OF THE PROJECT

The main scope of the project is to learn the pic microcontroller, using 10BIT ADC

serial communication, with coding system write in win avr and load the code in pic

microcontroller in hex code.

1.3 OBJECTIVE

To know the design procedure of Automatic Street Light Control Using Light

Dependent Resistor.

Study different electrical parts & elements

Study about PIC microcontroller. .

To measure the light intensity.

Study microcontroller program language.

To control the lighting system on/off.

Page 14: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 3 -

CHAPTER-2

THEORY OF THE PROJECT

2.1 INTRODUCTION

To 333 implement of the desire project, our target is to arrange all required

components and module as per circuit design and practical functioning status

observation of components as well as PCB layout design. The required components

and description are as follows –

2.2. REQUIRED COMPONENTS

Light Dependent Resistor

Capacitor

Resistor

LED

Voltage Regulator (7805)

Zener Diode

Opto-Coupler

Microcontroller (pic16f676)

Fuse

Triac

Transistor

Heat Sink

Diode Bridge

Snubber

Pushbutton Switch

Page 15: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 4 -

2.3 LIGHT DEPENDENT RESISTOR (LDR)

LDR 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

1000000 ohms, but when they are illuminated with light resistance drops

dramatically. Electronic onto sensors are the devices that alter their electrical

characteristics, in the presences of visible or invisible light. The best-known devices

of this type are the light dependent resistor (LDR), the photo diode and the

phototransistors.

Light dependent resistor as the name suggests depends on light for the variation of

resistance.

LDR are made by depositing a film of cadmium sulphide or cadmium selenide

on a substrate of ceramic containing no or very few free electrons when not

illuminated. The longer the strip the more the value of resistance.

When light falls on the strip, the resistance decreases. In the absence of light

the resistance can be in the order of 10 K ohm to 15 K ohm and is called the

dark resistance.

Depending on the exposure of light the resistance can fall down to value of 500 ohms.

The power ratings are usually smaller and are in the range 50 mw to 0.5 w. Though

very sensitive to light, the switching time is very high and hence cannot be used for

high frequency applications. They are used in chopper amplifiers. Light dependent

resistors are available as discs 0.5 cm to 2.5 cm. The resistance rises to several Mega

ohms under dark conditions.

The below figure shoes that when the torch is turned on, the resistance of the LDR

falls, allowing current to pass through it is shown in figure.

Page 16: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 5 -

Fig.2.1 LDR. Fig.2.2 Symbol for LDR.

The basic construction and symbol for LDR are shown in above figures respectively.

The device consists of a pair of metal film contacts separated by a snakelike track of

cadmium sulphide film, designed to provide the maximum possible contact area with

the two metal films. The structure is housed in a clear plastic or resin case, to provide

free access to external light. Practical LDR are available in variety of sizes and

packages styles, the most popular size having a face diameter of roughly 10 mm.

practical LDR and its characteristic graph is shown in below figure.

Fig.2.3 LDR and its characteristic graph

Page 17: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 6 -

2.3.1 RECOVERY RATE

When an LDR is brought from a certain illuminating level into total darkness, the

resistance does not increase immediately to the dark value. The recovery rate is

specified in k ohm/second and for current LDR types it is more than 200 k

ohm/second. The recovery rate is much greater in the reverse direction, e.g. going

from darkness to illumination level of 300 lux, it takes less than 10ms to reach a

resistance which corresponds with a light level of 400 lux. A LDR may be connected

either way round and no special precautions are required when soldering.

Darkness: Maximum resistance, about 1Mohm.

Very bright light: Minimum resistance, about 100 ohm.

The LDR is a variable resistor whose resistance decreases with the increase in light

intensity. Two cadmium sulphide (cds) photoconductive cells with spectral response

similar to that of the human eye. The cell resistance falls with increasing light

intensity. Some of its features:

High reliability.

Light weight.

Wide spectral response.

Wide ambient temperature range.

Page 18: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 7 -

2.4 MICRO CONTROLLER

This section provides an introduction to most common word in the embedded system

“microcontroller”. It is written to familiarize you with microcontroller terminology

and basic microcontroller architecture.

A microcontroller is a single chip, self-contained computer which incorporates all the

basic components of a personal computer on a much smaller scale. Microcontrollers

are often referred to as single chip devices or single chip computers. The main

consequence of the microcontroller’s small size is that its resources are far more

limited than those of a desktop personal computer. In functional terms, a

microcontroller is a programmable single chip which controls a process or system.

Microcontrollers are typically used as embedded controllers where they control part

of a very larger system such as an appliance, automobile, scientific instrument or a

computer peripheral.

Microcontrollers are designed to be low cost solutions; therefore using them can

drastically reduce part and design costs for a project. Physically, a microcontroller is

an integrated circuit with pins along each side. The pins presented by a

microcontroller are used for power, ground, oscillator, I/O ports, interrupt request

signals, reset and control. In contrast, the pins exposed by a microprocessor are most

often memory bus signals (rather than I/O ports).

A microcontroller has seven main components:

i. Central processing unit (CPU).

ii. ROM.

iii. RAM.

iv. Input and Output.

v. Timer.

vi. Interrupt circuitry.

vii. Buses.

Page 19: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 8 -

Fig.2.4 The Microcontroller.

Microcontrollers do not function in isolation. As their name suggests they are

designed to control other devices.

2.5 The PIC16 F676

200 nanosecond instruction execution only 35 single word instructions CMOS

FLASH-based 8-bit microcontroller packs Microchip's powerful PIC® architecture

into 14-pin package and is upwards compatible with the PIC16F5X, PIC12FXXX and

PIC16F7X devices. The PIC16F676 features 8 channels of 10-bit Analog-to-Digital

(A/D) converter with 2 additional timers, 2 capture/compare/PWM functions and the

synchronous serial port can be configured as either 3- wire Serial Peripheral Interface

or the 2-wire Inter-Integrated Circuit bus 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.

PICs are popular with both industrial developers due to their low cost, wide

availability, large user base, extensive collection of application notes, availability of

low cost or free development tools, and serial programming (and re-programming

with flash memory) capability.

Page 20: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 9 -

2.5.1 Block Diagram OF PIC16F676

Fig.2.5 Block Diagram

2.5.2 Specifications of Microcontroller

High Performance Risc CPU

• Only 35 instructions to learn:

- All single-cycle instructions except branches.

• Operating speed:

- DC - 20 MHz oscillator/clock input.

- DC - 200 ns instruction cycle.

Page 21: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 10 -

• Interrupt capability.

• 8-level deep hardware stack.

• Direct, Indirect, and Relative Addressing modes.

Special Microcontroller Features

• Internal and external oscillator options:

- Precision internal 4 MHz oscillator factory calibrated to ±1%.

- External oscillator support for crystals and resonators.

- 5μs wake-up from sleep, 3.0V, typical.

• Power saving sleep mode.

• Wide operating voltage range - 2.0V to 5.5V.

• Industrial and extended temperature range.

• Low power power-on Reset (POR).

• Power-up timer (PWRT) and oscillator start-up timer (OST).

• Brown-out detects (BOD).

• Watchdog timer (WDT) with independent oscillator for reliable operation.

• Multiplexed MCLR/input-pin.

• Interrupt-on-pin change.

• Individual programmable weak pull-ups.

• Programmable code protection.

• High endurance FLASH/EEPROM cell:

- 100,000 write FLASH endurance.

- 1,000,000 write EEPROM endurance.

- FLASH/data EEPROM retention: > 40 years.

Low Power Features

• Standby current:

- 1 nA @ 2.0V, typical.

• Operating current:

- 8.5μA @ 32 kHz, 2.0V, typical.

- 100μA @ 1 MHz, 2.0V, typical.

Page 22: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 11 -

• Watchdog timer current

- 300 nA @ 2.0V, typical.

• Timer1 oscillator current:

- 4μA @ 32 kHz, 2.0V, typical.

Peripheral Features

• 12 I/O pins with individual direction control.

• High current sink/source for direct LED drive.

• Analog comparator module with:

- One analog comparator.

- Programmable on-chip comparator voltage reference (CVREF) module.

- Programmable input multiplexing from device inputs.

- Comparator output is externally accessible.

• Analog-to-digital Converter module (PIC16F676):

- 10-bit resolution.

- Programmable 8-channel input.

- Voltage reference input.

• Timer0: 8-bit timer/counter with 8-bit programmable prescaler.

• Enhanced Timer1:

- 16-bit timer/counter with prescaler.

- External gate input mode.

- Option to use OSC1 and OSC2 in LP mode as timer1 oscillator, if INTOSC mode

selected.

2.5.3 Pin Layout

Fig.2.6 Pin Layout

Page 23: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 12 -

2.5.4 Pin Description

Pin Number Description

1 Vdd - positive power supply

2 RA5/T1CKI/OSC1/CLKIN - port A

3 RA4/T1G/OSC2/AN3/CLKOUT - port A

4 RA3/MCLR/Vpp - port A

5 RC5 - port C

6 RC4 - port C

7 RC3/AN7 – port C

8 RC2/AN6 – port C

9 RC1/AN5 – port C

10 RC0/AN4 – port C

11 RA2/AN2/COUT/T0CKI/INT - port A

12 RA1/AN1/CIN-/Vref/ICSPCLK - port A

13 RA0/AN0/CIN+/ICSPDAT - port A

14 Vss – Ground

Page 24: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 13 -

CHAPTER -3

THYRISTOR

3.1 THYRISTOR

Thyristor or silicon controlled rectifiers (SCR) are finding many uses in electronics,

and in particular for power control. Thyristor or silicon controlled rectifiers (SCRs)

have even been called the workhorse of high power electronics. The thyristor is a

four-layered, three terminalsemiconducting devices, with each layer consisting of

alternately N-type or type material, for example P-N-P-N. The main terminals, labeled

anode and cathode, are across the full four layers, and the control terminal, called the

gate, is attached to p-type material near to the cathode. (Avariant called an SCS—

Silicon Controlled Switch — brings all four layers out to terminals.) The operation of

a thyristor can be understood in terms of a pair of tightly coupled bipolar transistors,

arranged to cause the self-latching action.

Fig.3.1 Structure on the physical and electronic level, and the thyristor symbol.

3.1.1 TYPICAL THYRISTOR CHARACTERISTICS

Figure 3.2 shows a typical characteristic curve for a thyristor. It can be seen that in the

reverse biased region it behaves in a similar way to a diode. All current, apart from a

small leakage current is blocked (reverse blocking region) until the reverse

Page 25: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 14 -

breakdown region is reached, at which point the insulation due to the depletion layers

at the junctions breaks down

In the forward biased mode, unlike a normal diode, no current apart from a small

leakage current flows. This is called the forward blocking mode. If a gating pulse is

applied however, the thyristor "fires" and the forward resistance of the device falls to

a very low value, allowing very large(several amperes) currents to flow in the forward

conducting mode. Thyristor can also be made to fire by applying a very large forward

voltage between anode and cathode, but this is not desirable as the device is not then

being used to control conduction.

Fig.3.2 Characteristics of SCR.

3.1.2 FIRING TECHNIQUE OF THYRISTOR

An SCR can be switched from off state to on state in several ways and these are:

forward voltage triggering, temperature triggering, light triggering and gate triggering.

Gate triggering is, however, the most common method of turning on the SCRs,

because this method lends itself accurately for turning on the SCR at the desired

instant of time. In addition gate triggering is an efficient and reliable method.

Page 26: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 15 -

3.2 POPULAR METHODS OF GENERATING FIRING PULSES

Using ramp signal: In this scheme a ramp signal is generated in synchronism with the

a.c. supply. The first comparator translates the input sinusoidal voltage into a square

wave voltage. When the square wave voltage is high, the transistor (P-N-P type)

collector-base junction is forward biased; the transistor is non conducting stage (off)

and the capacitor charges exponentially giving ramp rise of the voltage at the output.

However, as soon as the square voltage is negative, transistor becomes on due to

collector-base junction is reverse biased and the capacitor discharges sharply giving a

saw tooth like waveform as shown in Fig. 3.2

Fig.3.3 Basic idea of ramp scheme

This triangular voltage can now be compared by the second comparator with a

variable reference d.c. voltage (Vref) to get the firing pulse signal at Y. The value of α

can be varied in the range o α 180 by changing the value of the reference voltage

(Vref).2). Using sine control: In this interesting scheme, the supply voltage Vs is first

integrated to obtain a sine wave as shown in Fig.3.4 The sine wave so obtained is

compared with a reference d.c. voltage (Vref). Therefore square pulses will be

generated at the output terminal of the comparator. The signal at Y is synchronized

with the pulse and is delayed from the supply zero crossing by an angle α. obviously,

the value of α can be varied a range of o α 180

Page 27: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 16 -

Fig.3.4 Basic idea of sine scheme

3.3 PHASE ANGLE CONTROLL

In phase angle control, thyristors are used to halve the voltage cycle during input. By

controlling the phase angle or trigger angle, the output RMS voltage of the load can

be varied. The thyristor is turned on for every half-cycle and switched off for each

remaining half-cycle.

Fig.3.5 Voltage phage angle control

The phase angle is the position at which the thyristor is switched on. TRIACs are

often used instead of thyristors to perform the same function for better efficiency. If

the load is a combination of resistance and inductance, the current cycle lags the

voltage cycle, decreasing overall power output.

Page 28: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 17 -

3.4 INTRODUCTION OF TRIAC

The triac is another three-terminal ac switch that is triggered into conduction when a

low-energy signal is applied to its gate terminal. Unlike the SCR, the triac conducts in

either direction when turned on. The triac also differs from the SCR in that either a

positive or negative gate signal triggers it into conduction. Thus the triac is a three

terminal, four layer bidirectional semiconductor device that controls ac power

whereas an SCR controls dc power or forward biased half cycles of ac in a load.

Because of its bidirectional conduction property, the triac is widely used in the field

of power electronics for control purposes “Triac” is an abbreviation for three terminal

ac switch. ‘Tri’-indicates that the device has three terminals and ‘ac’ indicates that the

device controls alternating current or can conduct in either direction.

Fig.3.6 Basic Structure of Triac.

Page 29: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 18 -

3.4.1 CONSTRUCTION OF A TRIAC

Triac is a three terminal, four layer bilateral semiconductor device. It incorporates two

SCRs connected in inverse parallel with a common gate terminal in a single chip

device. The arrangement of the triac is shown in figure . As seen, it has six doped

regions. The gate terminal G makes ohmic contacts with both the N and P materials.

This permits trigger pulse of either polarity to start conduction. Electrical equivalent

circuit are shown in figure 3.7. Since the triac is a bilateral device, the term “anode”

and “cathode” has no meaning, and therefore, terminals are designated as main

terminal 1. (MT1), main terminal 2 (MT2) and gate G. To avoid confusion, it has

become common practice to specify all voltages and currents using MT1 as the

reference.

Fig.3.7 Triac Construction

3.4.2 OPERATION OF TRIAC

Triac can be turned on without any gate current provided the supply voltage becomes

equal to the break over voltage of the triac but the normal way to turn on the triac is

by applying a proper gate current. As in case of SCR, here too, the larger the gate

current, the smaller the supply voltage at which the triac is turned on.

Page 30: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 19 -

Fig.3.8 Operation of Triac

Triac can conduct current irrespective of the voltage polarity of terminals MT1 and

MT2 with respect to each other and that of gate and terminal MT2. Consequently four

different possibilities of operation of triac exist. They are:

1. When terminal MT2 is positive with respect to terminal MT1 current flows through

path P1-N1-P2-N2. The two junctions P1-N1 and P2-N2 are forward biased whereas

junction N1 P2 is blocked. The triac is now said to be positively biased. A positive

gate with respect to terminal MT1 forward biases the junction P2-N2 and the

breakdown occurs as in a normal SCR. Shown in figure:

2. Terminal MT2 is positive but gate is negative with respect to terminal MT1 Though

the flow path of current remains the same as in mode 1 but now junction P2-N3 is

forward biased and current carriers injected into P2 turn on the triac.

3. Terminal MT2 and gate are negative with respect to terminal MT1 When terminal

MT2 is negative with respect to terminal MT1, the current flow path is P2-N1- P1-N4.

The two junctions P2-N1 and P1 - N4 are forward biased whereas junction N1-P1 is

blocked. The triac is now said to be negatively biased.

A negative gate with respect to terminal MT1 injects current carriers by forward

biasing junction P2-N3 and thus initiates the conduction.

Page 31: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 20 -

4. Terminal MT2 is negative but gate is positive with respect to terminal MT1 Though

the flow path of current remains the same as in mode 3 but now junction P2-N2 is

forward biased, current carriers are injected and therefore, the triac is turned on.

Generally, trigger mode 4 should be avoided especially in circuits where high di/dt

may occur. The sensitivity of triggering modes 2 and 3 is high and in case of marginal

triggering capability negative gate pulses should be used. Though the triggering mode

1 is more sensitive compared to modes 2 and 3, it requires a positive gate trigger.

However, for bidirectional control and uniform gate trigger modes 2 and 3 are

preferred.

3.5 GATE THRESHOLD CURRENT

A triac starts conducting when a current flowing into or out of its gate is sufficient to

turn on the relevant junctions in the quadrant of operation. The minimum current able

to do this is called gate threshold current and is generally indicated by IGT.

3.6 LATCHING CURRENT

When the gate current is discontinued, if the current flowing between the two main

terminals is more than what is called the latching current, the device keeps

conducting, otherwise the device might turn off. Latching current is the minimum that

can make up for the missing gate current in order to keep the device internal structure

latched.

3.7 HOLDING CURRENT

In particular, if the pulse width of the gate current is sufficiently large (generally some

tens of Microseconds), the TRIAC has completed the triggering process when the gate

signal is discontinued and the latching current reaches a minimum level called holding

current. Holding current is the minimum required current flowing between the two

main terminals that keeps the device on after it has achieved commutation in every

part of its internal structure.

Page 32: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 21 -

3.8 PHASE ANGLE CONTROLL BY TRIAC

When TRIAC switch is connected between the AC power supply and the motor, the

power flow can be controlled by varying the RMS of the AC voltage. This is called an

AC voltage controller. There are two types of control normally used: _ On-off control

– TRIAC switches connect the load to the AC source for a few cycles and then

disconnect it for another few cycles of the source voltage _ In phase control – TRIAC

switches connect the load to the AC sources for a moment in each cycle. (Fig.3.8)

A reliable intensity control of a AC lamp can be accomplished by combining the

Microcontroller and the phase angle control using a TRIAC. A benefit of this

approach is avoiding non-linearity that is present if using only the TRIAC.

Fig.3.9 Phase angle control.

Page 33: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 22 -

3.9 GENERATE ZERO- CROSSING SIGNAL

We just want to control the output phase angle of the sine wave AC signal so that we

can control the lamp brightness easily. Here is a simple wave shape for understand it

easily:

Fig.3.10 Generate zero-crossing signal

In this case, we need to know what to do with MCU. Actually we need to sense the

zero-crossing signal

Fig.3.11 Zero-crossing signal circuit.

So we know the zero-crossing points. Taking it as an interrupt we can easily design a

micro-controller based system which can generate a gate firing signal. And this signal

will trigger the gate of the TRIAC. But a problem occurs again. The micro-controller

works at 5V DC on the other hand the TRIAC works at 220V AC. So how can I

trigger the TRIAC with PIC .So we need a coupler or Opto-isolator.

Page 34: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 23 -

3.10 PULSE-WIDTH MODULATION

Pulse-width modulation (PWM), or pulse-duration modulation (PDM), is a

modulation technique that confirms the width of the pulse, formally the pulse

duration, based on modulator signal information. Although this modulation technique

can be used to encode information for transmission, its main use is to allow the

control of the power supplied to electrical devices, especially to inertial loads such as

light or motors. In addition, PWM is one of the two principal algorithms used in

photovoltaic solar battery chargers,[1] the other being MPPT.

The average value of voltage (and current) fed to the load is controlled by turning the

switch between supply and load on and off at a fast pace. The longer the switch is on

compared to the off periods, the higher the power supplied to the load is. The PWM

switching frequency has to be much faster than what would affect the load, which is

to say the device that uses the power. Typically switching have to be done several

times a minute in an electric stove, 120 Hz in a lamp dimmer, from few kilohertz

(kHz) to tens of kHz for a motor drive and well into the tens or hundreds of kHz in

audio amplifiers and computer ower supplies. The term duty cycle describes the

proportion of 'on' time to the regular interval or 'period' of time; a low duty cycle

corresponds to low power, because the power is off for most of the time. Duty cycle is

expressed in percent, 100% being fully on. The main advantage of PWM is that power

loss in the switching devices is very low. When a switch is off there is practically no

current, and when it is on, there is almost no voltage drop across the switch. Power

loss, being the product of voltage and current, is thus in both cases close to zero.

PWM also works well with digital controls, which, because of their on/off nature, can

easily set the needed duty cycle.

Fig.3.12 Duty Cycle

Page 35: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 24 -

CHAPTER FOUR

OPTOCOUPLER

4.1 OPTOCOUPLER

An Optocoupler, also known as an Opto-isolator or Photo-coupler, are electronic

components that interconnect two electrical circuits by means of an optical interface.

The basic design of an optocoupler consists of an LED that produces infra-red light

and a semiconductor photo-sensitive device that is used to detect this emitted infra-red

light. Both the LED and photo-sensitive device are enclosed in a light-tight body or

package with metal legs for the electrical connections as shown .An opt coupler or

opto-isolator consists of a light emitter, the LED and a light sensitive receiver which

can be a single photo-diode, photo-transistor, photo-resistor, photo-SCR, or a photo-

TRIAC and the basic operation of an optocoupler is very simple to understand.

Fig.4.1 Optocoupler

4.1.1 PHOTO-TRANSISTOR OPTOCOUPLER

Assume a photo-transistor device as shown. Current from the source signal passes

through the input LED which emits an infra-red light whose intensity is proportional

to the electrical signal. This emitted light falls upon the base of the photo-transistor,

causing it to switch-ON and conduct in a similar way to a normal bipolar transistor.

The base connection of the photo-transistor can be left open for maximum sensitivity

Page 36: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 25 -

or connected to ground via a suitable external resistor to control the switching

sensitivity making it more stable.

When the current flowing through the LED is interrupted, the infra-red emitted light is

cut-off, causing the photo-transistor to cease conducting. The photo-transistor can be

used to switch current in the output circuit. The spectral response of the LED and the

photo-sensitive device are closely matched being separated by a transparent medium

such as glass, plastic or air. Since there is no direct electrical connection between the

input and output of an optocoupler, electrical isolation up to10kV is achieved.

Fig.4.2 Photo-Transistor Optocoupler

4.1.2 OPTOCOUPLER TYPES

Optocoupler are available in four general types, each one having an infra-red LED

source but with different photo-sensitive devices. The four optocoupler are: photo-

transistor, photo-Darlington, photo-SCR and photo-Triac as shown below.

Fig4.3 Different types of optocoupler

Page 37: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 26 -

The photo-transistor and photo-Darlington devices are mainly for use in DC circuits

while the photo-SCR and photo-triac allow AC powered circuits to be controlled.

There are many other kinds of source-sensor combinations, such as LED-photodiode,

LED-LASER, lamp-photo resistor pairs, reflective and slotted optocoupler. Simple

home made optocoupler can be constructed by using individual components. An LED

and a photo-transistor are inserted into a rigid plastic tube or encased in heat-

shrinkable tubing as shown. The tubing can be of any length.

Fig.4.4 Rigid plastic tube

4.1.3 OPTOCOUPLER APPLICATIONS

Optocoupler and opto-isolators can be used on their own, or to switch a range of other

larger electronic devices such as transistors and triacs providing the required electrical

isolation between a lower voltage control signal and the higher voltage or current

output signal. Common applications for optocoupler include microprocessor

input/output switching, DC and AC power control, PC communications, signal

isolation and power supply regulation which suffer from current ground loops, etc.

The electrical signal being transmitted can be either analogue (linear) or digital

(pulses).

Page 38: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 27 -

4.2 OPTOCOUPLER TRIAC CONTROL

This type of optocoupler configuration forms the basis of a very simple solid state

relay application which can be used to control any AC mains powered load such as

lamps and motors. Also unlike a Thyristor (SCR), a triac is capable of conducting in

both halves of the mains AC cycle with zero-crossing detection

Fig.4.5 Optocoupler Triac Control Circuit.

4.3 BI-POLAR JUNCTION TRANSISTOR

BC547 is an NPN bi-polar junction transistor. A transistor, stands for transfer of

resistance, is commonly used to amplify current. A small current at its base controls a

larger current at collector & emitter terminals.

BC547 is mainly used for amplification and switching purposes. It has a maximum

current gain of 800. Its equivalent transistors are BC548 and BC549.

The transistor terminals require a fixed DC voltage to operate in the desired region of

its characteristic curves. This is known as the biasing. For amplification applications,

the transistor is biased such that it is partly on for all input conditions. The input

signal at base is amplified and taken at the emitter. BC547 is used in common emitter

Page 39: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 28 -

configuration for amplifiers. The voltage divider is the commonly used biasing mode.

For switching applications, transistor is biased so that it remains fully on if there is a

signal at its base. In the absence of base signal, it gets completely off.

Fig.4.6 Pin Diagram and Symbol of Transistor

A BC547 transistor is a negative-positive-negative (NPN) transistor that is used for

many purposes. Together with other electronic components, such as resistors, coils,

and capacitors, it can be used as the active component for switches and amplifiers.

Like all other NPN transistors, this type has an emitter terminal, a base or control

terminal, and a collector terminal. In a typical configuration, the current flowing from

the base to the emitter controls the collector current. A short vertical line, which is the

base, can indicate the transistor schematic for an NPN transistor, and the emitter,

which is a diagonal line connecting to the base, is an arrowhead pointing away from

the base.

There are various types of transistors, and the BC547 is a bipolar junction transistor

(BJT). There are also transistors that have one junction, such as the junction field-

effect transistor, or no junctions at all, such as the metal oxide field-effect transistor

(MOSFET). During the design and manufacture of transistors, the characteristics can

be predefined and achieved. The negative (N)-type material inside an NPN transistor

has an excess of electrons, while the positive (P)-type material has a lack of electrons,

both due to a contamination process called doping.

Page 40: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 29 -

4.4 POWER SUPPLY

For making DC supply circuit, we use transformer of 230V/18V. This type of

transformer provide center tap for neutral point (0V). Power supply with 5V with

neutral point is obtained. The 5v power supply is to connected to the PIC16F676

microcontroller and the peripheral items and 220V power supply is connected to the

Triac, and AC Lamp.

4.5 STEP DOWEN TRANSFORMER

A transformer is a static electrical device that transfers energy by inductive

coupling between its winding circuits. A varying current in the primary winding

creates a varying magnetic flux in the transformer's core and thus a varying magnetic

flux through the secondary winding. This varying magnetic flux induces a

varying electromotive force (emf) or voltage in the secondary winding.

A transformer whose output voltage is lower than it’s input voltage. A secondary

winding of such a transformer has fewer turns than the primary. Such a transformer

may have multiple secondary windings. It used, for instance, to decrease the voltage

of electricity as it leaves the transmission system and enters the distribution system.

The output voltage of a step-up transformer is higher than its input voltage. Also

spelled step down transformer.

Fig.4.7 Step Down Transformer

Page 41: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 30 -

This is a step-down transformer, as evidenced by the high turn count of the primary

winding and the low turn count of the secondary. As a step-down unit, this

transformer converts high-voltage, low-current power into low-voltage, high-current

power. The larger-gauge wire used in the secondary winding is necessary due to the

increase in current. The primary winding, which doesn't have to conduct as much

current, may be made of smaller-gauge wire.

Transformers are often constructed in such a way that it is not obvious which wires

lead to the primary winding and which lead to the secondary. One convention used in

the electric power industry to help alleviate confusion is the use of “H” designations

for the higher-voltage winding and “X” designations for the lower-voltage winding.

Therefore, a simple power transformer will have wires labeled “H1”, “H2”, “X1”, and

“X2” . There is usually significance to the numbering of the wires, which we'll explore

a little later in this chapter. The fact that voltage and current get “stepped” in opposite

directions (one up, the other down) makes perfect sense when you recall that power is

equal to voltage times current, and realize that transformers cannot produce power,

only convert it. Any device that could output more power than it took in would violate

the Law of Energy Conservation in physics, namely that energy cannot be created or

destroyed, only converted.

4.6 RECTIFIER

A rectifier is an electrical device that converts alternating current (AC), which

periodically reverses direction, to direct current (DC), which flows in only one

direction. The process is known as rectification. Physically, rectifiers take a number

of forms, including vacuum tube diodes, mercury-arc valves, copper and selenium

oxide rectifiers, semiconductor diodes, silicon-controlled rectifiers and other silicon-

based semiconductor switches. Historically, even synchronous electromechanical

switches and motors have been used. Early radio receivers, called crystal radios, used

a "cat's whisker" of fine wire pressing on a crystal of galena (lead sulfide) to serve as

a point-contact rectifier or "crystal detector".

Page 42: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 31 -

4.6.1 FULL-WAVE RECTIFICATION

A full-wave rectifier converts the whole of the input waveform to one of constant

polarity (positive or negative) at its output. Full-wave rectification converts both

polarities of the input waveform to pulsating DC (direct current), and yields a higher

average output voltage. Two diodes and a center tapped transformer source (including

a transformer without center tap), are n double diodes with common cathode or

common anode, and four manufactured as single components.

For single-phase AC, if the transformer is center to-cathode or anode-to-anode,

depending upon output polarity required) can form rectifier. Twice as many turns are

required on the transformer secondary to obtain the same output voltage than for a

bridge rectifier, but the power rating is unchanged.

Fig.4.8 Full-wave rectifier.

4.7 CAPACITOR

A capacitor (originally known as a condenser) is a passive two-terminal electrical

component used to store energy electro statically in an electric field. By

contrast, batteries store energy via chemical reactions. The forms of practical

capacitors vary widely, but all contain at least two electrical conductors separated by a

dielectric (insulator); for example, one common construction consists of metal foils

separated by a thin layer of insulating film. Capacitors are widely used as parts

of electrical circuits in many common electrical devices.

Page 43: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 32 -

Fig.4.9 Capacitor

Capacitors are components that are used to store an electrical charge and are used in

timer circuits. A capacitor may be used with a resistor to produce a timer. Sometimes

capacitors are used to smooth a current in a circuit as they can prevent false triggering

of other components such as relays. When power is supplied to a circuit that includes

a capacitor - the capacitor charges up. When power is turned off the capacitor

discharges its electrical charge slowly.

When there is a potential difference (voltage) across the conductors, a static 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. This is the ratio of

the electric charge on each conductor to the potential difference between them.

The SI unit of capacitance is the farad, which is equal to one coulomb per volt.

Capacitors are widely used in electronic circuits for blocking direct current while

allowing alternating current to pass. In analog filter networks, they smooth the output

of power supplies. In resonant circuits they tune radios to particular frequencies.

In electric power transmission systems they stabilize voltage and power flow.

Page 44: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 33 -

4.8 RESISTOR

A resistor is a passive two-terminal electrical component that implements electrical

resistance as a circuit element.

Fig.4.10 Resistor

The current through a resistor is in direct proportion to the voltage across the resistor's

terminals. This relationship is represented by Ohm's law:

(4.1)

Where I is the current through the conductor in units of amperes, V is the potential

difference measured across the conductor in units of volts, and R is the resistance of

the conductor in units of ohms.

The ratio of the voltage applied across a resistor's terminals to the intensity of current

in the circuit is called its resistance, and this can be assumed to be a constant

(independent of the voltage) for ordinary resistors working within their ratings.

Resistors are common elements of electrical networks and electronic circuits and are

ubiquitous in electronic equipment. Practical resistors can be made of various

compounds and films, as well as resistance wire (wire made of a high- resistivity

alloy, such as nickel-chrome). Resistors are also implemented within integrated

circuits, particularly analog devices, and can also be integrated into hybrid and printed

circuits

Page 45: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 34 -

4.9 LIGHT EMITING DIODE (LED)

A light-emitting diode (LED) is a semiconductor light source. LEDs are used as

indicator lamps in many devices and are increasingly used for other lighting.

Appearing as practical electronic components in 1962, early LEDs emitted low-

intensity red light, but modern versions are available across the visible, ultraviolet,

and infrared wavelengths, with very high brightness.

Fig.4.11 Light Emitting Diode

When a light-emitting diode is switched on, electrons are able to recombine with

holes within the device, releasing energy in the form of photons. This effect is

called electroluminescence and the color of the light (corresponding to the energy of

the photon) is determined by the energy band gap of the semiconductor. An LED is

often small in area (less than 1 mm2), and integrated optical components may be used

to shape its radiation pattern. LEDs present many advantages over incandescent light

sources including lower energy consumption, longer lifetime, improved physical

robustness, smaller size, and faster switching. However, LEDs powerful enough for

room lighting are relatively expensive and require more precise current and heat

management than compact fluorescent lamp sources of comparable output.

Page 46: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 35 -

4.10 DIODE (IN 4007)

These diodes are used to convert AC into DC these are used as half wave rectifier or

full wave rectifier. Three points must he kept in mind while using any type of diode.

1. Maximum forward current capacity

2. Maximum reverse voltage capacity

3. Maximum forward voltage capacity

Fig.4.12 Diode (IN4007)

In electronics, a diode is a two-terminal electronic component with

asymmetric conductance, it has low (ideally zero)resistance to current flow in one

direction, and high (ideally infinite) resistance in the other. A semiconductor diode,

the most common type today, is a crystalline piece of semiconductor material with

a p–n junction connected to two electrical terminals. A vacuum tube diode has

two electrodes, a plate (anode) and a heated cathode.

The most common function of a diode is to allow an electric current to pass in one

direction (called the diode's forward direction), while blocking current in the opposite

direction (the reverse direction). Thus, the diode can be viewed as an electronic

version of a check valve. This unidirectional behavior is called rectification, and is

used to convert alternating current to direct current, including extraction

of modulation from radio signals in radio receivers—these diodes are forms

of rectifiers..

Page 47: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 36 -

We used IN 4007 which is a simple, very common rectifier diode. Often used for

reverse voltage protection, the 1N4007 is a staple for many powers, DC to DC step

up, and breadboard projects. 1N4007 is rated for up to 1A/1000V.

4.11 ZENER DIODE

A Zener diode is a diode which allows current to flow in the forward direction in the

same manner as an ideal diode, but also permits it to flow in the reverse direction

when the voltage is above a certain value known as the breakdown voltage, "zener

knee voltage", and Zener voltage “or” avalanche point.

The zener diode's operation depends on the heavy doping of its p-n junction. The

depletion region formed in the diode is very thin (<1 µm) and the electric field is

consequently very high (about 500 kV/m) even for a small reverse bias voltage of

about 5 V, allowing electrons to tunnel from the valence band of the p-type material

to the conduction band of the n-type material

Fig.4.13 Zener Diode

4.12 RC SNUBBER

A simple Snubber uses a small resistor (R) in series with a small capacitor (C). This

combination can be used to suppress the rapid rise in voltage across a thyristor,

preventing the erroneous turn on of the thyristor; it does this by limiting the rate of

rise in voltage (dV/dt) across the thyristor to a value which will not trigger it. An

Page 48: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 37 -

appropriately-designed RC snubber can be used with either DC or AC loads. This sort

of snubber is commonly used with inductive loads such as electric motors.

Fig.4.14 RC Snubbers

The voltage across a capacitor cannot change instantaneously, so a decreasing

transient current will flow through it for a small fraction of a second, allowing the

voltage across the switch to increase more slowly when the switch is opened.

Determination of voltage rating can be difficult owing to the nature of transient

waveforms, and may be defined simply by the power rating the snubber components

and the application. RC snubbers can be made discretely and are also built as a single

component.

4.13 VOLTAGE REGULATOR (7805)

The 7805 (sometimes LM7805) is a family of self-contained fixed linear voltage

regulator integrated circuits. The 78xx family is commonly used in electronic circuits

requiring a regulated power supply due to their ease-of-use and low cost. For ICs

within the family, the xx is replaced with two digits, indicating the output voltage (for

example, the 7805 has a 5 volt output, while the 7812 produces 12 volts). The 78xx

line is positive voltage regulators: they produce a voltage that is positive relative to a

common ground. There is a related line of 79xxdevices which are complementary

negative voltage regulators. 78xx and 79xx ICs can be used in combination to provide

positive and negative supply voltages in the same circuit.

Page 49: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 38 -

Fig.4.15 LM7805 Pinout Diagram.

7805 ICs have three terminals and are commonly found in the TO220 form factor,

although smaller surface-mount and larger TO3 packages are available. 78xx series

ICs do not require additional components to provide a constant, regulated source of

power, making them easy to use, as well as economical and efficient uses of space.

Other voltage regulators may require additional components to set the output voltage

level, or to assist in the regulation process.

4.14 PUSH BUTTON SWITCH

A push-button or simply button is a simple switch mechanism for controlling some

aspect of a machine or a process. Buttons are typically made out of hard material,

usually plastic or metal. The surface is usually flat or shaped to accommodate the

human finger or hand, so as to be easily depressed or pushed. Buttons are most

often biased switches, though even many un-biased buttons (due to their physical

nature) require a spring to return to their un-pushed state. Different people use

different terms for the "pushing" of the button, such as press, depress, mash,

and punch

Page 50: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 39 -

Fig.4.16 Push-button switch

4.15 FUSE

A fuse is an inexpensive device that can carry only a certain amount of current. When

a fuse is in an electronic circuit and the current exceeds the rated level, the fuse melts

(blows), thus breaking the circuit and preventing the excessive current from flowing.

Fuses are an essential component of any electrical system that uses line voltage and

has the possibility of short-circuiting or overheating and causing a fire.

The most common type of fuse is the cartridge fuse, which consists of a cylindrical

body that’s usually made of glass, plastic, or ceramic, with two metal ends. The metal

ends are the two terminals of the fuse. Inside the body is a thin wire conductor that’s

designed to melt away if the current exceeds the rated threshold.

Fig.4.17 Fuse

Page 51: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 40 -

As long as the current stays below the maximum level, the conductor passes the

current from one metal end to the other. But when the current exceeds the rated

maximum, the conductor melts, and the circuit is broken.

An AGC fuse, which is a small fuse made of glass, 1-1/4″ in length and 1/4″ in

diameter. This particular fuse is rated at 2 A, but you can get AGC fuses in larger

ratings, up to 15 A. (AGC stands for Automotive Glass Cartridge.)

Fuses should always be connected to the hot wire and should be placed before any

other component in the circuit. In most projects, the fuse should be the first thing the

hot wire connects to after it enters your project enclose

Page 52: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 41 -

CHAPTER FIVE

DESIGN AND FABRICATION

5.1 INTRODUCTION

Here we present the circuit diagram and PCB board diagram, also given the circuit

description or working principle of this circuit diagram.

5.2 Circuit Diagram

Fig.5.1 Circuit Diagram

5.3 PCB BOARD CONNECTION DIAGRAM

Fig.5.2 PCB Board Diagram

5.4 CIRCUIT DESCRIPTION

The main apparatus of the circuit is PIC16F676 microcontroller. It executes the

main function of the control system. It has 14 pins which are connected with the

necessary equipments. At first, we gave input supply to the step-down transformer

and to the ac bulb through a fuse. Here we used a triac to give input supply to the

ac bulb. In this case triac is used for controlling high power. Our Step down

transformer gives us 18 v from 220 v primary supply. It becomes 18 v DC by

using a full wave rectifier. In this project bridge diode is used for zero crossing

Page 53: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 42 -

signal. We also used a zener diode for sending not more than 5v of the dc signal to

the microcontroller. Otherwise the microcontroller will be burnt. The

microcontroller is operated in 5 v DC and the 5 v is served by a 7805 voltage

regulator. In the circuit we used bridge diode for dc pulse setting. Here we also

use an opto-coupler to interface between triac and microcontroller. A series

snubber and a heat sink are used to protect the triac. We used an LED to

understand the 5v supply in microcontroller. In auto mode, An LDR is connected

with microcontroller to opt-coupler. LDR is used for sense the intensity of light.

In day when the light is fall upon LDR, then the output light intensity is

decreasing and when light intensity is full then output light intensity becomes off.

In other, when light intensity is decreasing, then the output light will be increasing

and when the dark mode then output light intensity will full. In manual mode, We

also used four push switches in this circuit for controlling the intensity of two ac

bulb, by controlling the firing angle manually. Switch-1 and Switch-4 is used for

on or off mode the bulbe-1 and bulbe-2, and Switch-3(+) and Switch-4(-) is used

for intensity up and down. A fuse is also used in the circuit to protect the whole

system for any kind of damage of this circuit.

Page 54: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 43 -

5.5 FLOW CHART OF THIS PROJECT

Initialize

Button

Manual Aut

o

If light is not

available If Light is

available

Lamp intensity

decrease / LDR

is OFF

Lamp intensity

increase / LDR is ON

Get Firing

Angle

Set Firing

Angle

Return to

previous

Program

Return to previous

Program

Start

Page 55: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 44 -

Chapter SIX

RESULT ANALYSIS

6.1 RESULT

The fastest field of development in the electronic engineering is the field of embedded

systems engineering it is used in a variety of applications. In this project the designing

of the hardware circuit is successfully done.

The hardware designing and the software both are successfully done.

6.2 IMAGE OP THIS PROJECT

Fig.6.1 Image of the project

Page 56: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 45 -

6.3 ADVANTAGES AND DISADVANTAGES

Advantages

No need of any manpower for maintenance.

Our systems will automatic control the switch ON/OFF.

Faster response

Easy to set up.

LDRs are sensitive, inexpensive, and readily available devices. They have

good power and voltage handling capabilities, similar to those of a

conventional resistor.

They are small enough to fit into virtually any electronic device and are used

all around the world as a basic component in many electrical systems.

Disadvantages

Can be more complicated to align detector pairs.

Is sensitive to ambient light and require careful shielding.

Photo resistors are only sensitive to light and no other force can power it

without risking damage. Also, they are unable to detect low light levels and

may take a few seconds to deliver a charge while their electrons build up

momentum.

6.4 APPLICATIONS

Photo resistors have many uses, most of which involve detecting the presence

of light. Street lights use photo resistors to detect whether it is day or night and

turn the light on or off accordingly.

Photo resistors are also used in digital cameras to detect how much light

camera sees and adjust the picture quality accordingly.

They are also used in some clocks, alarms, and other electronic devices that

are semi-dependent on sunlight.

Smoke detection.

Page 57: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 46 -

CHAPTER SEVEN

CONCLUSION

7.1 CONCLUSION

In this project work we have studied and implemented a complete working model

using a PIC microcontroller. The programming and interfering of PIC microcontroller

has been mastered during the implementation. This work includes the study of energy

saving system in many applications.

7.2 FUTURE SCOPE

The above project we can develop Solar Street light system with Automatic street

light controller. The system can be powered from a battery, which can be charged

during day time by harvesting the solar energy through a solar cell. The solar energy

harvested from sunlight can be stored, inverted from DC voltage to AC voltage using

sun tie converter. The AC voltage can be stepped up and given to the electric grid.

The AC voltage from the electric grid can be stepped down, rectified and used for

powering the circuit. Meanwhile, the street light can also be powered by the A.C.

voltage, which is controlled by a relay switch connected to the switching part of the

circuit. The above mentioned strategy will enable us to harvest solar energy in an

effective way for the operation of the circuit and for powering the street light also.

Page 58: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 47 -

APPENDIX

Program Code:

The algorithm of the program is very simple.

// PIN difine...

#define Fan1 RA1_bit

#define Fan2 RA2_bit

#define Zero RA0_bit

#define Plus_Button RC0_bit

#define Minus_Button RA3_bit

#define Switch1 RC2_bit

#define Switch2 RC3_bit

#define LED1 RC4_bit

#define LED2 RC5_bit

#define LED3 RA4_bit

#define LED4 RA5_bit

#define LDR RA5_bit

// global variables

unsigned int current=5;

unsigned int ch_cnt=0;

unsigned short Lamp1,Lamp2;

unsigned int auto_mode, intensity;

unsigned int auto_cnt;

unsigned int adc_rd;

unsigned short mode=0;

Page 59: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 48 -

void Ato_Mode(void);

void Manual_Mode(void);

// Interrupt ...

void interrupt()

{

while(Lamp1)

{

while(Zero==0)

{

ch_cnt++;

while(ch_cnt<=105-current)

{

Fan1 = 0;

break;

}

while(ch_cnt>=105-current)

{

Fan1 = 1;

break;

}

break;

}

while(Zero==1)

{

Fan1 = 0;

ch_cnt = 0;

break;

}

break;

}

while(Lamp2)

{

Page 60: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 49 -

while(Zero==0)

{

ch_cnt++;

while(ch_cnt<=105-current)

{

Fan2 = 0;

break;

}

while(ch_cnt>=105-current)

{

Fan2 = 1;

break;

}

break;

}

while(Zero==1)

{

Fan2 = 0;

ch_cnt = 0;

break;

}

break;

}

// Timer settings

TMR0IF_bit = 0;

TMR0 = 250;

}// interrupt

void main()

{

TRISA = 0b00001001;

Page 61: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 50 -

PORTA = 0x00;

TRISC = 0b00001111;

PORTC = 0x00;

ANSEL = 0b00100000; // all digital

ADCON1 = 0x00;// set ADC clock

CMCON = 0x07; // Comparator off

OPTION_REG = 0x81;

TMR0 = 250;

INTCON = 0xA0;

TMR0IE_bit = 1;// enable timer0

while(1)

{

while(!Switch1 && !Switch2)

{

if(auto_cnt<5)auto_cnt++;

Delay_ms(100);

break;

}

while(auto_cnt>=5)

{

mode=~mode;

auto_cnt = 0;

current = 0;

break;

}

if(mode)

{

Ato_Mode(void);

}

else

{

Manual_Mode(void);

Page 62: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 51 -

}

}// While

}// void main

void Manual_Mode(void)

{

// intensity controll...

while(!Minus_Button)

{

if(current<90)

{

current+=10;

Delay_ms(20);

}

else

{

current = 100;

}

Delay_ms(100);

break;

}

while(!Plus_Button)

{

if(current>11)

{

current-=10;

Delay_ms(20);

}

else

{

current = 0;

}

Delay_ms(100);

Page 63: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 52 -

break;

}

// Switch cotroll...

while(!Switch1 && Switch2)

{

Lamp1 = 1;

Lamp2 = 0;

Delay_ms(200);

Fan2 = 0;

break;

}

while(!Switch2 && Switch1)

{

Lamp1 = 0;

Lamp2 = 1;

Fan1 = 0;

Delay_ms(200);

break;

}

// LED bar-graph

// LED bar graph...

if(current>78)

{

LED4 = 1;

LED3 = 1;

LED2 = 1;

LED1 = 1;

}

else if(current > 57 && current < 78)

{

LED4 = 0;

LED3 = 1;

LED2 = 1;

Page 64: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 53 -

LED1 = 1;

}

else if(current>24&&current<56)

{

LED4 = 0;

LED3 = 0;

LED2 = 1;

LED1 = 1;

}

else

{

LED4 = 0;

LED3 = 0;

LED2 = 0;

LED1 = 1;

}

}

// Auto mode

void Ato_Mode(void)

{

ADCON0 = 0b00010101;

adc_rd = ADC_Read(5);

current = (1023-adc_rd)/10;

Lamp1 = 1;

Lamp2 = 1;

// LED indication...

LED1 = ~LED1;

Delay_ms(10);

LED2 = 0;

LED3 = 0;

LED4 = 0;

}

Page 65: Automatic street light control using LDR.

Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman

- 54 -

REFERENCE:

1. R. Kamal, “Microcontrollers Architecture, Programming, Interfacing and

System Design”, Pearson Education, 2005.

2. J. B. Peatman, “Design with PIC Microcontrollers”, Pearson Education, 2005.

3. B. L. Theraja & A. K. Theraja “A text Book of Electrical Technology” Schand

& and Company Ltd. 1999,Ramnagar, New Delhi.

4. V. K. Mehta, “Principle Of Electronics” 1st Rdition 1959

5. M. H. Rashid Power Electronics “ Circuit Devices and Application “, 2nd

Edition, 2000.

6. M. A. Mazidi, “The 8051 Microcontroller and Embedded System” 2nd Edition.

7. A. P. Godse, D.A.Godse “ Microprocessors & Microcontrollers”

● Websites :

www.wikipedia.org

www.kpsec.freeuk.com

www.allaboutcircuits.com

www.answer.yahoo.com

www.vscontrols.com

www.lipower.org/residential/efficiency/.../poolpumps-faq.html

www.inyopools.com/category_controls.aspx

www.howstuffworks.com/microcontroller.htm

www.solenoid-valve-info.com/solenoid-valve-basics.html

www.hydra-cell.com/applications/reverse-osmosis-pumps.html