Thursday, 26 April 2012

AUTHENTICATED AND SECURED ACCESS OF A SYSTEM USING SMART CARD TECHNOLOGY

14:14



TITLE OF THE PROJECT:-
“Conceptual designs development & demonstrations of a AUTHENTICATED AND SECURED ACCESS OF A SYSTEM USING SMART CARD TECHNOLOGY”
 


OBJECTIVES:-understanding and implementing smart card authentication Understanding and Implementing Smart Card Authentication THE CIRCUIT
NEED OF POWER SUPPLY:-
Component list

ETC.

TIMER 0

TIMER 1
 



Program Counter

 


CY       AC       F0       RS1       RS0       OV       --         P   

 
LCD PIN DESCRIPTION
VALUE CODE
TOLERANCE CODE
                                                             
                                      
A transformer works by electromagnetic induction: AC. is supplied to the primary and produces a changing magnetic field, which passes through the secondary, thereby inducing a changing (alternating) voltage in the secondary. It is important that as much as possible of the magnetic field produced by the primary passes through the secondary. A practical arrangement designed to achieve this in an iron-cored transformer in which the secondary is wound on top of the primary. We should also notice that the induced voltage in the secondary is always of opposite polarity to the primary voltage.
TYPES OF TRANSFORMER
CAPACITOR
FIXED CAPACITORS
             

·                   To Design a circuit of an electronic smart card using password, used to set up the password.
·                    Develop new ideas to implement this circuit purposely.
·                   To study the circuitry and different types of components & 89C51 microcontroller, magnetic sensor, smart card in the circuit.

Authentication is the process by which an entity identifies itself, before network logon is permitted. After a user is authenticated, access control defines what resources can be accessed, what actions can be performed on the resource, and whether these actions are audited or not. Access control is implemented by specifying permissions for resources and objects, and assigning rights to users. Data protection involves two security concepts, namely, data confidentiality, and data integrity. Data confidentiality deals with securing data as it is transmitted over the network through the application of cryptographic operations. Encryption algorithms and the utilization of private and public keys provide data confidentiality. Any unauthorized parties intercepting the message, will not be able to interpret the contents of the message. Data integrity is implemented through the digital signing of messages, and files. Through the use of digital signatures, you can determine whether the message was tampered with or not. From this brief discussion, you can see that many concepts and principals are included when discussing security. So where does smart cards fit into the process of securing an organization's network and resources from malicious attacks. The answer is authentication.
As mentioned earlier, authentication is process whereby which users or other entities identify themselves so that they can attempt to access network resources. Authentication is the initial step in the process of allowing users to access network resources. In Active Directory, user authentication occurs by the user providing user account credentials, such as the user logon name, password, and the user's security identifier (SID).
Authentication in Windows Server 2003 environments involves the following two processes:
·         Interactive logon: Interactive logon occurs when a user logs on to the system using a password or smart card.
·         Network authentication: Network authentication occurs when a user is permitted to access resources, without the user having to re-enter this password or the personal identification number (PIN) of the smart card.
The user or entity proves its identity by using a shared secret. The shared secret can be one of the components listed below, and has to be a secret between the user requesting authentication, and the authenticator, for authentication to be successful:
·         A password
·         An encryption key
·         A secret PIN
Authentication protocols are used to share the secret between the user and authenticator. The authenticator then either allows access or denies the requestor access. The authentication protocols that can be used in Windows Server 2003 environments are listed below:
·         Kerberos version 5, used for network authentication. Kerberos version 5 is used for the interactive logon authentication process, and for network authentication in Windows Server 2003.
·         Secure Socket Layer/Transport Layer Security (SSL/TLS), used for network authentication and is based on X.509 public key certificates.
·         Microsoft Windows NT LAN Manager (NTLM), used for network authentication but mainly for Microsoft Windows NT 4 compatibility.
·         Microsoft Challenge Handshake Authentication Protocol version 2 (MS-CHAP v2), used for network authentication and dial-up authentication.
·         Password Authentication Protocol (PAP), used for network authentication and dial-up authentication.
·         Extensible Authentication Protocol-Transport Level Security (EAP-TLS), used for wireless connection authentication.
·         Extensible Authentication Protocol (EAP), used for network authentication and dial-up authentication, and includes support for smart cards (hardware enabled authentication).
Hardware enabled authentication occurs when encryption keys are stored on a smart card, a PC card, or some other cryptographic token mechanism, and the user needs to have the smart card, and the PIN or password to pass authentication and access the system. This provides an additional level of security because any unauthorized individuals attempting to access the system, needs the smart card and the PIN or password.
Smart card authentication is based on the use of smart cards and is supported in Windows 2000 and Windows Server 2003. A smart card is a security device or credit card sized hardware token which can be used to provide additional protection to applications and security protocols.
Smart cards provide the following features:
·         Secure method of user authentication
·         Interactive logon
·         Remote access logons
·         Administrator logons
·         Secure code signing
·         Secure e-mail
In network environments, they are typically used for following purposes
·         Logging on to a computer
·         Encryption of e-mail
·         Encryption of disk files through EFS
As mentioned earlier, smart card authentication provides very strong authentication because the user has to possess the smart card, and the user has to know the personal identification number (PIN). You can block a smart card from the system after a successive number of unsuccessful logon attempts have been made. To enable these features, smart card authentication involves the use of a smart card reader which is attached to the computer. It is recommended to use Plug and Play (PnP) readers with Windows Server 2003. The smart card contains a microprocessor and permanent flash memory that holds the user's logon information, private key, digital certificates, and other private information. When the userinserts the smart card into the smart card reader, the user has to provide the PIN to log on to the system. Smart cards are designed to provide tamper-resistant authentication. The difference between smart cards and software private keys is that you can move smart cards from one computer to computer.
The smart card reader is usually attached to the serial port, USB port, or PCMCIA port of the computer. Since PCs, laptop computers, and PDAs have one of these ports, smart card readers are supported by all computers. Smart cards are available in a number of forms. The majority though have a resemblance to credit cards. The more advanced smart cards utilize magnetics. What this means is that they do not need to have external contacts. A common form is the dongle which can fit into a USB port. From here, it is accessed by the Cryptographic Service Provider (CSP). The dongle form does not need any special reader. The downfall of the form is that it is roughly four times more costly than the conventional smart card forms. While the installation of a smart card implementation can be complex and expensive, another difficult process is determining which vendor to use. The drivers of smart card products from Gemplus and Schlumberger are actually built into the operating system.

Smart cards are becoming all pervasive. These are being adopted for many important private and public-sector applications.
Visa, MasterCard, American Express, JCB and other card payments associations are actively working with financial card issuers for conversion of all bank payment cards into smart cards. Contactless bank payment cards for fast, low-value payments at retail point-of-sale terminals are being launched.
Governments in Europe, USA and Asia have begun high-profile rollouts of smart cards for local and national schemes. At the same time, the movement towards next-generation, chip-based passports and visas, for increased border security and automated passenger clearance, is gaining momentum. Smart subscriber identity module (SIM) cards have been mandated for 3G hand-sets, and CDMA and TDMA  systems have begun their introduction. It is accepted that every mobile device device will contain at least one SIM card and interface to third-party smart cards for mobile payment and identity applications. Smart cards are also being introduced to secure wireless LAN access on 802. 11 networks. These cards will provide the foundation for digital identity and payment services over networks.
Although physical access control and transport automatic fare collection applications still dominate the contactless smart card market, end-users are beginning to explore and develop contactless technologies for new application. These include payment cards for fast and convenient low-value transactions at the point-of-sale, and long-life identification (ID) cards that offer increased security and convenience to sitizens.

WHAT’S A SMART CARD?
Smart cards are cards embedded with either a microprocessor and a memory chip or only a memory chip with non-programmable logic. The microprocessor card can add, delete and otherwise manipulate information on the card, while a memory-chip card (for example, prepaid phone cards) can only undertake a predefined operation.
Smart cards, unlike magnetic stripe cards, can carry all necessary functions and information on the card. Therefore they do not require access to remote databases at the time of the transaction.
There are three broad categories of smart cards, all of which are evolving rapidly into new markets and applications: integrated circuit (IC) microprocessor card, IC memory cards and optical memory cards.
Microprocessor cards (also referred to as ‘chip cards’) offer greater memory storage and security of data than traditional magnetic stripe cards. These can process data on the card. The current generation of chip cards has an 8-bit processor, 16 kB read-only memory (ROM) and 512 bytes of random-access memory (RAM). This gives them the equivalent processing power of the original IBM-XT computer, albeit with slightly less memory capacity.
Chip cards are used for a variety of applications, especially those with cryptography built in, which requires manipulation of large numbers. Thus chip cards have been the main platform for cards that hold a secure digital identity. Some examples of these cards are cards that hold money equivalents, cards that provide secure access to a network, cards that hold money equivalents, cards that provide secure access to a network, cards that secure cellular phones from fraud and cards that allow set-top boxes (STBs) on televisions to remain secure from piracy. IC memory cards can hold up to 4kb of data, but have no processor on the card with which to manipulate that data. Thus, these are dependent on the card reader (also known as the card-accepting device) for their processing and suitable for uses where the card performs a fixed operation. Memory cards represent the bulk of smart cards sold every year, primarily for prepaid, disposable card applications such as prepaid, phone cards. These cards are popular as high-security alternatives to magnetic stripe cards.
Optical memry cards look like a card with a piece of a CD glued on top-which is basically what they are. Thes cards can store up to 4MB of data. But once written, the data cannot be changed or removed. Therefore optical memory cards are ideal for record keeping- for example, medical files, driving records or travel histories. These cards have no processor in them, although efforts are on to put the processor on the cards. While these cards are comparable in price to chip cards, the card readers use non-standard protocols and are expensive.


 

BLOCK DIAGRAM

POWER SUPPLY
Perhaps all of you are aware that a power supply is a primary requirement for the test bench of a home experimenter’s mini lab. A battery eliminator can eliminate or replace the batteries of solid-state electronic equipment and 220V A.C. mains instead of the batteries or dry cells thus can operate the equipment. Nowadays, the sued of commercial battery eliminator or power supply unit have become increasingly popular as power source for household appliances like transceiver, record player, clock etc.
Summary of power supply circuit features:-

·       Brief description of operation: gives out well regulated +8V output, output current capability of 500mA.
·       Circuit protection: Built –in overheating protection shuts down output when regulator IC gets too hot.
·       Circuit complexity: simple and easy to build.
·       Circuit performance: Stable +8V output voltage, reliable Operation.
·       Availability of components: Easy to get, uses only common basic components.
·       Design testing: Based on datasheet example circuit, I have used this circuit successfully as part of other electronics projects.
·       Applications: part of electronics devices, small laboratory power supply.
·       Power supply voltage: unregulated 8-18V-power supply.
·       Power supply  current: needed output current 500 mA.
·       Components cost: Few rupees for the electronic components plus the cost of input transformer.






Pin Diagram of 7808 Regulator IC
Pin 1: Unregulated voltage input
Pin 2: Ground
Pin3: Regulated voltage output


1.  7805 regulator IC
2. 0-9 transformer     
3. 1000uf and 0.01uf. Capacitor, at least 25V voltage rating.
DESCRITION OF POWER SUPPLY

This circuit is a small + 8 volts power supply. Which is useful when experimenting with digital electronics.  Small inexpensive battery with variable output voltage are available, but usually their voltage regulation is very poor, which makes them not very usable for digital circuit experimenter unless a better regulation can be achieved in some way. The following circuit is the answer to the problem.
This circuit can give +5V output at about 500mA current. The circuit has overload and terminal protection.








CIRCUIT DIAGRAM OF POWER SUPPLY
The above circuit utilizes the voltage regulator IC 7808 and 7805 for the constant power supply. The capacitors must have enough high voltage rating to safely handle the input voltage feed to circuit. The circuit is very easy to build for example into a piece of Zero board.

THE CIRCUIT


THE MICROCONTROLER:

In our day to day life the role of micro-controllers has been immense. They are used in a variety of applications ranging from home appliances, FAX machines, Video games, Camera, Exercise equipment, Cellular phones musical Instruments to Computers, engine control, aeronautics, security systems and the list goes on.

MICROCONTROLLERS VERSUS MICROPROCESSORS

What is the difference between a microprocessor and microcontroller? The microprocessors (such as 8086,80286,68000 etc.) contain no RAM, no ROM and no I/O ports on the chip itself. For this reason they are referred as general- purpose microprocessors. A system designer using general- purpose microprocessor must add external RAM, ROM, I/O ports and timers to make them functional. Although the addition of external RAM, ROM, and I/O ports make the system bulkier and much more expensive, they have the advantage of versatility such that the designer can decide on the amount of RAM, ROM and I/o ports needed to fit the task at hand. This is the not the case with microcontrollers. A microcontroller has a CPU (a microprocessor) in addition to the fixed amount of RAM, ROM, I/O ports, and timer are all embedded together on the chip: therefore, the designer cannot add any external memory, I/O, or timer to it. The fixed amount of on chip RAM, ROM, and number of I/O ports in microcontrollers make them ideal for many applications in which cost and space are critical. In many applications, for example a TV remote control, there is no need for the computing power of a 486 or even a 8086 microprocessor. In many applications, the space it takes, the power it consumes, and the price per unit are much more critical considerations than the computing power. These applications most often require some I/O operations to read signals and turn on and off certain bits. It is interesting to know that some microcontrollers manufactures have gone as far as integrating an ADC and other peripherals into the microcontrollers.


       EXTERNAL
      INTERRUPTS












                                                                                          TXD  RXD


                  MICROCONTROLLER BLOCK DIAGRAM



      
MICROCONTROLLERS FOR EMBEDDED SYSTEMS
In the literature discussing microprocessors, we often see a term embedded system. Microprocessors and microcontrollers are widely used in embedded system products. An embedded product uses a microprocessor (or microcontroller) to do one task and one task only. A printer is an example of embedded system since the processor inside it performs one task only: namely, get data and print it. Contrasting this with a IBM PC which can be used for a number of applications such as word processor, print server, network server, video game player, or internet terminal. Software for a variety of applications can be loaded and run. Of course the reason a PC can perform myriad tasks is that it has RAM memory and an operating system that loads the application software into RAM and lets the CPU run it. In an embedded system, there is only one application software that is burned into ROM. An PC contains or is connected to various embedded products such as the keyboard, printer, modem, disk controller, sound card, CD-ROM driver, mouse and so on. Each one of these peripherals has a microcontroller inside it that performs only one task. For example, inside every mouse there is a microcontroller to perform the task of finding the mouse position and sending it to the PC.
      Although microcontrollers are the preferred choice for many embedded systems, there are times that a microcontroller is inadequate for the task. For this reason, in many years the manufacturers for general-purpose microprocessors have targeted their microprocessor for the high end of the embedded market.


INTRODUCTION TO 8051
In 1981, Intel Corporation introduced an 8-bit microcontroller called the 8051. This microcontroller had 128 bytes of RAM, 4K bytes of on-chip ROM, two timers, one serial port, and four ports (8-bit) all on a single chip. The 8051 is an 8-bit processor, meaning the CPU can work on only 8- bit pieces to be processed by the CPU. The 8051 has a total of four I/O ports, each 8- bit wide. Although 8051 can have a maximum of 64K bytes of on-chip ROM, many manufacturers put only 4K bytes on the chip.
         The 8051 became widely popular after Intel allowed other manufacturers to make any flavor of the 8051 they please with the condition that they remain code compatible with the 8051. This has led to many versions of the 8051 with different speeds and amount of on-chip ROM marketed by more than half a dozen manufacturers. It is important to know that although there are different flavors of the 8051, they are all compatible with the original 8051 as far as the instructions are concerned. This means that if you write your program for one, it will run on any one of them regardless of the manufacturer. The major 8051 manufacturers are Intel, Atmel, Dallas Semiconductors, Philips Corporation, Infineon.  



AT89C51 FROM ATMEL CORPORATION
This popular 8051 chip has on-chip ROM in the form of flash memory. This is ideal for fast development since flash memory can be erased in seconds compared to twenty minutes or more needed for the earlier versions of the 8051. To use the AT89C51 to develop a microcontroller-based system requires a ROM burner that supports flash memory: However, a ROM eraser is not needed. Notice that in flash memory you must erase the entire contents of ROM in order to program it again. The PROM burner does this erasing of flash itself and this is why a separate burner is not needed. To eliminate the need for a PROM burner Atmel is working on a version of the AT89C51 that can be programmed by the serial COM port of the PC.
FEATURES OF AT89C51
-        4K on-chip ROM
-        128 bytes internal RAM (8-bit)
-        32 I/O pins
-        Two 16-bit timers
-        Six Interrupts
-        Serial programming facility
-        40 pin Dual-in-line Package 

PIN DESCRIPTION
The 89C51 have a total of 40 pins that are dedicated for various functions such as I/O, RD, WR, address and interrupts. Out of 40 pins, a total of 32 pins are set aside for the four ports P0, P1, P2, and P3, where each port takes 8 pins. The rest of the pins are designated as Vcc, GND, XTAL1, XTAL, RST, EA, and PSEN. All these pins except PSEN and ALE are used by all members of the 8051 and 8031 families. In other words, they must be connected in order for the system to work, regardless of whether the microcontroller is of the 8051 or the 8031 family. The other two pins, PSEN and ALE are used mainly in 8031 based systems.
Vcc  
        Pin 40 provides supply voltage to the chip. The voltage source is +5 V.
GND
         Pin 20 is the ground.
XTAL1 and XTAL2
                          The 8051 have an on-chip oscillator but requires external clock to run it. Most often a quartz crystal oscillator is connected to input XTAL1 (pin 19) and XTAL2 (pin 18). The quartz crystal oscillator connected to XTAL1 and XTAL2 also needs two capacitors of 30 pF value. One side of each capacitor is connected to the ground.

                                                           C2  
                                                                                XTAL2
                                                           C1   
                                                                                XTAL1

                                                                                GND           


 It must be noted that there are various speeds of the 8051 family. Speed refers to the maximum oscillator frequency connected to the XTAL. For example, a 12 MHz chip must be connected to a crystal with 12 MHz frequency or less. Likewise, a 20 MHz microcontroller requires a crystal frequency of no more than 20 MHz. When the 8051 is connected to a crystal oscillator and is powered up, we can observe the frequency on the XTAL2 pin using oscilloscope.

RST
       Pin 9 is the reset pin. It is an input and is active high (normally low). Upon applying a high pulse to this pin, the microcontroller will reset and terminate all activities. This is often referred to as a power –on reset. Activating a power-on reset will cause all values in the registers to be lost. Notice that the value of Program Counter is 0000 upon reset, forcing the CPU to fetch the first code from ROM memory location 0000. This means that we must place the first line of source code in ROM location 0000 that is where the CPU wakes up and expects to find the first instruction. In order to RESET input to be effective, it must have a minimum duration of 2 machine cycles. In other words, the high pulse must be high for a minimum of 2 machine cycles before it is allowed to go low.
EA
All the 8051 family members come with on-chip ROM to store programs. In such cases, the EA pin is connected to the Vcc. For family members such as 8031 and 8032 in which there is no on-chip ROM, code is stored on an external ROM and is fetched by the 8031/32. Therefore for the 8031 the EA pin must be connected to ground to indicate that the code is stored externally. EA, which stands for “external access,” is pin number 31 in the DIP packages. It is input pin and must be connected to either Vcc or GND. In other words, it cannot be left unconnected.
PSEN
           This is an output pin. PSEN stands for “program store enable.” It is the read strobe to external program memory. When the microcontroller is executing from external memory, PSEN is activated twice each machine cycle.
ALE
         ALE (Address latch enable) is an output pin and is active high. When connecting a microcontroller to external memory, potr 0 provides both address and data. In other words the microcontroller multiplexes address and data through port 0 to save pins. The ALE pin is used for de-multiplexing the address and data by connecting to the G pin of the 74LS373 chip.
I/O port pins and their functions
                 The four ports P0, P1, P2, and P3 each use 8 pins, making them 8-bit ports. All the ports upon RESET are configured as output, ready to be used as output ports. To use any of these as input port, it must be programmed.
Port 0
           Port 0 occupies a total of 8 pins (pins 32 to 39). It can be used for input or output. To use the pins of port 0 as both input and output ports, each pin must be connected externally to a 10K-ohm pull-up resistor. This is due to fact that port 0 is an open drain, unlike P1, P2 and P3. With external pull-up resistors connected upon reset, port 0 is configured as output port. In order to make port 0 an input, the port must be programmed by writing 1 to all the bits of it. Port 0 is also designated as AD0-AD7, allowing it to be used for both data and address. When connecting a microcontroller to an external memory, port 0 provides both address and data. The microcontroller multiplexes address and data through port 0 to save pins. ALE indicates if P0 has address or data. When ALE=0, it provides data D0-D7, but when ALE=1 it has address A0-A7. Therefore, ALE is used for de-multiplexing address and data with the help of latch 74LS373.
Port 1
           Port 1 occupies a total of 8 pins (pins 1 to 8). It can be used as input or output. In contrast to port 0, this port does not require pull-up resistors since it has already pull-up resistors internally. Upon reset, port 1 is configures as an output port. Similar to port 0, port 1 can be used as an input port by writing 1 to all its bits.
Port 2
           Port 2 occupies a total of 8 pins (pins 21 to 28). It can be used as input or output. Just like P1, port 2 does not need any pull-up resistors since it has pull-up resistors internally. Upon reset port 2 is configured as output port. To make port 2 input, it must be programmed as such by writing 1s to it.
Port 3
           Port 3 occupies a total of 8 pins (pins 10 to 17). It can be used as input or output. P3 does not need any pull-up resistors, the same as P1 and P2 did not. Although port 3 is configured as output port upon reset, this is not the way it is most commonly used. Port 3 has an additional function of providing some extremely important signals such as interrupts. Some of the alternate functions of P3 are listed below:
P3.0      RXD (Serial input)
P3.1      TXD (Serial output)
P3.2      INT0 (External interrupt 0)
P3.3      INT1 (External interrupt 1)
P3.4      T0 (Timer 0 external input)
P3.5      T1 (Timer 1 external input)
P3.6      WR (External memory write strobe)
P3.7      RD (External memory read strobe)

INSIDE THE 89C51
Registers
                  In the CPU, registers are used to store information temporarily. That information could be a byte of data to be processed, or an address pointing to the data to be fetched. In the 8051 there us only one data type: 8 bits. With an 8- bit data type, any data larger than 8 bits has to be broken into 8-bit chunks before it is processed. 



                                                        DPTR

                                                             PC   
                                                                            
                                                  

  (b) Some 8051 16-bit registers

(a)     Some 8051 8-bit registers 

The most commonly used registers of the 8051 are A(accumulator), B, R0, R1, R2, R3, R4, R5, R6, R7, DPTR (data pointer) and PC (program counter). All the above registers are 8-bit registers except DPTR and the program counter. The accumulator A is used for all arithmetic and logic instructions.
Program Counter and Data Pointer
The program counter is a 16- bit register and it points to the address of the next instruction to be executed. As the CPU fetches op-code from the program ROM, the program counter is incremented to point to the next instruction. Since the PC is 16 bit wide, it can access program addresses 0000 to FFFFH, a total of 64K bytes of code. However, not all the members of the 8051 have the entire 64K bytes of on-chip ROM installed.
                                               The DPTR register is made up of two 8-bit registers, DPH and DPL, which are used to furnish memory addresses for internal and external data access. The DPTR is under the control of program instructions and can be specified by its name, DPTR. DPTR does not have a single internal address, DPH and DPL are assigned an address each.

Flag bits and the PSW Register
       Like any other microprocessor, the 8051 have a flag register to indicate arithmetic conditions such as the carry bit. The flag register in the 8051 is called the program status word (PSW) register.
                           The program status word (PSW) register is an 8-bit register. It is also referred as the flag register. Although the PSW register is 8-bit wide, only 6 bits of it are used by the microcontroller. The two unused bits are user definable flags. Four of the flags are conditional flags, meaning they indicate some conditions that resulted after an instruction was executed. These four are CY (carry), AC (auxiliary carry), P (parity), and OV (overflow). The bits of the PSW register are shown below:


                                                                                            

CY     PSW.7          Carry flag
AC     PSW.6          Auxiliary carry flag
--        PSW.5          Available to the user for general purpose
RS1   PSW.6          Register bank selector bit 1
RS0   PSW.3          Register bank selector bit 0
OV     PSW.2          Overflow flag
F0      PSW.1          User definable bit
P        PSW.0          Parity flag

CY, the carry flag
             This flag is set whenever there is a carry out from the d7 bit. This flag bit is affected after an 8-bit addition or subtraction. It can also be set to 1 or 0 directly by an instruction such as “SETB C” and “CLR C” where “SETB C” stands for set bit carry and “CLR C” for clear carry.
AC, the auxiliary carry flag
              If there is carry from D3 to D4 during an ADD or SUB operation, this bit is set: otherwise cleared. This flag is used by instructions that perform BCD arithmetic.
P, the parity flag  
              The parity flag reflects the number of 1s in the accumulator register only. If the register A contains an odd number of 1s, then P=1. Therefore, P=0 if Ahas an even number of 1s.
OV, the overflow flag
              This flag is set whenever the result of a signed number operation is too large, causing the high order bit to overflow into the sign bit. In general the carry flags is used to detect errors in unsigned arithmetic operations.

MEMORY SPACE ALLOCATION
1.  Internal ROM
                    The 89C51 has a 4K bytes of on-chip ROM. This 4K bytes ROM memory has memory addresses of 0000 to 0FFFh. Program addresses higher than 0FFFh, which exceed the internal ROM capacity will cause the microcontroller to automatically fetch code bytes from external memory. Code bytes can also be fetched exclusively from an external memory, addresses 0000h to FFFFh, by connecting the external access pin to ground. The program counter doesn’t care where the code is: the circuit designer decides whether the code is found totally in internal ROM, totally in external ROM or in a combination of internal and external ROM.

2.  Internal RAM
           The 1289 bytes of RAM inside the 8051 are assigned addresses 00 to 7Fh. These 128 bytes can be divided into three different groups as follows:
1.  A total of 32 bytes from locations 00 to 1Fh are set aside for register banks and the stack.
2.  A total of 16 bytes from locations 20h to 2Fh are set aside for bit addressable read/write memory and instructions.
3.  A total of 80 bytes from locations 30h to 7Fh are used for read and write storage, or what is normally called a scratch pad. These 80 locations of RAM are widely used for the purpose of storing data and parameters by 8051 programmers.

Countdown timers can be con strutted using discrete digital Ics deluding up/down counters and /or 555 timers. If you wish to incorporate various facilities like setting the count, start, stop, reset and display facilities, these circuits would require too many Ics.
Here is a simple design based on 40- amel AT89C51 microcontroller that performs count- down operation for up to LCD displays showing the actual time left. During the activity period, a relay is latched and a flashing led indicates countdown timing’s progress.
Four tactile, push-to-on switches are used to start /stop and  to set the initial value for countdown operation. The timing value can also be changed while the counting is still in progress. Auto-repeat key logic also works, i.e., if you hold  up or down key continuously, the timing as shown on L displays changes at a faster rate. The program code in hex is only 800 bytes long, while AT89C2051 microcontroller can take up to 2kb of code. This program can be ‘burnt’ into the chip using any universal progammer  suitable  for Atmel AT 89C2051 chip.

LCD
The LCD acts as the output interface for communication with the microcontroller. Frequently, an AT89C51 program must interact with the outside world using input and output devices that communicate directly with human beings.
Some of the most common LCDs connected to the AT89C51 are 16X2 and 20x2 type. This means 16 characters per line by 2 lines and 20 characters per line by 2 lines, respectively. Here we have used a 16X2 display, which means there are two rows with a capacity of displaying 16 characters each.
Since an 8-bit data bus is used with this microcontroller, the LCDwill require a total of eleven data lines: 3 control lines plus 8 lines for the data bus. These three control lines are EN, RS and RW. The EN line is ‘Enable.’ To send data to the LCD, your program should make sure the EN line is low (0) and then set the other two control lines and put data on the data bus. When the other lines are completely ready, bring EN high (1) and wait for the minimal duration of time (this varies from LCD to LCD) required by the LCD as per the manufacturer’s specifications and end by bringing it low (0) again.
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 and position cursor). When RS is high (1), the data being sent is text data, which should be displayed on the screen. For example, to display a character on the screen, you should set RS high. The RW line is the ‘Read/Write’ control line. When RW is low (0) , the information of the data bus  is being written to the LCD. When RW is high (1), the program is effectively querying (or reading) the LCD.
These control lines are the vital nerves of a connection between an LCD and the microcontroller chip.  

Parallel Port to 16 Character x 2 Line LCD Schematic

                               
ORG 0000
MAIN:
MOV P0,#0FFH

F1:
acall setup
acall proj
acall delay
acall delay

NEXT1:
JNB P0.3,NEXT
SJMP NEXT1

NEXT:
JNB P0.0, RAJ1
JNB P0.1, MEERA1
JNB P0.2, RAMESH1
acall delay
acall delay
acall delay
acall delay
acall delay
acall delay
SJMP F1
SJMP NEXT
RAJ1:
ACALL RAJ
ljmp f1
sjmp raj1
MEERA1:
ACALL MEERA
ljmp f1
sjmp meera1
RAMESH1:
ACALL RAMESH
ljmp f1
 sjmp ramesh1
RAJ:
;;;;RAJ;;;;;;;;;;
CLR P3.2
MOV A,#01
ACALL COMNWRT
ACALL DELAY
mov r1, #05h
MOV DPTR,#LOOK
B0: CLR A
MOVC A,@A+DPTR
ACALL DATAWRT
ACALL DELAY
 INC DPTR
 DJNZ R1,B0

 mov r1, #0fh
mov A,#0C0H
ACALL COMNWRT
ACALL DELAY
 MOV DPTR,#LOOK2
B1: CLR A
MOVC A,@A+DPTR
ACALL DATAWRT
ACALL DELAY
 INC DPTR
 DJNZ R1,B1
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 mov r1, #0Fh
mov A,#01H
ACALL COMNWRT
ACALL DELAY
MOV A,#80H
ACALL COMNWRT
ACALL DELAY
 MOV DPTR,#LOOK3
B2: CLR A
MOVC A,@A+DPTR
ACALL DATAWRT
ACALL DELAY
 INC DPTR
 DJNZ R1,B2

 mov r1, #0fh
mov A,#0C0H
ACALL COMNWRT
ACALL DELAY
 MOV DPTR,#LOOK33
B_1: CLR A
MOVC A,@A+DPTR
ACALL DATAWRT
ACALL DELAY
 INC DPTR
 DJNZ R1,B_1
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 SETB P3.2
ret
MEERA:
;;;;;;;;;;;;MEERA;;;;;;;;;;;;;;;;;
CLR P3.2
MOV A,#01
ACALL COMNWRT
ACALL DELAY
MOV A,#80H
ACALL COMNWRT
ACALL DELAY
mov r1, #0Bh
MOV DPTR,#LOOK4
B3: CLR A
MOVC A,@A+DPTR
ACALL DATAWRT
ACALL DELAY
 INC DPTR
 DJNZ R1,B3

 mov r1, #0Fh
mov A,#0C0H
ACALL COMNWRT
ACALL DELAY
 MOV DPTR,#LOOK5
B4: CLR A
MOVC A,@A+DPTR
ACALL DATAWRT
ACALL DELAY
 INC DPTR
 DJNZ R1,B4
ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 mov r1, #0Fh
mov A,#01H
ACALL COMNWRT
ACALL DELAY
MOV A,#80H
ACALL COMNWRT
ACALL DELAY
 MOV DPTR,#LOOK6
B5: CLR A
MOVC A,@A+DPTR
ACALL DATAWRT
ACALL DELAY
 INC DPTR
 DJNZ R1,B5

mov r1, #0Fh
mov A,#0C0H
ACALL COMNWRT
ACALL DELAY
 MOV DPTR,#LOOK66
B_4: CLR A
MOVC A,@A+DPTR
ACALL DATAWRT
ACALL DELAY
 INC DPTR
 DJNZ R1,B_4
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 SETB P3.2
ret
RAMESH:
;;;;;;;;;;RAJESH;;;;;;;;;;;;;;;;;;;;;;;;
CLR P3.2
 MOV A,#01
ACALL COMNWRT
ACALL DELAY
MOV A,#80H
ACALL COMNWRT
ACALL DELAY
mov r1, #05h
MOV DPTR,#LOOK7
B6: CLR A
MOVC A,@A+DPTR
ACALL DATAWRT
ACALL DELAY
 INC DPTR
 DJNZ R1,B6

 mov r1, #0Fh
mov A,#0C0H
ACALL COMNWRT
ACALL DELAY
 MOV DPTR,#LOOK8
B7: CLR A
MOVC A,@A+DPTR
ACALL DATAWRT
ACALL DELAY
 INC DPTR
 DJNZ R1,B7
ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 mov r1, #0Fh
mov A,#01H
ACALL COMNWRT
ACALL DELAY
MOV A,#80H
ACALL COMNWRT
ACALL DELAY
 MOV DPTR,#LOOK9
B8: CLR A
MOVC A,@A+DPTR
ACALL DATAWRT
ACALL DELAY
 INC DPTR
 DJNZ R1,B8

  mov r1, #0Fh
mov A,#0C0H
ACALL COMNWRT
ACALL DELAY
 MOV DPTR,#LOOK99
B_7: CLR A
MOVC A,@A+DPTR
ACALL DATAWRT
ACALL DELAY
 INC DPTR
 DJNZ R1,B_7
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 ACALL DELAY
 SETB P3.2
ret


;;;;;;;;;; TILEL OF PROJECT;;;;;;;;;
 proj:
 mov r1, #0ch
MOV DPTR,#LOOK10
BACK: CLR A
MOVC A,@A+DPTR
ACALL DATAWRT
ACALL DELAY
 INC DPTR
 DJNZ R1,BACK

 mov r1, #0dh
mov A,#0C0H
ACALL COMNWRT
ACALL DELAY
 MOV DPTR,#LOOK11
BAC: CLR A
MOVC A,@A+DPTR
ACALL DATAWRT
ACALL DELAY
 INC DPTR
 DJNZ R1,BAC
 RET
 setup:
MOV A,#38H
ACALL COMNWRT
ACALL DELAY
MOV A,#01H
ACALL DELAY
MOV A,#0EH
ACALL COMNWRT
ACALL DELAY
;;MOV A,#01
;;ACALL COMNWRT
;;ACALL DELAY
MOV A,#06H
ACALL COMNWRT
ACALL DELAY
MOV A,#80H
ACALL COMNWRT
ACALL DELAY
 ret

COMNWRT:
MOV P1,A
CLR P2.2
CLR P2.1
SETB P2.0
ACALL DELAY
CLR P2.0
RET
DATAWRT:
MOV P1,A
SETB P2.2
CLR P2.1
SETB P2.0
ACALL DELAY
CLR P2.0
RET


DELAY: MOV R3,#150
HERE2: MOV R4,#255
HERE: DJNZ R4,HERE
      DJNZ R3,HERE2
            RET

LOOK: DB "KAJAL"
LOOK2: DB "ROLL No. 284020"
LOOK3: DB "DEPT-ECE, SEM-6"
LOOK33: DB "HOME TOWN-BIHAR"

LOOK4: DB "NEHA GAUTAM"
LOOK5: DB "ROLL No. 284030"
LOOK6: DB "DEPT-ECE, SEM-6"
LOOK66: DB "HOME TOWN-DELHI"
LOOK7: DB "MEGHA"
LOOK8: DB "ROLL No. 284026"
LOOK9: DB "DEPT-ECE, SEM-6"
LOOK99: DB "HOME TOWN-DELHI"
LOOK10: DB "  SMART CARD"
LOOK11: DB "     IDENTIFY"
            END






RESISTORS

The jobs done by resistors include directing and controlling current, making changing current produce changing voltage (as in a voltage amplifier) and obtaining variable voltages from fixed ones (as in a potential divider). There are two main types of resistor-those with fixed values and those that are variable.





When choosing a resistor there are three factors which have to be considered, apart from the stated value.

(i)  THE TOLERANCE. Exact values cannot be guaranteed by mass-production methods but this is not a great disadvantage because in most electronic circuits the values of resistors are not critical. The tolerance tells us the minimum and maximum values a resistor might have, e.g. one with a stated (called nominal) value of 100 and a tolerance of  +10% could have any value between 90 and 110


(ii) THE POWER RATING. If the rate which a resistor changes electrical energy into heat exceeds its power rating, it will overheat and be damaged or destroyed. For most electronic circuit 0.25 Watt or 0.5 Watt power ratings are adequate. The greater the physical size of a resistor the greater is its rating.

(iii) THE STABILITY. This is the ability of a component to keep the same value as it ‘ages’ despite changes of temperature and other physical conditions. In some circuits this is an important factor.


RESISTOR MARKINGS

  The value and tolerance of a fixed resistor is marked on it using codes. The resistor has four colored bands painted on it towards one end. The first three from the end give the value and the fourth the tolerance. Sometimes it is not clear which is the first band but deciding where to start should not be difficult if you remember that the fourth band (which is not always present) will be either gold or silver, these being colours not used for the first band.
The first band gives the first number, the second band gives the second number and the third band tells how many naught (0) come after the first two numbers.


              NUMBER                          COLOUR

0                              Black
1                              Brown
2                              Red
3                              Orange
4                              Yellow
5                              Green
6                              Blue
7                              Violet
8                              Gray
9                              White


              PERCENTAGE                  COLOUR
                   +-5%                             Gold
                   +-10%                                 Silver
                   +-20%                          no colour in 4th band






VARIABLE RESISTORS

Description. Variable resistors used as volume and other controls in radio and TV set are usually called ‘pots’ (short for potential divider- see below). They consist of an incomplete circular track of either a fixed carbon resistor for high values and low power (up to 2W) or of a fixed wire-wound resistor for high powers. Connections to each end of the track are bought out to two terminal tags. A wiper makes contact with the track and is connected to a third terminal tag, between the other two. Rotation of the spindle moves the wiper over the track and changes the resistance between the center tag and the ones. ‘Slide’ type variable resistors have a straight track.
In a linear track equal changes of resistance occur when the spindle is rotated through equal angles. In a log track, the change of resistance at one end of the track is less than at the other for equal angular rotations.
Maximum values range from a few ohms to several mega ohms, common values are 10k Ohm, 50k Ohm., 100k Ohm., 500k ohm. and  1M Ohm.
Some circuits use small preset types, the symbol and form of which are shown in figs. These are adjusted with a screwdriver when necessary and have tracks of carbon or ceramic (ceramic and metal oxide).








TRANSFORMER

A transformer changes (transforms) an alternating voltage from one value to another. It consists of two coils, called the primary and secondary windings, which are not connected electrically. The windings are either one on top of the other or are side by side on an iron, iron-dust or air core.

SYMBOLS

(i)  MAINS. Mains transformers are used at AC. mains frequency (50 Hz in Britain), their primary coil being connected to the 240V a.c. supply. Their secondary windings may be step-up or step-down or they may have one or more of each. They have laminated iron cores and are used in power supply units. Sometimes the secondary has a centre-tap.

Step-down toroidal types are becoming popular. They have virtually no external magnetic field and a screen between primary and secondary windings gives safety and electrostatic screening. Their pin connections are brought out to a 0.1 inch grid which makes them ideal for printed circuit board (p.c.b.) mounting.

Isolating transformers have a one-t-one turns ratio (i.e. ns/np = 1/1) and are safety devices for separating a piece of equipment from the mains supply. They do not change the voltage.

(ii) AUDIO FREQUENCY. Audio frequency transformer also have laminated iron cores and are used as output matching transformers to ensure the maximum transfer of power from the a.f. output stage to the loudspeaker in , for example, a radio set or amplifier.

(iii)       RADIO FREQUENCY. Radio frequency transformers usually have adjustable iron-dust cores and form part of the tuning circuits in a radio. They are enclosed in a small aluminium ‘screening’ can to stop them radiating energy to other parts of the circuit.



A capacitor stores electric charge. It does not allow direct   current to flow through it and it behaves as if alternating current does flow through. In its simplest form it consists of two parallel metal plates separated by an insulator called the dielectric. The symbols for fixed and variable capacitors are given in fig. Polarized types must be connected so that conventional current enters their positive terminal. Non-polarized types can be connected either way round.
The capacitance (C) of a capacitor measures its ability to store charge and is stated in farads (F). The farad is sub-divided into smaller, more convenient units.

1 microfarad (1uf) = 1 millionth of a farad = 10-6 f
1 nanofarad (1 nf) = 1 thousand- millionth of a farad = 10-9 f
1 Pico farad ( 1pf ) = 1 million-millionth of a farad = 10-12 f

In practice, capacitances range from 1 pf to about 150 000 uf: they depend on the area A of the plates (large A gives large C), the separation d of the plates (small d gives large C) and the material of the dielectric (e.g. certain plastics give large C).
When selecting a particular job, the factors to be considered are the value (again this is not critical in many electronic circuits), the tolerance and the stability. There are two additional factors.
(i)  The working voltage. It is the largest voltage (d.c.or peak a.c.) which can be applied across the capacitor and is often marked on it, e.g. 30V wkg. It is exceeded, the dielectric breaks down and permanent damage may result.
(ii) The leakage current. No dielectric is a perfect insulator but the loss of charge through it as ‘leakage current’ should be small.



Fixed capacitors can be classified according to the dielectric used; their properties depend on this. The types described below in (i), (ii) and (iii) are non-polarized; those in (iv) are polarized. 

(i)  Polyester. Two strips of polyester film (the plastic dielectric) are wound between two strips of aluminum foil (the plates). Two connections, one to each strip of foil, form the capacitor leads. In the metallized version, films of metal are deposited on the plastic and act as the plates. Their good all-round properties and small size make them suitable for many applications in electronics. Values range from 0.01uf to 10mfd. or so and are usually marked (in pf) using the resistor colour code. Polycarbonate capacitors are similar to the polyester type; they have smaller leakage currents and better stability but cost more.
(ii) Mica. Mica is naturally occurring mineral, which splits into very thin sheets of uniform thickness. Plates are formed by depositing a silver film on the mica or by using interleaving sheets of aluminum foil. Their tolerance is low ( +1% ), stability and working voltage is high, leakage current low but they are used in radio frequency tuned circuits where low loss is important and are pictured in figs. Polystyrene capacitors have similar though not quite so good properties as mica types but are cheaper.
(iii)       Ceramic. There are several types depending on the ceramic used. One type has similar properties to mica and is used in radio frequency circuits. In another type, high capacitance values are obtained with small size, but stability and tolerance are poor; they are useful where exact values are not too important. They may be disc, rod- or plate-shaped. A disc-shaped capacitor is shown in fig. Values range form 10pf to 1uf.

(iv) Electrolytic:  In the aluminum type the dielectric is an extremely thin layer of aluminum oxide, which is formed electrolytically. Their advantages are high values (up to 150 000uF) in a small volume and cheapness. Their disadvantages are wide tolerance (-20 to +100% of the value printed on them), high leakage current and poor stability but they are used where these factors do not matter and high values are required, e.g. in power supplies.
               
 Electrolytic are polarized. Usually their positive terminal is marked with a + or by a groove; often the aluminum can is the negative terminal. The d.c. Leakage current maintains the oxide layer; otherwise reversed polarity (or disuse) will cause the layer to deteriorate.
 Tantalum electrolytic capacitors can be used instead of aluminum in low voltage circuits where values do not exceed about 100 uf. They have lower leakage currents.








TRANSISTORS

Transistors are the most important devices in electronics today. Not only are they made as discrete (separate) components but also integrated circuits (IC) may contain several thousands on a tiny slice of silicon. They are three-terminal devices, used as amplifiers and as switches. Non-amplifying components such as resistors, capacitors, inductors and diodes are said to be ‘passive’; transistors are ‘active’ components.
The two basic types of transistor are:
(a) The bipolar or junction transistor (usually called the transistor); its operation depends on the flow of both majority and minority carriers;
(b) The unipolar or field effect transistor (called the FET) in which the current is due to majority carriers only (either electrons or holes).


JUNCTION TRANSISTOR
(i) CONSTRUCTION: The bipolar or junction transistor consists of two p-n junctions in the same crystal. A very thin slice of lightly doped p-or n-type semiconductor (the base B) is sandwitched between two thicker, heavily doped materials of the opposite type (the collector C and emitter E).
The two possible arrangements are shown diagrammatically in fig with their symbols. The arrow gives the direction in which conventional (positive) current flows; in the n-p-n type it points from B to E and in the p-n-p type it points from E to B.







As with diodes, silicon transistors are in general preferred to germanium ones because they withstand with higher temperatures  ( up to about 175 0C compared with 75 0C) and higher voltages, have lower leakage currents and are better suited to high frequency circuits. Silicon n-p-n types, are more easily mass-produced than p-n-p type, the opposite is true of germanium.
A simplified section of an n-p-n silicon transistor made by the planar process in which the transistor is in effect created on one face (plane) of a piece of semi conducting material; fig. Shows a transistor complete with case (called the ‘encapsulation’) and three wire leads.
   










(ii) ACTION. An n-p-n silicon transistor is represented and is connected in a common emitter circuit; the emitter is joined (via batteries B1 and B2) to both the base and the collector. For transistor action to occur the base emitter junction must be forward biased, i.e. positive terminal of B1 to p- type base, and the collector base junction reverse biased, i.e. positive terminal of B2 to n- type collector.
   When the base emitter bias is about +0.6 V, electrons (the majority carriers in the heavily doped n type emitter) cross the junction ( as they would in any junction diode) into the base . Their loss is made good by electrons entering the emitter from the external circuit to form the emitter current. At the same time holes from the base to the emitter, since the p- type base is lightly doped, this is small compared with the electron flow in the opposite direction, i.e. electrons are the majority carriers in an n-p-n transistor.
     In the base, only a small proportion (about 1%) of the electrons from the emitter combine with the holes in the base because the base is very thin (less than millionth of a meter) and is lightly doped. Most of the electrons are swept through the base, because they are attracted by the positive voltage on the collector, and the cross base – collector junction to become the collector current in the circuit.
     The small amount of electron – hole recombination, which occurs in the base, gives it a momentary negative charge, which is immediately compensated by battery B1 supplying it with  (positive) holes. The flow of holes to the base from the external circuit creates a small base current. This keeps the base emitter junction forward biased and so maintains the larger collector current.
   Transistor action is turning on (and controlling ) of a large current through the high resistance  ( reverse biased ) collector – base junction by a small current through the low – resistance  ( forward biased )  base – emitter  junction . The term transistor refers to this   
effect  and comes from the two words ‘ transfer resistor’ . Physically the collector is larger than the emitter and if one is used in place of the other the action is inefficient.
 
 The behavior of a p-n-p transistor is similar to that of the n-p-n type but it is holes that are the majority carriers, which flow from the emitter to the collector and electrons, are injected into the base to compensate for recombination. To obtain correct biasing the polarities of both batteries must be reversed.















RELAY

Relay is a common, application of application of electromagnetism. It uses an electromagnet made from an iron rod wound with hundreds of fine copper wire. When electricity is applied to the wire, the rod become magnetic. A movable contact arm above the rod is then pulled toward; a small spring pulls the contract arm away from the rod until it closes, a second switch contact. By means of relay, a current circuit can be broken or closed in one circuit as a result of a current in another circuit. Relays can have several poles and contacts. The types of contacts could be normally open and normally closed. One closure of the relay can turn on the same normally open contacts; can turn off the other normally closed contacts
     A relay is a switch worked by an electromagnet. It is useful if we want a small current in one circuit to control another circuit containing a device such as a lamp or electric motor which requires a large current, or if we wish several different switch contacts to be operated simultaneously.
The structure of relay and its symbol are shown in figure. When the controlling current flows through the coil, the soft iron core is magnetized and attracts the L-shaped soft iron armature. This rocks on its pivot and opens, closes or changes over, the electrical contacts in the circuit being controlled.


    
   









 
DIODE
The simplest semiconductor device is made up of a sandwich of P- and N type semi conducting material, with contacts provided to connect the P-and N-type layers to an external circuit, this is a junction Diode. If the positive terminal of the battery is connected to the p-type material (cathode) and the negative terminal to the N-type material (Anode), a large current will flow. This is called forward current or forward biased.
If the connection is reversed, a very little current will flow. This is because under this condition, the p-type material will accept the electrons from the negative terminal of the battery and the N-type material will give up its free electrons to the battery, resulting in the state of electrical equilibrium since the N-type material has no more electrons. Thus there will be a small current to flow and the diode is called Reverse biased.
Thus the Diode allows direct current to pass only in one direction while blocking it in the other direction. Power diodes are used in concerting AC into DC. In this, current will flow freely during the first half cycle (forward biased) and practically not at all during the other half cycle (reverse biased). This makes the diode an effective rectifier, which converts ac into pulsating dc. Signal diodes are used in radio circuits fro detection, Zener diodes are used in the circuit to control the voltage.
A diode allows current to flow easily in one direction but not in the other, i.e. its resistance is low in the conducting or ‘forward’ direction but very high in the opposing or ‘reverse’ direction. Most semiconductor diodes are made from silicon or germanium.
A diode has two leads, the anode and the cathode: its symbol is given in fig (a). The cathode is often marked by a band at one end fig.(b); it is the lead by which conventional current leaves the diode when forward biased – as the arrow on the symbol shown. In some cases the arrow is marked on the diode fig.(c) or the shape is different (d), (e)




There are several kinds of diode, each with features that suit it for a particular job. Three of the main types are:
(a) The junction diode,
(b) The point-contact diode and
(c) The zener diode
Two identification codes are used for diodes. In the American system the code always starts with 1N and is followed by a serial number, e.g. IN 4001. in the continental system the first letter gives the semiconductor material  (A=germanium, B= silicon) and the second letter gives the use. (A=signal diode, Y=rectifier diode, Z=Zener diode.). for example, AA119 is a germanium signal diode,. To complicate the situation some manufacturers have their own codes.



ZENER DIODE
Zener diodes are very important because they are the key to voltage regulation. The chapter also includes opt electronic diodes, Scotty diodes, aviators, and other diodes.
A Zener diode is specially designed junction diode, which can operate continuously without being damaged in the region of reverse breakdown voltage. One of the most important applications of zener diode is the design of constant voltage power supply. The zener diode is joined in reverse bias to D.C. through a resistance of suitable value.
Small signal and rectifier diodes are never intentionally operated in the breakdown region because this may damage them. A zener diode is different; it is a silicon diode that the manufacturer has optimized for operation in the breakdown region, zener diodes work best in the breakdown region. Sometimes called a breakdown diode, the zener diode is the backbone of voltage regulators, circuits that hold the load voltage almost constant despite large changes in line voltage and load resistance.
Figure shows the schematic symbol of a zener diode; another figure is an alternate symbol. In the either symbol, the lines resemble a “z”, which stands for zener. By varying the doping level of silicon diodes, a manufacturer can produce zener diodes with breakdown voltage from about 2 to 200V. These diodes can operate in any of three regions: forward, leakage, or breakdown.
Figure shows the V-I graph of a zener diode. In the forward region, it starts conduction around 0.7V, just like a ordinary silicon diode, In the leakage region (between zero and breakdown), it has only a small leakage or reverse current. In a zener diode, the breakdown has a very sharp knee, followed by an almost vertical Vz over most of breakdown region. Data sheets usually specify the value of Vz at a particular test current IzT.
   



L.E.D.

(LIGHT EMITTING DIODE)
Light emitting diode (LED ) is basically a P-N junction semiconductor diode particularly  designed to emit visible light. There are infra-red emitting LEDs which emit invisible light. The LEDs are now available in many colour red, green and yellow,. A normal LED at 2.4V and consumes ma of current. The LEDs are made in the form of flat tiny P-N junction enclosed in a semi-spherical dome made up of clear coloured epoxy resin. The dome of a LED acts as a lens and diffuser of light. The diameter of the base is less than a quarter of an inch. The actual diameter varies somewhat with different makes. The common circuit symbols for the LED are shown in fig. 1. It is similar to the conventional rectifier diode symbol with two arrows pointing out. There are two leads- one for anode and the other for cathode.
LEDs often have leads of dissimilar length and the shorter one is the cathode. This is not strictly adhered to by all manufacturers. Sometimes the cathode side has a flat base. If there is doubt, the polarity of the diode should be identified. A simple bench method is to use the ohmmeter incorporating 3-volt cells for ohmmeter function. When connected with the ohmmeter: one way there will be no deflection and when connected the other way round there will be a large deflection of a pointer. When this occurs the anode lead is connected to the negative of test lead and cathode to the positive test lead of the ohmmeter.
(i)  Action. An LED consists of a junction diode made from the semi conducting compound gallium arsenide phosphide. It emits light when forward biased, the colour depending on the composition and impurity content of the compound. At present red, yellow and green LEDs are available. When a p-n junction diode is forward biased, electrons move across the junction from the n-type side to the p-type side where they recombine with holes near the junction. The same occurs with holes going across the junction from the p-type side. Every recombination results in the release of a certain amount of energy, causing, in most semiconductors, a temperature rise. In gallium arsenide phosphide some of the energy is emitted as light which gets out of the LED because the junction is formed very close to the surface of the material. An LED does not light when reverse biased and if the bias is 5 V or more it may be damaged.




(ii) External resistor. Unless an LED is of the ‘constant-current type’ (incorporating an integrated circuit regulator for use on a 2 to 18 V d.c. or a. c. supply), it must have an external resistor R connected in series to limit the forward current which, typically, may be 10 mA (0.01 A). Taking the voltage drop (Vf) across a conducting LED to be about 1.7 V, R can be calculated approximately from:

                      (supply voltage – 1.7) V
R = ——————————————————
                                0.01A

For example, on a 5 V supply, R  = 3.3/0.01 = 330  Ohm.

(iii)       Decimal display. Many electronic calculators, clocks, cash registers and measuring instruments have seven-segment red or green LED displays as numerical indicators (Fig.). Each segment is an LED and depending on which segments are energized, the display lights up the numbers 0 to 9 as in Fig.. Such displays are usually designed to work on a 5 V supply. Each segment needs a separate current-limiting resistor and all the cathodes (or anodes) are joined together to form a common connection.
The advantages of LEDs are small size, reliability, longer life, small current requirement and high operating speed.






                      SEVEN SEGMENT DISPLAY

Op-Amp.








              Definition of 741-pin functions: (Refer to the internal 741 schematic of Fig. 3)
Pin 1 (Offset Null): Offset nulling, see Fig. 11. Since the op-amp is the differential type, input offset voltage must
be controlled so as to minimize offset. Offset voltage is nulled by application of a voltage of opposite polarity to the
ofset. An offset null-adjustment potentiometer may be used to compensate for offset voltage. The null-offset potentiometer also compensates for irregularities in the operational amplifier
manufacturing process which may cause an offset. Consequently, the null potentiometer is recommended for critical applications. See ‘Offset Null Adjustment’ for method.
Pin 2 (Inverted Input): All input signals at this pin will be inverted at output pin 6. Pins 2 and 3 are very important (obviously) to get the correct input signals or the op amp can not do its work.
Pin 3 (Non-Inverted Input): All input signals at this pin will be processed normally without invertion. The rest is the same as pin 2.
Pin 4 (-V): The V- pin (also referred to as Vss) is the negative sup-
ply voltage terminal. Supply-voltage operating range for the 741 is -4.5 volts (minimum) to -18 volts (max), and it is specified for
operation between -5 and -15 Vdc. The device will operate essentially the same over this range of voltages without change in timing period. Sensitivity of time interval to supply voltage change is low, typically 0.1% per volt. (Note: Do not confuse the -V with ground).
Pin 5 (Offset Null): See pin 1, and Fig. 11.
Pin 6 (Output): Output signal’s polarity will be the oposite of the input’s when this signal is applied to the op-amp’s inverting input. For example, a sine-wave at the inverting input will output a
square-wave in the case of an inverting comparator circuit.
Pin 7 (posV): The V+ pin (also referred to as Vcc) is the positive supply voltage terminal of the 741 Op-Amp IC. Supply-voltage operating range for the 741 is +4.5 volts (minimum) to +18 volts
(maximum), and it is specified for operation between +5 and +15 Vdc. The device will operate essentially the same over this range of voltages without change in timing period. Actually, the most
significant operational difference is the output drive capability, which increases for both current and voltage range as the supply voltage is increased. Sensitivity of time interval to supply voltage
change is low, typically 0.1% per volt.
Pin 8 (N/C): The ‘N/C’ stands for ‘Not Connected’. There is no other explanation. There is nothing connected to this pin, it is just there to make it a standard 8-pin package.

Output Parameters:

1. Output Resistance (Zoi)
The resistance seen ‘looking into’ the op-amp’s output.
2. Output Short-Circuit Current (Iosc)
This is the maximum output current that the op-amp can deliver to a load.
3. Output Voltage Swing (Vo max)
Depending on what the load resistance is, this is the maximum ‘peak’ output voltage that the op-amp can supply without saturation or clipping.
Dynamic Parameters:
1. Open-Loop Voltage Gain (Aol)
The output to input voltage ratio of the op-amp without external feedback.
2. Large-Signal Voltage Gain
This is the ratio of the maximum voltage swing to the charge in the input voltage required to drive the ouput from zero to a specified voltage (e.g. 10 volts).
3. Slew Rate (SR)
The time rate of change of the ouput voltage with the op-amp circuit having a voltage gain of unity (1.0).
Other Parameters:
1. Supply Current
This is the current that the op-amp will draw from the power supply.
2. Common-Mode Rejection Ratio (CMRR)
A measure of the ability of the op-amp’ to reject signals that are simultaneously present at both inputs. It is the ratio of the common-mode input voltage to the generated output voltage, usually
expressed in decibels (dB).


 Soldering Techniques


       Bad solder joints are often the cause of annoying intermittent faults. They can often be hard to find an cause circuit failure at the most inappropriate time. It’s much better to learn to make a good solder joints from day one.
·       Preparing the soldering iron:
·       Wipe the tip clean on the wetted sponge provided.
·       Bring the resin cored solder to the iron and ‘tin’ the tip of the iron.
·       Wipe the excess solder of the tip using the wet sponge.
·       Repeat until the tip is properly ‘tinned’.



·       Soldering components into the PCB

·       Bend the component leads at right angles with both bends at the same distance apart as the PCB pad holes.
·       Ensure that both component leads and the copper PCB pads are clean and free of oxidization.
·       Insert component leads into holes and bend leads at about 30 degrees from vertical.
·       Using small angle cutters, cut the leads at about 0.1 - 0.2 of an inch (about 2 - 4 mm) above copper pad.
·       Bring tinned soldering iron tip into contact with both the component lead and the PCB pad. This ensures that both surfaces undergo the same temperature rise.
·       Bring resin cored solder in contact with the lead and the copper pad. Feed just enough solder to flow freely over the pad and the lead without a ‘blobbing’ effect. The final solder joint should be shiny and concave indicating good ‘wetting’ of both the copper pad and the component lead. If a crack appears at the solder to metal interface then the potential for forming a dry joint exists. If an unsatisfactory joint is formed, suck all the solder off the joint using a solder sucker or solder wick (braid) and start again.

PRECAUTIONS

1.       Mount the components at the apron places before soldering. Follow the circuit description and components details, leads identification etc. Do not start soldering before making it confirm that all the components are mounted at the right place.
2.       Do not use a spread solder on the board, it may cause short circuit.
3.       Do not sit under the fan while soldering.
4.       Position the board so that gravity tends to keep the solder where you want it.
5.       Do not over heat the components at the board. Excess heat may damage the components or board.
6.       The board should not vibrate while soldering otherwise you have a dry or a cold joint.
7.       Do not put the kit under or over voltage source. Be wire about the voltage either is d.c. or a.c. while operating the gadget.


8.       Do spare the bare ends of the components leads otherwise it may short circuit with the other components. To prevent this use sleeves at the component leads or use sleeved wire for connections.
9.       Do not use old dark colour solder. It may give dry joint. Be sure that all the joints are clean and well shiny.
10.      Do make loose wire connections specially while connections to the circuit board, otherwise it may get loose.





           

REFERENCES


2.  BASIC ELECTRONIC CIRCUITS: MALVINO & ZBAR.

3.  ELECTRONIC COMPONENTS MANUAL: PARSAI.

4.  EFY JUNE.- 2004







Written by

We are Electronics Engineers and we are here to guide ECE students.

0 comments:

Post a Comment

 

© 2013 Electro aRK. All rights resevered. Designed by Templateism

Back To Top