You are on page 1of 23

CHAPTER-3

HARDWARE COMPONENTS CHAPTER-3 HARDWARE COMPONENTS

3.1 MICROCONTROLLER 89C51:

INTRODUCTION:

A Micro controller consists of a powerful CPU tightly coupled with memory RAM, ROM or EPROM), various I / O features such as Serial ports, Parallel Ports, Timer/Counters, Interrupt Controller, Data Acquisition interfaces-onto a single Silicon Chip. It does not mean that any micro controller should have all the above said features on chip, Depending on the need and area of application for which it is designed, The ON-CHIP features present in it may or may not include all the individual section said above.

ADVANTAGES OF MICROCONTROLLERS:

If a system is developed with a microprocessor, the designer has to go for external memory such as RAM, ROM or EPROM and peripherals and hence the size of the PCB will be large enough to hold all the required peripherals. But, the micro controller has got all these

peripheral facilities on a single chip so development of a similar system with a micro controller reduces PCB size and cost of the design.

One of the major differences between a micro controller and a microprocessor is that a controller often deals with bits , not bytes as in the real world application, for example switch contacts can only be open or close, indicators should be lit or dark and motors can be either turned on or off and so forth.

DEPARTMENT OF EEE, KITS, KMM

Page14

CHAPTER-3

HARDWARE COMPONENTS

COMPARISON

What is the difference between a microprocessor and microcontroller?

Data bus

CPU
RAM General purpose Micro Processor ROM I/O PORT TIMER SERIAL COM PORT

Address bus

General purpose Micro processor System

CPU RAM I/O

ROM

TIMER Serial COM PORT

Microcontroller

DEPARTMENT OF EEE, KITS, KMM

Page14

CHAPTER-3
The Major Features:
Compatible with MCS-51 products

HARDWARE COMPONENTS

4k Bytes of in-system Reprogrammable flash memory Fully static operation: 0HZ to 24MHZ Three level programmable clock 128 * 8 bit timer/counters Six interrupt sources Programmable serial channel Low power idle power-down modes

Why AT 89C51? :

The system requirements and control specifications clearly rule out the use of 16, 32 or 64 bit micro controllers or microprocessors. Systems using these may be earlier to implement due to large number of internal features. They are also faster and more reliable but, the above application is satisfactorily served by 8-bit micro controller. Using an inexpensive 8-bit Microcontroller will doom the 32-bit product failure in any competitive market place.

Coming to the question of why to use AT89C51 of all the 8-bit microcontroller available in the market the main answer would be because it has 4 Kb on chip flash memory which is just sufficient for our application. The on-chip Flash ROM allows the program memory to be reprogrammed in system or by conventional non-volatile memory Programmer. Moreover ATMEL is the leader in flash technology in todays market place and hence using AT 89C51 is the optimal solution

DEPARTMENT OF EEE, KITS, KMM

Page14

CHAPTER-3

HARDWARE COMPONENTS

AT89C51 MICROCONTROLLER ARCHITECTURE

The 89C51 architecture consists of these specific features: Eight bit CPU with registers A (the accumulator) and B Sixteen-bit program counter (PC) and data pointer (DPTR) Eight- bit stack pointer (PSW) Eight-bit stack pointer (Sp) Internal ROM or EPROM (8751) of 0(8031) to 4K (89C51) Internal RAM of 128 bytes: 1. Four register banks, each containing eight registers 2. Sixteen bytes, which maybe addressed at the bit level 3. Eighty bytes of general- purpose data memory Thirty two input/output pins arranged as four 8-bit ports:p0-p3 Two 16-bit timer/counters: T0 and T1 Full duplex serial data receiver/transmitter: SBUF Control registers: TCON, TMOD, SCON, PCON, IP, and IE Two external and three internal interrupts sources. Oscillator and clock circuits.

DEPARTMENT OF EEE, KITS, KMM

Page14

CHAPTER-3

HARDWARE COMPONENTS

The 89C51 oscillator and clock:

The heart of the 89C51 circuitry that generates the clock pulses by which all the internal all internal operations are synchronized. Pins XTAL1 and XTAL2 is provided for connecting a resonant network to form an oscillator. Typically a quartz crystal and capacitors are employed. The crystal frequency is the basic internal clock frequency of the microcontroller. The manufacturers make 89C51 designs that run at specific minimum and maximum frequencies typically 1 to 16 MHz

DEPARTMENT OF EEE, KITS, KMM

Page14

CHAPTER-3

HARDWARE COMPONENTS

Oscillator and timing circuit

Technical Overview of Flash Memory

Flash memory is a nonvolatile memory using NOR technology, which allows the user to electrically program and erase information. Intel Flash memory uses memory cells similar to an EPROM, but with a much thinner, precisely grown oxide between the floating gate and the source (see Figure 2). Flash programming occurs when electrons are placed on the floating gate. The charge is stored on the floating gate, with the oxide layer allowing the cell to be electrically erased through the source. Intel Flash memory is extremely reliable nonvolatile memory architecture.

DEPARTMENT OF EEE, KITS, KMM

Page14

CHAPTER-3

HARDWARE COMPONENTS

Pin diagram of AT89C51

Pin Description:

VCC: Supply voltage.

GND: Ground.

DEPARTMENT OF EEE, KITS, KMM

Page14

CHAPTER-3
Port 0:

HARDWARE COMPONENTS

Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance inputs. Port 0 may also be configured to be the multiplexed low order address/data bus during accesses to external program and data memory. In this mode P0 has internal pull-ups. Port 0 also receives the code bytes during Flash programming, and outputs the code bytes during program verification. External pull-ups are required during program verification.

Port 1:

Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. Port 1 also receives the low-order address bytes during Flash programming and verification.

Port 2:

Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memories that use 16-bit addresses (MOVX @DPTR). In this application, it uses strong internal pull-ups when emitting 1s. During accesses to external data memories that use 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. Port 2 also receives the high-order address bits and some control signals during Flash programming and verification.

Port 3:

DEPARTMENT OF EEE, KITS, KMM

Page14

CHAPTER-3

HARDWARE COMPONENTS

Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull-ups. Port 3 also serves the functions of various special features of the AT89C51 as listed below: Port 3 also receives some control signals for Flash programming and verification

Port pins and their alternate functions

RST:

Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device.

ALE/PROG:

Address Latch Enable output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation ALE is emitted at a constant rate of 1/6the oscillator
DEPARTMENT OF EEE, KITS, KMM Page14

CHAPTER-3

HARDWARE COMPONENTS

frequency, and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external Data Memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is Weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode.

PSEN:

Program Store Enable is the read strobe to external program memory. When the AT89C51 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory.

EA/VPP:

External Access Enable (EA) must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin also receives the 12volt programming enable voltage (VPP) during Flash programming, for parts that require 12-volt VPP.

XTAL1:

Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL2:

Out put from the inverting oscillator amplifier.

DEPARTMENT OF EEE, KITS, KMM

Page14

CHAPTER-3
Oscillator Characteristics:

HARDWARE COMPONENTS

XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier which can be configured for use as an on-chip oscillator, as shown in Figs 6.2.3. Either a quartz crystal or ceramic resonator may be used. To drive the device from an external clock source, XTAL2 should be left unconnected while XTAL1 is driven as shown in Figure 6.2.4.There are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high and low time specifications must be observed.

Oscillator Connections

External Clock Drive Configuration

Notes: 1. Under steady state (non-transient) conditions, IOL must be externally limited as follows: Maximum IOL per port pin: 10 mA Maximum IOL per 8-bit port: Port 0: 26 mA Ports 1, 2, 3: 15 mA Maximum total IOL for all output pins: 71 mA If IOL exceeds the test condition, VOL may exceed the related specification. Pins are not guaranteed to sink current greater than the listed test conditions. 1. Minimum VCC for Power-down is 2V.

DEPARTMENT OF EEE, KITS, KMM

Page14

CHAPTER-3

HARDWARE COMPONENTS

3.2 RF ENCODER & DECODER

RF ENCODER (HT12E):

Features _ Operating voltage _ 2.4V~5V for the HT12A _ 2.4V~12V for the HT12E _ HT12A with a 38kHz carrier for infrared transmission medium _ Minimum transmission word _ Built-in oscillator needs only 5% resistor _ Data code has positive polarity _ Minimal external components _ HT12A/E: 18-pin DIP/20-pin SOP package Applications _ Burglar alarm system _ Smoke and fire alarm system _ Garage door controllers _ Car door controllers _ Car alarm system _ Security system

DEPARTMENT OF EEE, KITS, KMM

Page14

CHAPTER-3

HARDWARE COMPONENTS

Block diagram of HT 12E Encoder

Pin Description:

Pin description of HT12E

DEPARTMENT OF EEE, KITS, KMM

Page14

CHAPTER-3

HARDWARE COMPONENTS

RF DECODER (HT 12D): Features _ Operating voltage: 2.4V~12V _ Low power and high noise immunity CMOS technology _ Low standby current _ Capable of decoding 12 bits of information _ Binary address setting _ Received codes are checked 3 times _ Address/Data number combination _ Easy interface with an RF or an infrared transmission medium

DEPARTMENT OF EEE, KITS, KMM

Page14

CHAPTER-3
_ Minimal external components _ Pair with Holteks 212 series of encoders _ 18-pin DIP, 20-pin SOP package

HARDWARE COMPONENTS

Applications _ Burglar alarm system _ Smoke and fire alarm system _ Garage door controllers _ Car door controllers _ Car alarm system _ Security system

Pin Assignment:

Fig 26: Pin diagram of HT12D

DEPARTMENT OF EEE, KITS, KMM

Page14

CHAPTER-3

HARDWARE COMPONENTS

3.3 LINEAR KEYPAD This section basically consists of a Linear Keypad. Basically a Keypad can be classified into 2 categories. One is Linear Keypad and the other is Matrix keypad.

1. Matrix Keypad. 2. Linear Keypad.

1. Matrix Keypad: This Keypad got keys arranged in the form of Rows and Columns. That is why the name Matrix Keypad. According to this keypad, In order to find the key being pressed the keypad need to be scanned by making rows as i/p and columns as output or vice versa. This Keypad is used in places where one needs to connect more keys with less no. of data lines. 2. Linear Keypad: This Keypad got n no. of keys connected to n data lines of RF encoder.
DEPARTMENT OF EEE, KITS, KMM Page14

no. of

CHAPTER-3

HARDWARE COMPONENTS
This Keypad is used in places where one needs to connect less no. of keys.

Generally, in Linear Keypads one end of the switch is connected to encoder (Configured as i/p) and other end of the switch is connected to the common ground. So whenever a key of Linear Keypad is pressed the logic on the microcontroller pin will go LOW.

Here in this project, a linear keypad is used with switches connected in a serial manner. Linear keypad is used in this project because it takes less no. of port pins. The Linear Keypad with 4 Keys is shown below.

DEPARTMENT OF EEE, KITS, KMM

Page14

CHAPTER-3
3.4 RELAYS

HARDWARE COMPONENTS

Equivalent to Good Sky Part# RW-SH-112D Details: These SPDT relays covers switching capacity of 10A in spite of miniature size for PCB Mount. Contact Rating

12A at 120VAC 10A at 120VAC 10A at 24VDC

Coil Resistance 400ohm 12VDC

Life expectancy Mechanical 10,000,000 operations at no load Electrical 100,000 at rated resistive load

DEPARTMENT OF EEE, KITS, KMM

Page14

CHAPTER-3

HARDWARE COMPONENTS

Main Feature 1. RW Series Relay covers switching capacity by 10A is spite of miniature size to comply with users wide selection. 2. RWH is approved C-UL & TV safety standard. 3. The employment of suitable plastic materials is applied under high temperature condition and various chemical solutions. 4. Complete protective construction is designed form dust and soldering flux. If required, plastic sealed type is available for washing procedure. 5. 12A at 120VAC for RW & 12A at 240VAC for RWH are UL approved. Applications: Domestic Appliances Office Machines Audio Equipment Coffee-Pots Control units

A relay is an electrically operated switch. Current flowing through the coil of the relay creates a magnetic field which attracts a lever and changes the switch contacts. The coil current can be on or off so relays have two switch positions and they are double throw (changeover) switches.

DEPARTMENT OF EEE, KITS, KMM

Page14

CHAPTER-3

HARDWARE COMPONENTS

Relays allow one circuit to switch a second circuit which can be completely separate from the first. For example a low voltage battery circuit can use a relay to switch a 230V AC mains circuit. There is no electrical connection inside the relay between the two circuits, the link is magnetic and mechanical. The coil of a relay passes a relatively large current, typically 30mA for a 12V relay, but it can be as much as 100mA for relays designed to operate from lower voltages. Most ICs (chips) cannot provide this current and a transistor is usually used to amplify the small IC current to the larger value required for the relay coil. The maximum output current for the popular 555 timer IC is 200mA so these devices can supply relay coils directly without amplification. Relays are usually SPDT or DPDT but they can have many more sets of switch contacts, for example relays with 4 sets of changeover contacts are readily available. For further information about switch contacts and the terms used to describe them please see the page on switches. Most relays are designed for PCB mounting but you can solder wires directly to the pins providing you take care to avoid melting the plastic case of the relay. The supplier's catalogue should show you the relay's connections. The coil will be obvious and it may be connected either way round. Relay coils produce brief high voltage 'spikes' when they are switched off and this can destroy transistors and ICs in the circuit. To prevent damage you must connect a protection diode across the relay coil. The animated picture shows a working relay with its coil and switch contacts. You can see a lever on the left being attracted by magnetism when the coil is switched on. This lever moves the switch contacts. There is one set of contacts (SPDT) in the foreground and another behind them, making the relay DPDT.

DEPARTMENT OF EEE, KITS, KMM

Page14

CHAPTER-3

HARDWARE COMPONENTS

The relay's switch connections are usually labeled COM, NC and NO:

COM = Common, always connect to this, it is the moving part of the switch. NC = Normally Closed, COM is connected to this when the relay coil is off. NO = Normally Open, COM is connected to this when the relay coil is on. Connect to COM and NO if you want the switched circuit to be on when the relay coil is on.

Connect to COM and NC if you want the switched circuit to be on when the relay coil is off.

Choosing a relay You need to consider several features when choosing a relay: 1. Physical size and pin arrangement If you are choosing a relay for an existing PCB you will need to ensure that its dimensions and pin arrangement are suitable. You should find this information in the supplier's catalogue. 2. Coil voltage The relay's coil voltage rating and resistance must suit the circuit powering the relay coil. Many relays have a coil rated for a 12V supply but 5V and 24V relays are also readily
DEPARTMENT OF EEE, KITS, KMM Page14

CHAPTER-3

HARDWARE COMPONENTS

available. Some relays operate perfectly well with a supply voltage which is a little lower than their rated value. 3. Coil resistance The circuit must be able to supply the current required by the relay coil. You can use Ohm's law to calculate the current: supply voltage Relay coil current = coil resistance

4. For example: A 12V supply relay with a coil resistance of 400

passes a current of

30mA. This is OK for a 555 timer IC (maximum output current 200mA), but it is too much for most ICs and they will require a transistor to amplify the current.

5. Switch ratings (voltage and current) the relay's switch contacts must be suitable for the circuit they are to control. You will need to check the voltage and current ratings. Note that the voltage rating is usually higher for AC, for example: "5A at 24V DC or 125V AC". 6. Switch contact arrangement (SPDT, DPDT etc) most relays are SPDT or DPDT which are often described as "single pole changeover" (SPCO) or "double pole changeover" (DPCO). For further information please see the page on switches.

3.5 LCD

It is a semiconductor diode having radioactive recombination. It requires a definite amount of energy to generate an electron-hole pair. The same energy is released when an electron recombines with a hole. This released energy may result in the emission of photon and such a recombination. Hear the amount of energy released when the electro reverts from the conduction band to the valence band appears in the
DEPARTMENT OF EEE, KITS, KMM Page14

CHAPTER-3

HARDWARE COMPONENTS

form of radiation. Alternatively the released energy may result in a series of phonons causing lattice vibration. Finally the released energy may be transferred to another electron. The recombination radiation may be lie in the infra-red and visible light spectrum. In forward is peaked around the band gap energy and the phenomenon is called injection luminescence. I n a junction biased in the avalanche break down region , there results a spectrum of photons carrying much higher energies . Almost White light then gets emitted from micro-plasma breakdown region in silicon junction. Diodes having radioactive Emitting Diode, abbreviated as LEDs. recombination are termed as Light

Light Emitting Diodes (LEDs)

Example:
.

Circuit symbol:

DEPARTMENT OF EEE, KITS, KMM

Page14

You might also like