Sei sulla pagina 1di 47

TABLE OF CONTENTS

Page No
List of figures i

Abstract ii

1. Introduction to Embedded systems 1-6


1.1 applications of embedded systems
1.2 An Introduction to project

2. Literature Survey 7-8


2.1 Existing system
2.2 Disadvantages of Existing system
2.3 Proposed system

3. Analysis 9-37
3.1 Introduction
3.2 Software Requirement specifications
3.2.1 User Requirement
3.2.2 Software Requirement
3.2.3 Hardware components description
4. Implementation & Results 38
5. Testing & Validation 39-40
6. Conclusion & Future recommendations 41-42
7. References 43
LIST OF FIGURES

Figures Page no

Figure 1.1: Block diagram of Embedded System 2


Figure 1.2: Block Diagram of Micro Processor (p) 3
Figure 1.3 Block Diagram of Micro Controller (c) 3
Figure 3.1 Block diagram of project 16
Figure 3.2 Voltage regulator 17
Figure 3.3 Block Diagram of Power supply 18
Figure 3.4 Transformer 18
Figure 3.5 Principle of operation of transformer 19
Figure 3.6 The ideal transformer as a circuit element 20
Figure 3.7 Bridge rectifier 21
Figure 3.8 Operation of bridge rectifier 22
Figure 3.9 7805 pin configuration and circuit diagram 24
Figure 3.10 classifications of 7805 voltage regulators 24
Figure 3.11 Disk capacitor 25
Figure 3.12 Removal of unwanted frequency components 25
Figure 3.13 Pin diagram of AT89S51 27
Figure 3.14 Oscillator connections 29
Figure 3.15 Top view and side view of Light Dependent Resisitor 32
Figure 3.16 Light Dependent Resistor and its circuit symbol 33
Figure 3.17 LDR symbol 34
Figure 3.18 LED circuit symbol 36
Figure 4.1 Automatic street light control system 38

i
ABSTRACT:

The important consideration in the present field of Electronics and Electrical related
technologies are Automation, Power consumption and cost effectiveness. Automation is
intended to reduce manpower with the help of intelligent systems and Power saving is the main
consideration forever as the source of the power(Thermal, Hydro etc.,)are getting diminished
due to various reasons

The main goal of our project Season based Street Light switching based on sensors to control
the switching of Street Lights automatically according to the Light Intensity. This allows us to
realize the task efficiently and effectively without the intervention of human by making it
automated.

This project is designed around a microcontroller which forms the heart of the project. In
our project we are going to make use of a sensor called LDR which stands for Light Dependent
Resistor which senses the intensity of light. And accordingly the street lights are made ON and
OFF. The LDR is interfaced with microcontroller.

The control unit consists of a microcontroller with its associated circuitry. According to
this project, the Street Lights are made ON and OFF according to the Light Intensity. The
hardware involved in the project is Power supply, Microcontroller, LDR and street light.

ii
UNIT 1

INTRODUCTION TO EMBEDDED SYSTEMS

An embedded system is a system which is going to do a predefined specified task


is the embedded system and is even defined as combination of both software and
hardware.

A general-purpose definition of embedded systems is that they are devices used to


control, monitor or assist the operation of equipment, machinery or plant. "Embedded"
reflects the fact that they are an integral part of the system. In many cases their
embeddedness may be such that their presence is far from obvious to the casual
observer and even the more technically skilled might need to examine the operation of a
piece of equipment for some time before being able to conclude that an embedded control
system was involved in its functioning. At the other extreme a general-purpose computer
may be used to control the operation of a large complex processing plant, and its presence
will be obvious.

All embedded systems are including computers or microprocessors. Some of


these computers are however very simple systems as compared with a personal computer.
The very simplest embedded systems are capable of performing only a single function or
set of functions to meet a single predetermined purpose. In more complex systems an
application program that enables the embedded system to be used for a particular purpose
in a specific application determines the functioning of the embedded system. The ability
to have programs means that the same embedded system can be used for a variety of
different purposes. In some cases a microprocessor may be designed in such a way that
application software for a particular purpose can be added to the basic software in a
second process, after which it is not possible to make further changes. The applications
software on such processors is sometimes referred to as firmware.
1
The simplest devices consist of a single microprocessor (often called a "chip),
which may itself be packaged with other chips in a hybrid system or Application Specific
Integrated Circuit (ASIC). Its input comes from a detector or sensor and its output goes to
a switch or activator which (for example) may start or stop the operation of a machine or,
by operating a valve, may control the flow of fuel to an engine.

As the embedded system is the combination of both software and hardware

Figure 1.1 Block diagram of Embedded System

Software deals with the languages like ALP, C, and VB etc., and Hardware deals with
Processors, Peripherals, and Memory.
o Memory: It is used to store data or address.
o Peripherals: These are the external devices connected
o Processor: It is an IC which is used to perform some task
Processors are classified into four types like:
1. Micro Processor (p)
2. Micro controller (c)
3. Digital Signal Processor (DSP)
4. Application Specific Integrated Circuits (ASIC)

Micro Processor (p):

2
It is an electronic chip which performs arithmetic and logical operations with assistance
of internal memory.

ALU

CONTROL UNIT
MEMORY
Figure 1.2 Block Diagram of Micro Processor (p)

Micro Controller (c):


It is a highly integrated micro processor designed for specific use in embedded systems.

ALU

CU

Memory

EEPROM, ADC,
DAC, Timers,
Figure 1.3 Block Diagram of Micro Controller (c)
USART, Oscillators

Etc.,
1.1. Introduction to applications of embedded system:
Embedded controllers may be found in many different kinds of system and are
used for many different applications. The list, which follows, is indicative rather than
exhaustive. An item in the list may be relevant to a particular company because either (a)
it is or involves a core process or product, (b) it is or involves an ancillary function or
service performed by the company or (c) it refers to a product or service provided by a
contractor under some form of agreement and the vulnerability of the supplier may need
to be considered.

3
Some applications of embedded systems:
Manufacturing and process control
Construction industry
Transport
Buildings and premises
Domestic service
Communications
Office systems and mobile equipment
Banking, finance and commercial
Medical diagnostics, monitoring and life support
Testing, monitoring and diagnostic systems

Industrial functions of embedded systems:

A manufacturing company has provided the following list of embedded systems:


Multi-loop control and monitoring - DCS, SCADA, telemetry Panel mounted devices -
Control, display, recording and operations.
Safety and security - Alarm and trip systems, fire and gas systems, buildings and facilities
security.
Field devices-measurement, actuation.
Analytical systems -Laboratory systems; on-line/ plant systems.
Electrical supply - supply, measurement, control, protection.
Tools - for design, documentation, testing, maintenance.

Embedded systems compared with commercial systems:


The Year 2000 problem in embedded systems differs from the problem in
commercial / database / transaction processing systems (often referred to as IT systems)
in a number of ways. Firstly the user's problem may much lie much deeper than packages
or applications software. It may lie in and be inseparable from systems and operating
software and from hardware, i.e. in the platform on which the application software is

4
based. When users of IT systems have hardware or operating software problems they can
and should be made the concern of the computer supplier: typically, this is not the case
with microprocessors and devices based on them.

Secondly in embedded systems the concern is often with intervals rather than with
specific dates: the need may be for an event to occur at 100-day intervals rather than on
the 5th day of each month. This has the implication that Year 2000 problems may reveal
themselves both before and for some time after 1 January 2000 and not at all on the date
itself.

The lifetime of embedded systems tends to be greater than that of commercial


data processing systems: they remain in use for longer without alteration to their
software. Because their software may therefore be older they are rendered more liable to
Year 2000 problems.

1.2. An introduction to the project


Automation plays an increasingly important role in the world economy and in
daily life. Automatic systems are being preferred over manual system. The research
work shows automatic control of streetlights as a result of which power is saved to
some extent.

In the scope of industrialization, automation is a step beyond mechanization.


Whereas mechanization provided human operators with machinery to assist the users
with muscular requirements of work, automation greatly decreases the need for human
sensory and mental requirements as well.

Basically, street lighting is one of the important parts. Therefore, the street
lamps are relatively simple but with the development of urbanization, the number of
streets increases rapidly with high traffic density. There are several factors need to be
considered in order to design a good street lighting system such as night-time safety for
community members and road users, provide public lighting at cost effective, the
reduction of crime and minimizing it is effect on the environment. At the beginning,

5
street lamps were controlled by manual control where a control switch is set in each of
the street lamps which is called the first generation of the original street light. After
that, another method that has been used was optical control method done using high
pressure sodium lamp in their system. Nowadays, it is seen that the method is widely
used in the country. The method operates by set up an optical control circuit, change
the resistance by using of light sensitive device to control street lamps light up
automatically at dusk and turn off automatically after dawn in the morning. Due to
the technological development nowadays, road lighting can be categorized according
to the installation area and performance, for an example, lighting for traffic routes,
lighting for subsidiary roads and lighting for urban center and public amenity areas.
The WSN helps in improving the network sensing for street lighting.

Meanwhile, street light system can be classified according to the type of lamps
used such as incandescent light, mercury vapor light, metal halide light, high pressure
sodium light, low pressure sodium light, fluorescent light, compact fluorescent light,
induction light and LED light. Different type of light technology used in lighting
design with their luminous efficiency, lamp service life and their considerations.

The LED is considered a promising solution to modern street lighting system


due to its behavior and advantages. A part from that, the advantages of LED are likely
to replace the traditional street lamps such as the incandescent lamp, fluorescent lamp
and High Pressure Sodium Lamp in future but LED technology is an extremely
difficult process that requires a combination of advanced production lines, top quality
materials and high-precision manufacturing process. Therefore, the research work
highlights the energy efficient system of the street lights system using LED lamps with
IR sensor interface for controlling and managing.

6
CHAPTER 2

Literature Survey

The Smart street light control system adopts a dynamic control methodology.
According to the proposed plan, initially when it becomes dark, all the street lights
automatically glow for a few seconds and switches off. But throughout the night, only
one streetlights remains switched on for security concerns. When a vehicle passes by, a
block of street lights glows and as the vehicle moves forward, the next block of lights
starts glowing where the previous block switches off.

2.1 Existing system:

Industry of street lighting systems are growing rapidly and going to complex
with rapid growth of industry and cities. Automation, Power consumption and Cost
Effectiveness are the important considerations in the present field of electronics and
electrical related technologies. To control and maintain complex street lighting system
more economically, various street light control systems are developed. These systems
are developed to control and reduce energy consumption of a town's public lighting
system using different technologies. The existing work is done using HID lamps.
Currently, the HID is used for urban street light based on principle of gas discharge, thus
the intensity is not controlled by any voltage reduction method as the discharge path is
broken.

HID lamps are a type of electrical gas discharge lamp which produces light by
means of an electric arc between tungsten electrodes housed inside a translucent or
transparent fused quartz or fused alumina arc tube. This tube is filled with both gas
and metal salts. The gas facilitates the arc's initial strike. Once the arc is started, it
heats and evaporates the metal salts forming plasma, which greatly increases the
intensity of light produced by the arc and reduces its power consumption. High-
intensity discharge lamps are a type of arc lamp.

7
2.2 Disadvantages of Existing System:

HID lamps consume more power.

The life time of the HID lamps is very less.

It cannot be used in all outdoor applications.

Brightness of the lights in the rear view mirrors which causes a problem for
drivers in front of your vehicle.

2.3 Proposed System

Since the HID lamps are not cost effective and not reliable, smart street light
system has overcome by replacing the HID lamps with LED. Due to automation, power
consumption and cost effectiveness in the present field of electronics and electrical
related technologies, industry of street lighting systems are growing rapidly and going to
complex with rapid growth of industry and cities.

To control and maintain complex street lighting system more economically,


various street light control systems are developed. These systems are developed to
control and reduce energy consumption of a town's public lighting system using
different technologies which uses IR motion sensors to detect the vehicle movement
after which the street light begins to glow. As the vehicle moves, the street light that
was glowing switches off and the following lights begins to glow.

8
CHAPTER 3

ANALYSIS

3.1 INTRODUCTION
Initial stage of every electronic circuit is power supply system which provides
required power to drive the whole system. The specification of power supply depends on
the power requirement. And this requirement is determined by its rating. The main
components used in supply system are:

8051 Microcontroller
Relay
LED
IR sensor
Transformer
Rectifier

3.2 SOFTWARE REQUIREMENT SPECIFICATION

3.2.1 USER REQUIREMENT


The function of a document is to serve as the mandate or terms of reference for
the design, development and realisation of the technical component of a system or
subsystem within Automatic streetlight control based on vehicle movement t. Usually
there is only one document for each Automatic streetlight control based on vehicle
movement, even when the required development encompasses more than one
development contract.

A document is produced as a result of appropriate Requirements Analysis


activity, based on the stipulations of the Project Definition document and the Global
Implementation Plan. All specific requirements in the document must be consistent with
similar statements in higher-level specifications, if they exist.

9
3.2.2 SOFTWARE REQUIREMENT
In our project Automatic streetlight control based on vehicle movement there
are number of softwares we can use but we choose three of them. One is for writing
code, second is for designing components and last one is for dumping the code into the
microcontroller.

Keil Software

Proteus Software

Micro flash software

KEIL SOFTWARE:

Installing the Keil software on a Windows PC:

Insert the CD-ROM in your computers CD drive


On most computers, the CD will auto run, and you will see the Keil installation
menu. If the menu does not appear, manually double click on the Setup icon, in
the root directory: you will then see the Keil menu.
On the Keil menu, please select Install Evaluation Software. (You will not
require a license number to install this software).
Follow the installation instructions as they appear.

LOADING THE PROJECTS:

The example projects for this book are NOT loaded automatically when you
install the Keil compiler. These files are stored on the CD in a directory /Pont. The files
are arranged by chapter: for example, the project discussed in Chapter 3 is in the
directory /Pont/Ch03_00-Hello. Rather than using the projects on the CD (where
changes cannot be saved), please copy the files from CD onto an appropriate directory on
your hard disk.

10
Open the Keil Vision2

Go to Project Open Project and browse for Hello in Ch03_00 in Pont and open
it.

Go to Project Select Device for Target Target1

11
Select 8052(all variants) and click OK

Now we need to check the oscillator frequency:

12
Building the Target

Build the target as illustrated in the figure below

Running the Simulation

13
Having successfully built the target, we are now ready to start the debug session
and Go to Debug - Go

While the simulation is running, view the performance analyzer to check the
delay durations.

Go to Debug Performance Analyzer and click on it

14
Double click on DELAY_LOOP_Wait in Function Symbols: and click Define
button

15
3.2.3 HARDWARE COMPONENTS DESCRIPTION

Figure 3.1 Block diagram of project

HARDWARE COMPONENTS:
Basically in our project we used the following hardware components

Transformer (230 -12 V Ac)

Rectifier

Voltage Regulator (Lm 7805)

Filter

Micro Controller (At89s52/At89c51)

LDR

IR Sensor

Heat Sink

Relay

16
LED

POWER SUPPLY

A variable regulated power supply, also called a variable bench power supply, is
one where you can continuously adjust the output voltage to your requirements. Varying
the output of the power supply is the recommended way to test a project after having
double checked parts placement against circuit drawings and the parts placement guide.

This type of regulation is ideal for having a simple variable bench power supply. Actually
this is quite important because one of the first projects a hobbyist should undertake is the
construction of a variable regulated power supply. While a dedicated supply is quite
handy e.g. 5V or 12V, it's much handier to have a variable supply on hand, especially for
testing.

Most digital logic circuits and processors need a 5 volt power supply. To use these parts
we need to build a regulated 5 volt source. Usually you start with an unregulated power
supply ranging from 9 volts to 24 volts DC To make a 5 volt power supply, we use a
LM7805 voltage regulator IC (Integrated Circuit). The IC is shown below.

Figure 3.2 Voltage regulator

The LM7805 is simple to use. You simply connect the positive lead of your unregulated
DC power supply (anything from 9VDC to 24VDC) to the Input pin, connect the

17
negative lead to the common pin and then when you turn on the power, you get a 5 volt
supply from the Output pin

. Block Diagram:

Figure 3.3 Block Diagram of Power supply

TRANSFORMER:

Usually, DC voltages are required to operate various electronic equipment and these
voltages are 5V, 9V or 12V. But these voltages cannot be obtained directly.

Figure 3.4 Transformer

18
Thus the a.c input available at the mains supply i.e., 230V is to be brought down to the
required voltage level. This is done by a transformer. Thus, a step down transformer is
employed to decrease the voltage to a required level.

Basic principles:

The transformer is based on two principles: first, that an electric current can produce
a magnetic field (electromagnetism), and, second that a changing magnetic field within a
coil of wire induces a voltage across the ends of the coil (electromagnetic induction).
Changing the current in the primary coil changes the magnetic flux that is developed. The
changing magnetic flux induces a voltage in the secondary coil.

An ideal transformer is shown in the adjacent figure. Current passing through the primary
coil creates a magnetic field. The primary and secondary coils are wrapped around a core
of very high magnetic permeability, such as iron, so that most of the magnetic flux passes
through both the primary and secondary coils.

Figure 3.5 Principle of operation of transformer

19
Induction law:

The voltage induced across the secondary coil may be calculated from Faraday's law of
induction, which states that:

Where Vs is the instantaneous voltage, Ns is the number of turns in the secondary


coil and is the magnetic flux through one turn of the coil. If the turns of the coil are
oriented perpendicular to the magnetic field lines, the flux is the product of the magnetic
flux density B and the area A through which it cuts. The area is constant, being equal to
the cross-sectional area of the transformer core, whereas the magnetic field varies with
time according to the excitation of the primary. Since the same magnetic flux passes
through both the primary and secondary coils in an ideal transformer, the instantaneous
voltage across the primary winding equals

Taking the ratio of the two equations for Vs and Vp gives the basic equation for stepping
up or stepping down the voltage

Np/Ns is known as the turns ratio, and is the primary functional characteristic of any
transformer. In the case of step-up transformers, this may sometimes be stated as the
reciprocal, Ns/Np. Turns ratio is commonly expressed as an irreducible fraction or ratio:
for example, a transformer with primary and secondary windings of, respectively, 100
and 150 turns is said to have a turns ratio of 2:3 rather than 0.667 or 100:150.

20
Ideal power equation:

Figure 3.6 The ideal transformer as a circuit element

If the secondary coil is attached to a load that allows current to flow, electrical power is
transmitted from the primary circuit to the secondary circuit. Ideally, the transformer is
perfectly efficient; all the incoming energy is transformed from the primary circuit to the
magnetic field and into the secondary circuit. If this condition is met, the incoming
electric power must equal the outgoing power:

giving the ideal transformer equation

Transformers normally have high efficiency, so this formula is a reasonable


approximation.If the voltage is increased, then the current is decreased by the same
factor. The impedance in one circuit is transformed by the square of the turns ratio. For
example, if an impedance Zs is attached across the terminals of the secondary coil, it
appears to the primary circuit to have an impedance of (Np/Ns)2Zs. This relationship is
reciprocal, so that the impedance Zp of the primary circuit appears to the secondary to be
(Ns/Np)2Zp.

BRIDGE RECTIFIER:

21
The output from the transformer is fed to the rectifier. It converts A.C. into pulsating
D.C. The rectifier may be a half wave or a full wave rectifier.

Figure 3.7 Bridge rectifier

The Bridge rectifier is a circuit, which converts an ac voltage to dc voltage using


both half cycles of the input ac voltage. The Bridge rectifier circuit is shown in the figure.
The circuit has four diodes connected to form a bridge. The ac input voltage is applied to
the diagonally opposite ends of the bridge. The load resistance is connected between the
other two ends of the bridge.

22
23
Figure 3.8 Operation of bridge rectifier

For the positive half cycle of the input ac voltage, diodes D1 and D3 conduct,
whereas diodes D2 and D4 remain in the OFF state. The conducting diodes will be in
series with the load resistance RL and hence the load current flows through RL.

For the negative half cycle of the input ac voltage, diodes D2 and D4 conduct
whereas, D1 and D3 remain OFF. The conducting diodes D2 and D4 will be in series
with the load resistance RL and hence the current flows through RL in the same direction
as in the previous half cycle. Thus a bi-directional wave is converted into a unidirectional
wave.

VOLTAGE REGULATOR

A voltage regulator is an electrical regulator designed to automatically maintain a


constant voltage level. It may use an electromechanical mechanism, or passive or active
electronic components. Depending on the design, it may be used to regulate one or more
AC or DC voltages. As the name itself implies, it regulates the input applied to it. A
voltage regulator is an electrical regulator designed to automatically maintain a constant

24
voltage level. In this project, power supply of 5V and 12V are required. In order to obtain
these voltage levels, 7805 and 7812 voltage regulators are to be used. The first number 78
represents positive supply and the numbers 05, 12 represent the required output voltage
levels. The L78xx series of three-terminal positive regulators is available in TO-220, TO-
220FP, TO-3, D2PAK and DPAK packages and several fixed output voltages, making it
useful in a wide range of applications.

These regulators can provide local on-card regulation, eliminating the distribution
problems associated with single point regulation. Each type employs internal current
limiting, thermal shut-down and safe area protection, making it essentially indestructible.
If adequate heat sinking is provided, they can deliver over 1 A output current. Although
designed primarily as fixed voltage regulators, these devices can be used with external
components to obtain adjustable voltage and currents.

Figure 3.9 7805 pin configuration and circuit diagram

The voltage regulators are classified into two types.

1. positive series(7805)

2. Negative series(7905)

25
Figure 3.10 classifications of 7805 voltage regulators

CERAMIC CAPACITOR (FILTER)

Capacitive filter is used in this project. It removes the ripples from the output of
rectifier and smoothens the D.C. Output received from this filter is constant until the
mains voltage and load is maintained constant. However, if either of the two is varied,
D.C. voltage received at this point changes. Therefore a regulator is applied at the output
stage.

Figure 3.11 Disk capacitor

Capacitor blocks DC (constant) signals. Capacitors easily pass AC (changing) signals

26
Electronic filters are electronic circuits which perform signal processing functions,
specifically to remove unwanted frequency components from the signal, to enhance
wanted ones, or both.

Figure 3.12 Removal of unwanted frequency components

MICRO CONTROLLER AT89S52:

The AT89S52 is a low-power, high-performance CMOS 8-bit micro controller


with 8Kbytes of in-system programmable flash memory. The device is manufactured
Atmels high-density nonvolatile memory technology and is compatible with the
industry-standard 80C51 micro controller. The on-chip Flash allows the program memory
to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By
combining a versatile 8-bit CPU with in-system programmable flash one monolithic http;
the Atmel AT89S52 is a powerful micro controller, which provides a highly flexible and
cost effective solution to any cost effective solution to any embedded control applications
to any embedded control applications.

Features:

Compatible with MCS-51 Products


8K Bytes of In-System Programmable (ISP) Flash Memory Endurance: 1000
Write/Erase Cycles

27
4.0V to 5.5V Operating Range
Fully Static Operation: 0 Hz to 33 MHz
Three-level Program Memory Lock
256K Internal RAM
32 Programmable I/O Lines
16-bit Timer/Counters
Eight Interrupt Sources
Full Duplex UART Serial Channel
Low-power Idle and Power-down Modes
Interrupt Recovery from Power-down Mode
Watchdog Timer
Dual Data Pointer
Power-off Flag

Pin Diagram:

28
Figure 3.13 Pin diagram of AT89S51

29
Table 3.1: Pin Description of 89S52:
Pin No Function Name

1 External count input to Timer/Counter 2, clock-out T2 P1.0

2 Timer/Counter 2 capture/reload trigger and direction control T2 EX P11

3 P1.2
4 P1.3
5 P1.4
8 bit input/output port (P1) pins
6 P1.5
7 P1.6
8 P1.7
9 Reset pin; Active high Reset
Input (receiver) for serial
10 RxD P3.0
communication

11 Output (transmitter) for serial communication TxD P3.1

8 bit
12 External interrupt 1 Into P3.2
input/output
13 External interrupt 2 Int1 P33
port (P3)
14 limer1 external input TO pins P3.4

15 limer2 external input T1 P3.5

16 Write to external data memory Write P3.6

17 Read from external data memory Read P3.7

18 Crystal 2
Quartz crystal oscillator (up to 24 MHz)
19 Crystal 1
20 Ground (OV) Ground
21 8 bit input/output port (P2) pins / P20/ A8
22 High-order address bits when interfacing with P21/ A9
23 external memory P22/ A10
24 P2.3/ A11
25 P2.4/ A12
26 P2.5/ A13
27 P2.6/ A14

30
28 P2.7/ A15

29 Program store enable; Read from external program memory PSEN

Address Latch Enable ALE


30
Program pulse input during Flash programming Prog

External Access Enable; Vcc for internal program executions EA


31
Programming enable voltage; 12V (during Flash programming) Vpp

32 PO7/ AD7
33 PO.6/ AD6
34 PO.5/ AD5
35 8 bit input/output port (PO) pins Low-order address bits when POA/ AD4
36 interfacing with external memory PO.3/ AD3
37 PO.2I AD2
38 PO.1/ AD1
39 PO.O/ ADO
40 Supply voltage: 5V (up to 6.6V) Vcc

Oscillator Characteristics:
XTAL1 and XTAL2 are the input and output, respectively, of an inverting
amplifier that can be configured for use as an on-chip oscillator, as shown in Figure 1.
Either a quartz crystal or ceramic resonator may be used. To drive the device from an
External clock source, XTAL2 should be left unconnected while XTAL1 is driven.

Fig 3.14 Oscillator connections

31
Special Function Register (SFR) Memory: Special Function Registers (SFR s) are
areas of memory that control specific functionality of the 8051 processor. For example,
four SFRs permit access to the 8051s 32 input/output lines. Another SFR allows the user
to set the serial baud rate, control and access timers, and configure the 8051s interrupt
system.

Accumulator: The Accumulator, as its name suggests is used as a general register to


accumulate the results of a large number of instructions. It can hold 8-bit (1-byte) value
and is the most versatile register.

The R registers: The R registers are a set of eight registers that are named R0, R1.
Etc. up to R7. These registers are used as auxiliary registers in many operations.
The B registers: The B register is very similar to the accumulator in the sense that it
may hold an 8-bit (1-byte) value. Two only uses the B register 8051 instructions: MUL
AB and DIV AB.

Data Pointer: The Data pointer (DPTR) is the 8051s only user accessible 16-bit
(2Bytes) register. The accumulator, R registers are all 1-Byte values. DPTR, as the
name suggests, is used to point to data. It is used by a number of commands, which allow
the 8051 to access external memory.

Program counter & Stack pointer: The program counter (PC) is a 2-byte address,
which tells the 8051 where the next instruction to execute is found in memory. The stack
pointer like all registers except DPTR and PC may hold an 8-bit (1-Byte) value.

Memory:
Special Function Registers (SFRs) are areas of memory that control specific functionality
of the 8051 processor. For example, four SFRs permit access to the 8051s 32
input/output lines. Another SFR allows the user to set the serial baud rate, control and
access timers, and configure the 8051s interrupt system

32
.
Timer 2 Registers: Control and status bits are contained in registers T2CON and
T2MOD for Timer 2. The register pair (RCAP2H , RCAP2L) are the Capture /
Reload registers for Timer 2 in 16-bit capture mode or 16-bit auto-reload mode .

Interrupt Registers: The individual interrupt enable bits are in the IE register .
Two priorities can be set for each of the six interrupt sources in the IP register.

Timer 2: Timer 2 is a 16-bit Timer / Counter that can operate as either a timer or
an event counter. The type of operation is selected by bit C/T2 in the SFR T2CON.
Timer 2 has three operating Modes : capture , auto-reload ( up or down Counting ) ,
and baud rate generator . The modes are selected by bits in T2CON. Timer2 consists
of two 8-bit registers, TH2 and TL2. In the Timer function, the TL2 register is
incremented every machine cycle. Since a machine cycle consists of 12 oscillator
periods, the count rate is 1/12 of the oscillator frequency. In the Counter
function , the register is incremented in response to a 1-to-0 transition at its
corresponding external input pin , T2 .When the samples show a high in one cycle
and a low in the next cycle, the count is incremented . Since two machine cycles (24
Oscillator periods ) are required to recognize 1-to-0 transition , the maximum
count rate is 1 / 24 of the oscillator frequency . To ensure that a given level is
sampled at least once before it changes , the level should be held for at least
one full machine cycle.

Light Dependent Resistor

A light dependent resisitor is a resisitor whose resistance changes with the


intensity of incident light. The working principle of light dependent resistor is
photoelectric effect. A light dependent resisitor is made of a high resistance
semiconductor. If the energy of the incident light is greater than the band gap of the
semiconductor, electron -hole pairs are generated. The photo generated electron-hole pair
transits the device giving rise to photoconductivity.

33
The essential elements of a photoconductive cell are the ceramic substrate, a
layer of photoconductive material, metallic electrodes to connect the device into a circuit
and a moisture resistant enclosure. Light sensitive material is arranged in the form of a
long strip, zigzagged across a disc shaped base with protective sides. For additional
protection, a glass or plastic cover may be included. The two ends of the strip are brought
out to connecting pins below the base as shown below.

Top Side
Figure 3.15 Top view and side view of Light Dependent Resisitor

The commercial photoconductive materials include cadmium sulphide


(CdS), cadmium selenide (CdSe), Lead sulfide (PbS) and Indium antimonide (InSb) etc.,
There is large change in the resistance of a cadmium selenide cell with changes in
ambient temperature, but the resistance of cadmium sulphide remains relatively stable.
Moreover, the spectral response of a cadmium sulphide cell closely matches to that of a
human eye. Hence, LDR is used in applications where human vision is a factor such as
street light control or automatic iris control for cameras. The above mentioned features
drive us to opt for CdS based LDR in our electronic circuit for Automatic street light
controller.

34
Figure 3.16 Light Dependent Resistor and its circuit symbol

LDR Architecture:-

The light dependent resistor, LDR, is known by many names including the photo
resistor, photo resistor, photoconductor, photoconductive cell, or simply the photocell. It
is probably the term photocell that is most widely used in data and instruction sheets for
domestic equipment.
The photo resistor, or light dependent resistor, LDR, finds many uses as a low cost photo
sensitive element and was used for many years in photographic light meters as well as in
other applications such as flame, smoke and burglar detectors, card readers and lighting
controls for street lamps. Often within the literature the photo resistor is called the
photocell as a more generic term.

Photo resistor discovery:

Photo-resistors, or light dependent resistors have been in use for very many years.
Photo resistors have been seen in early forms since the nineteenth century when
photoconductivity in selenium was discovered by Smith in 1873. Since then many
variants of photoconductive devices have been made.
Much useful work was conducted by T. W. Case in 1920 when he published a
paper entitled "Thalofide Cell - a new photo-electric cell".

35
Other substances including PbS, PbSe and PbTe were studied in the 1930s and 1940s, and
then in 1952, Rollin and Simmons developed their photoconductors using silicon and
germanium.

Light dependent resistor symbol

The circuit symbol used for the light dependent resistor or photo resistor
combines its resistor action while indicating that it is sensitive to light. The basic light
dependent resistor symbol has the rectangle used to indicate its resistor action, and then
has two incoming arrows - the same as those used for photodiodes and phototransistors to
indicate its light sensitivity.

Figure 3.17 LDR symbol

Light dependent resistor symbol used in circuit diagrams

For most applications, the light dependent resistor symbol used will be that with the
resistor with arrows, but in some instances those drawing circuit diagrams prefer to
encase the resistor in a circle. The more commonly used photo resistor symbol is the
resistor without the circle around it.
.

INFRARED SENSOR:

An infrared sensor is an electronic device that emits in order to sense some


aspects of the surroundings. An IR sensor can measure the heat of an object as well as
detects the motion. These types of sensors measures only infrared radiation, rather than
emitting it that is called as a passive IR sensor. Usually in the infrared spectrum, all the
objects radiate some form of thermal radiations. These types of radiations are invisible
to our eyes that can be detected by an infrared sensor. The emitter is simply an IR LED

36
and the detector is simply an IR photodiode which is sensitive to IR light of the same
wavelength as that emitted by the IR LED. When IR light falls on the photodiode. The
resistances and these output voltages, change in proportion to the magnitude of the IR
light received.

HEAT SINK:
More often transistors gets heated when the circuit is ON for long time. In order
to avoid heating up of transistors we use heat sinks.

RELAY:

A relay is an electrically operated switch. Many relays use an electromagnet to operate


a switching mechanism mechanically, but other operating principles are also used. Relays
are used where it is necessary to control a circuit by a low-power signal (with complete
electrical isolation between control and controlled circuits), or where several circuits
must be controlled by one signal. The first relays were used in long distance telegraph
circuits, repeating the signal coming in from one circuit and re-transmitting it to another.
Relays were used extensively in telephone exchanges and early computers to perform
logical operations.

A type of relay that can handle the high power required to directly control an electric
motor is called a contactor. Solid-state relays control power circuits with no moving
parts, instead using a semiconductor device to perform switching. Relays with calibrated
operating characteristics and sometimes multiple operating coils are used to protect
electrical circuits from overload or faults; in modern electric power systems these
functions are performed by digital instruments still called "protective relays".

37
LED:
LEDs emit light when an electric current passes through them. A single LED is a
low-voltage solid state device and cannot be directly operated on standard AC current
without some circuitry to control the voltage applied and the current flow through the
lamp. A series diode and resistor could be used to control the voltage polarity and to limit
the current, but this is inefficient since most of the applied voltage would be dropped as
wasted heat in the resistor. A single series string of LEDs would minimize dropped-
voltage losses, but one LED failure could extinguish the whole string. Paralleled strings
increase reliability by providing redundancy. In practice, three strings or more are usually
used. To be useful for illumination for home or work spaces, a number of LEDs must be
placed close together in a lamp to combine their illuminating effects. This is because
individual LEDs emit only a fraction of the light of traditional light sources. When using
the color-mixing method, a uniform color distribution can be difficult to achieve, while
the arrangement of white LEDs is not critical for color balance. Further, degradation of
different LEDs at various times in a color-mixed lamp can lead to an uneven color output.
LED lamps usually consist of clusters of LEDs in a housing with both driver electronics,
a heat sink and optics.

Circuit symbol:

Figure 3.18 LED circuit symbol

ADVANTAGES:

simple circuit
easy operation
low cost
The main advantage of this circuit over the others is that it can send the sensed
level of water on to certain distance say up to using two wires only.

38
APPLICATIONS:

Water tanks
Used for petrol identification in tankers etc

CHAPTER 4
IMPLEMENTATION AND RESULTS
4.1 Implementation

In this section, the setup of the whole research work is depicted in a step by
step manner. Sample screenshots are displayed once the components are fixed and
connected to each other. All the components are connected to each other and thus
completes the system setup which helps one to understand the steps in a simple and easy
way. With these steps, even when a person who is trying to implement the same, it
makes it simple, clear and easy.

39
Circuit is connected as described, In this project we used IR sensor and LED, IR
sensor consist of An IR transmitter and IR receiver, IR transmitter transmits IR rays when
ever an obstacle comes in between the way the IR rays will reflects on the receiver, we
program the microcontroller in such a way that whenever receiver receives the signal
then the connected LEDs should Turn off for 60 seconds. After that they will go turn Off
4.2 Results

Figure 4.1 Automatic street light control system

CHAPTER 5

TESTING & VALIDATION

TOOLS USED:
Soldering iron

A soldering iron is a hand tool most commonly used in

40
soldering. It supplies heat to melt the solder so that it can
flow into the joint between two work pieces.

A soldering iron is composed of a heated metal tip and an


insulated handle. Heating is often achieved electrically,
by passing an electric current (supplied through an
electrical cord or
battery cables) through the resistive material of a heating element. Another heating
method includes combustion of a suitable gas, which can either be delivered through a
tank mounted on the iron (flameless), or through an external flame.

Less common uses include pyrography (burning designs into wood) and plastic welding.
Soldering irons are most often used for installation, repairs, and limited production work.
High-volume production lines use other soldering methods.

Wire Stripper

Wire stripper is used to strip off wire insulator from its conductor before it is used to
connect to another wire or soldered into the printed circuit board. Some wire stripper or
wire cutter has a measurement engraved on it to indicate the length that will be stripped.

Side-Cutting Plier

A 4-inch side cutting plier will come in handy as one of


the electronic tools when one need to trim off excess
component leads on the printed circuit board. It can also
be used to cut wires into shorter length before being used.
Tweezer
Small tweezer is used to hold small components especially when doing soldering
and de-soldering of surface mount components.

COMPONENT MOUNTING

Now mount all the components on the PCBs using the above mentioned tools.

41
CHAPTER 6

CONCLUSION AND FUTURE RECOMMENDATIONS

CONCLUSION:
This project of Automatic Street Lights is a cost effective, practical, eco friendly
and the safest way to save energy. It clearly tackles the two problems that world is
facing today, saving of energy and also disposal of incandescent lamps, very efficiently.
According to statistical data we can save more that 40 % of electrical energy that is now

42
consumed by the highways. Initial cost and maintenance can be the draw backs of this
project. With the advances in technology and good resource planning the cost of the
project can be cut down and also with the use of good equipment the maintenance can
also be reduced in terms of periodic checks. The LEDs have long life, emit cool light,
donor have any toxic material and can be used for fast switching. For these reasons our
project presents far more advantages which can over shadow the present limitations.
Keeping in view the long term benefits and the initial cost would never be a problem as
the investment return time is very less.

The project has scope in various other applications like for providing lighting in
industries, campuses and parking lots of huge shopping malls. This can also be used for
surveillance in corporate campuses and industries.

FUTURE RECOMMENDATIONS:

Pole damage detection with the addition of a suitable sensor.


Taxi call buttons on lamp posts to signal to the network management centre to
generate a Taxi call to the appropriate location.
If the system has traffic speed sensors then this information could be used to
manage traffic speed via the dimming of the streetlights. If the average traffic

speed is too fast during evening and night hours, this could be used to trigger a
slight dimming of the streetlights. The level of dimming would be
imperceptible to motorists but they would slow down, regardless, in response to
the slightly diminished lighting. A five percent light reduction slows traffic but
is not noticeable to motorists.

With the added intelligence in the lamp, you can add further features to increase
HID lamp life, such as softer start-up and protection against re-igniting an
already hot HID lamp, since this shortens the lamp life.
Information management

43
REFERENCES
[1] The 8051 Microcontroller and Embedded systems by Muhammad Ali Mazidi and
Janice Gillispie Mazidi , Pearson Education.

[2] Electronic Devices and Circuit Theory, Boylestad.

[3] Sensors: Advancements in Modeling, Design Issues, Fabrication and Practical by


Subhas Chandra

[4] Handbook of Modern Sensors: Physics, Designs, and Applications by Jacob Fraden.

[5] The 8051 Microcontroller by Kenneth J. Ayala,

[6] Hand Book of Electronics by A.K. Maini.

[7] Digital Systems Principles and Application by Ronald Ltocci (Sixth Addition).

[8] Digital Design by Moris Mano (Second Addition),

[9] Relays and Its Application Sharma, M.C. (BPB-Publishers)

[10] Websites:

www.atmel.com

www.beyondlogic.org

www.wikipedia.org

www.howstuffworks.com

www.alldatasheets.com

www.wikipedia.com

44

Potrebbero piacerti anche