Vous êtes sur la page 1sur 49

ELECTRONIC CODE LOCK

TRAINING REPORT OF SIX WEEKS INDUSTRIAL TRAINING, UNDERTAKEN AT DOEACC Society,Chandigarh ON ELECTRONIC CODE LOCK SUBMITTED IN PARTIAL FULFILLMENT OF THE DEGREE (B.E. - Electronics and Communication - 2009)

Under the Guidance of Name: Mr. Sarwan Singh B090020213 Department: Embedded Systems B090020529 B090020359
Chitkara University, Himachal Pradesh

Submitted By:Manvinder Saini Tushar Mittal Sushant choudhary

ELECTRONIC CODE LOCK

Vinay Sharma B090020378 Shikhil Vyas B090020328

As the part of B.E (ECE), we have undergone six weeks industrial training, after our 7th trimester, from DOEACC Society, Chandigarh, as it is growing organization in the field of embedded system. In this training, we explored our knowledge related to the electronics. During this period we worked on the project LCD DISPLAY USING MICROCONTROLLER 8051 which is basis of INTERFACING OF LCD WITH MICROCONTROLLER.

Areas covered under Hardware section:


Basic introduction to various electronic components. Soldering and Desoldering practices. Positive regulated power supplies. LCD interfacing with microcontroller

Areas covered under Software section:


Introduction to 8051 Microcontroller. Programming of basic 8051 instructions such as data flow instructions, jump

and branching instructions, arithmetic and logical instructions etc. Programming for interfacing of 8051 with LCD.

Project work:

Chitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

In this 6 week industrial training, the project assigned to us was LCD DISPLAY USING MICROCONTROLLER 8051 The interface was implemented using the Atmels AT89C51microcontroller.

TABLE OF CONTENTS
1) 2) 3) Acknowledgement Company Profile Training Report a) Introduction of Embedded System i)Microprocessor ii)Microcontrolller b) Component Desciption 4) Project Report a) Component list b) Circuit Diagram c) Circuit Description d) Microcontroller8051 i) Pin description ii) LCD iii) Interfacing LCD with microcontroller iv) Concept of programming e) Soldering and desoldering d) Conclusion 5) Bibliography a) Reference

Chitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

Chitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

ACKNOWLEDGEMENT
Technology is like an ocean & engineer is like a pearl driver in search of a treasure beneath the sea. Today technology is very vast and there is no end of technical studies. We are submitting our report on the project entitled ELECTRONIC CODE LOCK. We are very thankful to all the persons who with their views and participation helped us to carry this project and report successfully. It is with pleasure that we find our selves penning down these lines to express my sincere thanks to various people to help me along the way in completing the project. With deep sense of gratitude, we express our sincere thanks to Mr.Kamal Jot Kansal, Mr.Sachin and Mr.Pushpreet Singh for their precious guidance and for taking extra pain to seek through our problems. Under their efficient guidance, we had no problem in acquiring and getting various jobs done. They were always a pillar of strength to infuse encouragement during our disheartening failures. We are greatly thnkful to Lt.Col.N.S.Julka {retd.} for providing us with this wonderful opportunity.

Chitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

DOEACC Society
SC0 114-116, Sector 17 B, Chandigrah-160017 Website:- http://rcc.nic.in Contact No. : - 0172-2703281, 2702263 COMPANY PROFILE
K.K. Technology is an organization which is established in the field of Network Support, Network training, Embedded systems and VLSI-VHDL. We provide Support and training in the field of Networking solutions, Programming Languages, Embedded systems (Micro controller based design, Electronics system design) and VLSI-VHDL.K.K. Technology also conducts courses in CADENCE based design tools.K.K. Technology also provides Technical Research & Development support and consultancy to some Electronics companies. Our clients for R&D support in field of embedded systems. 1) 2) 3) 4) 5) Recorders and Medicare ltd Chandigarh. TELEBOX India ltd. Lotus Machines Pvt. Ltd. Chandigarh. Impearl Electronis Pvt. Ltd. Chandigarh. KANTA Electrical Ltd. Mohali.

The partial list of our clientele for network field is as below: 1) 2) 3) 4) CEDTI, Mohali Premier ISP, Chandigarh Innovative Solutions, Chandigarh Emmtel ISP, Chandigarh

Chitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

5) 6) 7) 8) 9) 10) 11) 12) 13) 14) 15) 16) 17) 18) 19) OUR TEAM

NIPER, Mohali Navik Technologies, Chandigarh Software Technology Parks India, Mohali Glide Internet Services Rana Group IDS HFCL Infotel Ltd. mohali Targus technologies pvt ltd STPI, Mohali BBMB The Tribune Quark Ind Swift Sagitech, Panchkula Jarc Infotech, Mohali

Presently we have a strong technical team of certified professionals for catering to these solutions and have presence in Chandigarh and Punjab. We have skilled team of engineers who are experienced in design, programming. We are having more than 10 engineers who are working on latest technologies like VLSI-VHDL, Embedded, and Networking etc. 1) Er. Kamal Jot Kansal M.Tech in ECE, B.Tech in E&I, 4 year industrial experience on VLSI-VHDL 2) Er. Seema Phd. Pursuing MCA in 1st division 4 year industrial experience on PHP Software Program Development Head 3) Er. Nipun Sharma Phd. Pursuing in ECE MCA in 1st division
Chitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

B.Tech & CISCO Certified 6 year industrial experience on Networking Head of Networking Department

COURSES Offered:For CSE/IT Branch:Software/ Programming Courses:1) C/C++ 2) Web Development (PHP) with Live Project 3) ASP.Net, VB.Net, C#.Net 4) JAVA ( Core JAVA, JAVA, ADVANCE JAVA, J2EE) 5) Oracle 6) Linux 7) MySQL, SQL (b) Networking Courses 1) MCSE 2) CCNA 3) RHCE

For Electronics & Communication:1) VLSI-VHDL with Live Project 2) Embedded System Design with Live Project 3) Microcontroller with Live Project

Chitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

4) Microprocessor with Live Project 5) PCB Designing Support Area (network solutions) a) LINUX / UNIX networks b) SUN networks c) CISCO devices (Routers, Switches, Firewalls, Cache Engine, RAS etc) d) Security Solutions Design Services (Embedded systems) a) AVR family b) ELECTRONIC SYSTEM DESIGN c) Pcb and layout designing d) PIC family e) Project development with ARM processors f) Switch mode power supply design Network Training a) CISCO CCNA, CCNP b) RED HAT LINUX c) SUN SOLARIS d) WINDOWS 2000, 2003 Our core strength is our commitment, technical expertise and cost effective solutions. We ensure high service levels and prompt support availability leading to lower downtime.K.K. Technology is a leader in education services and developer of innovative embedded solutions. To meet the demands of Post PC era K.K. provides complete solutions as well as design-to-order services to satisfy our customers.

Chitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

For K.K. Technology Kamal Jot Kansal

TRAINING REPORT

Chitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

INTRODUCTION OF EMBEDDED SYSTEM


Now a days electronics have developed at very fast rate. It plays a major role in the life of human being and makes it very easy and comfortable. Electronics circuits are designed to obtain a particular function. For this purpose a no of electronic component are suitably connected.Embedded systems have proved changing face of today's industrial scenario. An embedded system is a system is a specialpurpose computer system designed to perform one or a few dedicated functions often with real-time computing constraints. It is usually embedded as part of a complete device including hardware and mechanical parts. In contrast, a general-purpose computer, such as a personal computer, can do many different tasks depending on programming. Embedded systems control many of the common devices in use today. Fuelling in unbridled power into industrial computers to tackle the most complex applications, they have made quite an impression with a lot of the leading industrial sectors. Backed with the most durable components and peripherals sticking to the highest quality standards, the next generation embedded computers have what it takes to endure highly trying and harsh work environments. Multifunctional ability is the highlight of these systems even as they comprise a uniquely designed combination of software and hardware to perform highly challenging tasks that are a far cry for the common personal computers. This combination happens to be a programmed platform that is assigned with specific applications for the task and goes through various tests to make sure the systems offer long-life performance. Embedded systems range from portable devices such as digital watches and MP3 players, to large stationary installations like traffic lights, factory controllers, or be a crucial contributor systems controlling nuclear power plants. Complexity varies from low, with a single microcontroller chip, to very high with multiple units, peripherals and networks mounted inside a large chassis or enclosure. Embedded computers serve their purpose in a variety of areas, like the gaming industry, military, security and surveillance, and infotainment. Talking of their abilities and efficiency, a look into the highly popular CorBrick855E embedded computer will offer a good insight into what is possible at their behest.

Chitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

EXAMPLES OF EMBEDDED SYSTEM


Automated tiller machines (ATMS). Cellular telephones and telephonic switches. Computer network equipment, including routers timeservers and firewalls Computer printers, Copiers. Disk drives (floppy disk drive and hard disk drive) Engine controllers and antilock brake controllers for automobiles. Home automation products like thermostat, air conditioners sprinkles and

security monitoring system. House hold appliances including microwave ovens, washing machines, TV

sets DVD players/recorders. Medical equipment. Measurement equipment such as digital storage oscilloscopes, logic

analyzers and spectrum analyzers. Multimedia appliances: internet radio receivers, TV set top boxes. Stationary video game controllers.

Chitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

MICROPROCESSOR
A microprocessor is a general-purpose digital computer central processing unit (CPU). Although popularly known as a computer on a chip is in no sense a complete digital computer. The block diagram of a microprocessor CPU is shown, which contains an arithmetic and logical unit (ALU), a program counter (PC), a stack pointer (SP),some working registers, a clock timing circuit, and interrupt circuits.

Data Bus
Serial COM Port

CPU

RAM

ROM

I/O Port

Timer

FIG:BLOCK DIAGRAM OF A MICROPROCESSOR

MICROCONTROLLERS (MCU)
Figure shows the block diagram of a typical microcontroller, which is a true computer on a chip. The design incorporates all of the features found in micro-processor CPU, ALU, PC, SP, and registers. It also added the other features needed to make a complete computer: ROM, RAM, parallel I/O,serial I/O, counters, and clock circuit.

Chitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

CPU

RAM

ROM

A single chip
I/O Port Timer Serial COM Port

COMPARISON

BETWEEN

MICROPROCESSORS &

MICROCONTROLLERS

The microprocessor must have many additional parts to be operational as a computer whereas microcontroller requires no additional external digital parts. The prime use of microprocessor is to read data, perform extensive

calculations on that data and store them in the mass storage device or display it. The prime functions of microcontroller is to read data, perform limited calculations on it, control its environment based on these data. Thus the microprocessor is said to be general-purpose digital computers whereas the microcontroller are intend to be special purpose digital controller. Microprocessor is concerned with the rapid movement of the code and

data from the external addresses to the chip, microcontroller is concerned with the rapid movement of the bits within the chip.

Lastly, the microprocessor design accomplishes the goal of flexibility in the hardware configuration by enabling large amounts of memory and I/O that could be connected to the address and data pins on the IC package. The
Chitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

microcontroller design uses much more limited set of single and double byte instructions to move code and data from internal memory to ALU.

COMPONENTS DESCRIPTION
RESISTOR
The resistor's function is to reduce the flow of electric current.This symbol is used to indicate a resistor in a circuit diagram, known as a schematic. Resistance value is designated in units called the "Ohm." A 1000 Ohm resistor is typically shown as 1K-Ohm (kilo Ohm), and 1000 K-Ohms is written as 1MOhm (megohm).There are two types of resistors; 1) Fixed resistors 2) Variable resistors. They are also classified according to the material from which they are made. The typical resistor is made of either carbon film or metal film. There are other types as well, but these are the most common. The resistance value of the resistor is not the only thing to consider when selecting a resistor for use in a circuit. The "tolerance" and the electric power ratings of the resistor are also important.

Chitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

The tolerance of a resistor denotes how close it is to the actual rated resistance value. For example, a 5% tolerance would indicate a resistor that is within 5% of the specified resistance value. The power rating indicates how much power the resistor can safely tolerate. The maximum rated power of the resistor is specified in Watts. Power is calculated using the square of the current (I2) x the resistance value (R) of the resistor. If the maximum rating of the resistor is exceeded, it will become extremely hot and even burn.Resistors in electronic circuits are typically rated 1/8W, 1/4W, and 1/2W. 1/8W.

Variable Resistors
There are two general ways in which variable resistors are used. One is the variable resistor which value is easily changed, like the volume adjustment of Radio. The other is semi-fixed resistor that is not meant to be adjusted by anyone but a technician. It is used to adjust the operating condition of the circuit by the technician. Semi-fixed resistors are used to compensate for the inaccuracies of the resistors, and to fine-tune a circuit. The rotation angle of the variable resistor is usually about 300 degrees. Some variable resistors must be turned many times to use the whole range of resistance they offer. This allows for very precise adjustments of their value. These are called "Potentiometers" or "Trimmer Potentiometers. In the photograph to the left, the variable resistor typically used for volume controls can be seen on the far right. Its value is very easy to adjust. The four resistors at the center of the photograph are the semiChitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

fixed type. These ones are mounted on the printed circuit board. The two

resistors on the left are the trimmer potentiomeers.This symbol indicate a variable resistor in a circuit diagram.

is used to

Resistor color code

Color Black Brown

Value 0 1

Multiplier 0 1

Tolerance (%) 1

Chitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

Example (Brown=1),(Black=0),(Orange=3) 10 x 103 = 10k Tolerance(Gold) =

1 ohm 5%

Example 2 (Yellow=4),(Violet=7),(Black=0),(Red=2) 470 x 102 = 47k ohm Tolerance(Brown) = 1%

CAPACITOR
The capacitor's function is to store electricity, or electrical energy. The capacitor also functions as a filter, passing alternating current (AC), and blocking direct current (DC).This symbol is used to indicate a capacitor in a circuit diagram. The capacitor is constructed with two electrode plates facing each other, but separated by an insulator. When DC voltage is applied to the capacitor, an electric charge is stored on each electrode. While the capacitor is charging up, current flows.The current will stop flowing when the capacitor has fully charged.The capacitance of a capacitor is generally very small, so units such as the microfarad (10-6F ), nanofarad (10-9F ), and Pico farad (10-12F ) are used. Recently, a new capacitor with very high capacitance has been developed. The Electric Double Layer capacitor has capacitance designated in Farad units. These are known as "Super Capacitors. The capacitor has an insulator (the dielectric) between 2 sheets of electrodes. Different kinds of capacitors use different materials for the dielectric.
Chitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

Types of capacitors
Electrolytic Capacitors
Aluminum is used for the electrodes by using a thin oxidization membrane. Large values of capacitance can be obtained in comparison with the size of the capacitor, because the dielectric used is very thin. The most important characteristic of electrolytic capacitors is that they have polarity. They have a positive and a negative electrode. [Polarized] This means that it is very important which way round they are connected. If the capacitor is subjected to voltage exceeding its working voltage, or if it is connected with incorrect polarity, it may burst. It is extremely dangerous, because it can quite literally explode. Generally, in the circuit diagram, the positive side is indicated by a "+" (plus) symbol.

Electrolytic capacitors range in value from about 1F to thousands of F.Mainly this type of capacitor is used as a ripple filter in a power supply circuit, or as a filter to bypass low frequency signals, etc. .

Chitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

Ceramic Capacitors
Ceramic capacitors are constructed with materials such as titanium acid barium used as the dielectric. Internally, these capacitors are not constructed as a coil, so they can be used in high frequency applications. Typically, they are used in circuits which bypass high frequency signals to ground.These capacitors have the shape of a disk. Their capacitance is comparatively small.The capacitor on the left is a 100pF capacitor with a diameter of about 3 mm.The capacitor on the right side is printed with 103, so 10 x 103pF becomes 0.01 F. The diameter of the disk is about 6 mm.Ceramic capacitors have no polarity.Ceramic capacitors should not be used for analog circuits, because they can distort the signal.

DIODE
A diode is a semiconductor device which allows current to flow through it in only one direction. Although a transistor is also a semiconductor device, it does

Chitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

not operate the way a diode does. A diode is specifically made to allow current to flow through it in only one direction A diode can be used as a rectifier that converts AC to DC for a power supply device. Diodes can be used to separate the signal from radio frequencies. Diodes can be used as an on/off switch that controls current. This symbol is used to indicate a diode in a circuit diagram.

TRANSISTOR
The transistor's function is to amplify an electric current.Many different kinds of transistors are used in analog circuits, for different reasons. This is not the case for digital circuits. In a digital circuit, only two values matter on or off. The amplification ability of a transistor is not relevant in a digital circuit. In many cases, a circuit is built with integrated circuits.Transistors are often used in digital circuits as buffers to protect ICs. For example, when powering an electromagnetic switch (called a 'relay'), or when controlling a light emitting diode.Two different symbols are used for the transistor.

Chitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

PNP type

and NPN type

A transistor is a semiconductor device, commonly used as an amplifier. Because of its fast response and accuracy, the transistor may be used in a wide variety of digital and analog functions, including amplification, switching, voltage regulation, signal modulation, and oscillators. Transistors may be packaged individually or as part of an integrated circuit chip, which may hold thousands of transistors in a very small area.

CRYSTAL OSCILLATOR
A crystal oscillator is an electronic circuit that uses the mechanical resonance of a vibrating crystal of piezoelectric material to create an electrical signal with a very precise frequency. This frequency is commonly used to keep track of time

Chitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

(as in quartz wristwatches), to provide a stable clock signal for digital integrated circuits, and to stabilize frequencies for radio transmitters and receivers. The most common type of piezoelectric resonator used is the quartz crystal, so oscillator circuits designed around them were called "crystal oscillators".

TRANSFORMER
Transformers for use at power or audio frequencies have cores made of many thin laminations of silicon steel. By concentrating the magnetic flux, more of it is usefully linked by both primary and secondary windings. Since the steel core is conductive, it, too, has currents induced in it by the changing magnetic flux. Each layer is insulated from the adjacent layer to reduce the energy lost to eddy current heating of the core. The thin laminations are used to reduce the eddy currents, and the insulation is used to keep the laminations from acting as a solid piece of steel. The thinner the laminations the lower the eddy currents, and the lower the losses. Very thin laminations are generally used on high frequency transformers. The cost goes up when using thinner laminations mainly over the labor in stacking them.

Chitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

PRINTED CIRCUIT BOARD


When assembling an electronic circuit, a board is needed on which the components can be mounted and wired together. This board is called a Printed Wiring Board (PWB).In Japan, the printed wiring board used to be called a "Printed Circuit Board." Nowadays in Japan the name "Printed Circuit Board" is not used because the initials of "Printed Circuit Board" are "PCB." PCB also stands for "Polychlorinated Biphenyls (PCBs)," which is a poison. So in Japan, we refer to the boards as "Printed Wiring Boards." In other countries, they are still referred to as "Printed Circuit Boards," or PCBs. In electronics, printed circuit boards, or PCBs, are used to mechanically support and electrically connect electronic components using

Chitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

conductive pathways, or traces, etched from copper sheets laminated onto a non-conductive substrate. PCBs are rugged, inexpensive, and can be highly reliable. They require much more layout effort and higher initial cost than either wire-wrapped or point-to-point constructed circuits, but are much cheaper, faster, and consistent in high volume productionMaking a PWB takes a lot of work, and can be very difficult.

WIRING MATERIAL
Wire is used to electrically connect circuit parts, devices, equipment etc.There are various kinds of wiring materials. The different types of wire can be divided largely into two categories: single wire and twisted strand wire. It really doesn't matter which kind you use for a given application, but usually, single wire is used to connect devices (resistors, capacitors ect) together on the PWB. (Parts that don't move)It is also used for jumper wiring.Twisted strand wire can bend freely, so it can be used for wiring on the PWB, and also to connect discrete

Chitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

pieces of equipment.If single wire is used to connect separate equipment, it will break soon, as it is not very flexible.It is convenient to use the single tin coated wire of the diameter 0.32 mm for the wiring of PWB. If the diameter is larger, soldering becomes a little bit difficult. And if the diameter is too thin, it becomes difficult to bend the wire the way you want it to stay. It's best to use whatever wire you are comfortable with, and not worry about those things.

Chitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

PROJECT REPORT

Chitkara University, Himachal Pradesh

ELECTRONIC CODE LOCK

COMPONENT LIST
S.NO.
1) 2) 3) 4) 5) 6) 7) 8) 9) 10) 11) 12) 13) 14) 15)

NAME OF COMPONENT
PCB Connector Transformer Diode Capacitor-1 Capacitor-2 Capacitor-2 Resistor Regulator IC Crystal oscillator Microcontroller Potentiometer LCD Berge stick Connecting wires

VALUE
4.5 3 pin 220V IN4001 10uf,50V 1000uf,25V 33pf 10k 7805 11.0592 AT89C52 10K JMD142A

Chitkara University, Himachal Pradesh

28

ELECTRONIC CODE LOCK

CIRCUIT DIAGRAM

Chitkara University, Himachal Pradesh

29

ELECTRONIC CODE LOCK

CIRCUIT DESCRIPTION
As seen in the circuit diagram the pin no. 9 is a reset pin and is used to develop a pulse from low to high when we are required to reset the controller.The switch across the capacitor will do this as one of the terminal of the switch is attached to VCC.When it is pressed the VCC reaches the controller pin no.9 and will reset it. Next to it is pin no.18 and 19 to which crystal circuit is fixed.the crystal has got a frequency of 11.0592 Mhz with two small capacitors of 33pf each.these are used to avoid the frequency noise in the circuit.the pin no.20 is a ground pin and connected to the ground of the supply section.The pin no.20 is a supply pin thus it is attached to the VCC which is +5V dc.The pin no.31 is Vpp pin and is shorted with pin no.40 to give it VCC. In front of port 0 and port 2 we have fixed pin type connectors called berge sticks.this we have attached to make our card flexible to use so that it may pick the out from this stick and attach it with the application circuitry in order to drive it using connectors.the port 0 is not internally pulled up port so we have to use external pull up by putting a SIP of 10K.It is also shown in the circuit the SIP is nothing but a resistor network of a fixed value and is used to fix provide the necessary external voltage to the ports so that they can be used at the time of sourcing the current to any external device. The complete components were with us and we are suppose to make a power supply section.for this section we are suppose to generate a 5V dc supply at the output.This is then used as VCC for the controller and even for the application circuitry.

POWER SUPPLY UNIT


Power supply is a reference to a source of electrical power .a device or a system that supplies electrical or other type of energies to an output load or group of loads is called a power supply unit.

Chitkara University, Himachal Pradesh

30

ELECTRONIC CODE LOCK

REGULATED POWER SUPPLY


A Regulated power supply circuit that is an electronic circuit that is designed to provide a constant voltage of predetermined value across the load terminals irrespective to the main function.A regulated power supply circuit consists of a transformer to step down the ac mains voltage to the required value. The output of the transformer is fed to the rectifier circuit which converts the ac voltage into pulsating dc voltage. In series with the rectifier, the filter circuit is connected which filters out the pulsating dc voltage into pure dc voltage. Then the output is connected to the voltage regulator circuit, which regulates the dc output and converts it into constant dc supply, which can be then fed to the electronics circuits. The circuit for the regulated supply circuit is as shown below For example a 5V regulated supply: U 1 4 0 0 C 1 D 2 I N 4 0 0 7 0 1 0 0 V 1 I GND

D 1 T 2 2 0 51 6 8 V I N

M V

7 3 O

v J 1 5 N v 2

f / 2

C v 1

1 u 2f / 2 C O

After doing this we have fixed the controller base and its associated circuitry with all the precautions as if reset circuit should be properly bias and crystal should be proper and moreover the pin no.31 should be well short circuited with the controllers pin no 40 to have VCC.

Chitkara University, Himachal Pradesh

31

ELECTRONIC CODE LOCK

MICROCONTROLLER 8051
Microcontroller (also MCU or C) is a computer-on-a-chip. It is a type of microprocessor emphasizing high integration, low power consumption, self-sufficiency and cost-effectiveness, in contrast to a general-purpose microprocessor (the kind used in a PC). In addition to the usual arithmetic and logic elements of a general purpose microprocessor, the microcontroller typically integrates additional elements such as read-write memory for data storage, read-only memory, such as flash for code storage, EEPROM for permanent data storage, peripheral devices, and input/output interfaces. At clock speeds of as little as a few MHz or even lower, microcontrollers often operate at very low speed compared to modern day microprocessors, but this is adequate for typical applications. They consume relatively little power (milliwatts), and will generally have the ability to sleep while waiting for an interesting peripheral event such as a button press to wake them up again to do something.

Description
The AT89C2051 is a low-voltage, high-performance CMOS 8-bit microcomputer with 2K bytes of Flash programmable and erasable read-only memory (PEROM). The device is manufactured using Atmels high-density nonvolatile memory technology and is compatible with the industry-standard MCS-51 instruction set. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C2051 is a power-full microcomputer which provides a highly-flexible and cost-effective solution to many embedded control applications. The AT89C2051 provides the following standard features: 2K bytes of Flash, 128 bytes of RAM, 15 I/O lines, two 16-bit timer/counters, a five vector two-level interrupt architecture, a full duplex serial port, a precision analog comparator, on-chip oscillator and clock circuitry. In addition, the AT89C2051 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue functioning. The power-down mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset.

Chitkara University, Himachal Pradesh

32

ELECTRONIC CODE LOCK

Special features of 8051 are 8-bit data bus 16-bit address bus 32 general purpose registers each of 8 bits 16 bit timers (usually 2, but may have more, or less). 3 internal and 2 external interrupts. Bit as well as byte addressable RAM area of 16 bytes. Four 8-bit ports, (short models have two 8-bit ports). 16-bit program counter and data pointer

PIN DESCRIPTION OF 8051


The microcontroller has total forty pins in all. Most of the pins of 8051 microcontroller have more than one function. The first function is the input /output operation and the second function can be some special function like they can be used as counters or for serial communication. In microcontroller there are four ports (collection of pins) P0, P1, P2 &P3. These ports have 8 pins each as shown. As we will see later on we will be able to address the whole port during programming. Whenever we are talking about 8051 we are talking of the family of microcontrollers having the architecture of 8051. They are all same except for some additional features, pins distribution and packaging. PORT 0: Serve as an i/p, o/p or when used together as a bi-directional low order address and data bus for external memory. When used as i/p, a 1 must be written to the corresponding port 0 latches by the prg, thus turning both of o/p transistors off, which in turn causes the pin to float in a high impedance state, and the pin is essentially connected to i/p buffer. When used as o/p, the pin latches that are programmed to a 0 will turn on the lower FET grounding the pin.

Chitkara University, Himachal Pradesh

33

ELECTRONIC CODE LOCK

PORT 1: Port 1 pins have no dual functions, therefore the output latch is connected directly to the gate of the lower FET, which has an FET circuit labeled internal FET pull-up as an active pull-up load. Used as an i/p, a 1 is written to the latch, turning the lower FET off; the pin and the i/p to the pin buffer are pulled high by the FET load. An external ckt can overcome the high impedance pull-up and drive the pin low to i/p a 0 or leave the i/p high for a 1.If used as o/p, the latches containing a 1 can derive the input of an external ckt high through the pull-up. If a 0 is written to the latch, the lower.FET is on, the pull-up is off, and the pin can drive the i/p of the external ckt low. PORT 2: This may be used as the I/O port similar in operation to the port 1.The alternate use of this port is to supply a high order address byte in conjunction with the port 0 low-order byte to address external memory. Port 2 pins are momentarily changed by the address control signals when supplying the high byte of a 16-bit address. Port 2 latches remain stable when external memory is addressed as they do not have to be turned around {set to 1}for data i/p as the case of port 0. PORT 3: Is an i/o port similar to port 1.the i/o functions can be programmed under the control of the p3 latches or under the control of the various other SFRs.The port 3 alternate uses are also shown in table: Unlike P0, P2 which can have external addressing functions and change all eight port bits when in alternate use, each pin of port 3 may be individually programmed to be used either as I/O or as one of the alternate functions. PIN 40 &20 (VCC and GND): The pin 40 is Vcc i.e. it is given 5V and pin 20 is GND i.e. it is given 0V (supplied from power source) for powering up the microcontroller. Pins 40 and 20 are VCC and ground respectively. The 8051 chip needs +5V 500mA to function properly, although there are lower powered versions like the Atmel 2051 which is a scaled down version of the 8051 which runs on +3V.

Chitkara University, Himachal Pradesh

34

ELECTRONIC CODE LOCK

PIN 9 RESET PIN CONNECTIONS (RST): PIN 9 is the reset pin which is used reset the microcontrollers internal registers and ports upon starting up.2 machine cycle should be high at this pin. The reset pin i.e. pin number 9 is used to reset the program just like we restart a computer, the program starts executing from the very beginning. When reset is used the program counter is set back to zero and the values in all other registers are lost.

Chitkara University, Himachal Pradesh

35

ELECTRONIC CODE LOCK

PINS 18 & 19 CONNECTING THE CRYSTAL (XTAL1- XTAL2): The 8051 has a built-in oscillator amplifier hence we need to only connect a crystal at these pins to provide clock pulses to the circuit. The 8051 requires the existence of an external oscillator circuit. The oscillator circuit usually runs around 12MHz, although the 8051 (depending on which specific model) is capable of running at a maximum of 40MHz. Each machine cycle in the 8051 is 12 clock cycles, giving an effective cycle rate at 1MHz (for a 12 KHz clock) to 3.33MHz (for the maximum 40MHz clock).The heart of 8051 is the circuitry that generates the clock pulses by which all internal operations are synchronised.Pins XTAL1 and XTAL2 are provided for connecting a resonant circuit to form an oscillator. Typically quartz crystal and capacitors are employed. The crystal frequency is the basic internal clock frequency of the microcontroller. The pin numbers 18 - 19 are used to connect the crystal. The frequency of this crystal determines the machine cycle.

PINS 29, 30 & 31: As described in the features of the 8051, this chip contains a built-in flash memory. In order to program this we need to supply a voltage of +12V at pin 31. If external memory is connected then PIN 31, also called EA/VPP, should be connected to ground to indicate the presence of external memory. PIN 30 is called ALE (address latch enable), which is used when multiple memory chips are connected to the controller and only one of them needs to be selected. We will deal with this in depth in the later chapters. PIN 29 is called PSEN. This is "program select enable". In order to use the external memory it is required to provide the low voltage (0) on both PSEN and EA pins.

Chitkara University, Himachal Pradesh

36

ELECTRONIC CODE LOCK

LIQUID CRYSTAL DISPLAY


A liquid crystal display (LCD) is a thin, flat panel used for electronically displaying information such as text, images, and moving pictures. Its uses include monitors for computers, televisions, instrument panels, and other devices ranging from aircraft cockpit displays, to every-day consumer devices such as video players, gaming devices, clocks, watches, calculators, and telephones. Among its major features are its lightweight construction, its portability, and its ability to be produced in much larger screen sizes than are practical for the construction of cathode ray tube (CRT) display technology. Its low electrical power consumption enables it to be used in battery-powered electronic equipment. It is an electronically-modulated optical device made up of any number of pixels filled with liquid crystals and arrayed in front of a light source (backlight) or reflector to produce images in color or monochrome. The earliest discoveries leading to the development of LCD technology date from 1888. By 2008, worldwide sales of televisions with LCD screens had surpassed the sale of CRT units.

The most commonly used LCDs found in the market today are 1 line,2 lines or 4 lines LCDs which have only one controller and support at most 80 characters , whereas LCDs supporting more than 80 characters make use of 2 HD44780 controllers. Most LCDs with 1 controller has 14 pins and LCDs with 2 controllers have 16 pins.
Chitkara University, Himachal Pradesh

37

ELECTRONIC CODE LOCK

LCD pin descriptions:


The LCD discussed in this section has 14 pins. The function of each pin is given in table.

Vcc, Vss, and VEE: While Vcc and Vss provide +5V and ground, respectively, VEE is used for controlling LCD contrast. RS register select: There are two very important registers inside the LCD. The RS pin is used for their selection as follows. If RS = 0, the instruction command code register is selected, allowing the user to send a command such as clear display, cursor at home, etc. If RS = 1 the data register is selected, allowing the user to send data to be displayed on the LCD.
Chitkara University, Himachal Pradesh

38

ELECTRONIC CODE LOCK

R/W read/write: R/W input allows the user to write information to the LCD or read information from it. R/W = 1 when reading; R/W =0 when writing. E Enable: The enable pin is used by the LCD to latch information presented to its data pins. When data is supplied to data pins, a high to low pulse must be applied to this pin in order for the LCD to latch in the data present at the data pins. This pulse must be a minimum of 450 ns wide. D0 D7: The 8 bit data pins, D0 D7, are used to send information to the LCD or read the contents of the LCDs internal registers.To display letters and numbers, we send ASCII codes for the letters A Z, a z, and numbers 0 9 to these pins while making RS = 1.There are also instructions command codes that can be sent to the LCD to clear the display or force the cursor to the home position or blink the cursor. Table below lists the instruction command codes.

Chitkara University, Himachal Pradesh

39

ELECTRONIC CODE LOCK

We also use RS = 0 to check the busy flag bit to see if the LCD is ready to receive information. The busy flag is D7 and can be read when R/W =1 and RS = 0, as follows: if R/W =1, RS =0. When D7 = 1(busy flag = 1), the LCD busy taking care of internal operations and will not accept any new information. When D7 = 0, the LCD is ready to receive new information. Note: It is recommended to check the busy flag before writing any data to the LCD.

Data display: In LCD, one can put data at any location. The following shows address locations
and how they are accessed: RS 0 R/W 0 DB7 1 DB6 A DB5 A DB4 A DB3 A DB2 A DB1 A DB0 A

Chitkara University, Himachal Pradesh

40

ELECTRONIC CODE LOCK

LCD addressing
DB7 Line 1(max.) Line 1(min.) Line 2(max.) Line 2(min.) 1 1 1 1 DB6 0 0 1 1 DB5 0 1 0 1 DB4 0 0 0 0 DB3 0 0 0 0 DB2 0 1 0 1 DB1 0 1 0 1 DB0 0 1 0 1

The upper address range can go as high as 0100111 for 40 character-wide LCD while for the 20 character-wide LCD it goes up to 010011 (19 decimal = 10011 binary). Notice that the upper range 0100111 (binary) = 39 decimal which corresponds to locations 0 to 39 for the LCDs of 40*2 size.

Interfacing LCD to 8051


The 44780 standard requires 3 control lines as well as either 4 or 8 I/O lines for the data bus. The user may select whether the LCD is to operate with a 4-bit data bus or an 8-bit data bus.

If a 4-bit data bus is used, the LCD will require a total of 7 data lines.If an 8-bit data bus is used, the LCD will require a total of 11 data lines.The three control lines are EN, RS, and RW. Note that the EN line must be raised/lowered before/after each instruction sent to the LCD regardless of
Chitkara University, Himachal Pradesh

41

ELECTRONIC CODE LOCK

whether that instruction is read or write text or instruction. In short, you must always manipulate EN when communicating with the LCD. EN is the LCD's way of knowing that you are talking to it. If you don't raise/lower EN, the LCD doesn't know you're talking to it on the other lines.

PRACTICAL CONNECTIONS
The figure below shows a general way in which we can connect a LCD to the microcontroller .Here the figure shows 8051 controller, the same way we can use AT89C92 controller as we have used in our trainiong session.The LCD over here is attached to port 0 and in our training project we have attached it to port 3.

Concept of programming
Chitkara University, Himachal Pradesh

42

ELECTRONIC CODE LOCK

A computer can do what programmer ask to do.To perform a particular task theprogrammer prepare the sequence of instructions called a program. A set of program written for particular computer is known as software for that computer. The program is stored in RAM. The instructions are coded and stored in the memory in the form of 0s and 1s.A program written in the form of 0s and 1s is known as machine language program.

DEMERITS OF MACHINE LANGUAGE PROGRAM


1. 2. 3. 4. 5. It is very difficult to understand or debug a program. Since the each bit has to be entered individually the entry of a program is very slow. Programs are long. Program writing is difficult and tiresome. Chances of careless errors in writing yhe program. ASSEMBLY LANGUAGE: The writing of program in machine language is difficult, tiresome, boring, and errorprone. A pprogrammer can easily write a program in alphanumeric symbols instead of 0s and 1s. A program written in mnemonics is known as assembly language program. COMPILER: A program that translates a high-level program into machine language is known as compiler. ASSEMBLER: A program that translates an assembly language program into machine language prorram is known as assembler. Finally we have reached a point where we have to insert the brain to the controller and we were ready to do so.We used the most famous software to write programs in assembly language in it and this software is called KEIL micro-vision-3. This software has got in built assembler as well as compiler as well as compiler to generate required hex file is to be burned in the controller.

SOLDERING
Chitkara University, Himachal Pradesh

43

ELECTRONIC CODE LOCK

The electronic industry depends upon very much on the solder joints. Soldering is an alloying process b\w two meters or soldering as a method of making reliable joints is one of the widely practiced production techniques.

SOLDERING EQUIPMENT
If the number of PCBs and components to be soldered are less, hands soldering process is used. Following are the tools used: 1. Soldering Iron 2. Solder 3. Soldering Fluxes 4. Tools

1. SOLDERING IRON
It is reasonable priced electrical equipment. It supplies sufficient heat transformer when the iron tip is applied to connection to be soldered. Soldering irons are of different Temperature ranges. Soldering irons are divided in two groups: 1.1 Soldering iron or pencils 1.2 Soldering guns

Chitkara University, Himachal Pradesh

44

ELECTRONIC CODE LOCK

2. SOLDER It is the oldest and most widely used alloy. It is a genes name representing a host of alloys of raw melting materials like tin, lead, cadmium, bismuth, sodium silver and many more. An alloy is not just a mixture but also an exact combination of two or more metals to get an entirely new set of desired properties. 3. FLUXES During soldering operations an auxiliary medium is most commonly used to increase the flow properties of molten solder to improve the degree of melting and remove the oxide film from the base metal which prevents the film from reforming so that the liquid solder can display the flux and react with the base metal to form a bond characteristics of flux.

DESOLDERING
At some stage you will probably need to desolder a joint to remove or re-position a wire or component. There are two ways to remove the solder: With a desoldering pump (solder sucker) With solder remover wick (copper braid)

Chitkara University, Himachal Pradesh

45

ELECTRONIC CODE LOCK

APPLICATIONS
Microcontrollers are frequently used in automatically controlled products and devices, such as automobile engine control systems, remote controls, office machines, appliances, power tools, and toys. LCD interfaced with microcontroller can also be used in various applications such as written below: Home automatic products like air conditioners, security monitoring system. House holds appliances like microwave oven, washing machines Medical equipments Digital multimeter, voltmeter, calculators and watches Moving display in Malls, Banks etc. Parking system

Chitkara University, Himachal Pradesh

46

ELECTRONIC CODE LOCK

CONCLUSION
After completing the project, we learnt much things.Our interest in practical work also increased.We had learned the following things: How to read the circuit Diagram? How to identify the components? How to assemble the given components with the help of circuit Diagram on the PCB? To know how the interfacing of LCD can be done with microcontroller 8051? How the micro-controller works? How to eliminate any fault if occurs? How to solder/desolder the components efficiently?

What practical works provides us and how accuracy, efficiency can be got in the work?

Chitkara University, Himachal Pradesh

47

ELECTRONIC CODE LOCK

BIBLOGRAPHY
DAILY DIARY

BOOKS
Muhammad Ali Mazidi, Janice Gillispie Mazidi, Rosin D. Mc Kinlay, the 8051 Microcontroller & Embedded Systems, Pearson Education Inc. 2nd Edition, 2008. Kenneth J Ayala, the 8051 Microcontroller Architecture, Programming & Applications

Penram International, 2nd Edition, 1996. J B Gupta, Electronics Devices and Circuits, KATSON Books, India Electronics for You Electronics devices and circuits Electronics manufacturing Technique serials Electronics components and materials

WEB RESOURCES
http://www.8051projects.net/forum http://www.datasheetdirect.com http://www.medicaid.co.in www.electronicsforyou.com http://www.google.com www.alldatasheets.com www.wikipedia.com
Chitkara University, Himachal Pradesh

48

ELECTRONIC CODE LOCK

Chitkara University, Himachal Pradesh

49

Vous aimerez peut-être aussi