black box set report

Upload: rohit-verma

Post on 04-Mar-2016

220 views

Category:

Documents


0 download

DESCRIPTION

black box security system(project report)

TRANSCRIPT

Dissertation submitted in partial fulfillment of the Btech. course.

Black Box

Under the Guidence of Arun BansalInnovative Project solutionswww.ludhianaprojects.comludhiana

Submitted ByAbhishek KaushikSG-119836.

Table of Contents

1. Acknowledgements.2. Certificate.3. Introduction to the Project.4. Circuit Diagram.5. Component List.6. Hardwarea. Power Supply for the circuit.b. Integrated Circuits.c. Transistors.d. Diode.e. Relays.f. Transformer.g. Resistors.h. Capacitors.

7. Project Working.8. Project Synopsis.9. Bibliography.

IntroductionWe 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

Component List:-Microcontroller 89C051LCD display 16*2 matrixKeys matrixStepper MotorWood or plyCrystal 3.58MhzResistance 220 ohmCapacitor 0.01 micro faradKeyboard general or push to on ButtonDIP switchesConnecting wiresMicrocontroller programming kit12v supplycopper clad boardFerric chlorideMarkerComputer

Micro Controller 8051

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.

Different microcontrollers in market.

PIC One of the famous microcontrollers used in the industries. It is based on RISC Architecture which makes the microcontroller process faster than other microcontroller.

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

DallasDallas 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 4K Bytes of Flash Memory 128 x 8-Bit Internal RAM Fully Static Operation: 1 MHz to 24 MHz 32 Programmable I/O Lines Two 16-Bit Timer/Counters Six Interrupt Sources (5 Vectored) Programmable Serial Channel Low Power Idle and Power Down Modes

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 areLets 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.

How is this time then calculated?

The speed with which a microcontroller executes instructions is determined by what is known as the crystal speed. A crystal is a component connected externally to the microcontroller. The crystal has different values, and some of the used values are 6MHZ, 10MHZ, and 11.059 MHz etc.Thus a 10MHZ crystal would pulse at the rate of 10,000,000 times per second.

The time is calculated using the formula

No of cycles per second = Crystal frequency in HZ / 12.

For a 10MHZ crystal the number of cycles would be,

10,000,000/12=833333.33333 cycles.

This means that in one second, the microcontroller would execute 833333.33333 cycles.

Therefore for one cycle, what would be the time? Try it out.

The instruction clr p1.0 would use one cycle to execute. Similarly, the instruction setb p1.0 also uses one cycle.

So go ahead and calculate what would be the number of cycles required to be executed to get a time of 30 seconds!

Getting back to our bulb example, all we would need to do is to instruct the microcontroller to carry out some instructions equivalent to a period of 30 seconds, like counting from zero upwards, then switch on the bulb, carry out instructions equivalent to 30 seconds and switch off the bulb.

Just put the whole thing in a loop, and you have a never ending on-off sequence.

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.

3. 128 bytes on-chip RAM

This is the space provided for executing the program in terms of moving data, storing data etc.

4. 32 I/O lines. (Four- 8 bit ports, labeled P0, P1, P2, P3)

In our bulb example, we used the notation p1.0. This means bit zero of port one. One bit controls one bulb.

Thus port one would have 8 bits. There are a total of four ports named p0, p1, p2, p3, giving a total of 32 lines. These lines can be used both as input or output.

5. Two 16 bit timers / counters.

A microcontroller normally executes one instruction at a time. However certain applications would require that some event has to be tracked independent of the main program.

The manufacturers have provided a solution, by providing two timers. These timers execute in the background independent of the main program. Once the required time has been reached, (remember the time calculations described above?), they can trigger a branch in the main program.

These timers can also be used as counters, so that they can count the number of events, and on reaching the required count, can cause a branch in the main program.

6. Full Duplex serial data receiver / transmitter.

The 8051 microcontroller is capable of communicating with external devices like the PC etc. Here data is sent in the form of bytes, at predefined speeds, also known as baud rates.

The transmission is serial, in the sense, one bit at a time

7. 5- interrupt sources with two priority levels (Two external and three internal)

During the discussion on the timers, we had indicated that the timers can trigger a branch in the main program. However, what would we do in case we would like the microcontroller to take the branch, and then return back to the main program, without having to constantly check whether the required time / count has been reached?

This is where the interrupts come into play. These can be set to either the timers, or to some external events. Whenever the background program has reached the required criteria in terms 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.

PIN FUNCTION OF IC 89C51.

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.

SPECIAL FUNCTION REGISTER ( SFR) ADDRESSES.

ACCACCUMULATOR0E0H

BB REGISTER0F0H

PSWPROGRAM STATUS WORD0D0H

SP STACK POINTER81H

DPTRDATA POINTER 2 BYTES

DPLLOW BYTE OF DPTR82HDPHHIGH BYTE OF DPTR83H

P0PORT080H

P1PORT190H

P2PORT20A0H

P3PORT30B0H

TMODTIMER/COUNTER MODE CONTROL89H

TCONTIMER COUNTER CONTROL88H

TH0TIMER 0 HIGH BYTE8CH

TLOTIMER 0 LOW BYTE8AH

TH1TIMER 1 HIGH BYTE8DHTL1TIMER 1 LOW BYTE8BH

SCONSERIAL CONTROL98H

SBUFSERIAL DATA BUFFER99H

PCONPOWER CONTROL87H

INSTRUCTIONS

SINGLE BIT INSTRUCTIONS.

SETBBIT SET THE BIT =1

CLR BITCLEAR THE BIT =0

CPL BITCOMPLIMENT THE BIT 0 =1, 1=0

JB BIT,TARGETJUMP TO TARGET IF BIT =1

JNB BIT, TARGETJUMP TO TARGET IF BIT =0

JBC BIT,TARGETJUMP TO TARGET IF BIT =1 &THEN CLEAR THE BIT

MOV INSTRUCTIONS

MOV instruction simply copy the data from one location to another location MOV D,S Copy the data from(S) source to D(destination)

MOV R0,A; Copy contents of A into Register R0

MOV R1,A; Copy contents of A into register R1

MOV A,R3; copy contents of Register R3 into Accnmulator.

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 instructions adds the source byte to the accumulator ( A) and place the result in the Accumulator.

MOV A, #25H

ADD A,#42H ; BY this instructions we add the value 42h in Accumulator ( 42H+ 25H)ADDA,R3;By this instructions we move the data from register r3 to accumulator and then add the contents of the register into accumulator .

SUBROUTINE CALL FUNCTION.

ACALL,TARGET ADDRESS

By this instructions we call subroutines with a target address within 2k bytes from the current program counter.

LCALL, TARGET ADDRESS.

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.

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 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 jump to any address within 64 k byte location. INSTRUCTIONS RELATED TO THE CARRY

JC TARGET

JUMP TO THE TARGET IF CY FLAG =1

JNC TARGET

JUMP TO THE TARGET ADDRESS IF CY FLAG IS = 0

INSTRUCTIONS RELASTED TO JUMP WITH ACCUMULATOR

JZ TARGET

JUMP TO TARGET IF A = 0

JNZ TARGET

JUMP IF ACCUMULATOR IS NOT ZERO

This instructions jumps if registe A has a value other than zero

INSTRUCTIONS RELATED TO THE ROTATE

RL A

ROTATE LEFT THE ACCUMULATOR

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

ROTATE A LEFT THROUGH CARRY

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.

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 instructions supports only direct addressing mode.

DPTR INSTRUCTIONS.

MOV DPTR,#16 BIT VALUE

LOAD DATA POINTER

This instructions load the 16 bit dptr register with a 16 bit immediate value

MOV C A,@A+DPTRThis 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 AINC RnINC DIRECT

DEC BYTE

This instructions subtracts 1 from the byte operand. Note that CY is unchanged

DEC ADEC RnDEC DIRECT

ARITHMATIC INSTRUCTIONS.

ANL dest-byte, source-byte

This perform a logical AND operation

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.

TMOD ( TIMER MODE ) REGISTER

Both timer is 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)

M1Mode bit 1

M0Mode bit 0

M1M0MODEOPERATING MODE

00013 BIT TIMER/MODE

01116 BIT TIMER MODE

1028 BIT AUTO RELOAD

113SPLIT TIMER MODE

PSW ( PROGRAM STATUS WORD)

CYPSW.7CARRY FLAG

ACPSW.6AUXILIARY CARRY

F0PSW.5AVAILABLE FOR THE USER FRO GENERAL PURPOSE

RS1PSW.4REGISTER BANK SELECTOR BIT 1

RS0PSW.3REGISTER BANK SELECTOR BIT 0

0VPSW.2OVERFLOW FLAG

--PSW.1USER DEFINABLE BIT

PPSW.0PARITY 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 = 1CRYSTAL FREQUENCYTH1=256--------------------------------------192 X BAUD RATE

There are two ways to increase the baud rate of data transfer in the 8051

1. To use a higher frequency crystal2. 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)HEXSMOD =0SMOD =1

-3FD960019200-6FA48009600-12F424004800-24E812002400

XTAL = 11.0592 MHZ

IE ( INTERRUPT ENABLE REGISTOR)

EAIE.7Disable all interrupts if EA = 0, no interrupts is acknowledged If EA is 1, each interrupt source is individually enabled or disbaledBy sending or clearing its enable bit.

IE.6NOT implemented

ET2IE.5enables or disables timer 2 overflag in 89c52 only

ESIE.4Enables or disables all serial interrupt

ET1IE.3Enables or Disables timer 1 overflow interrupt

EX1IE.2Enables or disables external interrupt

ET0IE.1Enables or Disbales timer 0 interrupt.

EX0IE.0Enables or Disables external interrupt 0

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.7NOT IMPLEMENTED, RESERVED FOR FUTURE USE.

IP.6NOT IMPLEMENTED, RESERVED FOR FUTURE USE

PT2IP.5DEFINE THE TIMER 2 INTERRUPT PRIORITY LELVEL

PSIP.4DEFINES THE SERIAL PORT INTERRUPT PRIORITY LEVEL

PT1IP.3DEFINES THE TIMER 1 INTERRUPT PRIORITY LEVEL

PX1IP.2DEFINES EXTERNAL INTERRUPT 1 PRIORITY LEVEL

PT0IP.1DEFINES THE TIMER 0 INTERRUPT PRIORITY LEVEL

PX0IP.0DEFINES THE EXTERNAL INTERRUPT 0 PRIORITY LEVEL

SCON: SERIAL PORT CONTROL REGISTER , BIT ADDRESSABLE

SCON

SM0:SCON.7 Serial Port mode specifier

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 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

R1SCON.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

TF1TCON.7Timer 1 overflow flag. Set by hardware when the Timer/Counter 1 Overflows. Cleared by hardware as processor

TR1TCON.6Timer 1 run control bit. Set/cleared by software to turn Timer Counter 1 On/off

TF0TCON.5Timer 0 overflow flag. Set by hardware when the timer/counter 0 Overflows. Cleared by hardware as processor

TR0TCON.4Timer 0 run control bit. Set/cleared by software to turn timer Counter 0 on/off.

IE1TCON.3External interrupt 1 edge flag

ITITCON.2Interrupt 1 type control bit

IE0TCON.1External interrupt 0 edge

IT0TCON.0Interrupt 0 type control bit.

- 8051 Instruction Set

Arithmetic Operations

MnemonicDescriptionSizeCycles

ADD A,Rn Add register to Accumulator (ACC).11

ADD A,direct Add direct byte to ACC.21

ADD A,@Ri Add indirect RAM to ACC.11

ADD A,#data Add immediate data to ACC.21

ADDC A,Rn Add register to ACC with carry.11

ADDC A,direct Add direct byte to ACC with carry.21

ADDC A,@Ri Add indirect RAM to ACC with carry.11

ADDC A,#data Add immediate data to ACC with carry.21

SUBB A,Rn Subtract register from ACC with borrow.11

SUBB A,direct Subtract direct byte from ACC with borrow21

SUBB A,@Ri Subtract indirect RAM from ACC with borrow.11

SUBB A,#data Subtract immediate data from ACC with borrow. 21

INC A Increment ACC.11

INC Rn Increment register.11

INC direct Increment direct byte.21

INC @Ri Increment indirect RAM.11

DEC A Decrement ACC.11

DEC Rn Decrement register.11

DEC direct Decrement direct byte.21

DEC @Ri Decrement indirect RAM.11

INC DPTR Increment data pointer.12

MUL AB Multiply A and B Result: A 1 A. Semiconductor diode schematic symbol: Arrows indicate the direction of electron current flow.When placed in a simple battery-lamp circuit, the diode will either allow or prevent current through the lamp, depending on the polarity of the applied voltage. (Figure below)

Diode operation: (a) Current flow is permitted; the diode is forward biased. (b) Current flow is prohibited; the diode is reversed biased.When the polarity of the battery is such that electrons are allowed to flow through the diode, the diode is said to be forward-biased. Conversely, when the battery is backward and the diode blocks current, the diode is said to be reverse-biased. A diode may be thought of as like a switch: closed when forward-biased and open when reverse-biased. Oddly enough, the direction of the diode symbol's arrowhead points against the direction of electron flow. This is because the diode symbol was invented by engineers, who predominantly use conventional flow notation in their schematics, showing current as a flow of charge from the positive (+) side of the voltage 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.

Hydraulic check valve analogy: (a) Electron current flow permitted. (b) Current flow prohibited.Check valves are essentially pressure-operated devices: they open and allow flow if the pressure across them is of the correct polarity to open the gate (in the analogy shown, greater fluid pressure on the right than on the left). If the pressure is of the opposite polarity, the pressure difference across the check valve will close and hold the gate so that no flow occurs. Like check valves, diodes are essentially pressure- operated (voltage-operated) devices. The essential difference between forward-bias and reverse-bias is the polarity of the voltage dropped across the diode. Let's take a closer look at the simple battery-diode-lamp circuit shown earlier, this time investigating voltage drops across the various components in Figure below. ucts current and drops a small voltage across it, leaving most of the battery voltage dropped across the lamp. If the battery's polarity is reversed, the diode becomes reverse-biased, and drops all of the battery's voltage leaving none for the lamp. If we consider the diode to be a self-actuating switch (closed in the forward-bias mode and open in the reverse-bias mode), this behavior makes sense. The most substantial difference is that the diode drops a lot more voltage when conducting than the average mechanical switch (0.7 volts versus tens of millivolts). This forward-bias voltage drop exhibited by the diode is due to the action of the depletion region formed by the P-N junction under the influence of an applied voltage. If no voltage applied is across a semiconductor diode, a thin depletion region exists around the region of the P-N junction, preventing current flow. (Figure below (a)) The depletion region is almost devoid of available charge carriers, and acts as an insulator:

Diode representations: PN-junction model, schematic symbol, physical part.The schematic symbol of the diode is shown in Figure above (b) such that the anode (pointing end) corresponds to the P-type semiconductor at (a). The cathode bar, non-pointing end, at (b) corresponds to the N-type material at (a). Also note that the cathode stripe on the physical part (c) corresponds to the cathode on the symbol. If a reverse-biasing voltage is applied across the P-N junction, this depletion region expands, further resisting any current through it. (Figure below)

Depletion region expands with reverse bias.Conversely, if a forward-biasing voltage is applied across the P-N junction, the depletion region collapses becoming thinner. The diode becomes less resistive to current through it. In order for a sustained current to go through the diode; though, the depletion region must be fully collapsed by the applied voltage. This takes a certain minimum voltage to accomplish, called the forward voltage as illustrated in Figure below.

Inceasing forward bias from (a) to (b) decreases depletion region thickness.For silicon diodes, the typical forward voltage is 0.7 volts, nominal. For germanium diodes, the forward voltage is only 0.3 volts. The chemical constituency of the P-N junction comprising the diode accounts for its nominal forward voltage figure, which is why silicon and germanium diodes have such different forward voltages. Forward voltage drop remains approximately constant for a wide range of diode currents, meaning that diode voltage drop is not like that of a resistor or even a normal (closed) switch. For most simplified circuit analysis, the voltage drop across a conducting diode may be considered constant at the nominal figure and not related to the amount of current.

A light-emitting diode (LED) (pronounced /l i di/, L-E-D[1]) 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,[2] early LEDs emitted low-intensity red light, but modern versions are available across the visible, ultraviolet and infrared wavelengths, with very high brightness. When a light-emitting diode is forward biased (switched on), electrons are able to recombine with electron 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 often small in area (less than 1mm2), and integrated optical components may be used to shape its radiation pattern.[3] 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. LEDs powerful enough for room lighting are relatively expensive and require more precise current and heat management than compact fluorescent lamp sources of comparable output.Light-emitting diodes are used in applications as diverse as replacements for aviation lighting, automotive lighting (particularly brake lamps, turn signals and indicators) as well as in traffic signals

LIGHT EMITTING DIODELED falls within the family of P-N junction devices. The light emitting diode (LED) is a diode that will give off visible light when it is energized. In any forward biased P-N junction there is, within the structure and primarily close to the junction, a recombination of holes and electrons. This recombination requires that the energy possessed by the unbound free electron be transferred to another state.The process of giving off light by applying an electrical source of energy is called electroluminescence. As shown in fig., with its graphic symbol, the conducting surface connected to the P-material is much smaller, to permit the emergence of the maximum number of photons of light energy. Note in the figure that the recombination of the injected carriers due to the forward-biased junction results in emitted light at the site of recombination. There may, of course, be some absorption of the packages of photon energy in the structure itself, but a very large percentage are able to leave, as shown in the fig.

Fig. Process of electroluminescence in the LED

Absolute Maximum Ratings at TA = 25CParameterHigh Eff. Red 4160Units

Power dissipation120mW

Average forward current 20[1]mA

Peak forward current60mA

Operating and storage temperature range-55C to 100C

Lead soldering temperature [1.6mm (0.063 in.) from body]230C for 3 seconds

[1] Derate from 50C at 0.2 mA/C

Electrical/Optical Characteristics at TA = 25CParameterSymbolHigh Eff. Red 4160UnitsTest Conditions

Min. TypeMax

Axial luminous intensityIv1.03.0mcdIF = 10mA

Included angle between half luminous intensity points21/2 80deg.-

Peak wave lengthpeak635nmMeasurement at Peak

Dominant wave lengthd628nm-

Speed of responses90ns

CapacitanceC11pFVF=0; f=1 MHz

Thermal resistanceJC120C/WJunction to cathode lead at 0.79 mm (0.031 in)from body

Forward voltageVF2.23.0VIF = 10mA

Reverse breakdown voltageBVR5.0VIR = 100A

Luminous efficacy v147Lm/V-

BC548

NPN General Purpose AmplifierThis device is designed for use as general purpose amplifiersand switches requiring collector currents to 300 mA. Sourced fromProcess 10. See PN100A for characteristics.

TRANSISTOR (BC558)

A transistor is semi conductor device consisting of three regions separated by two P-N junctions. The three regions are Base, Emitter & Collector.The base may be of N- type or P- type. The emitter and collector have same impurities but different from that of base. Thus if base is of N- type then emitter and collector are of P- type then transistor is called P-N-P transistor and vice versa transistor is called N-P-N transistor.The base is made thin and number density of majority carriers is always less than emitter and collector. The base provides junction for proper interaction between emitter and collector.Electrons are majority charge carriers in N- region and in P-region, holes are the majority charge carriers. Thus two types of charge carriers are involved in current flow through N-P-N or P-N-P transistor.

SYMBOLS FOR TRANSISTORS:In schematic symbols, the emitter is always represented by an arrow indicating the direction of conventional current in the device.In case of N-P-N transistor arrow points away from base and in case of P-N-P transistor it points towards base.When transistor is used in circuit, emitter - base junction is always forward biased while base - collector junction is always reverse biased.

BIASING OF TRANSISTOR:The two junctions can be biased in four different ways:Both junctions may be forward biased. It causes large current to flow across junctions. Transistor is to be operated in SATURATION REGION.Both junctions may be reversed biased. It causes very small current to flow across junctions. Transistor is to be operated in CUT OFF REGION.E-B junction is forward biased and C-B junction is reverse biased. The transistor is said to be operated in ACTIVE REGION. Most of the transistors work in this region.E-B junction is reversed biased and C-B junction is forward biased. The transistor is said to be operated in INVERTED MODE.

Fig. (a) P-N-P transistor biasing (b) N-P-N transistor biasing

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 :Ta = 25C unless otherwise notedParameterSymbolValue

Collector Emitter VoltageVCEO-30

Collector Base VoltageVCBO-30

Emitter Base VoltageVEBO-5

Collector Current (DC)IC-100

Collector DissipationPC500

Junction TemperatureTJ150

Storage Temperature TSTG-65 to 150

Electrical Characteristics : Ta = 25C unless otherwise notedParameterSymbolTest ConditionMin.Type

Collector Cut-off CurrentICBOVCB = -30V, IE=0

DC Current GainhfeVCB = -5V, IC=2mA110

Collector Emitter Saturation VoltageVCE(sat)IC= -10mA, IB= -0.5mAIC= -100mA, IB= -5mA-90-250

Collector Base Saturation VoltageVBE(sat)IC= -10mA, IB= -0.5mAIC= -100mA, IB= -5mA-700-900

Base Emitter On VoltageVBE(On)VCE= -5V, IC= -2mAVCE= -5V, IC= -10mA-600-660

Current Gain Bandwidth ProductfTVCE= -5V, IC= -10mA,f=10MHz150

Output CapacitanceCobVCB= -10V,IE=0,f=1MHz

Noise FigureNFVCE= -5V, IC= -200mA2

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. Amagnetic field(from anelectromagnetor apermanent 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 non-ferrous precious metal over the flat contact portions of the reeds; low-resistivitysilveris more suitable thancorrosion-resistantgoldin the sealed envelope. There are also versions of reed switches withmercury"wetted" contacts. Such switches must be mounted in a particular orientation otherwise drops of mercury may bridge the contacts even when not activated.Since the contacts of the reed switch are sealed away from the atmosphere, they are protected againstatmospheric corrosion. The hermetic sealing of a reed switch make them suitable for use in explosive atmospheres where tiny sparks from conventional switches would constitute a hazard.One important quality of the switch is its sensitivity, the amount ofmagnetic fieldnecessary to actuate it. Sensitivity is measured in units ofAmpere-turns, corresponding to the current in a coil multiplied by the number of turns. Typical pull-in sensitivities for commercial devices are in the 10 to 60 AT range. The lower the AT, the more sensitive the reed switch. Also, smaller reed switches, which have smaller parts, are more sensitive to magnetic fields, so the smaller the reed switch's glass envelope is, the more sensitive it is.In production, a metal reed is inserted in each end of a glass tube and the end of the tube heated so that it seals around a shank portion on the reed.Infrared-absorbing glass is used, so an infrared heat source can concentrate the heat in the small sealing zone of the glass tube. The thermal coefficient of expansion of the glass material and metal parts must be similar to prevent breaking theglass-to-metal seal. The glass used must have a highelectrical resistanceand must not contain volatile components such aslead oxideandfluorides. The leads of the switch must be handled carefully to prevent breaking the glass envelope..

MICROSWITCH

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.[1][2] 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 nonconducting.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.

IC 7805 :

Three Terminal Positive Fixed Voltage RegulatorsThese voltage regulators are monolithic integrated circuits designed as fixed voltage. These regulators employ internal current limiting, thermal shutdown, and safe-area compensation. With adequate heat sinking they can deliver output currents in excess of 1.0A. Although designed primarily as a fixed voltage regulator, these devices can be used with external components to obtain adjustable voltages and currents. Output Current in Excess of 1.0A No external components required Internal thermal overload protection Internal short circuit current limiting

Output transistor safe area compensation Output voltage offered in 2% and 4% tolerance Available in surface mount D2pAK and standard 3-lead transistor packages Previous commercial temperature range has been extended to a junction temperature range of 40C to +125C

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.

Fig. Block Diagram of IC7805Absolute Maximum Rating :ParameterSymbolValueUnit

Input Voltage (for VO=5V to 18V) (for VO =24V)VIVI3540VV

Thermal Resistance, Junction to Cases (TO-220)RJC5C/W

Thermal Resistance, Junction to Air (TO-220)RJC65C/W

Operating Temp. RangeTOPR0 - +125C

Storage Temp. RangeTSTG-65 - +150C

Electrical Characteristics (TA = 25C unless otherwise noted)ParameterSymbolMinTypeMax.Unit

Output Voltage TJ =+25CVO4.85.05.2V

Line Regulation (Note 1) VO =7V to 25VRegline-4.0100MV

Load Regulation (Note 1)IO = 5.0mA to 1.5ARegload-9100MV

Quiescent Current TJ =+25CIQ-5.08.0mA

Quiescent Current Change IO = 5.0mA to 1.0AIQ-0.030.5mA

Output Voltage DriftIO = 5.0mAVO/T--0.8-MV/C

Output Noise Voltagef=10Hz to 100MHz TA=+25CVN-42-V/VO

Ripple Rejectionf=120Hz, VO=8V to 18VRR6273-dB

Dropout VoltageIO = 1A, TA=+25CVDrop-2-V

Output Resistancef=1KHzrO-15-m

Short Circuit CurrentVI = 35V, TA=+25CISC-230-MA

Peak Current TA=+25CIPK-2.2-A

NOTE : Load and line regulation are specified at constant junction temperature. Changes in VO due to heating effects must be taken into account separately. Pulse testing with low duty is used

RELAYS

STRIPOUT N/COUT N/OSPRINGMAGNET230V P

A relay is an electrically operated switch. The relay contacts can be made to operate in the pre-arranged fashion. For instance, normally open contacts close and normally closed contacts open. In electromagnetic relays, the contacts however complex they might be, they have only two position i.e. OPEN and CLOSED, whereas in case of electromagnetic switches, the contacts can have multiple positions.

NEED FOR THE USE OF RELAY

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 relay2. Power Relay.3. Time Delay Relay.4. Latching Relay.5. Crystal Can Relay.6. Co-axial Relay.

1. Electromagnetic relay:

An electromagnetic relay in its simplest form consists of a coil, a DC current passing through which produces a magnetic field. This magnetic field attracts an armature, which in turn operates the contacts. Normally open contacts close and normally closed contacts open. Electromagnetic relays are made in a large variety of contacts forms.

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.

3. Time Delay Relay:

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.

5. Crystal Can Relay:

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

How to control sensors

What is a voltage divider?You are going to find out but don't be in too much of a hurry. Work through the Chapter and allow the explanation to develop.The diagram below shows a light dependent resistor, or LDR, together with its circuit symbol:

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:

What happens if one of the resistors in the voltage divider is replaced by an LDR? In the circuit below, Rtop is a 10 resistor, and an LDR is used as Rbottom :

Suppose the LDR has a resistance of 500 , 0.5 , in bright light, and 200 in the shade (these values are reasonable). When the LDR is in the light, Vout will be:

In the shade, Vout will be:

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 sensorsA temperature-sensitive resistor is called a thermistor. There are several different types:

The resistance of most common types of thermistor decreases as the temperature rises. They are called negative temperature coefficient, or ntc, thermistors. Note the -t next to the circuit symbol. A typical ntc thermistor is made using semiconductor metal oxide materials. (Semiconductors have resistance properties midway between those of conductors and insulators.) As the temperature rises, more charge carriers become available and the resistance falls.Although less often used, it is possible to manufacture positive temperature coefficient, or ptc, thermistors. These are made of different materials and show an increase in resistance with temperature.How could you make a sensor circuit for use in a fire alarm? You want a circuit which will deliver a HIGH voltage when hot conditions are detected. You need a voltage divider with the ntc thermistor in the Rtop position:

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 valueSound sensorsAnother 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.5V across them. A suitable circuit for use with a 9V supply is:

The 4.7 and the 1 resistors make a voltage divider which provides 1.6V 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.6V, a capacitor is used. Signals from switchesWhen 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 0V. 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

Soldering is the process of joining two metallic conductors the joint where two metal conductors are to be joined or fused is heated with a device called soldering iron and then as allow of tin and lead called solder is applied which melts and converse the joint. The solder cools and solidifies quickly to ensure is good and durable connection between the jointed metal converting the joint solder also present oxidation.

SOLDERING & DESOLDERING TECHNIQUES :There are basically two soldering techniques:Manual soldering with iron. Mass soldering.The iron consist of an insulated handle connected via a metal shank to the bit the function of bit is to Stare host & convey it to the component To store and deliver molten solder 7 flux.To remove surplus solder from joints.Soldering bit are made of copper because it has good heat capacity & thermal conductivity. It may erode after long term use to avoid it coating of nickel or tin is used.

SOLDERING WITH IRON :The surface to be soldered must be cleaned & fluxed. The soldering iron switched on & bellowed to attain soldering temperature. The solder in form of wire is allied hear the component to be soldered &b heated with iron. The surface to be soldered is filled, iron is removed & the joint is cold without disturbing.

Solder joint are supposed to Provide permanent low resistance pathMake a robust mechanical link between PCB & leads of components.Allow heat flow between component, joining elements & PCB.Retain adequate strength with temperature variation.The following precaution should be taken while soldering. Use always an iron plated copper core tip for soldering iron.Slightly fore the tip with a cut file when it is cold. Use a wet sponge to wipe out dirt from the tip before soldering instead of asking the iron.Tighten the tip screw if necessary before iron is connected to power supply.Clean component lead & copper pad before soldering.Use proper tool for component handling instead of direct handling. Apply solder between component leads, PCB pattern & tip of soldering iron.Iron should be kept in contact with the joint s for 2-3 second s only instead of keeping for very long or very small time. Use optimum quantity of solder. Use multistoried wire instead of single strands solvent like isopropyl alcohol. Every time soldering is over, put a little clean solder on the tip.

org 0003hretiorg 000Bhretiorg 0013hretiorg 001Bhretiorg 0023hretiorg 002Bhretiorg 33hpoweron:mov sp,#stackmov p0,#0ffhmov p1,#0ffhmov p2,#0ffhmov p3,#0ffhmov IE,#00hmov IP,#00h

acall mainlpmainlp:setb p3.7 ;show car is parked or not on ledacall init_LCD;calling LCd commands acall express acall start1acall noooFollowing 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 LCDexpress:; moving auto carparking on lcdacall fcbfl mov dptr,#TABLE1 acall write ret

start1: ; moving motor forward and backward jnb p1.0,phase1;gasjnb p1.1,phase2jnb p1.2,phase3jnb p1.3,phase4jnb p1.4,phase5jnb p1.3,phase5jnb p1.4,phase6 acall phase10acall delaysjmp start1phase1:;gas acall fcbsl mov dptr,#TABLE2 acall write clr p2.0setb p2.1acall buzze acall delay1acall delay1acall delay1retphase2:;dipperacall fcbsl mov dptr,#TABLE3 acall write clr p2.0 setb p2.1acall buzzeacall delay1acall delay1acall delay1retphase3:;Rainacall fcbsl mov dptr,#TABLE4 acall write clr p2.0 setb p2.1acall buzze acall delay1acall delay1acall delay1 acall delayclr p2.0 setb p2.1 retThis program is to write table 6 on LCD. In table 6 we will display fire detected signal on LCDphase4:;thermocouplemov dptr,#TABLE6 acall write clr p2.0 setb p2.1acall buzze acall delay1acall delay1acall delay1 acall delay retphase5:; LDRacall fcbsl mov dptr,#TABLE7 acall write clr p2.0 setb p2.1acall buzze acall delay1acall delay1acall delay1 acall delay retphase6:acall fcbsl mov dptr,#TABLE8 acall write clr p2.0 setb p2.1acall buzze acall delay1acall delay1acall delay1 acall delay retphase7:acall fcbsl mov dptr,#TABLE9 acall write clr p2.0 setb p2.1acall buzze acall delay1acall delay1acall delay1 acall delay retphase10:acall fcbsl mov dptr,#TABLE5 acall writesetb p2.0 setb p2.1setb p2.2 acall delay1acall delay1 retTo 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.We will give low signal from mircoontroller to pnp transistor . pnp transistors o/p will be connected to npn. Npn will give low signal to buzzer or relay circuit. buzze: clr buzz acall delay acall delay setb buzz retclrlcd: mov A,#01h ;Entry mode, Set increment acall commandacall delayretinit_LCD:; LCD routinesmov A,#38h ;Display clear acall command ;acall delay mov A,#0Eh ;Entry mode, Set increment acall commandacall delaymov A,#01h ;Entry mode, Set increment acall commandacall delaymov A,#06h ;Entry mode, Set increment acall commandacall delayret

display: ;WRITE COMMAND TO LCD mov lcd,asetb rs clr rw setb enacall delayclr en ret command: ;INSTRUCTION COMMAND TO LCD mov lcd,a clr rs ; 4thn pin of LCDclr rwsetb enacall delayclr enret write: ;WRITE FROM DATATABLES clr a movc a,@a+dptracall display acall delay inc dptrjz again sjmp writeagain: acall delay1

fcbfl: mov a,#80h ;CURSOR AT BEGINNING OF IST LINE acall commandacall delayret fcbsl: mov a,#0C0h ;CURSOR AT BEGINNING OF IIND LINE acall delayacall command ret

delay:;lcd delaymov r3,#50here2: mov r4,#255here: djnz r4,heredjnz r3,here2retdelay1:;motor delaymov r0,#0ffhher: mov r1,#0ffh h1: djnz r1,h1djnz r0,herretnooo: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 TABLE5: DB "NO PROBLEM****",0 TABLE6: DB "FIRE DETECTED*",0TABLE7: DB "SOMEONE IN CAR",0end

BIBILIOGRAPHY 1. HAND BOOK OF ELECTRONICS A.K. MAINI.2.HAND BOOK OF ELECTRONICS GUPTA & KUMAR.3.LET US C YASHWANT KANITKAR. 4.SHYAM SERIES TATA MC GRILL.5.DIGITAL SYSTEMS PRINCIPLES AND APPLICATION 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 LABON. E. (Bpb-publishers) 14 MODERN IC MANAHAR LOTIA. (DATA AND SUBSTITUTIONAL MANUAL)