Production and Utilization of Energy by Busy Road
-
Upload
arvind-mishra -
Category
Documents
-
view
327 -
download
3
Transcript of Production and Utilization of Energy by Busy Road
1
CHAPTER 1
INTRODUCTION
As we know very well about the crisis of the energy. There are limited resources of energy
on the earth and they are decaying rapidly. So we should think about this topic otherwise
it may be a major problem in future.
Solution of this problem
There are two ways of solving this problem:
1. Producing new non conventional energy resources.
2. By saving some energy if anywhere it is being wasted.
Here in our project we consider both ways, producing as well as saving energy.
1.1 Producing non conventional energy:
Generally we see that many vehicles pass on a single road per day. So here in our project
we are producing some energy by the movement of the road traffic. We are storing such
nonconventional energy which is free.
1.2 Energy saving:
Generally we see that in the roads, street lights are generally on in the night. Whether a
vehicle is on the road or not. So we are designing a system for saving such energy.
1.3 Main features of the project:
2
1.4 WORKING:
In this project we show that how we generate a valuable voltage with the help of moving
traffic on the road. In this project we use conversion of mechanical energy into electrical
energy. For this purpose we install one mechanical dynamo on the road. With the help of
this dynamo we convert the mechanical energy into electrical energy. We use dc dynamo,
so output from the dynamo is connected to the dc battery. When battery is fully charged
then we use battery for our project.
We install one photoelectric effect in the project. Street light is to be switch on
automatically in the night and lights are automatically off in the day night.
In this project we switch on the street light in night in half mode. Half mode means all the
lights are to be on in 50 percent on/off mode. Rests of lights are to be on if the traffic is on
the road. If the road is with traffic then all the lights are on. If the road is without traffic
then 50 percent lights are again off.
For road sensing, we use two pair of infra red sensor on the road. When any car crosses the
road then infra red beam is interrupted and signal is connected to the controller. Controller
3
senses the signal and increment the counter. Counter display the total number of vehicle on
road. When counter shows a 0 number then road lights are off to 50 percent.
1.5 Basic diagram of the project on applying to the road:
4
CHAPTER 2
PROJECT DESCRIPTION
2.1 ENERGY PRODUCTION
In this project we are producing non conventional energy
We are generating the power which is free of cost.
We install one powerful dynamo on the road.
Horizontal roller of dynamo is a part of the speed breaker.
When dynamo moves then according to dynamo mechanism mechanical energy
converted to the electrical energy.
2.2 ENERGY STORING PROCESS
Now we have to store this electrical energy produced by dynamo.
For this purpose we use a powerful dc battery.
This battery stores the electrical energy.
This dc battery is rechargeable so we can use it as many times as we want.
This energy can be used for various applications.
5
2.3 ENERGY UTILIZATION
With the help of battery this energy is used in turning on the street light in night.
In this project we are using the automatic street light logic.
In the night, lights will automatic on with the help of photovoltaic switch logic.
But all lights will not on, only half of lights will on. Other half of lights will switch
on automatically when any vehicle moves on the road.
When there is no vehicle on the road then lights will off automatically.
We are using two infra red sensors to check the movement of vehicle.
When first infra red sensor is interrupted then lights will on and when second
sensor is interrupted then lights will off automatically.
When any car crosses the road then infra red beam is interrupted and a signal goes
to the controller. Controller senses the signal and it switches on the entire street
light.
When this car passes to the second end then second beam is interrupted and sensor
sends a signal to controller and it switches off the half of street light.
2.4 CIRCUIT
In this project we use 89s51 controller is a family member of the 8051 family. Supply
voltage of the microcontroller is 5 volt d.c . For this purpose we convert the battery voltage
into 5 volt dc with the help of the 5 volt regulator circuit. For this purpose we use IC 7805
regulator to regulate the high voltage in to 5 volt dc. One capacitor is ground from the
regulator for filtration. Capacitor here reduce the noise and suppress ripples from power
supply . Output of the regulator is connected to the pin no 40 of the controller directly. One
6
crystal is connected to the pin no 18 and 19 of the controller to provide a clock oscillation
signal. For this purpose we use 12 Mhz crystal. Two capacitors are grounded from the
crystal to reduce the noise. In this project we use two logical circuits. One is light sensitive
logic and second is road sensor logic. When light sensor is in dark then all the lights are on
and when light sensor is in light then all the lights are off. This is done by the light sensor (
LDR). LDR is a light dependent resistor, when light fall on the ldr then ldr offers a low
resistance and when ldr is in dark then ldr offers a high resistance.
Here in this project we use the LDR with the op-amp amplifier circuit. In this project we
use LM 339 op-amp as a comparator .LM 339 is quad op-amp circuit with four op-amp in
side. Out of this 4 op-amp inside we use three OP-AMP for the comparator circuit.Out of
these four comparator, we use two comparator for the road sensor and one comparator for
the ldr.
When ldr in dark then op-amp comparator gets a high voltage on pin no 6. Pin no 6 is
negative input of the op-amp. As the negative input gets a high voltage compare to the
positive reference voltage then output shifted to the op-amp is negative.. This negative
output now connected to the microcontroller circuit for further operation
7
3
4
5
7
10K-
+
8 149
6
2 2
1
3
+
+
10K
LM 339
12
1
100 ohm
L.E.D
+10kohm
+
+
10k
+
10k
+
10k
100 ohm
L.E.D
+10kohm
P.D
P.D
+
10kohm
LDR
+
Road sensor are connected to the pin no 4 and 8 of the op-amp circuit. On the road we
connect one infra red l.e.d. in series with the resistance. Light of this infra red l.e.d. is focus
to the photodiode directly. When we any vehicle interrupts the light focus on the
photodiode then photodiode resistance become high and pin no 4 gets a more positive on
pin. As a result op-amp provide a negative output to the controller circuit
8
All l.e.d’s are connected with the port 2 through the resistance in series, here in this circuit
we use 6 l. e. d with the port p2. Common point of the l. e. d is connected with the positive
line. Out of 6 l.e.d.’s only three l.e.d.’s are on when light sensor is in dark
Our second part of this project is road sensor. In this logic when any car crosses the first
IR sensor then all the led are on and if the traffic is to be continuous then all the lights are
on. If there is no car on the road then again three led are on and three are off.
9
2.5 COMPONENTS
PART NAME QUANTITY
PCB BARE PCB 1
INTREGATED CIRCUIT LM339
7805
1
1
MICROCONTROLLER 89S51 1
DYNAMO 12 VOLT 1
RECHARGEABLE
BATTERY
6 VOLT 1
DIODE LED
PHOTODIODE
8
2
CAPACITOR 27 PF
CRYSTAL OSCILATOR 12MHZ 1
RESISTOR 10KOHM
470 OHM
270 OHM
1 KOHM
3
2
6
1
Table 2.5.1
10
2.6Program code of the project.
Org 0000h
Sjmp main
Main:
Jnb p1.0,start
Sjmp main
Start:
Mov p2,#11101010b
Jnb p1.1,next
Jnb p1.0,start
Sjmp main
Next:
Mov p2,#00000000
Jnb p1.2,next1
Sjmp next
Next1:
Mov p2,#10101010b
Sjmp main
end
11
CHAPTER 3
MICROCONTROLLER AT89C51 3.1 Architecture of 8051 family:
3.2 Features:
• Compatible with MCS-51™ Products
• 4K Bytes of In-System Reprogrammable Flash Memory
– Endurance: 1,000 Write/Erase Cycles
• Fully Static Operation: 0 Hz to 24 MHz
• Three-Level Program Memory Lock
• 128 x 8-Bit Internal RAM
• 32 Programmable I/O Lines
• Two 16-Bit Timer/Counters
• Six Interrupt Sources
• Programmable Serial Channel
12
• Low Power Idle and Power Down Modes
3.3 Description
The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4K
bytes of Flash Programmable and Erasable Read Only Memory (PEROM). The device is
manufactured using Atmel’s high density nonvolatile memory technology and is
compatible with the industry standard MCS-51™ instruction set and pinout. 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 Flash on a
monolithic chip, the Atmel AT89C51 is a powerful microcomputer which provides a
highly flexible and cost effective solution to many embedded control applications. The
AT89C51 provides the following standard features: 4K bytes of Flash, 128 bytes of RAM,
32 I/O lines, two 16-bit timer/counters, five vector two-level interrupt architecture, a full
duplex serial port, and on-chip oscillator and clock circuitry.
In addition, the AT89C51 is designed with static logic for operation down to zero
frequency and supports two software selectable power saving modes. The Idle Mode stops
the CPU while allowing the RAM, timer/counters, serial port and interrupt system to
continue functioning. The Power down Mode saves the RAM contents but freezes the
oscillator disabling all other chip functions until the next hardware reset.
Pin Description
VCC
Supply voltage.
GND
Ground.
Port 0
Port 0 is an 8-bit open drain bidirectional I/O port. As an output port each pin can sink
eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high
impedance inputs. Port 0 may also be configured to be the multiplexed low order
address/data bus during accesses to external program and data memory. In this mode P0
has internal pull-ups. Port 0 also receives the code bytes during Flash programming, and
outputs the code bytes during program verification.
External pull-ups are required during program verification.
13
14
Port 1
Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers can
sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being
pulled low will source current (IIL) because of the internal pull-ups. Port 1 also receives
the low-order address bytes during Flash programming and verification.
Port 2
Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output buffers can
sink/source four TTL inputs. When 1s are written to Port 2 pins they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being
pulled low will source current (IIL) because of the internal pull-ups. Port 2 emits the high-
order address byte during fetches from external program memory and during accesses to
external data memory that uses 16-bit addresses (MOVX @ DPTR). In this application it
uses strong internal pull-ups when emitting 1s. During accesses to external data memory
that uses 8-bit addresses (MOVX @ RI); Port 2 emits the contents of the P2 Special
Function Register. Port 2 also receives the high-order address bits and some control signals
during Flash programming and verification.
Port 3
Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output buffers can
sink/source four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being
pulled low will source current (IIL) because of the pull-ups. Port 3 also serves the
functions of various special features of the AT89C51 as listed below:
Port 3 also receives some control signals for Flash programming and verification.
RST
Reset input. A high on this pin for two machine cycles while the oscillator is running resets
the device.
ALE/PROG
15
Address Latch Enable output pulse for latching the low byte of the address during accesses
to external memory. This pin is also the program pulse input (PROG) during Flash
programming. In normal operation ALE is emitted at a constant rate of 1/6 the oscillator
frequency, and may be used for external timing or clocking purposes. Note, however, that
one ALE pulse is skipped during each access to external Data Memory. If desired, ALE
operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is
active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled
high. Setting the ALE-disable bit has no effect if the microcontroller is in external
execution mode.
PSEN
Program Store Enable is the read strobe to external program memory.
Port Pin Alternate Functions
P3.0 RXD (serial input port)
P3.1 TXD (serial output port)
P3.2 INT0 (external interrupt 0)
P3.3 INT1 (external interrupt 1)
P3.4 T0 (timer 0 external input)
P3.5 T1 (timer 1 external input)
P3.6 WR (external data memory write strobe)
P3.7 RD (external data memory read strobe)
When the AT89C51 is executing code from external program memory, PSEN is activated
twice each machine cycle, except that two PSEN activations are skipped during each
access to external data memory.
EA/VPP
External Access Enable. EA must be strapped to GND in order to enable the device to
fetch code from external program memory locations starting at 0000H up to FFFFH. Note,
however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA
should be strapped to VCC for internal program executions. This pin also receives the 12-
16
volt programming enable voltage (VPP) during Flash programming, for parts that require
12-volt VPP.
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL2
Output from the inverting oscillator amplifier.
Oscillator Characteristics
XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier which
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 as shown in Figure
2.There are no requirements on the duty cycle of the external clock signal, since the input
to the internal clocking circuitry is through a divide-by-two flip-flop, but minimum and
maximum voltage high and low time specifications must be observed.
C1,C2=30PF for crystal
=40PF for ceramic resonator
Figure: external clock drive configuration
Idle Mode
17
In idle mode, the CPU puts itself to sleep while all the on chip peripherals remain active.
The mode is invoked by software. The content of the on-chip RAM and all the special
functions registers remain unchanged during this mode. The idle mode can be terminated
by any enabled
Interrupt or by hardware reset. It should be noted that when idle is terminated by a hard
Hardware reset, the device normally resumes program execution, from where it left off, up
to two machine cycles before the internal reset algorithm takes control. On-chip hardware
inhibits access to internal RAM in this event, but access to the port pins is not inhibited. To
eliminate the possibility of an unexpected write to a port pin when Idle is terminated by
reset, the instruction following the one that invokes Idle should not be one that writes to a
port pin or to external memory.
Status of External Pins during Idle and Power down Modes:
Mode Program Memory ALE PSEN PORT0 PORT1 PORT2 PORT3
Idle Internal 1 Data
Idle External 1 Float Data Address Data
Power down Internal 0 Data
Power down External 0 Float Data
Power down Mode
In the power down mode the oscillator is stopped, and the instruction that invokes power
down is the last instruction executed. The on-chip RAM and Special Function Registers
retain their values until the power down mode is terminated. The only exit from power
down is a hardware reset. Reset redefines the SFRs but does not change the on-chip RAM.
The reset should not be activated before VCC is restored to its normal operating level and
must be held active long enough to allow the oscillator to restart and stabilize.
Program Memory Lock Bits
On the chip are three lock bits which can be left un-programmed (U) or can be
programmed (P) to obtain the additional features listed in the table below:
18
When lock bit 1 is programmed, the logic level at the EA pin is sampled and latched during
reset. If the device is powered up without a reset, the latch initializes to a random value,
and holds that value until reset is activated. It is necessary that the latched value of EA be
in agreement with
The current logic level at that pin in order for the device to function properly.
Lock Bit Protection Modes
Program Lock Bits Protection Type
LB1 LB2 LB3
1 U No program lock features.
2 P U MOVC instructions executed from external program memory are disabled from
fetching code
Bytes from internal memory, EA is sampled and latched on reset, and further programming
of the
Flash is disabled.
3 P U Same as mode 2, also verify is disabled.
4 P same as mode 3, also external execution is disabled.
Programming the Flash
The AT89C51 is normally shipped with the on-chip Flash memory array in the erased state
(that is, contents = FFH) and ready to be programmed. The programming interface accepts
either a high-voltage (12-volt) or a low-voltage (VCC) program enable signal. The low
voltage programming mode provides a convenient way to program the AT89C51 inside the
user’s system, while the high-voltage programming mode is compatible with conventional
third party Flash or EPROM programmers. The AT89C51 is shipped with either the high-
voltage or low-voltage programming mode enabled. The respective top-side marking and
device signature codes are listed in the following table. The AT89C51 code memory array
is programmed byte-by byte
In either programming mode. To program any nonblank byte in the on-chip Flash Memory,
the entire memory must be erased using the Chip Erase Mode.
19
Programming Algorithm:
Before programming the AT89C51, the address, data and control signals should be set up
according to the Flash programming mode table and Figures 3 and 4. To program the
AT89C51, take the following steps.
1. Input the desired memory location on the address lines.
2. Input the appropriate data byte on the data lines.
3. Activate the correct combination of control signals.
4. Raise EA/VPP to 12V for the high-voltage programming mode.
5. Pulse ALE/PROG once to program a byte in the Flash array or the lock bits. The byte-
write cycle is self-timed and typically takes no more than 1.5 ms. Repeat steps 1 through 5,
changing the address and data for the entire array or until the end of the object file is
reached.
Data Polling:
The AT89C51 features Data Polling to indicate the end of a write cycle. During a write
cycle, an attempted read of the last byte written will result in the complement of the written
datum on PO.7. Once the write cycle has been completed, true data are valid on all outputs,
and the next cycle may begin. Data Polling may begin any time after a write cycle has been
initiated.
Ready/Busy:
The progress of byte programming can also be monitored by the RDY/BSY output signal.
P3.4 is pulled low after ALE goes high during programming to indicate BUSY. P3.4 is
pulled high again when programming is done to indicate READY.
Program Verify:
If lock bits LB1 and LB2 have not been programmed, the programmed code data can be
read back via the address and data lines for verification. The lock bits cannot be verified
directly. Verification of the lock bits is achieved by observing that their features are
enabled.
20
Chip Erase:
The entire Flash array is erased electrically by using the proper combination of control
signals and by holding ALE/PROG low for 10 ms. The code array is written with all ―1‖s.
The chip erase operation must be executed before the code memory can be re-programmed.
Reading the Signature Bytes:
The signature bytes are read by the same procedure as a normal verification of locations
030H,
031H, and 032H, except that P3.6 and P3.7 must be pulled to a logic low. The values
returned are as follows.
(030H) = 1EH indicates manufactured by Atmel
(031H) = 51H indicates 89C51
(032H) = FFH indicates 12V programming
(032H) = 05H indicates 5V programming
Programming Interface
Every code byte in the Flash array can be written and the entire array can be erased by
using the appropriate combination of control signals. The write operation cycle is self
timed and once initiated, will automatically time itself to completion. All major
programming vendors offer worldwide support for the Atmel microcontroller series. Please
contact your local programming vendor for the appropriate software revision.
Flash Programming Modes
Note: 1. Chip Erase requires a 10-ms PROG pulse.
21
3.4SPECIAL FUNCTION REGISTER (SFR) ADDRESSES:
ACC ACCUMULATOR 0E0H
B B REGISTER 0F0H
PSW PROGRAM STATUS WORD 0D0H
SP STACK POINTER 81H
DPTR DATA POINTER 2 BYTES
DPL LOW BYTE OF DPTR 82H
DPH HIGH BYTE OF DPTR 83H
P0 PORT0 80H
P1 PORT1 90H
P2 PORT2 0A0H
P3 PORT3 0B0H
TMOD TIMER/COUNTER MODE CONTROL 89H
TCON TIMER COUNTER CONTROL 88H
TH0 TIMER 0 HIGH BYTE 8CH
TLO TIMER 0 LOW BYTE 8AH
TH1 TIMER 1 HIGH BYTE 8DH
TL1 TIMER 1 LOW BYTE 8BH
SCON SERIAL CONTROL 98H
SBUF SERIAL DATA BUFFER 99H
PCON POWER CONTROL 87H
Table 3.4.1
22
3.5 IMPORTANT REGISTERS
TMOD (TIMER MODE) REGISTER
Both timers are the 89c51 share the one register TMOD. 4 LSB bit for the timer 0 and 4
MSB for the timer 1.
In each case lower 2 bits set the mode of the timer
Upper two bits set the operations.
GATE: Gating control when set. Timer/counter is enabled only while the INTX pin
is high and the TRx control pin is set. When cleared, the timer is enabled whenever the
TRx control bit is set
C/T: Timer or counter selected cleared for timer operation (input from internal
system clock)
M1 Mode bit 1
M0 Mode bit 0
M1 M0 MODE OPERATING MODE
0 0 0 13 BIT TIMER/MODE
0 1 1 16 BIT TIMER MODE
1 0 2 8 BIT AUTO RELOAD
1 1 3 SPLIT TIMER MODE
23
PSW (PROGRAM STATUS WORD)
CY PSW.7 CARRY FLAG
AC PSW.6 AUXILIARY CARRY
F0 PSW.5 AVAILABLE FOR THE USER FRO GENERAL PURPOSE
RS1 PSW.4 REGISTER BANK SELECTOR BIT 1
RS0 PSW.3 REGISTER BANK SELECTOR BIT 0
0V PSW.2 OVERFLOW FLAG
-- PSW.1 USER DEFINABLE BIT
P PSW.0 PARITY FLAG SET/CLEARED BY HARDWARE
PCON REGISATER (NON BIT ADDRESSABLE)
If the SMOD = 0 (DEFAULT ON RESET)
TH1 = CRYSTAL FREQUENCY
256---- ____________________
384 X BAUD RATE
If the SMOD IS = 1
CRYSTAL FREQUENCY
TH1 = 256--------------------------------------
192 X BAUD RATE
24
There are two ways to increase the baud rate of data transfer in the 8051
1. To use a higher frequency crystal
2. To change a bit in the PCON register
PCON register is an 8 bit register. Of the 8 bits, some are unused, and some are used for
the power control capability of the 8051. The bit which is used for the serial
communication is D7, the SMOD bit. When the 8051 is powered up, D7 (SMOD BIT) OF
PCON register is zero. We can set it to high by software and thereby double the baud rate
BAUD RATE COMPARISION FOR SMOD = 0 AND SMOD =1
TH1 (DECIMAL) HEX SMOD =0 SMOD =1
-3 FD 9600 19200
-6 FA 4800 9600
-12 F4 2400 4800
-24 E8 1200 2400
XTAL = 11.0592 MHZ
IE (INTERRUPT ENABLE REGISTOR)
EA IE.7 Disable all interrupts if EA = 0, no interrupts is acknowledged
If EA is 1, each interrupt source is individually enabled or disabled
By sending or clearing its enable bit.
IE.6 NOT implemented
ET2 IE.5 enables or disables timer 2 overflag in 89c52 only
ES IE.4 Enables or disables all serial interrupt
ET1 IE.3 Enables or Disables timer 1 overflow interrupt
EX1 IE.2 Enables or disables external interrupt
ET0 IE.1 Enables or Disables timer 0 interrupt.
EX0 IE.0 Enables or Disables external interrupt 0
25
INTERRUPT PRIORITY REGISTER
If the bit is 0, the corresponding interrupt has a lower priority and if the bit is 1 the
corresponding interrupt has a higher priority
IP.7 NOT IMPLEMENTED, RESERVED FOR FUTURE USE.
IP.6 NOT IMPLEMENTED, RESERVED FOR FUTURE USE
PT2 IP.5 DEFINE THE TIMER 2 INTERRUPT PRIORITY LELVEL
PS IP.4 DEFINES THE SERIAL PORT INTERRUPT PRIORITY LEVEL
PT1 IP.3 DEFINES THE TIMER 1 INTERRUPT PRIORITY LEVEL
PX1 IP.2 DEFINES EXTERNAL INTERRUPT 1 PRIORITY LEVEL
PT0 IP.1 DEFINES THE TIMER 0 INTERRUPT PRIORITY LEVEL
PX0 IP.0 DEFINES THE EXTERNAL INTERRUPT 0 PRIORITY LEVEL
SCON: SERIAL PORT CONTROL REGISTER, BIT ADDRESSABLE
SCON
SM0 : SCON.7 Serial Port mode specified
SM1 : SCON.6 Serial Port mode specifier
SM2 : SCON.5
REN : SCON.4 Set/cleared by the software to Enable/disable reception
TB8 : SCON.3 the 9th bit that will be transmitted in modes 2 and 3, Set/cleared
26
By software
RB8 : SCON.2 In modes 2 &3, is the 9th data bit that was received. In mode 1,
If SM2 = 0, RB8 is the stop bit that was received. In mode 0
RB8 is not used
T1 : SCON.1 Transmit interrupt flag. Set by hardware at the end of the 8th bit
Time in mode 0, or at the beginning of the stop bit in the other
Modes. Must be cleared by software
R1 SCON.0 Receive interrupt flag. Set by hardware at the end of the 8th bit
Time in mode 0, or halfway through the stop bit time in the other
Modes. Must be cleared by the software.
TCON : TIMER COUNTER CONTROL REGISTER
This is a bit addressable
TF1 TCON.7 Timer 1 overflows flag. Set by hardware when the Timer/Counter 1
Overflows. Cleared by hardware as processor
TR1 TCON.6 Timer 1 run control bit. Set/cleared by software to turn Timer
Counter 1 On/off
TF0 TCON.5 Timer 0 overflows flag. Set by hardware when the timer/counter 0
Overflows. Cleared by hardware as processor
TR0 TCON.4 Timer 0 run control bit. Set/cleared by software to turn timer
Counter 0 on/off.
IE1 TCON.3 External interrupt 1 edge flag
ITI TCON.2 Interrupt 1 type control bit
IE0 TCON.1 External interrupt 0 edge
IT0 TCON.0 Interrupt 0 type control bit.
27
3.6 INSTRUCTIONS
SINGLE BIT INSTRUCTIONS
SETB BIT SET THE BIT=1
CLR BIT CLEAR THE BIT=0
CPL BIT COMLEMENT THE BIT 0=1,1=0
JB BIT,TARGET JUMP TO TARGET IF BIT=1
JNB BIT,TARGET JUMP TO TARGET IF BIT=0
LBC BIT,TARGET JUMP TO TARGET IF BIT=1&THEN CLEAR THE BIT
MOV INSTRUCTIONS
MOV instructions simply copy the data from one location to another location.
MOV D,C
Copy the data from source(S) to destination(D)
MOV R0,A Copy contents of A into Register R0
MOV R1,A Copy content of Accumulator into Register into R1
MOV A,R3 Copy contents of Register R3 into Accumulator
DIRECT LOADING THROUGH MOV
MOV A,#23H Direct load the value of 23H in A
MOV R0,#12H Direct load the value of 12H in R0
MOV R5,#0F9H Load the F9 value in the Register R5
ADD INSTRUCTIONS
ADD instruction adds the source byte to the accumulator (A) and place the result in the
Accumulator.
ADD A,#42H By this instructions we add the value 42H in
Accumulator(42H+25H)
28
ADD A,R3 By this instructions we move the data from register R3 to
Accumulator and then add the contents of the register into
Accumulator.
JUMP INSTRUCTIONS
AJMP TARGET ADDRESS This is for absolute jump.
AJMP stand for absolute jump. It transfers program execution to the target address
unconditionally.The target address for this instruction must be within 2KB of program
memory.
LJMP is also for absolute jump.It transfers program execution to the target address
unconditionally.This is a 3 byte instruction.LJMP jump to any address within 64 KB
location.
INSTRUCTION RELATED TO CARRY
JC TARGET
JUMP TO THE TARGET IF CY FLAG=1
JNC TARGET
JUMP TO THE TARGET ADDRESS IF CY FLAG=0
JZ TARGET
JUMP TO TARGET IF A=0
JNZ TARGET
JUMP IF ACCUMULATOR IS NOT ZERO
This instruction jump if register A has a value other than zero.
INSTRUCTIONS RELATED TO THE ROTATE
RL A
ROTATE LEFT THE ACCUMULATOR.
By this instruction we rotate the bits of A left. The bits rotated out of A are rotated back
into A at the opposite end.
29
RR A
By this instruction we rotate the contents of the accumulator from right to left from LSB to
MSB.
RRC A
This is same as RR A but difference is that the bit rotated out of register first enter into
carry and then enter into MSB.
RLC A
ROTATE A LEFT THROUGH CARRY.
Same as above but shift the data from MSB to carry and carry to LSB.
RET
This is return from subroutine.This instructions s used to return from a subroutine
previously entered by instructions LCALL and ACALL.
RET1
This is used at the end of an interrupt service routine.We use this instructions after
interrupt routine.
PUSH
This copies the indicated byte onto the stack and increments Sp by 1.This instructions
supports only direct addressing mode.
POP
POP FROM STACK
This copies the byte pointed to be SP to the location whose direct address is indicated, and
decrements SP by 1.Notice that this instruction supports only direct addressing mode.
DPTR INSTRUCTIONS
MOV DPTR,#16 BIT VALUE
LOAD DATA POINTER
This instruction load the 16 bit DPTR register with a 16 bit immediate value.
30
MOV C A,@A+DPTR
This instructions moves a byte of data located in program ROM into register A.This allows
us to put strings of data,such as look up table elements.
MOVC A,@A+PC
This instructions moves a byte of data located in the program area to A.The address of the
desired byte of data is formed by adding the program counter(PC) register to the original
value of the accumulator.
INC BYTE
This instructions add 1 to the register or memory location specified by the operand.
31
CHAPTER 4
LM339 IC
In electronics, a comparator is a device which compares two voltages or currents and
switches its output to indicate which is larger.
4.1INPUT VOLTAGE RANGE
The input voltages must not exceed the power voltage range:
In the case of TTL/CMOS logic output comparators, negative inputs are not allowed:
OP-AMP IMPLEMENTATION OF VOLTAGE COMPARATOR
An operational amplifier has a well balanced difference input and a very high gain. The
parallels in the characteristics allows the op-amps to serve as comparators in some
functions.
A standard op-amp operating in open loop configuration (without negative feedback) can
be used as a comparator. When the non-inverting input (V+) is at a higher voltage than the
32
inverting input (V-), the high gain of the op-amp causes it to output the most positive
voltage it can. When the non-inverting input (V+) drops below the inverting input (V-), the
op-amp outputs the most negative voltage it can. Since the output voltage is limited by the
supply voltage, for an op-amp that uses a balanced, split supply, (powered by ± VS) this
action can be written:
where sgn(x) is the sign function. Generally, the positive and negative supplies VS will not
match absolute value:
when else when
In practice, using an operational amplifier as a comparator presents several disadvantages
as compared to using a dedicated comparator
Opamps are designed to operate in the linear mode with negative feedback. Hence, an
opamp typically has a lengthy recovery time from saturation. Almost all opamps have an
internal compensation capacitor which imposes slew rate limitations for high frequency
signals. Consequently an opamp makes a sloppy comparator with propagation delays that
can be as slow as tens of microseconds.
Since opamps do not have any internal hysteresis an external hysteresis network is always
necessary for slow moving input signals.
The quiescent current specification of an opamp is valid only when the feedback is active.
Some opamps show an increased quiescent current when the inputs are not equal.
A comparator is designed to produce well limited output voltages that easily interface with
digital logic. Compatibility with digital logic must be verified while using an opamp as a
comparator.
33
PHYSICAL APPEARANCE
4.2DEDICATED VOLTAGE AND COMPARATOR CHIPS
A dedicated voltage comparator will generally be faster than a general-purpose operational
amplifier (op-amp) pressed into service as a comparator. A dedicated voltage comparator
may also contain additional features such as an accurate, internal voltage reference, an
adjustablehysteresis and a clock gated input.
A dedicated voltage comparator chip such as LM339 is designed to interface with a digital
logic interface (to a TTL or a CMOS). The output is a binary state often used to interface
real world signals to digital circuitry (see analog to digital converter). If there is a fixed
voltage source from, for example, a DC adjustable device in the signal path, a comparator
is just the equivalent of a cascade of amplifiers. When the voltages are nearly equal, the
output voltage will not fall into one of the logic levels, thus analog signals will enter the
digital domain with unpredictable results. To make this range as small as possible, the
amplifier cascade is high gain. The circuit consists of mainly Bipolar transistors except
perhaps in the beginning stage which will likely be field effect transistors. For very high
frequencies, the input impedance of the stages is low. This reduces the saturation of the
slow, large P-N junction bipolar transistors that would otherwise lead to long recovery
34
times. Fast small Schottky diodes, like those found in binary logic designs, improve the
performance significantly though the performance still lags that of circuits with amplifiers
using analog signals. Slew rate has no meaning for these devices. For applications in flash
ADCs the distributed signal across 8 ports matches the voltage and current gain after each
amplifier, and resistors then behave as level-shifters.
The LM339 accomplishes this with an open collector output. When the inverting input is at
a higher voltage than the non inverting input, the output of the comparator connects to the
negative power supply. When the non inverting input is higher than the inverting input, the
output is floating.
35
CHAPTER 5
OTHER IMPORTANT COMPONENTS
5.1 DYNAMO A dynamo, originally another name for an electrical generator, now means a generator that
produces direct current with the use of a commutator. Dynamos were the first electrical
generators capable of delivering power for industry, and the foundation upon which many
other later electric-power conversion devices were based, including the electric motor, the
alternating-current alternator, and the rotary converter. They are rarely used for power
generation now because of the dominance of alternating current, the disadvantages of the
commutator, and the ease of converting alternating to direct current using solid
state methods.
The word still has some regional usage as a replacement for the word generator. A small
electrical generator built into the hub of a bicycle wheel to power lights is called a Hub
dynamo, although these are invariably AC devices.
DESCRIPTION
The dynamo uses rotating coils of wire and magnetic fields to convert mechanical rotation
into a pulsing direct electric current through Faraday's law. A dynamo machine consists of
a stationary structure, called the stator, which provides a constant magnetic field, and a set
of rotating windings called the armature which turn within that field. On small machines
the constant magnetic field may be provided by one or more permanent magnets; larger
machines have the constant magnetic field provided by one or more electromagnets, which
are usually called field coils.
PHYSICAL APPEARANCE
36
The commutator was needed to produce direct current. When a loop of wire rotates in a
magnetic field, the potential induced in it reverses with each half turn, generating an
alternating current. However, in the early days of electric experimentation, alternating
current generally had no known use. The few uses for electricity, such as electroplating,
used direct current provided by messy liquid batteries. Dynamos were invented as a
replacement for batteries. The commutator is a set of contacts mounted on the machine's
shaft, which reverses the connection of the windings to the external circuit when the
potential reverses, so instead of alternating current, a pulsing direct current is produced.
37
5.2 PHOTODIODE
A photodiode is a type of photo detector capable of converting light into either current or
voltage, depending upon the mode of operation.
Photodiodes are similar to regular semiconductor diodes except that they may be either
exposed (to detect vacuum UV or X-rays) or packaged with a window or optical
fiber connection to allow light to reach the sensitive part of the device. Many diodes
designed for use specifically as a photodiode will also use a PIN junction rather than the
typical PN junction.
PRINCIPLE OF OPERATION
A photodiode is a PN junction or PIN structure. When a photon of sufficient energy strikes
the diode, it excites an electron, thereby creating a mobile electron and a positively charged
electron hole. If the absorption occurs in the junction's depletion region, or one diffusion
length away from it, these carriers are swept from the junction by the built-in field of the
depletion region. Thus holes move toward the anode, and electrons toward the cathode, and
a photocurrent is produced.
PHOTOVOLTAIC MODE
When used in zero bias or photovoltaic mode, the flow of photocurrent out of the device is
restricted and a voltage builds up. The diode becomes forward biased and "dark current"
begins to flow across the junction in the direction opposite to the photocurrent. This mode
is responsible for the photovoltaic effect, which is the basis for solar cells—in fact, a solar
cell is just a large area photodiode.
38
PHOTOCONDUCTIVE MODE
In this mode the diode is often reverse biased, dramatically reducing the response time at
the expense of increased noise. This increases the width of the depletion layer, which
decreases the junction's capacitance resulting in faster response times. The reverse bias
induces only a small amount of current (known as saturation or back current) along its
direction while the photocurrent remains virtually the same. The photocurrent is linearly
proportional to the illuminance. Although this mode is faster, the photovoltaic mode tends
to exhibit less electronic noise. The leakage current of a good PIN diode is so low (< 1nA)
that the Johnson–Nyquist noise of the load resistance in a typical circuit often dominates.
OTHER MODES OF OPERATION
Avalanche photodiodes have a similar structure to regular photodiodes, but they are
operated with much higher reverse bias. This allows each photo-generated carrier to be
multiplied by avalanche breakdown, resulting in internal gain within the photodiode, which
increases the effective responsivity of the device.
Phototransistors also consist of a photodiode with internal gain. A phototransistor is in
essence nothing more than a bipolar transistor that is encased in a transparent case so that
light can reach the base-collector junction. The electrons that are generated by photons in
the base-collector junction are injected into the base, and this photodiode current is
amplified by the transistor's current gain β (or hfe). Note that while phototransistors have a
higher responsivity for light they are not able to detect low levels of light any better than
photodiodes. Phototransistors also have slower response times. A simple model of a
phototransistor, would be a forward biased LED (emitter–base) and a reverse biased
photodiode (base–collector) sharing an anode (base) in a single package such that 99%
(αF%) of the light emitted by the led is absorbed by the photodiode. Each electron-hole
recombination in the LED produces one photon and each photon absorbed by the
photodiode produces one electron-hole pair.
FEATURES:
Critical performance parameters of a photodiode include:
39
Responsivity
The ratio of generated photocurrent to incident light power, typically expressed
in A/W when used in photoconductive mode. The responsivity may also be expressed as
a quantum efficiency, or the ratio of the number of photogenerated carriers to incident
photons and thus a unitless quantity.
Dark Current
The current through the photodiode in the absence of light, when it is operated in
photoconductive mode. The dark current includes photocurrent generated by background
radiation and the saturation current of the semiconductor junction. Dark current must be
accounted for by calibration if a photodiode is used to make an accurate optical power
measurement, and it is also a source of noisewhen a photodiode is used in an optical
communication system.
Noise-Equivalent Power
(NEP) The minimum input optical power to generate photocurrent, equal to the rms noise
current in a 1 hertz bandwidth. The related characteristic detectivity (D) is the inverse of
NEP, 1/NEP; and the specific detectivity ( ) is the detectivity normalized to the area (A)
of the photodetector, . The NEP is roughly the minimum detectable input
power of a photodiode.
40
When a photodiode is used in an optical communication system, these parameters
contribute to the sensitivity of the optical receiver, which is the minimum input power
required for the receiver to achieve a specified bit error ratio.
41
5.3 RECHARGEABLE BATTERY:
A rechargeable battery (also known as a storage battery) is a group of one or more
secondary cells. Rechargeable batteries use electrochemical reactions that are electrically
reversible. Rechargeable batteries come in many different sizes and use different
combinations of chemicals. Commonly used secondary cell ("rechargeable battery")
chemistries are lead acid, nickel cadmium (NiCd), nickel metal hydride (NiMH), lithium
ion (Li-ion), and lithium ion polymer (Li-ion polymer).
Rechargeable batteries can offer economic and environmental benefits compared to
disposable batteries. Some rechargeable battery types are available in the same sizes as
disposable types (eg. AA, AAA, CR123A). While the rechargeable cells have a higher
initial cost, rechargeable batteries can be recharged many times. Proper selection of a
rechargeable battery system can reduce toxic materials sent to landfills compared to an
equivalent series of disposable batteries. For example, battery manufacturers of NiMH
rechargeable batteries claim a service life of 100-1000 charge cycles for their batteries.
An electrical battery is a combination of one or more electrochemical cells, used to convert
stored chemical energy into electrical energy. Since the invention of the first Voltaic pile in
1800 by Alessandro Volta, the battery has become a common power source for many
household and industrial applications. According to a 2005 estimate, the worldwide battery
industry generates US$48billion in sales each year, with 6% annual growth.
Batteries may be used once and discarded, or recharged for years as in standby power
applications. Miniature cells are used to power devices such as hearing aids and
wristwatches; larger batteries provide standby power for telephone exchanges or computer
data centers.
PHYSICAL APPEARENCE
42
WORKING:
A battery is a device that converts chemical energy directly to electrical energy. It consists
of a number of voltaic cells; each voltaic cell consists of two half cells connected in series
by a conductive electrolyte containing anions and cations. One half-cell includes
electrolyte and the electrode to which anions (negatively-charged ions) migrate, i.e.,
the anode or negative electrode; the other half-cell includes electrolyte and the electrode to
which cations (positively-charged ions) migrate, i.e., the cathode or positive electrode. In
the redox reaction that powers the battery, reduction (addition of electrons) occurs to
cations at the cathode, while oxidation (removal of electrons) occurs to anions at the
anode. The electrodes do not touch each other but are electrically connected by
the electrolyte. Many cells use two half-cells with different electrolytes. In that case each
half-cell is enclosed in a container, and a separator that is porous to ions but not the bulk of
the electrolytes prevents mixing.
Each half cell has an electromotive force (or emf), determined by its ability to drive
electric current from the interior to the exterior of the cell. The net emf of the cell is the
difference between the emfs of its half-cells, as first recognized by Volta. Therefore, if the
electrodes have emfs and , then the net emf is ; in other words, the net emf
is the difference between the reduction potentials of the half-reactions.
The electrical driving force or across the terminals of a cell is known as
the terminal voltage (difference) and is measured involts. The terminal voltage of a cell
that is neither charging nor discharging is called the open-circuit voltage and equals the
emf of the cell. Because of internal resistance the terminal voltage of a cell that is
discharging is smaller in magnitude than the open-circuit voltage and the terminal voltage
of a cell that is charging exceeds the open-circuit voltage. An ideal cell has negligible
internal resistance, so it would maintain a constant terminal voltage of until exhausted,
then dropping to zero. If such a cell maintained 1.5 volts and stored a charge of
one Coulomb then on complete discharge it would perform 1.5 Joule of work. In actual
cells, the internal resistance increases under discharge, and the open circuit voltage also
decreases under discharge. If the voltage and resistance are plotted against time, the
resulting graphs typically are a curve; the shape of the curve varies according to the
chemistry and internal arrangement employed.
43
As stated above, the voltage developed across a cell's terminals depends on the energy
release of the chemical reactions of its electrodes and electrolyte. Alkaline and carbon-
zinc cells have different chemistries but approximately the same emf of 1.5 volts;
likewise NiCd and NiMH cells have different chemistries, but approximately the same emf
of 1.2 volts. On the other hand the high electrochemical potential changes in the reactions
of lithium compounds give lithium cells emfs of 3 volts or more
44
5.4 LIGHT EMITTING DIODE
A light-emitting diode (LED) (pronounced /ˌɛl.iːˈdiː/) is a semiconductor light source.
LEDs are used as indicator lamps in many devices, and are increasingly used for lighting.
Introduced as a practical electronic component in 1962, early LEDs emitted low-intensity
red light,but modern versions are available across
the visible, ultraviolet and infrared wavelengths, with very high brightness.
The LED is based on the semiconductor diode. When a diode is forward biased (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 gap of the
semiconductor. An LED is usually small in area (less than 1 mm2), and integrated optical
components are used to shape its radiation pattern and assist in reflection. LEDs present
many advantages over incandescent light sources including lower energy consumption,
longer lifetime, improved robustness, smaller size, faster switching, and greater durability
and reliability. However, they are relatively expensive and require more
precise current and heat management than traditional light sources. Current LED products
for general lighting are more expensive to buy than fluorescent lamp sources of
comparable output.
They also enjoy use in applications as diverse as replacements for traditional light sources
in automotive lighting (particularly indicators) and intraffic signals. Airbus has used LED
lighting in their A320 Enhanced since 2007, and Boeing plans its use in the 787. The
compact size of LEDs has allowed new text and video displays and sensors to be
developed, while their high switching rates are useful in advanced communications
technology.
PHYSICAL APPEARENCE
45
TECHNOLOGY
Physics
Like a normal diode, the LED consists of a chip of semiconducting material doped with
impurities to create a p-n junction. As in other diodes, current flows easily from the p-side,
or anode, to the n-side, or cathode, but not in the reverse direction. Charge-carriers—
electrons and holes—flow into the junction from electrodes with different voltages. When
an electron meets a hole, it falls into a lower energy level, and releases energy in the form
of a photon.
The wavelength of the light emitted, and therefore its color, depends on the band
gap energy of the materials forming the p-n junction. In silicon or germanium diodes, the
electrons and holes recombine by a non-radiative transition which produces no optical
emission, because these are indirect band gap materials. The materials used for the LED
have a direct band gap with energies corresponding to near-infrared, visible or near-
ultraviolet light.
LED development began with infrared and red devices made with gallium arsenide.
Advances in materials science have made possible the production of devices with ever-
shorter wavelengths, producing light in a variety of colors.
LEDs are usually built on an n-type substrate, with an electrode attached to the p-type layer
deposited on its surface. P-type substrates, while less common, occur as well. Many
commercial LEDs, especially GaN/InGaN, also use sapphire substrate.
Most materials used for LED production have very high refractive indices. This means that
much light will be reflected back into the material at the material/air surface interface.
Therefore Light extraction in LEDs is an important aspect of LED production, subject to
much research and development.
46
Efficiency and Operational Parameters
Typical indicator LEDs are designed to operate with no more than 30–60 milliwatts [mW]
of electrical power. Around 1999, Philips Lumileds introduced power LEDs capable of
continuous use at one watt [W]. These LEDs used much larger semiconductor die sizes to
handle the large power inputs. Also, the semiconductor dies were mounted onto metal
slugs to allow for heat removal from the LED die.
One of the key advantages of LED-based lighting is its high efficiency, as measured by its
light output per unit power input. White LEDs quickly matched and overtook the
efficiency of standard incandescent lighting systems. In 2002, Lumileds made five-watt
LEDs available with a luminous efficacy of 18–22 lumens per watt [lm/W]. For
comparison, a conventional 60–100 W incandescent lightbulb produces around 15 lm/W,
and standard fluorescent lights produce up to 100 lm/W. A recurring problem is that
efficiency will fall dramatically for increased current. This effect is known as droop and
effectively limits the light output of a given LED, increasing heating more than light output
for increased current.
47
In September 2003, a new type of blue LED was demonstrated by the company Cree,
Inc. to provide 24 mW at 20 milliamperes[mA]. This produced a commercially packaged
white light giving 65 lm/W at 20 mA, becoming the brightest white LED commercially
available at the time, and more than four times as efficient as standard incandescents. In
2006 they demonstrated a prototype with a record white LED luminous efficacy of 131
lm/W at 20 mA. Also, Seoul Semiconductor has plans for 135 lm/W by 2007 and 145
lm/W by 2008, which would be approaching an order of magnitude improvement over
standard incandescents and better even than standard fluorescents. Nichia Corporation has
developed a white LED with luminous efficacy of 150 lm/W at a forward current of 20
mA.
It should be noted that high-power (≥ 1 W) LEDs are necessary for practical general
lighting applications. Typical operating currents for these devices begin at 350 mA.
Note that these efficiencies are for the LED chip only, held at low temperature in a lab. In a
lighting application, operating at higher temperature and with drive circuit losses,
efficiencies are much lower. United States Department of Energy (DOE) testing of
commercial LED lamps designed to replace incandescent lamps or CFLs showed that
48
average efficacy was still about 46 lm/W in 2009 (tested performance ranged from
17 lm/W to 79 lm/W)
Cree issued a press release on February 3, 2010 about a laboratory prototype LED
achieving 208 lumens per watt at room temperature. The correlated color temperature was
reported to be 4579 K.
Lifetime and Failure
Solid state devices such as LEDs are subject to very limited wear and tear if operated at
low currents and at low temperatures. Many of the LEDs produced in the 1970s and 1980s
are still in service today. Typical lifetimes quoted are 25,000 to 100,000 hours but heat and
current settings can extend or shorten this time significantly.
The most common symptom of LED (and diode laser) failure is the gradual lowering of
light output and loss of efficiency. Sudden failures, although rare, can occur as well. Early
red LEDs were notable for their short lifetime. With the development of high-power LEDs
the devices are subjected to higher junction temperatures and higher current densities than
traditional devices. This causes stress on the material and may cause early light output
degradation. To quantitatively classify lifetime in a standardized manner it has been
suggested to use the terms L75 and L50 which is the time it will take a given LED to reach
75% and 50% light output respectively. L50 is equivalent to the half-life of the LED.
Like other lighting devices, LED performance is temperature dependent. Most
manufacturers’ published ratings of LEDs are for an operating temperature of 25°C. LEDs
used outdoors, such as traffic signals or in-pavement signal lights, and that are utilized in
climates where the temperature within the luminaire gets very hot, could result in low
signal intensities or even failure.
LEDs maintain consistent light output even in cold temperatures, unlike traditional lighting
methods. Consequently, LED technology may be a good replacement in areas such as
supermarket freezer lighting and will last longer than other technologies. Because LEDs do
not generate as much heat as incandescent bulbs, they are an energy-efficient technology to
use in such applications such as freezers. On the other hand, because they do not generate
much heat, ice and snow may build up on the LED luminaire in colder climates. This has
been a problem plaguing airport runway lighting, although some research has been done to
try to develop heat sink technologies in order to transfer heat to alternative areas of the
luminaire.
49
5.5 PASSIVE INFRARED SENSOR
A Passive InfraRed sensor (PIR sensor) is an electronic device that measures infrared (IR)
light radiating from objects in its field of view. PIR sensors are often used in the
construction of PIR-based motion detectors . Apparent motion is detected when an infrared
source with one temperature, such as a human, passes in front of an infrared source with
another temperature, such as a wall.
All objects emit what is known as black body radiation. It is usually infrared radiation that
is invisible to the human eye but can be detected by electronic devices designed for such a
purpose. The term passive in this instance means that the PIR device does not emit an
infrared beam but merely passively accepts incoming infrared radiation.
Design
Infrared radiation enters through the front of the sensor, known as the sensor face. At the
core of a PIR sensor is a solid state sensor or set of sensors, made from an approximately
1/4 inch square of natural or artificial pyroelectric materials, usually in the form of a thin
film, out of gallium nitride (GaN), caesium nitrate (CsNO3), polyvinyl fluorides,
derivatives of phenylpyrazine, and cobalt phthalocyanine. Lithium tantalate (LiTaO3) is a
crystal exhibiting both piezoelectric and pyroelectric properties.
The sensor is often manufactured as part of an integrated circuit and may consist of one
(1), two (2) or four (4) 'pixels' of equal areas of the pyroelectric material. Pairs of the
sensor pixels may be wired as opposite inputs to a differential amplifier. In such a
configuration, the PIR measurements cancel each other so that the average temperature of
the field of view is removed from the electrical signal; an increase of IR energy across the
entire sensor is self-cancelling and will not trigger the device. This allows the device to
resist false indications of change in the event of being exposed to flashes of light or field-
wide illumination. (Continuous bright light could still saturate the sensor materials and
render the sensor unable to register further information.) At the same time, this differential
arrangement minimizes common-mode interference, allowing the device to resist
triggering due to nearby electric fields. However, a differential pair of sensors cannot
measure temperature in that configuration and therefore this configuration is specialized
for motion detectors,
50
A person entering a monitored area is detected when the infrared energy emitted from the
intruder's body is focused by a Fresnel lens or a mirror segment and overlaps a section on
the chip that had previously been looking at some much cooler part of the protected area.
That portion of the chip is now much warmer than when the intruder wasn't there. As the
intruder moves, so does the hot spot on the surface of the chip. This moving hot spot
causes the electronics connected to the chip to de-energize the relay, operating its contacts,
thereby activating the detection input on the alarm control panel. Conversely, if an intruder
were to try to defeat a PID, perhaps by holding some sort of thermal shield between
himself and the PID, a corresponding 'cold' spot moving across the face of the chip will
also cause the relay to de-energize — unless the thermal shield has the same temperature
as the objects behind it.
Manufacturers recommend careful placement of their products to prevent false (non-
intruder caused) alarms. They suggest mounting the PIDs in such a way that the PID
cannot 'see' out of a window. Although the wavelength of infrared radiation to which the
chips are sensitive does not penetrate glass very well, a strong infrared source such as from
a vehicle headlight or sunlight reflecting from a vehicle window can overload the chip with
enough infrared energy to fool the electronics and cause a false alarm. A person moving on
the other side of the glass however would not be 'seen' by the PI
51
5.6 COUNTER
In digital logic and computing, a counter is a device which stores (and sometimes displays)
the number of times a particular event or process has occurred, often in relationship to a
clock signal. In practice, there are two types of counters:
up counters, which increase (increment) in value
down counters, which decrease (decrement) in value
Up–Down Counter
A counter that can change state in either direction, under control an up–down selector
input, is known as an up–down counter. When the selector is in the up state, the counter
increments its value; when the selector is in the down state, the counter decrements the
count.
In computability theory, a counter is considered a type of memory. A counter stores a
single natural number (initially zero) and can be arbitrarily many digits long. A counter is
usually considered in conjunction with a finite state machine (FSM), which can perform
the following operations on the counter:
Check whether the counter is zero
Increment the counter by one
Decrement the counter by one (if it's already zero, this leaves it unchanged).
52
5.7 REGULATOR
The 78xx (also sometimes known as LM78xx) series of devices is a family of self-
contained fixed linear voltage regulator integrated circuits. The 78xx family is a very
popular choice for many electronic circuits which require a regulated power supply, due to
their ease of use and relative cheapness. When specifying individual ICs within this family,
the xx is replaced with a two-digit number, which indicates the output voltage the
particular device is designed to provide (for example, the 7805 has a 5 volt output, while
the 7812 produces 12 volts). The 78xx line are positive voltage regulators, meaning that
they are designed to produce a voltage that is positive relative to a common ground. There
is a related line of 79xxdevices which are complementary negative voltage regulators.
78xx and 79xx ICs can be used in combination to provide both positive and negative
supply voltages in the same circuit, if necessary.
78xx ICs have three terminals and are most commonly found in the TO220 form factor,
although smaller surface-mount and larger TO3 packages are also available from some
manufacturers. These devices typically support an input voltage which can be anywhere
from a couple of volts over the intended output voltage, up to a maximum of 35 or 40
volts, and can typically provide up to around 1 or 1.5 amps of current (though smaller or
larger packages may have a lower or higher current rating).
PHYSICAL APPEARANCE
The 7805 series has several key advantages over many other voltage regulator circuits
which have resulted in its popularity:
53
7805 series ICs do not require any additional components to provide a constant,
regulated source of power, making them easy to use, as well as economical, and
also efficient uses of circuit board real estate. By contrast, most other voltage
regulators require several additional components to set the output voltage level, or
to assist in the regulation process. Some other designs (such as a switching power
supply) can require not only a large number of components but also substantial
engineering expertise to implement correctly as well.
78xx series ICs have built-in protection against a circuit drawing too much power.
They also have protection against overheating and short-circuits, making them
quite robust in most applications. In some cases, the current-limiting features of the
78xx devices can provide protection not only for the 78xx itself, but also for other
parts of the circuit it is used in, preventing other components from being damaged
as well.
54
5.8 CAPACITOR
A capacitor or condenser is a passive electronic component consisting of a pair
of conductors separated by a dielectric (insulator). When a potential difference (voltage)
exists across the conductors, an electric field is present in the dielectric. This field
stores energy and produces a mechanical force between the conductors. The effect is
greatest when there is a narrow separation between large areas of conductor, hence
capacitor conductors are often called plates.
An ideal capacitor is characterized by a single constant value, capacitance, which is
measured in farads. This is the ratio of the electric charge on each conductor to the
potential difference between them. In practice, the dielectric between the plates passes a
small amount ofleakage current. The conductors and leads introduce an equivalent series
resistance and the dielectric has an electric field strength limit resulting in a breakdown
voltage.
Capacitors are widely used in electronic circuits to block the flow of direct current while
allowing alternating current to pass, to filter out interference, to smooth the output
of power supplies, and for many other purposes. They are used in resonant circuits in radio
frequency equipment to select particular frequencies from a signal with many frequencies.
PHYSICAL APPEARANCE
A capacitor consists of two conductors separated by a non-conductive region. The non-
conductive substance is called the dielectric medium, although this may also mean
a vacuum or a semiconductor depletion regionchemically identical to the conductors. A
55
capacitor is assumed to be self-contained and isolated, with no netelectric charge and no
influence from an external electric field. The conductors thus contain equal and opposite
charges on their facing surfaces, and the dielectric contains an electric field. The capacitor
is a reasonably general model for electric fields within electric circuits.
An ideal capacitor is wholly characterized by a constant capacitance C, defined as the ratio
of charge ±Q on each conductor to the voltage V between them:
Sometimes charge buildup affects the mechanics of the capacitor, causing the capacitance
to vary. In this case, capacitance is defined in terms of incremental changes:
In SI units, a capacitance of one farad means that one coulomb of charge on each
conductor causes a voltage of one volt across the device.
Energy Storage
Work must be done by an external influence to move charge between the conductors in a
capacitor. When the external influence is removed, the charge separation persists and
energy is stored in the electric field. If charge is later allowed to return to
its equilibrium position, the energy is released. The work done in establishing the electric
field, and hence the amount of energy stored, is given by:
56
5.9 RESISTER A resistor is a two-terminal electronic component that produces a voltage across its
terminals that is proportional to the electric currentpassing through it in accordance
with Ohm's law:
V = IR
Resistors are elements of electrical networks and electronic circuits and are ubiquitous in
most 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.
The primary characteristics of a resistor are the resistance, the tolerance, maximum
working voltage and the power rating. Other characteristics include temperature
coefficient, noise, and inductance. Less well-known is critical resistance, the value below
which power dissipation limits the maximum permitted current flow, and above which the
limit is applied voltage. Critical resistance depends upon the materials constituting the
resistor as well as its physical dimensions; it's determined by design.
Resistors can be integrated into hybrid and printed circuits, as well as integrated circuits.
Size, and position of leads (or terminals) are relevant to equipment designers; resistors
must be physically large enough not to overheat when dissipating their power.
PHYSICAL APPEARANCE
Four-band resistors
Four-band identification is the most commonly used color-coding scheme on resistors. It
consists of four colored bands that are painted around the body of the resistor. The first two
bands encode the first two significant digits of the resistance value, the third is a power-of-
ten multiplier or number-of-zeroes, and the fourth is the tolerance accuracy, or acceptable
error, of the value. The first three bands are equally spaced along the resistor; the spacing
to the fourth band is wider. Sometimes a fifth band identifies the thermal coefficient, but
this must be distinguished from the true 5-color system, with 3 significant digits.
Each color corresponds to a certain digit, progressing from darker to lighter colors, as
shown in the chart below.
57
Color 1st band 2
nd band
3rd
band
(multiplier)
4th band
(tolerance)
Temp.
Coefficient
Black 0 0 ×100
Brown 1 1 ×101 ±1% (F) 100 ppm
Red 2 2 ×102 ±2% (G) 50 ppm
Orange 3 3 ×103
15 ppm
Yellow 4 4 ×104
25 ppm
Green 5 5 ×105 ±0.5% (D)
Blue 6 6 ×106 ±0.25% (C)
Violet 7 7 ×107 ±0.1% (B)
Gray 8 8 ×108 ±0.05% (A)
White 9 9 ×109
Gold
×10−1
±5% (J)
Silver
×10−2
±10% (K)
None
±20% (M)
Table 5.9.1
58
5.10 SEVEN SEGMENT DISPLAY
A seven-segment display (abbreviation: "7-seg(ment) display"), less commonly known as
a seven-segment indicator, is a form of electronic display device for displaying decimal
numerals that is an alternative to the more complex dot-matrix displays. Seven-segment
displays are widely used in digital clocks, electronic meters, and other electronic devices
for displaying numerical information.
PHYSICAL APPEARANCE
A seven segment display, as its name indicates, is composed of seven elements.
Individually on or off, they can be combined to produce simplified representations of
the arabic numerals. Often the seven segments are arranged in an oblique (slanted)
arrangement, which aids readability.
Each of the numbers 0, 6, 7 and 9 may be represented by two or more different glyphs on
seven-segment displays.
59
The seven segments are arranged as a rectangle of two vertical segments on each side with
one horizontal segment on the top, middle, and bottom. Additionally, the seventh segment
bisects the rectangle horizontally. There are also fourteen-segment displays andsixteen-
segment displays (for full alphanumerics); however, these have mostly been replaced
by dot-matrix displays.
The segments of a 7-segment display are referred to by the letters A to G, as shown to the
right, where the optional DP decimal point(an "eighth segment") is used for the display of
non-integer numbers.
The animation to the left cycles through the common glyphs of the ten decimal numerals
and the six hexadecimal "letter digits" (A–F). It is an image sequence of a "LED" display,
which is described technology-wise in the following section. Notice the variation between
uppercase and lowercase letters for A–F; this is done to obtain a unique, unambiguous
shape for each letter.
Seven-segment displays may use liquid crystal display (LCD), arrays of light-emitting
diodes (LEDs), and other light-generating or controlling techniques such as
cold cathode gas discharge, vacuum fluorescent, incandescent filaments, and others.
For gasoline price totems and other large signs, vane displays made up of
electromagnetically flipped light-reflecting segments (or "vanes") are still commonly used.
An alternative to the 7-segment display in the 1950s through the 1970s was the cold-
cathode, neon-lamp-like nixie tube. Starting in 1970, RCA sold a display device known as
the Numitron that used incandescent filaments arranged into a seven-segment display.
In a simple LED package, each LED is typically connected with one terminal to its own
pin on the outside of the package and the other LED terminal connected in common with
all other LEDs in the device and brought out to a shared pin. This shared pin will then
make up all of the cathodes (negative terminals) OR all of the anodes (positive terminals)
of the LEDs in the device; and so will be either a "Common Cathode" or "Common
Anode" device depending how it is constructed. Hence a 7 segment plus DP package will
only require nine pins to be present and connected.
Seven segments are, effectively, the fewest required to represent each of the ten Hindu-
Arabic numerals with a distinct and recognizable glyph. Bloggers have experimented with
six-segment and even five-segment displays with such novel shapes as curves, angular
blocks and serifs for segments; however, these often require complicated and/or non-
uniform shapes and sometimes create unrecognizable glyphs.
60
NUMBERS TO 7 SEGMENT CODE
A single byte can encode the full state of a 7-segment-display. The most popular bit
encodings are gfedcba and abcdefg - both usually assume 0 is off and 1 is on.
This table gives the hexadecimal encodings for displaying the digits 0 to 9:
Table 5.10.1
Digit gfedcba abcdefg a b c d E f g
0 0x3F 0x7E on on on on On on off
1 0x06 0x30 off on on off off off off
2 0x5B 0x6D on on off on On off on
3 0x4F 0x79 on on on on off off on
4 0x66 0x33 off on on off off on on
5 0x6D 0x5B on off on on off on on
6 0x7D 0x5F on off on on On on on
7 0x07 0x70 on on on off off off off
8 0x7F 0x7F on on on on On on on
9 0x6F 0x7B on on on on off on on
61
5.11 PHOTORESISTOR
A photoresistor or light dependent resistor or cadmium sulfide (CdS) cell is
a resistor whose resistance decreases with increasing incident light intensity. It can also be
referred to as a photoconductor.
A photoresistor is made of a high resistance semiconductor. If light falling on the device is
of high enough frequency, photons absorbed by the semiconductor give
bound electrons enough energy to jump into the conduction band. The resulting free
electron (and its hole partner) conduct electricity, thereby lowering resistance.
A photoelectric device can be either intrinsic or extrinsic. An intrinsic semiconductor has
its own charge carriers and is not an efficient semiconductor, e.g. silicon. In intrinsic
devices the only available electrons are in the valence band, and hence the photon must
have enough energy to excite the electron across the entire bandgap. Extrinsic devices have
impurities, also called dopants, added whose ground state energy is closer to the
conduction band; since the electrons do not have as far to jump, lower energy photons (i.e.,
longer wavelengths and lower frequencies) are sufficient to trigger the device. If a sample
of silicon has some of its atoms replaced by phosphorus atoms (impurities), there will be
extra electrons available for conduction. This is an example of an extrinsic semiconductor.
62
5.12Diode
Diodes allow electricity to flow in only one direction. The arrow of the circuit symbol
shows the direction in which the current can flow. Diodes are the electrical version of a
valve and early diodes were actually called valves.
Physical Appearance of Diode
The diode also isn't perfect in the forward conduction direction. When passing a current
from anode to cathode, there will be a small voltage drop across the PN junction. This is
typically around 0.7v for silicon diodes and around 0.4v for germanium diodes. This is
why germanium diodes often still appear in low level audio circuits and similar items even
though silicon is a far superior material in terms of thermal stability and reliability. The
forward voltage drop of the diode must be taken into account when using it as a rectifier in
high current circuits. The voltage drop will cause a loss of efficiency in the circuit and will
also cause a build up of heat in the diode. This is why many rectifier diodes are designed to
be bolted onto heat sinks. Also specialized diodes are designed with low forward voltage
drops to be used specifically as rectifiers
The two terminals of the diode are known as the anode and cathode. The diode may be
regarded as a one way valve to the flow of electric current. Current flowing from anode to
cathode flows with ease but current flowing from cathode to anode is blocked.
A diode is composed of two regions of semiconductor (eg. silicon, germanium). A
semiconductor is neither a good conductor such as copper, nor an insulator (dielectric)
such as glass. A slab of semiconductor can be thought of as a resistor whose resistance
depends on the amount of doping (impurities such as gallium or arsenic) that is implanted
63
in the silicon. One region of semiconductor within the diode is called the P region. The P
region has been doped with an impurity which causes the presence of holes, or incomplete
covalent bonds in the semiconductor crystal. These holes in the P region attract electrons
and therefore are analogous to positive charges. Hence, the P region may be thought of as
being Positive (even though it is electrically neutral). The N region has been doped with an
impurity which causes the presence of more electrons than are needed for the covalent
bonds in the crystal.
The ―extra‖ electrons (the ones not involved in covalent bonding) are available for
conduction. The N region may be thought of as the Negative region due to the presence of
the electrons available for conduction. At the junction between the two regions, a potential
field is built-up. This field produces a barrier potential and is responsible for the (approx.)
0.7 V turn-on voltage (for silicon diodes) required in the forward direction to establish
current flow. When a voltage is applied in the reverse direction we say that the diode is
reverse biased. When the diode is reverse biased, the potential barrier builds up across the
junction and opposes current flow through the diode. The greater the applied reverse
voltage, the larger the barrier. When reverse biased, only a very small leakage current
flows. This leakage current is called the reverse saturation current
64
5.13 Crystal oscillator
A crystal oscillator is an electronic circuit that uses the mechanical resonance of a vibrating
crystal of piezoelectric material to create an electrical signal with a very precise frequency.
This frequency is commonly used to keep track of time (as in quartz wristwatches), to
provide a stable clock signal for digital integrated circuits, and to stabilize frequencies for
radio transmitters and receivers. The most common type of piezoelectric resonator used is
the quartz crystal, so oscillator circuits designed around them were called "crystal
oscillators".
Operation
A crystal is a solid in which the constituent atoms, molecules, or ions are packed in a
regularly ordered, repeating pattern extending in all three spatial dimensions.
Almost any object made of an elastic material could be used like a crystal, with appropriate
transducers, since all objects have natural resonant frequencies of vibration. For example,
steel is very elastic and has a high speed of sound. It was often used in mechanical filters
before quartz. The resonant frequency depends on size, shape, elasticity, and the speed of
sound in the material. High-frequency crystals are typically cut in the shape of a simple,
rectangular plate. Low-frequency crystals, such as those used in digital watches, are
typically cut in the shape of a tuning fork. For applications not needing very precise
timing, a low-cost ceramic resonator is often used in place of a quartz crystal.
65
When a crystal of quartz is properly cut and mounted, it can be made to distort in an
electric field by applying a voltage to an electrode near or on the crystal. This property is
known as piezoelectricity. When the field is removed, the quartz will generate an electric
field as it returns to its previous shape, and this can generate a voltage. The result is that a
quartz crystal behaves like a circuit composed of an inductor, capacitor and resistor, with a
precise resonant frequency.
Modeling
Electrical model
Electronic symbol for a piezoelectric crystal resonator
Schematic symbol and equivalent circuit for a quartz crystal in an oscillator
A quartz crystal can be modeled as an electrical network with a low impedance (series) and
a high impedance (parallel) resonance point spaced closely together. Mathematically
(using the Laplace transform) the impedance of this network can be written as:
or,
66
where s is the complex frequency (s = jω), ωs is the series resonant frequency in radians
per second and ωp is the parallel resonant frequency in radians per second.
67
5.14Switch
In electronics, a switch is an electrical component that can break an electrical circuit,
interrupting the current or diverting it from one conductor to another. The most familiar
form of switch is a manually operated electromechanical device with one or more sets of
electrical contacts. Each set of contacts can be in one of two states: either 'closed' meaning
the contacts are touching and electricity can flow between them, or 'open', meaning the
contacts are separated and non conducting.
Physical Appearance of Switch
A switch may be directly manipulated by a human as a control signal to a system, such as a
computer keyboard button, or to control power flow in a circuit, such as a light switch.
Automatically-operated switches can be used to control the motions of machines, for
example, to indicate that a garage door has reached its full open position or that a machine
tool is in a position to accept another workpiece. Switches may be operated by process
variables such as pressure, temperature, flow, current, voltage, and force, acting as sensors
in a process and used to automatically control a system. For example, a thermostat is an
automatically-operated switch used to control a heating process. A switch that is operated
by another electrical circuit is called a relay. Large switches may be remotely operated by a
motor drive mechanism. Some switches are used to isolate electric power from a system,
providing a visible point of isolation that can be pad-locked if necessary to prevent
accidental operation of a machine during maintenance, or to prevent electric shock.
68
CONCLUSION
Thus by this project we are producing energy from road traffic and this energy is used to
power on the street lights and we are also saving some energy by deciding on-off timing of
the street lights.
Thus we are saving conventional energy resources by the use of non-conventional energy
resource by road traffic.
69
REFRENCES www.efymag.com
www.google.com
www.wikipedia.com
Electronic Devices & Circuits - J.B.Gupta
Electronics For You - Magazine
Electronics Makers - Magazine
Electronics Bazar – Magazine
Boylaestad Nashelsky ―Electronics Devices and Circuit theory‖
Deshmukh Ajay V ―Microcontroller(Theory and Application)
Millman Jacob and Tabak ―Christos C Electronics Devices and Circuit‖
Mqazidi Muhammad Ali and Janice Gillispie ―Microcontroller‖
Sedra Smith ―Microelectronic Circuit‖
70