Chapter-1: 1.1electronics
Chapter-1: 1.1electronics
Chapter-1: 1.1electronics
CHAPTER-1 INTRODUCTION
1.1ELECTRONICS
Electronics is the branch of science and technology which makes use of the controlled motion of electrons through different media and vacuum. The ability to control electron flow is usually applied to information handling or device control. Electronics is distinct from electrical science and technology, which deals with the generation, distribution, control and application of electrical power. This distinction started around 1906 with the invention by Lee De Forest of the triode, which made electrical amplification possible with a non-mechanical device. Until 1950 this field was called "radio technology" because its principal application was the design and theory of radio transmitters, receivers and vacuum tubes. Most electronic devices today use semiconductor components to perform electron control. The study of semiconductor devices and related technology is considered a branch of physics, whereas the design and construction of electronic circuits to solve practical problems come under electronics engineering. This article focuses on engineering aspects of electronics ELECTRONIC COMPONENTS An electronic component is any physical entity in an electronic system used to affect the electrons or their associated fields in a desired manner consistent with the intended function of the electronic system. Components are generally intended to be connected together, usually by being soldered to a printed circuit board (PCB), to create an electronic circuit with a particular function (for example an amplifier, radio receiver, or oscillator). Components may be packaged singly or in more complex groups as integrated circuits. Some common electronic components are capacitors, resistors, diodes, transistors, etc. Components are often categorized as active (e.g. transistors and thyristors) or passive (e.g. resistors and capacitors). The main components used in electronics are of two types: ACTIVE PASSIVE ACTIVE COMPONENTS
1
The components which produce the energy in the form of current or voltage are called as active components or we can say that the component which can perform a specific function like amplifying the signal, rectify the signal they are called active component. For ex: transistors, diode PASSIVE COMPONENTS The components which store the energy in the form of current or voltage are called as passive components or we can say that the component which cant perform any function itself but when these components are connected in any circuit with active component then it gives a performance. For ex: resistor, capacitor, and inductor.
Figure1.1 Active & Passive components NEED OF PASSIVE COMPONENTS They help in amplification of active components TYPES OF PASSIVE COMPONENTS 1. Vacuum tubes 2. Semiconductor devices
A micro controller is a programmable logic and integrated circuit which can be programmed to do a number of tasks. It is possible to control just about anything with the program written by the user. A microcontroller (sometimes abbreviated C, uC or MCU) is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. Neither program memory in the form of NOR flash or OTP ROM is also often included on chip, as well as a typically small amount of RAM. Microcontrollers are designed for embedded applications, in contrast to the microprocessors used in personal computers or other general purpose applications. Microcontrollers are used in automatically controlled products and devices, such as automobile engine control systems, implantable medical devices, remote controls, office machines, appliances, power tools, toys and other embedded systems. By reducing the size and cost compared to a design that uses a separate microprocessor, memory, and input/output devices, microcontrollers make it economical to digitally control even more devices and processes. Mixed signal microcontrollers are common, integrating analog components needed to control non-digital electronic systems .Some microcontrollers may use four-bit words and operate at clock rate frequencies as low as 4 kHz, for low power consumption (mill watts or microwatts). They will generally have the ability to retain functionality while waiting for an event such as a button press or other interrupt; power consumption while sleeping (CPU clock and most peripherals off) may be just nanowatts, making many of them well suited for long lasting battery applications. Other microcontrollers may serve performance-critical roles, where they may need to act more like a digital signal processor (DSP), with higher clock speeds and power consumption. Novices in electronics usually think that the microcontroller is the same as the microprocessor. That's not true. They differ from each other in many ways. The first and most important difference in favor of the microcontroller is its functionality. In order for the microprocessor to be used, other components, first of all memory, must be added to it. Even though it is considered a powerful computing machine, it is not capable of establishing direct communication with the peripherals. Instead, specialized circuits must be used for this purpose. This is how it was in the beginning and remains the same today. We can find microcontrollers in all kinds of electronic devices these days. Any device that measures, stores, controls, calculates, or displays information must have a microcontroller chip inside. The largest single use for microcontrollers is in automobile industry (microcontrollers
3
widely used for controlling engines and power controls in automobiles). You can also find microcontrollers inside keyboards, mouse, modems, printers, and other peripherals. In test equipments, microcontrollers make it easy to add features such as the ability to store measurements, to create and store user routines, and to display messages and waveforms. Consumer products that use microcontrollers include digital camcorders, optical players, LCD/LED display units, etc. And these are just a few examples
Central processing unit(CPU) Random Access Memory)(RAM) Read Only Memory(ROM) Input/output ports Timers and Counters Interrupt Controls Analog to digital converters Digital analog converters Serial interfacing ports Oscillatory circuits
building a personal computer now involves only installing assembled boards and other major components in an enclosure.
A personal computer like Apples Macintosh or IBMs PC is a general-purpose machine, since you can use it for many applicationsword processing, spreadsheets, computer-aided design, and morejust by loading the appropriate software from disk into memory. Interfaces to personal computers are for the most part standard ones like those to video displays, keyboards, and printers.
But along with cheap, powerful, and versatile personal computers has developed a new interest in small, customized computers for specific uses. Each of these small computers is dedicated to one task, or a set of closely related tasks. Adding computer power to a device can enable it to do more, or do it faster, better, or more cheaply. For example, automobile engine controllers have helped to reduce harmful exhaust emissions. And microcontrollers inside computer modems have made it easy to add features and abilities beyond the basic computer-to-phoneline interface.
In addition to their use in mass-produced products like these, its also become feasible to design computer power into one-of-a-kind projects, such as an environmental controller for a scientific study or an intelligent test fixture that ensures that a product meets its specifications before its shipped to a customer.
At the core of many of these specialized computers is a microcontroller. The computers program is typically stored permanently in semiconductor memory such as ROM or EPROM. The interfaces between the microcontroller and the outside world vary with the application, and may include a small display, a keypad or switches, sensors, relays, motors, and so on.
These small, special-purpose computers are sometimes called single-board computers , or SBCs. The term can be misleading, however, since the computer doesnt have to be on a single circuit board, and many types of computer systems, such as laptop and notebook computers, are now manufactured on a single board.
Electronics capable of controlling a small submarine, a crane or an elevator are now built into one single chip. Microcontrollers offer a wide range of applications, but only a few of them are normally used. It's up to you to decide what you want from the microcontroller and dump a program accordingly containing appropriate instructions into it. Prior to turning the device on, its operation should be tested by simulation. If everything works fine, build the microcontroller into your device. If you ever need to change, improve or upgrade the program, just does it. Until when? Until you feel satisfied. That's all.
Parallax Propeller Free scale 68HC11 (8-bit) Intel 8051 Silicon Laboratories Pipelined 8051 Microcontrollers ARM processors (from many vendors) using ARM7 or Cortex-M3 cores are generally microcontrollers
STMicroelectronics STM8 (8-bit), ST10 (16-bit) and STM32 (32-bit) Atmel AVR (8-bit), AVR32 (32-bit), and AT91SAM (32-bit) Freescale ColdFire (32-bit) and S08 (8-bit) Hitachi H8, Hitachi SuperH (32-bit) Hyperstone E1/E2 (32-bit, First full integration of RISC and DSP on one processor core [1996] [1])
Infineon Microcontroller: 8, 16, 32 Bit microcontrollers for automotive and industrial applications
PIC (8-bit PIC16, PIC18, 16-bit dsPIC33 / PIC24) PowerPC ISE PSoC (Programmable System-on-Chip) Rabbit 2000 (8-bit) Texas Instruments Microcontrollers: TI MSP430 16-bit Microcontrollers, C2000 (32bit), and Stellaris (32-bit)
And many others, some of which are used in very narrow range of applications or are more like applications processors than microcontrollers. The microcontroller market is extremely fragmented, with numerous vendors, technologies, and markets. Note that many vendors sell (or have sold) multiple architectures.
Basic components of a Microcontroller are A CPU to execute programmed code Memory, both RAM and ROM Internal timers and input/output system, in form of i/o pins
Some Microcontrollers have some extra features like- UART for serial communication, Internal EEPROM and PWM modules for analogue output. Microcontrollers are the main heart of any embedded system. They run the hardware according to the program burnt them.
VON-NEUMANN ARCHITECTURE- It has only one bus which is used for both data transfers and instruction fetches, and therefore data transfers and instruction fetches must be scheduled - they cannot be performed at the same time. HARWARD ARCHITECTURE- It has physically separate signals and storage for code and data memory. It is possible to access program memory and data memory simultaneously. Microcontroller architectures vary widely. Some designs include general-purpose
microprocessor cores, with one or more ROM, RAM, or I/O functions integrated onto the package. Other designs are purpose built for control applications. A micro-controller instruction set usually has many instructions intended for bit-wise operations to make control programs more compact. For example, a general purpose processor might require several instructions to test a bit in a register and branch if the bit is set, where a micro-controller could have a single instruction to provide that commonly-required function. Microcontrollers typically do not have a math coprocessor, so floating point arithmetic is performed by software. Since the emergence of microcontrollers, many different memory technologies have been used. Almost all microcontrollers have at least two different kinds of memory, a non-volatile memory for storing firmware and a read-write memory for temporary data.
10
Simulators are available for some microcontrollers, such as in Microchip's MPLAB environment and the Revolution Education PICAXE range. These allow a developer to analyze what the behavior of the microcontroller and their program should be if they were using the actual part. A simulator will show the internal processor state and also that of the outputs, as well as allowing input signals to be generated. While on the one hand most simulators will be limited from being unable to simulate much other hardware in a system, they can exercise conditions that may otherwise be hard to reproduce at will in the physical implementation, and can be the quickest way to debug and analyze problems. Recent microcontrollers are often integrated with on-chip debug circuitry that when accessed by an in-circuit emulator via JTAG, allow debugging of the firmware with a debugger.
1.11 USES OF MICROCONTROLLER: Reduce chip count. Many applications do not require as much computing power. Less space. Reduced power consumption. Less weight. Reduced design cost.
12
CHAPTER-2
13
INTRODUCTION TO 8051
2.1 INTRODUCTION
8051 is a small piece of semiconductor integrated circuits. The package type of these integrated circuits is DIP package. DIP stand for Dual Inline Package for semiconductor IC. This package is very easy to be soldered onto the strip board. However using a DIP socket is much easier so that this chip can be plugged and removed from the development board. This is very popular. Apart from that it is also very easy to be assembled. Additional components that you need to make this IC work are just a 5V power supply adapter, a 20MHz crystal oscillator and 2 units of 22pF capacitors.
2.2 HISTORY
14
The original 8051 was built to be used with General Instruments' new 16-bit CPU, the CP1600. While generally a good CPU, the CP1600 had poor I/O performance, and the 8-bit 8051 was developed to improve performance of the overall system by offloading I/O tasks from the CPU. The 8051 used simple microcode stored in ROM to perform its tasks, and although the term was not used at the time, it shares some common features with RISC designs. In 1985, General Instruments spun off their microelectronics division and the new ownership cancelled almost everything which by this time was mostly out-of-date. The 8051, however, was upgraded with internal EPROM to produce a programmable channel controller and today 8051 are available with various on-board peripherals and program memory from 256 words to 64k words and more (a "word" is one assembly language instruction, varying from 12, 14 or 16 bits depending on the specific family).8051are registered trademarks of Microchip Technology.
Precision internal oscillator Factory calibrated Software selectable frequency range of 8MHz to 31KHz Power supply voltage 2.0-5.5V Consumption: 220uA (2.0V, 4MHz), 11uA (2.0 V, 32 KHz) 50nA (stand-by mode) Power-Saving Sleep Mode Brown-out Reset (BOR) with software control option 35 input/output pins High current source/sink for direct LED drive Software and individually programmable pull-up resistor Interrupt-on-Change pin 8K ROM memory in FLASH technology Chip can be reprogrammed up to 100.000 times In-Circuit Serial Programming Option Chip can be programmed even embedded in the target device 256 bytes EEPROM memory Data can be written more than 1.000.000 times 368 bytes RAM memory A/D converter: 14-channels 10-bit resolution 3 independent timers/counters Watch-dog timer Analogue comparator module with Two analogue comparators Fixed voltage reference (0.6V) Programmable on-chip voltage reference PWM output steering control
16
Enhanced USART module Supports RS-485, RS-232 and LIN2.0 Auto-Baud Detect Master Synchronous Serial Port (MSSP) Supports SPI and I2C mod
2.4 PERFORMANCE
The 8051 instruction set is suited to implementation of fast lookup tables in the program space. Such lookups take one instruction and two instruction cycles. Many functions can be modeled in this way. Optimization is facilitated by the relatively large program space of the 8051 (e.g. 4096 x 14-bit words) and by the design of the instruction set, which allows for embedded constants. For example, a branch instruction's target may be indexed by W, and execute a "RETLW" which does as it is named - return with literal in W. Execution time can be accurately estimated by multiplying the number of instructions by two cycles; this simplifies design of real-time code. Similarly, interrupt latency is constant at three instruction cycles. External interrupts have to be synchronized with the four clock instruction cycle; otherwise there can be a one instruction cycle jitter. Internal interrupts are already synchronized. The constant interrupt latency allows 8051 to achieve interrupt driven low jitter timing sequences. An example of this is a video sync pulse generator. This is no longer true in the newest PIC models, because they have a synchronous interrupt latency of three or four cycles.
ROM MEMORY ROM memory is used to permanently save the program being executed. This is why it is often called program memory. The 8051 has 8Kb of ROM (in total of 8192 locations). Since this ROM is made with FLASH technology, its contents can be changed by providing a special programming voltage (13V).Anyway, there is no need to explain it in detail because it is
17
automatically performed by means of a special program on the PC and a simple electronic device called the Programmer.
EEPROM MEMORY Similar to program memory, the contents of EEPROM is permanently saved, even the power goes off. However, unlike ROM, the contents of the EEPROM can be changed during operation of the microcontroller. That is why this memory (256 locations) is a perfect one for permanently saving results created and used during the operation.
RAM MEMORY This is the third and the most complex part of microcontroller memory. In this case, it consists of two parts: general-purpose registers and special-function registers (SFR). Even though both groups of registers are cleared when power goes off and even though they are manufactured in the same way and act in the similar way, their functions do not have many things in common.
GENERAL-PURPOSE REGISTERS General-Purpose registers are used for storing temporary data and results created during operation. For example, if the program performs a counting (for example, counting products on the assembly line), it is necessary to have a register which stands for what we in everyday life call sum. Since the microcontroller is not creative at all, it is necessary to specify the address of some general purpose register and assign it a new function. A simple program to increment the value of this register by 1, after each product passes through a sensor, should be created. Therefore, the microcontroller can execute that program because it now knows what and where the sum which must be incremented is. Similarly to this simple example, each program variable must be reassigned some of general-purpose register.
SFR REGISTERS Special-Function registers are also RAM memory locations, but unlike general-purpose registers, their purpose is predetermined during manufacturing process and cannot be changed.
18
Since their bits are physically connected to particular circuits on the chip (A/D converter, serial communication module, etc.), any change of their contents directly affects the operation of the microcontroller or some of its circuits. For example, by changing the TRISA register, the function of each port .A pin can be changed in a way it acts as input or output. Another feature of these memory locations is that they have their names (registers and their bits), which considerably facilitates program writing. Since high-level programming language can use the list of all registers with their exact addresses, it is enough to specify the registers name in order to read or change its contents.
RAM MEMORY BANKS The data memory is partitioned into four banks. Prior to accessing some register during program writing (in order to read or change its contents), it is necessary to select the bank which contains that register. In order to facilitate operation, the most commonly used SFRs have the same address in all banks which enables them to be easily accessed. This is the third and the most complex part of microcontroller memory. In this case, it consists of two parts: general-purpose registers and special-function registers (SFR). Even though both groups of registers are cleared when power goes off and even though they are manufactured in the same way and act in the similar way, their functions do not have many things in common.
19
STACK A part of the RAM used for the stack consists of eight 13-bit registers. Before the microcontroller starts to execute a subroutine (CALL instruction) or when an interrupt occurs, the address of first next instruction being currently executed is pushed onto the stack, i.e. onto one of its registers. In that way, upon subroutine or interrupt execution, the microcontroller knows from where to continue regular program execution. This address is cleared upon return to the main program because there is no need to save it any longer, and one location of the stack is automatically available for further use. It is important to understand that data is always circularly pushed onto the stack. It means that after the stack has been pushed eight times, the ninth push overwrites the value that was stored with the first push. The tenth push overwrites the second push and so on .In addition, the programmer cannot access these registers for write or read and there is no Status bit to indicate stack overflow or stack underflow conditions. For that reason, one should take special care of it during program writing.
CENTRAL PROCESSING UNIT CPU is manufactured with in RISC technology an important factor when deciding which microprocessor to use. RISC Reduced Instruction Set Computer gives two great advantages:
The CPU can recognize only 35 simple instructions (In order to program some other microcontrollers it is necessary to know more than 200 instructions by heart).
The execution time is the same for all instructions except two and lasts 4 clock cycles (oscillator frequency is stabilized by a quartz crystal). The Jump and Branch instructions execution time is 2 clock cycles. It means that if the microcontrollers operating speed is 20MHz, execution time of each instruction will be 200nS, i.e. the program will be executed at the speed of 5 million instructions per second!
20
2.7 LIMITATIONS
The 8051 architectures have these limitations:
One accumulator. Register-bank switching is required to access the entire RAM of many devices
21
Operations and registers are not orthogonal; some instructions can address RAM and/or immediate constants, while others can only use the accumulator.
22
CHAPTER 3
23
STEP2: Draw a layout of the circuit. STEP3: Trace the mirror image of layout on CCB. STEP4: Piant the layout on CCB. STEP5: Now remove the copper through the etching process. STEP6: After etching remove the paint. STEP7: Now start testing the copper tracks. STEP8: PCB is prepared & components can be mounted.
25
without doubt ammonium peroxydisulfate is the best choice for etching at home. However, copper sulfate is a poisonous substance and should be treated as chemical waste.
3.5 SOLDERING
Soldering is a process in which two or more metal items are joined together by melting and flowing a filler metal (solder) into the joint, the filler metal having a lower melting point than the work piece. Soldering differs from welding in that soldering does not involve melting the work pieces. In brazing, the filler metal melts at a higher temperature, but the work piece metal does not melt. Formerly nearly all solders contained lead, but environmental concerns have increasingly dictated use of lead-free alloys for electronics and plumbing purposes.
3.5.1 SOLDERS
27
Soldering filler materials are available in many different alloys for differing applications. In electronics assembly, the eutectic alloy of 63% tin and 37% lead (or 60/40, which is almost identical in melting point) has been the alloy of choice. Other alloys are used for plumbing, mechanical assembly, and other applications. Some examples of soft-solder are tin-lead for general purposes, tin-zinc for joining aluminium, lead-silver for strength at higher than room temperature, cadmium-silver for strength at high temperatures, zinc-aluminium for aluminium and corrosion resistance, and tin-silver and tin-bismuth for electronics. A eutectic formulation has advantages when applied to soldering: the liquidus and solidus temperatures are the same, so there is no plastic phase, and it has the lowest possible melting point. Having the lowest possible melting point minimizes heat stress on electronic components during soldering. And, having no plastic phase allows for quicker wetting as the solder heats up, and quicker setup as the solder cools. A non-eutectic formulation must remain still as the temperature drops through the liquidus and solidus temperatures. Any movement during the plastic phase may result in cracks, resulting in an unreliable joint. 3.5.2 FLUX The purpose of flux is to facilitate the soldering process. The obstacle to a successful solder joint is an impurity at the site of the union, e.g. dirt, oils or oxidation. The impurities can be removed by mechanical cleaning or by chemical means, but the elevated temperatures required to melt the filler metal (the solder) encourages the work piece (and the solder) to re-oxidize. This effect is accelerated as the soldering temperatures increase and can completely prevent the solder from joining to the work piece. One of the earliest forms of flux was charcoal, which acts as a reducing agent and helps prevent oxidation during the soldering process. Some fluxes go beyond the simple prevention of oxidation and also provide some form of chemical cleaning (corrosion).
3.5.3 PROCESSES
28
There are three forms of soldering, each requiring progressively higher temperatures and producing an increasingly stronger joint strength:
Soft soldering, which originally used a tin-lead alloy as the filler metal, silver soldering, which uses an alloy containing silver, Brazing which uses a brass alloy for the filler.
(MINOR PROJECT)
4.1LIST OF COMPONENTS USED
Various components used in this project are as follows: Resistors Capacitors Diodes Motor Driver Voltage Regulator 8051 Microcontroller 16*2 LCD Transformer Stepper motor
4.1.1 RESISTORS Resistance is a passive component. It is defined as opposition to flow of current and is defined by OHMS law, which states that current in circuit, is directly proportional to electromagnetic force and inversely to resistance. it is measured in ohms. Material shows a great variability in there resistively & in fact it is one of the most widely used physical quantities. Material such as silver & copper have very low resistance, steal & nickel offer such a high resistance that it can be considered to be virtually infinite & in fact they are regarding as insulator. To match various requirement of there many applications, resistor vary wide in size& composition. Although in general ,resistor are cylindrical in shape with a lead at either ends, there physical size ranges from larger than a pin head to over all the dimension of several cm material used in there construction vary.
30
FIXED RESISTORS The most common fixed resistor is the composition type. The resistance element is made of graphite, or some other form of carbon, and alloy materials. These resistors generally have resistance values that range from 0.1 to 22 ohm Another kind of fixed resistor is the wire wound type. The resistance element is usually made of nickel-chromium wire wound on a ceramic rod. These resistors generally have resistance values that range from 1 to 100 k ohm. VARIABLE RESISTORS Variable resistors are used to adjust the amount of resistance in a circuit. A variable resistor consists of a sliding contact arm that makes contact with a stationary resistance element. As the sliding arm moves across the element, its point of contact on the element changes, effectively changing the length of the element. The rating of a variable resistor is its resistance at its highest setting. RESISTIVITY & CONTINUITY The electrical resistance of a wire would be expected to be greater for a longer wire, less for a wire of larger cross sectional area, and would be expected to depend upon the material out of which the wire is made. Experimentally, the dependence upon these properties is a straightforward one for a wide range of conditions, and the resistance of a wire can be expressed as
31
The factor in the resistance which takes into account the nature of the material is the resistivity . Although it is temperature dependent, it can be used at a given temperature to calculate the resistance of a wire of given geometry. The inverse of resistively is called conductivity. There are contexts where the use of conductivity is more convenient. 4.1.2 CAPACITORS The capacitors 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.
ELECTROLYTIC CAPACITORS
Aluminum is
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. TANTALUM CAPACITORS Tantalum Capacitors are electrolytic capacitors that is use a material called tantalum for the electrodes. Large values of capacitance similar to aluminum electrolytic capacitors can be obtained. Also, tantalum capacitors are superior to aluminum electrolytic capacitors in temperature and frequency characteristics.
32
Figure 4.3Tantulum Capacitors When tantalum powder is baked in order to solidify it, a crack forms inside. An electric charge can be stored on this crack. 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.
4.1.3 DIODES Diodes are components that allow current to flow in only one direction. They have a positive side (leg) and a negative side. When the voltage on the positive leg is higher than on the negative leg then current flows through the diode (the resistance is very low). When the voltage is lower on the positive leg than on the negative leg then the current does not flow (the resistance is very high). The negative leg of a diode is the one with the line closest to it. It is called the cathode. The 33ositive end is called the anode.
33
Figure4.5 Diodes 4.1.4 MOTOR DRIVER The L293 is a quadruple high-current half-H driver designed to provide bidirectional drive currents of up to 1 A at voltages from 4.5 V to 36 V. It is designed to drive inductive loads such as relays, solenoids, dc and bipolar stepping motors, as well as other high-current/high-voltage loads in positive-supply applications. 4.1.5 VOLTAGE REGULATOR A dc voltage regulator requires many components such as zener diode, transistors, resistors & potentiometer etc. all these components were provided in a single integrated circuit chip a722.it is a monolithic voltage regulator developed by fair child semiconductor ltd. In 1868. An improved IC was then developed as 7805 by fair child semiconductor & LM309 by national semiconductor. These IC are three terminal fixed voltage regulator. This required an unregulated supply between input and common terminal. It has internal protection against overload to give a fixed output voltage at +5v.
The three terminal voltage regulator is a single I.C. does not require many external components, has in built circuit for overload protection, saves spaces and cost.
34
4.1.6 8051 MICROCONTROL Microcontroller is a general purpose device. It has a CPU, memory, serial, parallel ports, interrupts, counters, timers, ROM, RAM all are embedded together on a single chip. An embedded system uses a microcontroller to do one and only one task. A printer is an example of embedded system since processor inside it can perform only one task getting the data in printing it contrast to it with the personal computer. A computer can be used for any numbers of applications such as word processor, video game playing etc. Computer can perform muti task as it has RAM memory and operating system that loads the application software in to RAM and gets the CPU run it.
4.1.7 LCD (LIQUID CRYSTAL DISPLAY) It is very important to keep a track of the working of almost all the automated and semiautomated devices, be it a washing machine, an autonomous robot or anything else. This is achieved by displaying their status on a small display module. LCD (Liquid Crystal Display) screen is such a display module and a 16x2 LCD module is very commonly used. These modules are replacing seven segments and other multi segment LEDs for these purposes. The reasons being: LCDs are economical, easily programmable, have no limitation of displaying special & even custom characters (unlike in seven segments), animations and so on.
35
Figure 4.8 LCD 4.1.8 TRANSFORMER A transformer is a static device, which transfer electric power from one circuit to another of same frequency. It can raise or low the voltage in a circuit but with a corresponding increase or decrease in current. The transformer has two windings primary or secondary. The winding, which is to source of supply, is called primary & other from which the power is obtained is called secondary.
36
Figure 4.9Transformer
4.1.9 STEPPER MOTOR A stepper motor is an electromechanical device which converts electrical pulses into discrete mechanical movements. The shaft or spindle of a stepper motor rotates in discrete step increments when electrical command pulses are applied to it in the proper sequence. The motors rotation has several direct relationships to these applied input pulses. The sequence of the applied pulses is directly related to the direction of motor shafts rotation. The speed of the motor shafts rotation is directly related to the frequency of the input pulses and the length of rotation is directly related to the number of input pulses applied.
SR NO
COMPONENT
QUANTITY
COST
IC 8051 MC
90
STEPPER MOTOR
90
TRANSFORMER
37
50
VOLTAGE REGULATOR
10
140
CRYSTAL OSCILATOR
20
DIODES
24
SWITCHES
40
RESISTORS
18
10
CAPACITORS
10
32
11
PCB
90
38
39
4.3.1PROGRAM
40
org 000 main: mov dptr,#line loop1: clr a movc a,@a+dptr call cmd call delay inc dptr mov dptr,#line1 call loop2 mov a,#0c0h call cmd mov dptr,#line11 main1: jnb p1.4,pos90 jnb p1.5,pos180 jnb p1.6,pos270 jnb p1.7,pos360 jnb p1.0,apos90 jnb p1.1,aposi180 jnb p1.2,aposi270 jnb p1.3,aposi360 mov p2,#00h jmp main1 aposi180:jmp apos180 aposi270:jmp apos270
41
aposi360:jmp apos360 pos90: mov a,#80h call cmd mov dptr,#line2 call loop2 mov a,#0c0h call cmd mov dptr,#line3 call loop2 mov r1,#03 l1: call clkwise djnz r1,l1 jmp main
pos180: mov a,#80h call cmd mov dptr,#line2 call loop2 mov dptr,#line4 call loop2 mov r1,#06 l2: call clkwise djnz r1,l2 jmp main
42
pos270: mov a,#80h call cmd mov dptr,#line2 call loop2 mov a,#0c0h call cmd mov dptr,#line5
mov r1,#09 l3: call clkwise djnz r1,l3 jmp main pos360: mov a,#80h call cmd mov dptr,#line2 call loop2 mov dptr,#line6 call loop2 mov r1,#12 l4: call clkwise djnz r1,l4 jmp main
43
apos90:
mov a,#80h call cmd mov dptr,#line2 call loop2 mov a,#0c0h call cmd mov dptr,#line7 call loop2 mov r1,#03
l5:
apos180: mov dptr,#line2 call loop2 mov a,#0c0h call cmd mov dptr,#line8 call loop2 mov r1,#06 l6: call aclkwise djnz r1,l6 jmp main
apos270:
44
mov a,#80h call cmd mov dptr,#line2 call loop2 mov a,#0c0h call cmd mov dptr,#line9 call loop2 mov r1,#09 l7: call aclkwise djnz r1,l7 jmp main
apos360: mov a,#80h call cmd mov dptr,#line2 call loop2 mov a,#0c0h call cmd mov dptr,#line10 call loop2 mov r1,#12 l8: call aclkwise djnz r1,l8 jmp main
45
cmd: mov p0,a clr p3.0 clr p3.1 setb p3.2 call delay clr p3.2 ret dis: setb p3.0 clr p3.1 setb p3.2 call delay clr p3.2 ret movc a,@a+dptr call dis call delay CALL DELAY inc dptr jnz loop2 ret clkwise: mov p2,#33h call delay1
46
mov p2,#66h call delay1 mov p2,#0cch call delay1 mov p2,#99h call delay1 ret aclkwise: mov p2,#33h call delay1 mov p2,#99h call delay1 mov p2,#0cch call delay1 mov p2,#66h call delay1 ret delay1: mov r4,#255 j1: mov r3,#255 djnz r3,$ djnz r4,j1 ret delay: mov r0,#255 djnz r0,$
47
line1: db line2: db line3: db line4: db line5: db line6: db line7: db line8: db line9: db line10: db line11: db end
"Shaft position ",00h "A clockwise 90' ",00h "A clockwise 180' ",00h "A clockwise 270' ",00h "A clockwise 360' ",00h "clockwise 90' ",00h "clockwise 180' ",00h "clockwise 270' ",00h "clockwise 360' ",00h "Press key ",00h
48
Business Machines- Card reader, type writer, banking systems Process Control- Conveyor Machine Tools- Milling machines, drilling machines, laser cutting, sewing, lathes
49
50