Dokumen - Tips - Automatic Street Light Control Using LDR 59011146e96bdeds
Dokumen - Tips - Automatic Street Light Control Using LDR 59011146e96bdeds
Dokumen - Tips - Automatic Street Light Control Using LDR 59011146e96bdeds
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
Supervised by
Prof. Dr. Mirza Golam Rabbani
Chairperson
Department of Electrical and Electronic Engineering.
Faculty of Engineering & Technology
EASTERN UNIVERSITY .
December, 2013
I
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
II
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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
III
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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,
IV
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
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.
V
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
CONTENTS
Chapter 1
LITERATURE REVIEW Page No.
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
VI
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
Chapter 3
THYRISTOR
3.1 Thyristor ……………………………………………………………… 13
Chapter 4
OPTOCOUPLER
VII
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
Chapter 5
Design & Fabrication
5.1 Introduction … …………………………………………………… 41
Chapter 6
Result Analysis
6.1 Result …………………………………………………………………. 45
VIII
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
Chapter 7
Conclusion
7.1 Conclusion ……………………………………………………………... 47
Appendix ……………………………………………………………… 48
Reference ……………………………………………………………… 55
IX
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
Figures List
X
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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
XI
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
-1-
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
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.
-2-
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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 –
-3-
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
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.
-4-
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
-5-
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
-6-
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
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).
-7-
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
-8-
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
-9-
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
• Interrupt capability.
• 8-level deep hardware stack.
• Direct, Indirect, and Relative Addressing modes.
- 10 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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 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
- 12 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
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
- 13 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
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.
- 14 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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
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
- 15 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
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.
- 16 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
- 17 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
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.
- 18 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
- 19 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
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.
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.
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)
- 21 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
In this case, we need to know what to do with MCU. Actually we need to sense the
zero-crossing signal
- 22 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
- 23 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
CHAPTER FOUR
OPTOCOUPLER
4.1 OPTOCOUPLER
Fig.4.1 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
- 24 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
- 25 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
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).
- 26 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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
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
- 27 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
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.
- 28 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
- 29 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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
- 30 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
4.7 CAPACITOR
- 31 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
- 32 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
4.8 RESISTOR
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
- 33 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
- 34 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
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..
- 35 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
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
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
- 36 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
Fig.4.14 RC Snubbers
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.
- 38 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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
- 39 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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
- 40 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
- 41 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
- 42 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
Start
Initialize
Manual Aut
o
Button
Get Firing
Angle
Set Firing
If light is not If Light is
Angle
available available
Lamp intensity
Lamp intensity
increase / LDR
decrease / LDR
Return to is ON
previous is OFF
Program
Return to previous
Program
- 43 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
- 44 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
Advantages
Disadvantages
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.
- 45 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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.
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.
- 46 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
APPENDIX
Program Code:
// 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;
- 47 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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)
{
- 48 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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;
- 49 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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);
- 50 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
}// 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);
- 51 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
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;
- 52 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
LED1 = 1;
}
else if(current>24&¤t<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;
}
- 53 -
Automatic Street Light Control Using Light Dependent Resistor (LDR) By Fazlur Rahman
REFERENCE:
● 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
- 54 -