Académique Documents
Professionnel Documents
Culture Documents
Black Box
Submitted By
Abhishek Kaushik
SG-119836.
Table of Contents
1.
Acknowledgements.
2.
Certificate.
3.
4.
Circuit Diagram.
5.
Component List.
6.
Hardware
a.
b.
Integrated Circuits.
c.
Transistors.
d.
Diode.
e.
Relays.
f.
Transformer.
g.
Resistors.
h.
Capacitors.
7.
Project Working.
8.
Project Synopsis.
9.
Bibliography.
Introduction
We know the about Black box in aeroplane.We are making same project for car. In which we
will use different type of sensors. We will use IR,LPG,LDR,water and Fire sensors.In this
project we will make project on black box of car. We will make security system for car. It
will detect the fire in car then it will give signal on indicator and we will use 16*2 LCD for
display fault on LCD. Here in this project we also show that how we detect a LPG gas or any
type of gases and if we detect a gases then alarm is on, doors glasses will open or doors will
open and the same time lcd display shows the gas detection display . lpg gas sensors are for
future point of view, because of increasing cost of petrol, most of car owner are using LPG
gas car kit/ If the gas is detected then relay is off and break the supply of gas applied to the
vehicle or we can control any type of electrical connection on or off by this relay operated
logic.Main part of this project is gas sensor.Here we use TGS gas sensor. This sensor is a 6
pin sensor . Top and bottom of the sensor is covered with 100 mesh stainless stell wire cloth.
The heart of the sensor is the cylindrical form in the middle of the unit. The cylinder is a
ceramic material with the SnO2 material deposited on its surface. The heater coil is located
inside the ceramic cylinder. The heater has a resistance of 38 ohms.Output of the gas sensor is
connected to npn transistor and the ic 555 as a monostable trigger ic. Sensor gives high signal
to npn transistor. Transistors emitter is connected with ground. And collector connected with
NE555 timer. Timer gives output to npn transitor. Second npn transistor gives low signal to
mcrcontroller. We know microcontroller default o/p is high.As the sensor is detect a gas then
ic 555 activate automatically and then output of the ic 555 is connected to the microcontroller
circuit.In the microcontroller circuit we use ic 89s51 controller. Use of this is is to control the
one or many relay logic and at the same time show the message on the lcd display. If no gas
is detected then display shows a everything is ok . If the gas is detected then show a warning
message on the screen and at the same time relay off the supply unit.
Circuit Diagram
V IN V O U T
D2
C1
1000uf
R1
C 2 470E
470uf
U2
12
VCC
LCD 16*2
VSS
RS
LE D +
2
15
R ST
ir sensor
VC C
R3
10K
C4
27pf
40
20
POT
P 2 .0 /A 8
P 2 .1 /A 9
P 2 .2 /A 1 0
P 2 .3 /A 1 1
P 2 .4 /A 1 2
P 2 .5 /A 1 3
P 2 .6 /A 1 4
P 2 .7 /A 1 5
P 1 .0 /T2
P 1 .1 /T 2 -E X
P 1 .2
P 1 .3
P 1 .4 /S S
P 1 .5 /M O S I
P 1 .6 /M IS O
P 1 .7 /S C K
R 14
R 15
NO CONNECTION
8051 A L E /P R O G
1
2
3
4
5
6
7
8
R 13
R 12
D7
voltage +9V
Q4
Q5
NO CONNECTION
Y 1 19
1 8 XTA L 1
XTA L 2
12MHz
D4
C5
27pf
R 22
Q 14 R 23
R E S IS TO R
R E S IS TO R
R6
R7
4 .7 K
12V
PC 819
N PN
O P TO IS O L A TO R
Q 10
R 20
1K
Q9
PNP
470E
4 .7 K
1K
R 21
1K
PC 820
O P TO IS O L A TO R
N PN
Q 11
R 19
PN P
Q8
R 18
1K
PC 818
O P TO IS O L A TO R
R9
4 .7 K
R 16
12V
Q6
O P TO IS O L A TO R
470E
N PN
Q7
N PN
R8
470E
R 17
4 .7 K
PC 817
R 10
thermister
R 11
470E
water sensor
D5
LDR SENSOR
R5
4 .7 K
10
11
12
13
14
15
16
17
R4
670E
P 3 .0 /R XD
P 3 .1 /TXD
P 3 .2 /IN T0
P 3 .3 /IN T1
P 3 .4 /T0
P 3 .5 /T1
P 3 .6 /W R
P 3 .7 /R D
R2
SW 3
29
PSEN 30
C3
10uf
21
22
23
24
25
26
27
28
VCC
P 0 .0 /A D 0
P 0 .1 /A D 1
P 0 .2 /A D 2
P 0 .3 /A D 3
P 0 .4 /A D 4
P 0 .5 /A D 5
P 0 .6 /A D 6
P 0 .7 /A D 7
GND
39
38
37
36
35
34
33
32
EA/VPP
U3
31
10
11
12
13
14
R/W
LED -
DB0
DB1
DB2
DB3
DB4
DB5
DB6
DB7
16
D3
LE D
7
8
9
IN 4 0 0 7
TR A N S F O R M E R
VEE
6 0
220V
A.C
U 1 LM 7805
1
D 1 IN 4 0 0 7
5 12
GND
T1
PN P
Q 12
PNP
Q 13
Q 15
B C 548
BUZZER
Computer
The 8051 developed and launched in the early 80`s, is one of the most popular micro
controller in use today. It has a reasonably large amount of built in ROM and RAM. In
addition it has the ability to access external memory. The generic term `8x51` is used to
define the device. The value of x defining the kind of ROM, i.e. x=0, indicates none, x=3,
indicates mask ROM, x=7, indicates EPROM and x=9 indicates EEPROM or Flash.
A note on ROM
The early 8051, namely the 8031 was designed without any ROM. This device could run only
with external memory connected to it. Subsequent developments lead to the development of
the PROM or the programmable ROM. This type had the disadvantage of being highly
unreliable.The next in line, was the EPROM or Erasable Programmable ROM. These devices
used ultraviolet light erasable memory cells. Thus a program could be loaded, tested and
erased using ultra violet rays. A new program could then be loaded again. An improved
EPROM was the EEPROM or the electrically erasable PROM. This does not require ultra
violet rays, and memory can be cleared using circuits within the chip itself. Finally there is
the FLASH, which is an improvement over the EEPROM. While the terms EEPROM and
flash are sometimes used interchangeably, the difference lies in the fact that flash erases the
complete memory at one stroke, and not act on the individual cells. This results in reducing
the time for erasure.
PIC One of the famous microcontrollers used in the industries. It is based on RISC
Architecture
which
microcontroller.
makes
the
microcontroller
process
faster
than
other
INTEL These are the first to manufacture microcontrollers. These are not as
sophisticated other microcontrollers but still the easiest one to learn.
ATMEL Atmels AVR microcontrollers are one of the most powerful in the embedded
industry. This is the only microcontroller having 1kb of ram even the entry stage. But
it is unfortunate that in India we are unable to find this kind of microcontroller.
Intel 8051
Intel 8051 is CISC architecture which is easy to program in assembly language and also has a
good support for High level languages.The memory of the microcontroller can be extended
up to 64k.This microcontroller is one of the easiest microcontrollers to learn.
The 8051 microcontroller is in the field for more than 20 years. There are lots of books and
study materials are readily available for 8051.
Derivatives
The best thing done by Intel is to give the designs of the 8051 microcontroller to everyone.
So it is not the fact that Intel is the only manufacture for the 8051 there more than 20
manufactures, with each of minimum 20 models. Literally there are hundreds of models of
8051 microcontroller available in market to choose. Some of the major manufactures of 8051
are
Atmel
Philips
Philips
The Philipss 8051 derivatives has more number of features than in any microcontroller. The
costs of the Philips microcontrollers are higher than the Atmels which makes us to choose
Atmel more often than Philips
Dallas
Dallas has made many revolutions in the semiconductor market. Dallass 8051 derivative is
the fastest one in the market. It works 3 times as fast as a 8051 can process. But we are
unable to get more in India.
Atmel
These people were the one to master the flash devices. They are the cheapest microcontroller
available in the market. Atmels even introduced a 20pin variant of 8051 named 2051. The
Atmels 8051 derivatives can be got in India less than 70 rupees. There are lots of cheap
programmers available in India for Atmel. So it is always good or students to stick with 8051
when you learn a new microcontroller.
Architecture
Architecture is must to learn because before learning new machine it is necessary to learn the
capabilities of the machine. This is some thing like before learning about the car you cannot
become a good driver. The architecture of the 8051 is given below.
The 8051 doesnt have any special feature than other microcontroller. The only feature is that
it is easy to learn. Architecture makes us to know about the hardware features of the
microcontroller. The features of the 8051 are
The 8051 has a 8-Bit CPU that means it is able to process 8 bit of data at a time. 8051 has
235 instructions. Some of the important registers and their functions are
Lets now move on to a practical example. We shall work on a simple practical application
and using the example as a base, shall explore the various features of the 8051
microcontroller.
Consider an electric circuit as follows,
The positive side (+ve) of the battery is connected to one side of a switch. The other side of
the switch is connected to a bulb or LED (Light Emitting Diode). The bulb is then connected
to a resistor, and the other end of the resistor is connected to the negative (-ve) side of the
battery.
When the switch is closed or switched on the bulb glows. When the switch is open or
switched off the bulb goes off
If you are instructed to put the switch on and off every 30 seconds, how would you do it?
Obviously you would keep looking at your watch and every time the second hand crosses 30
seconds you would keep turning the switch on and off.
Imagine if you had to do this action consistently for a full day. Do you think you would be
able to do it? Now if you had to do this for a month, a year??
No way, you would say!
The next step would be, then to make it automatic. This is where we use the Microcontroller.
But if the action has to take place every 30 seconds, how will the microcontroller keep track
of time?
Execution time
Look at the following instruction,
clr p1.0
This is an assembly language instruction. It means we are instructing the microcontroller to
put a value of zero in bit zero of port one. This instruction is equivalent to telling the
microcontroller to switch on the bulb. The instruction then to instruct the microcontroller to
switch off the bulb is,
Set p1.0
This instructs the microcontroller to put a value of one in bit zero of port one.
Dont worry about what bit zero and port one means. We shall learn it in more detail as we
proceed.
There are a set of well defined instructions, which are used while communicating with the
microcontroller. Each of these instructions requires a standard number of cycles to execute.
The cycle could be one or more in number.
Let us now have a look at the features of the 8051 core, keeping the above example as a
reference,
1. 8-bit CPU.( Consisting of the A and B registers)
Most of the transactions within the microcontroller are carried out through the A register,
also known as the Accumulator. In addition all arithmetic functions are carried out generally
in the A register. There is another register known as the B register, which is used
exclusively for multiplication and division.
Thus an 8-bit notation would indicate that the maximum value that can be input into these
registers is 11111111. Puzzled?
The value is not decimal 111, 11,111! It represents a binary number, having an equivalent
value of FF in Hexadecimal and a value of 255 in decimal.
We shall read in more detail on the different numbering systems namely the Binary and
Hexadecimal system in our next module.
2. 4K on-chip ROM
Once you have written out the instructions for the microcontroller, where do you put these
instructions?
Obviously you would like these instructions to be safe, and not get deleted or changed during
execution. Hence you would load it into the ROM
The size of the program you write is bound to vary depending on the application, and the
number of lines. The 8051 microcontroller gives you space to load up to 4K of program size
into the internal ROM.
4K, thats all? Well just wait. You would be surprised at the amount of stuff you can load in
this 4K of space.
Of course you could always extend the space by connecting to 64K of external ROM if
required.
of time or count or an external event, the branch is taken, and on completion of the branch,
the control returns to the main program.
Priority levels indicate which interrupt is more important, and needs to be executed first in
case two interrupts occur at the same time.
8. On-chip clock oscillator.
This represents the oscillator circuits within the microcontroller. Thus the hardware is
reduced to just simply connecting an external crystal, to achieve the required pulsing rate.
Supply pin of this ic is pin no 40. Normally we apply a 5 volt regulated dc power
supply to this pin. For this purpose either we use step down transformer power supply
or we use 9 volt battery with 7805 regulator.
Ground pin of this ic is pin no 20. Pin no 20 is normally connected to the ground pin
( normally negative point of the power supply.
XTAL is connected to the pin no 18 and pin no 19 of this ic. The quartz crystal
oscillator connected to XTAL1 and XTAL2 PIN. These pins also needs two capacitors
of 30 pf value. One side of each capacitor is connected to crystal and other pis is
connected to the ground point. Normally we connect a 12 MHz or 11.0592 MHz
crystal with this ic.. But we use crystal upto 20 MHz to this pins
RESET PIN.. Pin no 9 is the reset pin of this ic.. It is an active high pin. On applying
a high pulse to this pin, the micro controller will reset and terminate all activities.
This is often referred to as a power on reset. The high pulse must be high for a
minimum of 2 machine cycles before it is allowed to go low.
PORT0 Port 0 occupies a total of 8 pins. Pin no 32 to pin no 39. It can be used for
input or output. We connect all the pins of the port 0 with the pullup resistor (10 k
ohm) externally. This is due to fact that port 0 is an open drain mode. It is just like a
open collector transistor.
PORT1. ALL the ports in micrcontroller is 8 bit wide pin no 1 to pin no 8 because it is
a 8 bit controller. All the main register and sfr all is mainly 8 bit wide. Port 1 is also
occupies a 8 pins. But there is no need of pull up resistor in this port. Upon reset port
1 act as a input port. Upon reset all the ports act as a input port
PORT2.
port 2 also have a 8 pins. It can be used as a input or output. There is
no need of any pull up resistor to this pin.
PORT 3. Port3 occupies a totoal 8 pins from pin no 10 to pin no 17. It can
be
used as input or output. Port 3 does not require any pull up resistor. The same
as port 1 and port2. Port 3 is configured as an output port on reset. Port 3 has the
dditional function of providing some important signals such as interrupts. Port 3 also
use for serial communication.
ALE ALE is an output pin and is active high. When connecting an 8031 to external
memory, port 0 provides both address and data. In other words, the 8031 multiplexes
address and data through port 0 to save pins. The ALE pin is used for demultiplexing
the address and data by connecting to the ic 74ls373 chip.
PSEN. PSEN stands for program store eneable. In an 8031 based system in which an
external rom holds the program code, this pin is connected to the OE pin of the rom.
EA. EA. In 89c51 8751 or any other family member of the ateml 89c51 series all
come with on-chip rom to store programs, in such cases the EA pin is connected to
the Vcc. For family member 8031 and 8032 is which there is no on chip rom, code is
stored in external memory and this is fetched by 8031. In that case EA pin must be
connected to GND pin to indicate that the code is stored externally.
ACC
ACCUMULATOR
0E0H
B REGISTER
0F0H
PSW
SP
STACK POINTER
DPTR
DPL
82H
DPH
83H
P0
PORT0
80H
P1
PORT1
90H
P2
PORT2
0A0H
P3
PORT3
0B0H
0D0H
81H
TMOD
89H
TCON
88H
TH0
8CH
TLO
TH1
TL1
SCON
SERIAL CONTROL
98H
SBUF
99H
PCON
POWER CONTROL
87H
8AH
8DH
8BH
INSTRUCTIONS
SETB BIT
CLR BIT
CPL BIT
JB BIT,TARGET
JBC BIT,TARGET
MOV INSTRUCTIONS
MOV R0,A
MOV R1,A
MOV A,R3
MOV A,#23H
MOV R0,#12h
MOV R5,#0F9H
ADD INSTRUCTIONS.
ADD instructions adds the source byte to the accumulator ( A) and place the result in the
Accumulator.
MOV A, #25H
ADD A,#42H
ADDA,R3
ACALL,TARGET ADDRESS
By this instructions we call subroutines with a target address within 2k bytes from the
current program counter.
ACALL is a limit for the 2 k byte program counter, but for upto 64k byte we use LCALL
instructions.. Note that LCALL is a 3 byte instructions. ACALL is a
two byte instructions.
target address
unconditionally. The target address for this instruction must be withib 2 k byte of program
memory.
LJMP is also for absoltute jump. It tranfer program execution to the target addres
unconditionally. This is a 3 byte instructions LJMP
address within 64 k byte location.
INSTRUCTIONS RELATED TO THE CARRY
JC TARGET
JNC TARGET
jump to any
JZ TARGET
JUMP TO TARGET IF A = 0
JNZ TARGET
RL A
BY this instructions we rotate the bits of A left. The bits rotated out of A are rotated back into
A at the opposite end
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 in to carry
and then enter into MSB
RLC A
Same as above but but shift the data from MSB to carry and carry to LSB
RET
This is return from subroutine. This instructions is 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 intruupt
routine,
PUSH.
This copies the indicated byte onto the stack and increments SP by . This instructions
supports only direct addressing mode.
POP.
This copies the byte pointed to be SP to the location whose direct address is indicated, and
decrements SP by 1. Notice that this instructions supports only direct addressing mode.
DPTR INSTRUCTIONS.
This instructions load the 16 bit dptr register with a 16 bit immediate value
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.
INC A
INC Rn
INC DIRECT
DEC BYTE
This instructions subtracts 1 from the byte operand. Note that CY is unchanged
DEC A
DEC Rn
DEC DIRECT
ARITHMATIC INSTRUCTIONS.
This performs a logical AND on the operands, bit by bit, storing the result in the destination.
Notice that both the source and destination values are byte size only
`
DIV AB
This instructions divides a byte accumulator by the byte in register B. It is assumed that both
register A and B contain an unsigned byte. After the division the quotient will be in register
A and the remainder in register B.
Both timer is the 89c51 share the one register TMOD. 4 LSB bit for the timer 0 and 4 MSB
for the timer 1.
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
13 BIT TIMER/MODE
CY
PSW.7
CARRY FLAG
AC
PSW.6
AUXILIARY CARRY
F0
PSW.5
RS1
PSW.4
RS0
PSW.3
0V
PSW.2
OVERFLOW FLAG
--
PSW.1
PSW.0
TH1
CRYSTAL FREQUENCY
256---- ____________________
If the SMOD IS = 1
CRYSTAL FREQUENCY
TH1
There are two ways to increase the baud rate of data transfer in the 8051
1.
2.
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
TH1
( DECIMAL)
HEX
SMOD =0
SMOD =1
-3
FD
9600
19200
-6
FA
4800
9600
-12
F4
2400
4800
-24
E8
1200
2400
EA
IE.7
IE.6
NOT implemented
ET2
IE.5
ES
IE.4
ET1
IE.3
EX1
IE.2
ET0
IE.1
EX0
IE.0
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
IP.6
PT2
IP.5
PS
IP.4
PT1
IP.3
PX1
IP.2
PT0
IP.1
PX0
IP.0
SCON
SM0
SM1
SM2
SCON.5
REN
TB8
SCON.3 The 9th bit that will be transmitted in modes 2 and 3, Set/cleared
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
TF1
TCON.7
TR1
TCON.6
TF0
TCON.5
TR0
TCON.4
IE1
TCON.3
ITI
TCON.2
IE0
TCON.1
IT0
TCON.0
Arithmetic Operations
Mnemonic
Description
Size
Cycles
ADD A,Rn
ADDC A,direct
ADDC A,@Ri
ADDC A,#data
SUBB A,Rn
SUBB A,direct
SUBB A,#data
with borrow.
INC A
INC Rn
Increment ACC.
Increment register.
INC direct
INC @Ri
Decrement ACC.
DEC A
DEC Rn
Decrement register.
DEC direct
DEC @Ri
INC DPTR
MUL AB
DIV AB
DA A
Logical Operations
Mnemonic
Description
Size
Cycles
ANL A,Rn
ANL direct,#data
ORL A,Rn
OR Register to ACC.
ORL A,@Ri
ORL direct,#data
XRL A,@Ri
XRL direct,#data
XRL A,Rn
CLR A
CPL A
Compliment ACC.
RL A
RLC A
RR A
RRC A
SWAP A
Data Transfer
Mnemonic
Description
MOV A,Rn
Size
Cycles
MOV A,direct
MOV A,@Ri
MOV A,#data
MOV Rn,A
MOV Rn,direct
MOV Rn,#data
MOV direct,A
MOV direct,Rn
MOV direct,direct
MOV direct,@Ri
MOV direct,#data
MOV @Ri,A
MOV @Ri,direct
MOV @Ri,#data
MOVC A,@A+DPTR
Move code byte relative to DPTR to ACC (16 bit address).
MOVC A,@A+PC
MOVX A,@Ri
MOVX A,@DPTR
MOVX @Ri,A
MOVX @DPTR,A
PUSH direct
POP direct
XCH A,Rn
XCH A,direct
XCH A,@Ri
XCHD A,@Ri
Mnemonic
Description
Size
CLR C
CLR bit
SETB C
SETB
Cycles
CPL C
CPL bit
ANL C,bit
ANL C,/bit
ORL C,bit
ORL C,/bit
MOV C,bit
MOV bit,C
JC rel
JNC rel
JB bit,rel
JNB bit,rel
JBC bit,rel
Program Branching
Mnemonic
Description
Size Cycles
ACALL
addr11
LCALL
addr16
RET
RETI
SJMP rel
JMP @A+DPTR
JZ rel
JNZ rel
CJNE A,direct,rel
not equal.
CJNE A,#data,rel
CJNE Rn,#data,rel
DJNZ direct,rel
Other Instructions
Mnemonic
NOP
Description
No operation.
Size
Cycles
LCD DETAIL .
Frequently, an 8051 program must interact with the outside world using
input and output devices that communicate directly with a human being.
One of the most common devices attached to an 8051 is an LCD display.
Some of the most common LCDs connected to the 8051 are 16x2 and
20x2 displays. This means 16 characters per line by 2 lines and 20
characters per line by 2 lines, respectively.
Fortunately, a very popular standard exists which allows us to communicate with the vast
majority of LCDs regardless of their manufacturer. The standard is referred to as HD44780U,
which refers to the controller chip which receives data from an external source (in this case,
the 8051) and communicates directly with the LCD.
44780 BACKGROUND
The 44780 standard requires 3 control lines as well as either 4 or 8 I/O lines for the data bus.
The user may select whether the LCD is to operate with a 4-bit data bus or an 8-bit data bus.
If a 4-bit data bus is used, the LCD will require a total of 7 data lines (3 control lines plus the
4 lines for the data bus). If an 8-bit data bus is used, the LCD will require a total of 11 data
lines (3 control lines plus the 8 lines for the data bus).
The three control lines are referred to as EN, RS, and RW.
The EN line is called "Enable." This control line is used to tell the LCD that you are sending
it data. To send data to the LCD, your program should first set this line high (1) and then set
the other two control lines and/or put data on the data bus. When the other lines are
completely ready, bring EN low (0) again. The 1-0 transition tells the 44780 to take the data
currently found on the other control lines and on the data bus and to treat it as a command.
The RS line is the "Register Select" line. When RS is low (0), the data is to be treated as a
command or special instruction (such as clear screen, position cursor, etc.). When RS is high
(1), the data being sent is text data which should be displayed on the screen. For example, to
display the letter "T" on the screen you would set RS high.
The RW line is the "Read/Write" control line. When RW is low (0), the information on the
data bus is being written to the LCD. When RW is high (1), the program is effectively
querying (or reading) the LCD. Only one instruction ("Get LCD status") is a read command.
All others are write commands--so RW will almost always be low.
Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation selected by
the user). In the case of an 8-bit data bus, the lines are referred to as DB0, DB1, DB2, DB3,
DB4, DB5, DB6, and DB7.
As you can see, we've established a 1-to-1 relation between a pin on the 8051 and a line on
the 44780 LCD. Thus as we write our assembly program to access the LCD, we are going to
equate constants to the 8051 ports so that we can refer to the lines by their 44780 name as
opposed to P0.1, P0.2, etc. Let's go ahead and write our initial equates:
CLR EN
Programming Tip: The LCD interprets and executes our command
at the instant the EN line is brought low. If you never bring EN low,
your instruction will never be executed. Additionally, when you bring
EN low and the LCD executes your instruction, it requires a certain
amount of time to execute the command. The time it requires to
execute an instruction depends on the instruction and the speed of
the crystal which is attached to the 44780's oscillator input.
As previously mentioned, it takes a certain amount of time for each instruction to be executed
by the LCD. The delay varies depending on the frequency of the crystal attached to the
oscillator input of the 44780 as well as the instruction which is being executed.
While it is possible to write code that waits for a specific amount of time to allow the LCD to
execute instructions, this method of "waiting" is not very flexible. If the crystal frequency is
changed, the software will need to be modified. Additionally, if the LCD itself is changed for
another LCD which, although 44780 compatible, requires more time to perform its
operations, the program will not work until it is properly modified.
A more robust method of programming is to use the "Get LCD Status" command to
determine whether the LCD is still busy executing the last instruction received.
The "Get LCD Status" command will return to us two tidbits of information; the information
that is useful to us right now is found in DB7. In summary, when we issue the "Get LCD
Status" command the LCD will immediately raise DB7 if it's still busy executing a command
or lower DB7 to indicate that the LCD is no longer occupied. Thus our program can query the
LCD until DB7 goes low, indicating the LCD is no longer busy. At that point we are free to
continue and send the next command.
Since we will use this code every time we send an instruction to the LCD, it is useful to make
it a subroutine. Let's write the code:
WAIT_LCD:
EN
CLR
RS
MOV
DATA,#38h
CLR
EN
LCALL WAIT_LCD
Programming Tip: The LCD command 38h is really the sum of a
number of option bits. The instruction itself is the instruction 20h
("Function set"). However, to this we add the values 10h to indicate
an 8-bit data bus plus 08h to indicate that the display is a two-line
display.
We've now sent the first byte of the initialization sequence. The second
byte of the initialization sequence is the instruction 0Eh. Thus we must
repeat the initialization code from above, but now with the instruction.
Thus the next code segment is:
SETB EN
CLR RS
MOV DATA,#0Eh
CLR EN
LCALL WAIT_LCD
LCALL WAIT_LCD
RET
Having executed this code the LCD will be fully initialized and ready for us
to send display data to it.
CLEARING THE DISPLAY
When the LCD is first initialized, the screen should automatically be cleared by the 44780
controller. However, it's always a good idea to do things yourself so that you can be
completely sure that the display is the way you want it. Thus, it's not a bad idea to clear the
screen as the very first opreation after the LCD has been initialiezd.
An LCD command exists to accomplish this function. Not suprisingly, it is the command 01h.
Since clearing the screen is a function we very likely will wish to call more than once, it's a
good idea to make it a subroutine:
CLEAR_LCD:
SETB EN
CLR RS
MOV DATA,#01h
CLR EN
LCALL WAIT_LCD
RET
How that we've written a "Clear Screen" routine, we may clear the LCD at
any time by simply executing an LCALL CLEAR_LCD.
Programming Tip: Executing the "Clear Screen" instruction on the
LCD also positions the cursor in the upper left-hand corner as we
would expect.
WRITING TEXT TO THE LCD
Now we get to the real meat of what we're trying to do: All this effort is really so we can
display text on the LCD. Really, we're pretty much done.
Once again, writing text to the LCD is something we'll almost certainly want to do over and
over--so let's make it a subroutine.
WRITE_TEXT:
SETB EN
SETB RS
MOV DATA,A
CLR EN
LCALL WAIT_LCD
RET
The WRITE_TEXT routine that we just wrote will send the character in the
accumulator to the LCD which will, in turn, display it. Thus to display text
on the LCD all we need to do is load the accumulator with the byte to
display and make a call to this routine. Pretty easy, huh?
A "HELLO WORLD" PROGRAM
Now that we have all the component subroutines written, writing the classic "Hello World"
program--which displays the text "Hello World" on the LCD is a relatively trivial matter.
Consider:
LCALL INIT_LCD
LCALL CLEAR_LCD
MOV A,#'H'
LCALL WRITE_TEXT
MOV A,#'E'
LCALL WRITE_TEXT
MOV A,#'L'
LCALL WRITE_TEXT
MOV A,#'L'
LCALL WRITE_TEXT
MOV A,#'O'
LCALL WRITE_TEXT
MOV A,#' '
LCALL WRITE_TEXT
MOV A,#'W'
LCALL WRITE_TEXT
MOV A,#'O'
LCALL WRITE_TEXT
MOV A,#'R'
LCALL WRITE_TEXT
MOV A,#'L'
LCALL WRITE_TEXT
MOV A,#'D'
LCALL WRITE_TEXT
The above "Hello World" program should, when executed, initialize the
LCD, clear the LCD screen, and display "Hello World" in the upper lefthand corner of the display.
CURSOR POSITIONING
The above "Hello World" program is simplistic in the sense that it prints its text in the upper
left-hand corner of the screen. However, what if we wanted to display the word "Hello" in the
upper left-hand corner but wanted to display the word "World" on the second line at the tenth
character? This sounds simple--and actually, it is simple. However, it requires a little more
understanding of the design of the LCD.
The 44780 contains a certain amount of memory which is assigned to the display. All the text
we write to the 44780 is stored in this memory, and the 44780 subsequently reads this
memory to display the text on the LCD itself. This memory can be represented with the
following "memory map":
Thus, the first character in the upper left-hand corner is at address 00h. The following
character position (character #2 on the first line) is address 01h, etc. This continues until we
reach the 16th character of the first line which is at address 0Fh.
However, the first character of line 2, as shown in the memory map, is at address 40h. This
means if we write a character to the last position of the first line and then write a second
character, the second character will not appear on the second line. That is because the second
character will effectively be written to address 10h--but the second line begins at address 40h.
Thus we need to send a command to the LCD that tells it to position the cursor on the second
line. The "Set Cursor Position" instruction is 80h. To this we must add the address of the
location where we wish to position the cursor. In our example, we said we wanted to display
"World" on the second line on the tenth character position.
Referring again to the memory map, we see that the tenth character position of the second
line is address 4Ah. Thus, before writing the word "World" to the LCD, we must send a "Set
Cursor Position" instruction--the value of this command will be 80h (the instruction code to
position the cursor) plus the address 4Ah. 80h + 4Ah = C4h. Thus sending the command C4h
to the LCD will position the cursor on the second line at the tenth character position:
SETB EN
CLR RS
MOV DATA,#0C4h
CLR EN
LCALL WAIT_LCD
The above code will position the cursor on line 2, character 10. To display
"Hello" in the upper left-hand corner with the word "World" on the second
line at character position 10 just requires us to insert the above code into
our existing "Hello World" program. This results in the following:
LCALL INIT_LCD
LCALL CLEAR_LCD
MOV A,#'H'
LCALL WRITE_TEXT
MOV A,#'E'
LCALL WRITE_TEXT
MOV A,#'L'
LCALL WRITE_TEXT
MOV A,#'L'
LCALL WRITE_TEXT
MOV A,#'O'
LCALL WRITE_TEXT
SETB EN
CLR RS
MOV DATA,#0C4h
CLR EN
LCALL WAIT_LCD
MOV A,#'W'
LCALL WRITE_TEXT
MOV A,#'O'
LCALL WRITE_TEXT
MOV A,#'R'
LCALL WRITE_TEXT
MOV A,#'L'
LCALL WRITE_TEXT
MOV A,#'D'
LCALL WRITE_TEXT
1.
Vss
GROUND
2.
Vcc
+5VOLT SUPPLY
Vee
4.
RS
5.
R/W
DB0
DB1
9.
DB2
10.
DB3
ENABLE
11.
DB4
12.
DB5
13.
DB6
14.
DB7
15 ,16
1.
2.
RETURN HOME
6.
7.
8.
F.
10.
14.
18.
1C
80
C0
38
TRANSFORMER
Transformer works on the principle of mutual inductance. We know that if
two coils or windings are placed on the core of iron, and if we pass
alternating current in one winding, back emf or induced voltage is
produced in the second winding. We know that alternating current always
changes with the time. So if we apply AC voltage across one winding, a
voltage will be induced in the other winding. Transformer works on this
same principle. It is made of two windings wound around the same core of
iron. The winding to which AC voltage is applied is called primary winding.
The other winding is called as secondary winding.
We know that Power = Current X Voltage. It is to be noted that input power is equal
to output power. Power is not changed. If V 2 is greater than V1, then I2 will be less
than I1. This type of transformer is called as step up transformer. If V 1 is
greater than V2, then I1 will be less than I2. This type of transformer is called as step
down transformer.
For step up transformer, N2>N1, i.e., number of turns of secondary winding is more
than those in primary.
For step down transformer, N 1>N2, i.e., numbers of turns of primary winding is more
than those in secondary.
RESISTANCE
resistor is a two-terminal electronic component that produces a voltage across its
terminals that is proportional to the electric current passing 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 highresistivity alloy, such as nickel/chrome).
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 is determined by the design, materials and dimensions of the resistor.
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
Units
The ohm (symbol: ) is the SI unit of electrical resistance, named after Georg Simon Ohm.
Commonly used multiples and submultiples in electrical and electronic usage are the
milliohm (1x103), kilohm (1x103), and megohm (1x106).
Theory of operation
Ohm's law
The behavior of an ideal resistor is dictated by the relationship specified in Ohm's law:
Ohm's law states that the voltage (V) across a resistor is proportional to the current (I)
through it where the constant of proportionality is the resistance (R).
Equivalently, Ohm's law can be stated:
This formulation of Ohm's law states that, when a voltage (V) is maintained across a
resistance (R), a current (I) will flow through the resistance.
This formulation is often used in practice. For example, if V is 12 volts and R is 400 ohms, a
current of 12 / 400 = 0.03 amperes will flow through the resistance R.
Series and parallel resistors
Main article: Series and parallel circuits
Resistors in a parallel configuration each have the same potential difference (voltage). To find
their total equivalent resistance (Req):
The parallel property can be represented in equations by two vertical lines "||" (as in
geometry) to simplify equations. For two resistors,
The current through resistors in series stays the same, but the voltage across each resistor can
be different. The sum of the potential differences (voltage) is equal to the total voltage. To
find their total resistance:
A resistor network that is a combination of parallel and series can be broken up into smaller
parts that are either one or the other. For instance,
However, many resistor networks cannot be split up in this way. Consider a cube, each edge
of which has been replaced by a resistor. For example, determining the resistance between
two opposite vertices requires additional transforms, such as the Y- transform, or else matrix
methods must be used for the general case. However, if all twelve resistors are equal, the
corner-to-corner resistance is 56 of any one of them.
The practical application to resistors is that a resistance of any non-standard value can be
obtained by connecting standard values in series or in parallel.
Power dissipation
The power dissipated by a resistor (or the equivalent resistance of a resistor network) is
calculated using the following:
All three equations are equivalent. The first is derived from Joule's first law. Ohms Law
derives the other two from that.
The total amount of heat energy released is the integral of the power over time:
If the average power dissipated is more than the resistor can safely dissipate, the resistor may
depart from its nominal resistance and may become damaged by overheating. Excessive
power dissipation may raise the temperature of the resistor to a point where it burns out,
which could cause a fire in adjacent components and materials. There are flameproof resistors
that fail (open circuit) before they overheat dangerously.
Note that the nominal power rating of a resistor is not the same as the power that it can safely
dissipate in practical use. AIR circulation and proximity to a circuit board, ambient
temperature, and other factors can reduce acceptable dissipation significantly. Rated power
dissipation may be given for an ambient temperature of 25 C in free air. Inside an equipment
case at 60 C, rated dissipation will be significantly less; a resistor dissipating a bit less than
the maximum figure given by the manufacturer may still be outside the safe operating area
and may prematurely fail.
Resistor marking
Most axial resistors use a pattern of colored stripes to indicate resistance. Surface-mount
resistors are marked numerically, if they are big enough to permit marking; more-recent small
sizes are impractical to mark. Cases are usually tan, brown, blue, or green, though other
colors are occasionally found such as dark red or dark gray.
Early 20th century resistors, essentially uninsulated, were dipped in paint to cover their entire
body for color coding. A second color of paint was applied to one end of the element, and a
color dot (or band) in the middle provided the tthird digit. The rule was "body, tip, dot",
providing two significant digits for value and the decimal multiplier, in that sequence. Default
tolerance was 20%. Closer-tolerance resistors had silver (10%) or gold-colored (5%)
paint on the other end.
Four-band resistors
Temp. Coefficient
Black
100
Brown 1
101
1% (F)
100 ppm
Red
102
2% (G)
50 ppm
Orange 3
103
15 ppm
Yellow 4
104
25 ppm
Green
105
0.5% (D)
Blue
106
0.25% (C)
Violet
107
0.1% (B)
Gray
108
0.05% (A)
White
109
Gold
101
5% (J)
Silver
102
10% (K)
None
20% (M)
Variable Resistors
Construction
Variable resistors consist of a resistance track with
connections at both ends and a wiper which moves along the
track as you turn the spindle. The track may be made from carbon, cermet (ceramic and metal
mixture) or a coil of wire (for low resistances). The track is usually rotary but straight track
versions, usually called sliders, are also available.
Variable resistors may be used as a rheostat with two connections (the wiper and
just one end of the track) or as a potentiometer with all three connections in use.
Miniature versions called presets are made for setting up circuits which will not
require further adjustment.
Variable resistors are often called potentiometers in books and catalogues. They
are specified by their maximum resistance, linear or logarithmic track, and their
physical size. The standard spindle diameter is 6mm.
The resistance and type of track are marked on the body:
4K7 LIN means 4.7 k linear track.
1M LOG means 1 M logarithmic track.
Some variable resistors are designed to be mounted directly on the circuit board,
but most are for mounting through a hole drilled in the case containing the
circuit with stranded wire connecting their terminals to the circuit board.
CAPACITORS
A capacitor (formerly known as condenser) is a passive
electronic component consisting of a pair of conductors
separated by a dielectric (insulator). When there is a potential
difference (voltage) across the conductors a static electric field
develops in the dielectric that stores energy and produces a
mechanical force between the conductors. An ideal capacitor is
characterized by a single constant value, capacitance,
measured in farads. This is the ratio of the electric charge on
each conductor to the potential difference between them.
Capacitors are widely used in electronic circuits for blocking
direct current while allowing alternating current to pass, in filter
networks, for smoothing the output of power supplies, in the
resonant circuits that tune radios to particular frequencies and
for many other purposes.
The effect is greatest when there is a narrow separation
between large areas of conductor, hence capacitor conductors
are often called "plates", referring to an early means of
Ripple current
Ripple current is the AC component of an applied source (often
a switched-mode power supply) whose frequency may be
constant or varying. Certain types of capacitors, such as
electrolytic tantalum capacitors, usually have a rating for
maximum ripple current (both in frequency and magnitude).
CERAMIC CAPACITOR :
ELECTROLYTIC CAPACITOR :
In this project, 10f capacitor is an electrolytic capacitor. In this type of
capacitors, the dielectric consists of an extremely thin film of aluminum oxide
formed on one of its aluminum foil plates. Intimate contact with the other plate is
achieved by impregnating the paper between the foils with an electrolyte in the
form of viscous substance, such as ammonium borate. The sandwich is then
rolled into a cylindrical element and housed in either metallic cardboard, plastic
or ceramic protective tube.
Applications
Capacitors have many uses in electronic and electrical systems.
They are so common that it is a rare electrical product that
does not include at least one for some purpose.
Energy storage
A capacitor can store electric energy when disconnected from
its charging circuit, so it can be used like a temporary battery.
Capacitors are commonly used in electronic devices to maintain
power supply while batteries are being changed. (This prevents
loss of information in volatile memory.)
Conventional electrostatic capacitors provide less than 360
joules per kilogram of energy density, while capacitors using
developing technologies can provide more than 2.52 kilojoules
per kilogram[22].
In car audio systems, large capacitors store energy for the
amplifier to use on demand. Also for a flash tube a capacitor is
used to hold the high voltage. In ceiling fans, capacitors play
the important role of storing electrical energy to give the fan
enough torque to start spinning.
Pulsed power and weapons
Groups of large, specially constructed, low-inductance highvoltage capacitors (capacitor banks) are used to supply huge
pulses of current for many pulsed power applications. These
include electromagnetic forming, Marx generators, pulsed
lasers (especially TEA lasers), pulse forming networks, radar,
fusion research, and particle accelerators.
Large capacitor banks (reservoir) are used as energy sources
for the exploding-bridgewire detonators or slapper detonators
in nuclear weapons and other specialty weapons. Experimental
work is under way using banks of capacitors as power sources
Variable capacitor
A variable capacitor is a capacitor whose capacitance may be
intentionally and repeatedly changed mechanically or
electronically. Variable capacitors are often used in L/C circuits
to set the resonance frequency, e.g. to tune a radio (therefore
they are sometimes called tuning capacitors), or as a variable
reactance, e.g. for impedance matching in antenna tuners.
Mechanically controlled
In mechanically controlled variable capacitors, the distance
between the plates, or the amount of plate surface area which
overlaps, can be changed.
The most common form arranges a group of semicircular metal
plates on a rotary axis (rotor) that are positioned in the gaps
between a set of stationary plates (stator) so that the area of
Diode
1N4007
1N4001 - 1N4007
source to the negative (-). This convention holds true for all
semiconductor symbols possessing arrowheads: the arrow
points in the permitted direction of conventional flow, and
against the permitted direction of electron flow.
Diode behavior is analogous to the behavior of a hydraulic
device called a check valve. A check valve allows fluid flow
through it in only one direction as in Figure below.
Fig. Process of
electroluminescence in the LED
Units
Power dissipation
120
mW
20[1]
mA
60
mA
-55C to 100C
Symbol
Units
Test
Conditions
Min.
Type
Max
1.0
3.0
mcd
IF = 10mA
Axial luminous
intensity
Iv
Included angle
between half luminous
intensity points
21/2
80
deg.
peak
635
nm
Measurem
ent at Peak
628
nm
Speed of response
90
ns
Capacitance
11
pF
VF=0;
f=1 MHz
Thermal resistance
JC
120
C/W
Junction to
cathode
lead at
0.79 mm
(0.031 in)
from body
Forward voltage
VF
2.2
3.0
IF = 10mA
Reverse breakdown
voltage
BVR
Luminous efficacy
5.0
147
IR = 100A
Lm/V
BC548
TRANSISTOR (BC558)
BIASING OF TRANSISTOR:
CIRCUIT CONFIGURATIONS:
There are three possible ways in which a transistor can be
connected in the circuit which are following:
Common Base Configuration: Base is made common in this
configuration.
Common Emitter Configuration: Emitter is made common in
this configuration.
Common Collector Configuration: Collector is made common in
this configuration.
Absolute Maximum Rating :
noted
Parameter
Symb
ol
Value
VCEO
-30
VCBO
-30
VEBO
-5
IC
-100
Collector Dissipation
PC
500
Junction Temperature
TJ
150
Storage Temperature
TSTG
-65 to 150
Symbol
Test Condition
ICBO
DC Current Gain
hfe
Min.
110
Type
Collector Emitter
Saturation Voltage
VCE(sat)
-90
-250
VBE(sat)
-700
-900
VBE(On)
fT
Output Capacitance
Cob
VCB=
-10V,IE=0,f=1MHz
Noise Figure
NF
600
-660
150
f=10MHz
REED SWITCH:
The reed switch contains a pair (or more) of magnetizable,
flexible, metal reeds whose end portions are separated by a
small gap when the switch is open. The reeds are hermetically
sealed in opposite ends of a tubular glass envelope. A magnetic
field (from an electromagnet or a permanent magnet) will
cause the reeds to come together, thus completing anelectrical
circuit. The stiffness of the reeds causes them to separate, and
open the circuit, when the magnetic field ceases. Another
configuration contains a non-ferrous normally-closed contact
that opens when the ferrous normally-open contact closes.
Good electrical contact is assured by plating a thin layer of nonferrous precious metal over the flat contact portions of the
reeds; low-resistivity silver is more suitable than corrosionresistant gold in the sealed envelope. There are also versions of
reed switches with mercury "wetted" contacts. Such switches
MICROSWITCH
IC 7805 :
DESCRIPTION
The 7805 series of three terminal positive regulators are
available in the TO-220/D-PAK package and with several fixed
output voltages, making them useful in a wide range of
applications. Each type employs internal current limiting, thermal
shut down and safe operating area protection, making it
essentially indestructible. If adequate heat sinking is provided,
they can deliver over 1A output current. Although designed
primarily as fixed voltage regulators, these devices can be used
with external components to obtain adjustable voltages and
currents.
Symbol
Value
Unit
VI
35
(for VO =24V)
VI
40
RJC
C/W
RJC
65
C/W
TOPR
0 - +125
TSTG
-65 - +150
Symbol
Min
Typ
e
Max.
Unit
VO
4.8
5.0
5.2
Regline
4.0
100
MV
Regload
100
MV
Quiescent Current TJ
=+25C
IQ
5.0
8.0
mA
IQ
0.0
3
0.5
mA
VO/T
-0.8
MV/
C
VN
42
V/VO
RR
62
73
dB
VDrop
rO
15
ISC
230
MA
IPK
2.2
VO =7V to 25V
Load Regulation (Note 1)
IO = 5.0mA to 1.5A
IO = 5.0mA to 1.0A
Output Voltage Drift
IO = 5.0mA
Output Noise Voltage
f=10Hz to 100MHz
TA=+25C
Ripple Rejection
f=120Hz, VO=8V to 18V
Dropout Voltage
IO = 1A, TA=+25C
Output Resistance
f=1KHz
Short Circuit Current
VI = 35V, TA=+25C
Peak Current TA=+25C
RELAYS
OUT N/O
SPRING
230V
P
MAGNET
The reason behind using relay for switching loads is to provide complete
electrical isolation. The means that there is no electrical connection between the
driving circuits and the driven circuits. The driving circuit may be low voltage
operated low power circuits that control several kilowatts of power. In our
circuit where a high fan could be switched on or off depending upon the output
from the telephone.
Since the relay circuit operated on a low voltage, the controlling circuit is quite
safe. In an electromagnetic relay the armature is pulled by a magnetic force
only. There is no electrical connection between the coil of a relay and the
switching contacts of the relay. If there are more than one contact they all are
electrically isolated from each other by mounting them on insulating plates and
washers. Hence they can be wired to control different circuits independently.
Some of the popular contacts forms are described below:
1. Electromagnetic relay
2. Power Relay.
3. Time Delay Relay.
4. Latching Relay.
5. Crystal Can Relay.
6. Co-axial Relay.
1. Electromagnetic relay:
2. Power relays:
Power relays are multi-pole heavy duty lapper type relays that are capable of
switching resistive loads of upto 25amp.. These relays are widely used for a
variety of industrial application like control of fractional horse power motors,
solenoids, heating elements and so on. These relays usually have button like
silver alloy contacts and the contact welding due to heavy in rush current is
avoided by wiping action of the contacts to quench the arc during high voltage
DC switching thus avoiding the contact welding.
A time delay relay is the one in which there is a desired amount of time delay
between the application of the actuating signal and operation of the load
switching devices.
4. Latching Relay:
In a Latching Relay, the relay contacts remain in the last energized position
even after removal of signal in the relay control circuit. The contacts are held in
the last relay-energized position after removal of energisation either electrically
or magnetically. The contacts can be released to the normal position electrically
or mechanically.
They are so called, as they resemble quartz crystal in external shapes. These are
high performance hermetically sealed miniature or sub-miniature relay widely
used in aerospace and military application. These relays usually have gold
plated contacts and thus have extremely low contact resistance. Due to low
moment of inertia of the armature and also due to statically and dynamically
balanced nature of armature, these relays switch quite reliably even under
extreme condition of shock and vibration.
6. Co-axial Relay:
A Co-axial Relay has two basic parts, an actuator which is nothing but some
kind of a coil and a cavity, housing the relay contacts. The co-axial relay are
extensively used for radio frequency switching operations of equipment
The light-sensitive part of the LDR is a wavy track of cadmium sulphide. Light
energy triggers the release of extra charge carriers in this material, so that its
resistance falls as the level of illumination increases.
A light sensor uses an LDR as part of a voltage divider.
The essential circuit of a voltage divider, also called a potential divider, is:
, 0.5
In other words, this circuit gives a LOW voltage when the LDR is in the light,
and a HIGH voltage when the LDR is in the shade. The voltage divider circuit
gives an output voltage which changes with illumination.
A sensor subsystem which functions like this could be thought of as a 'dark
sensor' and could be used to control lighting circuits which are switched on
automatically in the evening.
Perhaps this does not seem terribly exciting, but almost every sensor circuit you
can think of uses a voltage divider. There's just no other way to make sensor
subsystems work.
Here is the voltage divider built with the LDR in place of Rtop :
Temperature sensors
A temperature-sensitive resistor is called a thermistor. There are several
different types:
How could you make a sensor circuit to detect temperatures less than 4C to
warn motorists that there may be ice on the road? You want a circuit which will
give a HIGH voltage in cold conditions. You need a voltage divider with the
thermistor in place of Rbottom :
This last application raises an important question: How do you know what value
of Vout you are going to get at 4C?
Key point: The biggest change in Vout from a voltage divider is obtained when
Rtop and Rbottom are equal in value
Sound sensors
Another name for a sound sensor is a microphone. The diagram shows a
cermet microphone:
Cermet' stands for 'ceramic' and 'metal'. A mixture of these materials is used in
making the sound-sensitive part of the microphone. To make them work
properly, cermet microphones need a voltage, usually around 1.5 V across them.
A suitable circuit for use with a 9 V supply is:
The 4.7
and the 1
across the microphone. Sound waves generate small changes in voltage, usually
in the range 10-20 mV. To isolate these small signals from the steady 1.6 V, a
capacitor is used.
Signals from switches
When a switch is used to provide an input to a circuit, pressing the switch
usually generates a voltage signal. It is the voltage signal which triggers the
circuit into action. What do you need to get the switch to generate a voltage
signal? . . . You need a voltage divider. The circuit can be built in either of two
ways:
The pull down resistor in the first circuit forces Vout to become LOW except
when the push button switch is operated. This circuit delivers a HIGH voltage
when the switch is pressed. A resistor value of 10
is often used.
In the second circuit, the pull up resistor forces Vout to become HIGH except
when the switch is operated. Pressing the switch connects Vout directly to 0 V. In
other words, this circuit delivers a LOW voltage when the switch is pressed.
In circuits which process logic signals, a LOW voltage is called 'logic 0' or just
'0', while a HIGH voltage is called 'logic1' or '1'. These voltage divider circuits
are perfect for providing input signals for logic systems.
What kinds of switches could you use. One variety of push button switch is
called a miniature tactile switch. These are small switches which work well
with prototype board:
As you can see, the switch has four pins which are linked in pairs by internal
metal strips. Pressing the button bridges the contacts and closes the switch. The
extra pins are useful in designing printed circuit boards for keyboard input and
also stop the switch from being moved about or bent once soldered into
position.
There are lots of other switches which you might want to use in a voltage
divider configuration. These include magnetically-operated reed switches, tilt
switches and pressure pads, all with burglar alarm applications.
SOLDERING
org 0003h
reti
org 000Bh
reti
org 0013h
reti
org 001Bh
reti
org 0023h
reti
org 002Bh
reti
org 33h
poweron:
mov sp,#stack
mov p0,#0ffh
mov p1,#0ffh
mov p2,#0ffh
mov p3,#0ffh
mov IE,#00h
mov IP,#00h
acall mainlp
mainlp:
setb p3.7
;show car is parked or not on led
acall init_LCD
acall express
acall start1
acall nooo
Following instruction will display black box on LCD. Fcbfl
instruction is to to write data on LCD in first line. First of all data
in table in dptr-16 bit register. Then we will call write
instruction. In write instruction we will mov data pointewin
accumulator and acc data on LCd and check zero at end. If zero
detetected it will show data on LCD
express:
acall fcbfl
mov dptr,#TABLE1
acall write
ret
start1:
jnb p1.0,phase1;gas
jnb p1.1,phase2
jnb p1.2,phase3
jnb p1.3,phase4
jnb p1.4,phase5
jnb p1.3,phase5
jnb p1.4,phase6
acall phase10
acall delay
sjmp start1
phase1:
;gas
acall fcbsl
mov dptr,#TABLE2
acall write
clr p2.0
setb p2.1
acall buzze
acall delay1
acall delay1
acall delay1
ret
phase2:
;dipper
acall fcbsl
mov dptr,#TABLE3
acall write
clr p2.0
setb p2.1
acall buzze
acall delay1
acall delay1
acall delay1
ret
phase3:
;Rain
acall fcbsl
mov dptr,#TABLE4
acall write
clr p2.0
setb p2.1
acall buzze
acall delay1
acall delay1
acall delay1
acall delay
clr p2.0
setb p2.1
ret
This program is to write table 6 on LCD. In table 6 we will
display fire detected signal on LCD
phase4:
;thermocouple
mov dptr,#TABLE6
acall write
clr p2.0
setb p2.1
acall buzze
acall delay1
acall delay1
acall delay1
acall delay
ret
phase5:
; LDR
acall fcbsl
mov dptr,#TABLE7
acall write
clr p2.0
setb p2.1
acall buzze
acall delay1
acall delay1
acall delay1
acall delay
ret
phase6:
acall fcbsl
mov dptr,#TABLE8
acall write
clr p2.0
setb p2.1
acall buzze
acall delay1
acall delay1
acall delay1
acall delay
ret
phase7:
acall fcbsl
mov dptr,#TABLE9
acall write
clr p2.0
setb p2.1
acall buzze
acall delay1
acall delay1
acall delay1
acall delay
ret
phase10:
acall fcbsl
mov dptr,#TABLE5
acall write
setb p2.0
setb p2.1
setb p2.2
acall delay1
acall delay1
ret
To make buzzer we will clear buzzer so that it will give low
signal from microcontroller to buzzer circuit. In Buzzer circuit
we will use two npn and pnp transistors.
We will use BC 548 npn and bc 558 pnp transistors.
acall delay
acall delay
setb buzz
ret
clrlcd:
mov A,#01h
acall command
acall delay
ret
init_LCD:
; LCD routines
mov A,#38h
acall command
acall delay
Display clear
mov A,#0Eh
increment
acall command
acall delay
mov A,#01h
increment
acall command
acall delay
mov A,#06h
increment
acall command
acall delay
ret
display:
mov lcd,a
setb rs
clr rw
setb en
acall delay
clr en
ret
command:
mov lcd,a
clr rs ; 4thn pin of LCD
clr rw
setb en
acall delay
clr en
ret
write:
clr a
movc a,@a+dptr
acall display
acall delay
inc dptr
jz again
sjmp write
again: acall delay1
fcbfl:
mov a,#80h
acall command
acall delay
ret
fcbsl:
mov a,#0C0h
LINE
acall delay
acall command
ret
delay:
mov r3,#50
here2: mov r4,#255
;lcd delay
here:
djnz r4,here
djnz r3,here2
ret
delay1:
;motor delay
mov r0,#0ffh
her: mov r1,#0ffh
h1: djnz r1,h1
djnz r0,her
ret
nooo:
nop
;DATA TABLE
we will create table for black box. To display more then one
charater on LCD. Then we will make table in database.Keep
data in double colons and end with comma. After completing
characters finish it with Zero so that we can check character
finished or not.
TABLE1: DB "BLACK BOX*****",0
TABLE2: DB 'GAS DETECTED**',0
TABLE3: DB "DPPER ON******",0
TABLE4: DB "RAIN DETECTED*",0
BIBILIOGRAPHY
A.K.
MAINI.
2.HAND BOOK OF ELECTRONICS
3.LET US C
KANITKAR.
4.SHYAM SERIES
TATA MC
GRILL.
RONALD LTOCCI.
(Sixth addition)
6.ELECTRONICS FOR YOU
(MARCH
1998).
7.DIGITAL DESIGN
MORIS
MANO.
(Second addition)
8.RELAYS AND ITS APPLICATION
SHARMA, MC.
(Bpb-publishers)
9.MODERN ALL ABOUT MOTHERBOARD
LOTHIA, M.
(Bpb-publishers)
10.POWER SUPPLY FOR ALL OCCASION
SHARMA,
MC.
(Bpb-publishers)
11.CMOS DATA BOOK (74SERIES)
ECA.
(Bpb-publishers)
12.PRACTICAL VALUE AND TRANSISTOR DATA
POPE.
(Bpb-publishers)
13.PRACTICAL TRANSFORMER DESIGN HAND BOOK
(Bpb-publishers)
LABON. E.
14 MODERN IC
LOTIA.
(DATA AND SUBSTITUTIONAL MANUAL)
MANAHAR