voice controlled intelligent security system

Published on June 2016 | Categories: Types, Reviews | Downloads: 29 | Comments: 0 | Views: 230
of 44
Download PDF   Embed   Report

Comments

Content

CHAPTER 1 EMBEDDED SYSTEMS 1.1 INTRODUCTION:
Embedded systems are by far the most prevalent of all electronic and computer systems used in world today. Advances in processors, controllers and memory technology and their associated low cost allow them to be considered for an enormous number of applications that led in tremendous growth in the size and sophistication of embedded applications. In present days embedded systems got great benefits in the Application of micro controllers and microprocessors. In simple words one can define embedded system as a processor that is embedded into the application. An embedded system product uses a micro controller (or microprocessor) to do one and only one task. Due to this reason embedded system is also called as dedicated system. Micro controller is concerned with rapid movement of bits within the chip. The micro controller can function as a computer with the addition of no external digital parts. The first task faced when learning to use a new computer is to become familiar with the capability of the machine. Studying the internal hardware design best learns the features of the computer also called as the architecture of the device. Embedded systems generally are developed around custom hardware, require high quality and reliability and frequently deal with real-time issues. Examples of these systems include telecommunication-switching systems, aircrafts, spacecraft, weapons systems, real-time systems, and the multitude of applications in the car and home.

1.2. CHARACTERISTICS:
Two major areas of differences are cost and power consumption. Since many embedded systems are produced in tens of thousands to millions of units range, reducing cost is a major concern. Embedded systems often use a (relatively) slow processor and small memory size to minimize costs. The slowness is not just clock speed. The whole architecture of the computer is often intentionally simplified to lower costs. For example, embedded systems often use peripherals controlled by synchronous serial interfaces, which are ten to hundreds of times slower than comparable peripherals used in PCs. Programs on an embedded system often run with realtime constraints with limited hardware resources: often there is no disk drive, operating system, keyboard or screen. A flash drive may replace rotating media, and a small keypad and LCD screen may be used instead of a PC's keyboard and screen. 1

Firmware is the name for software that is embedded in hardware devices, e.g. in one or more ROM/Flash memory IC chips. Embedded systems are routinely expected to maintain 100% reliability while running continuously for long periods, sometimes measured in years. Firmware is usually developed and tested too much harsher requirements than is general-purpose software, which can usually be easily restarted if a problem occurs.

Platform: There are many different CPU architectures used in embedded designs. This in
contrast to the desktop computer market which is limited to just a few competing architectures mainly the Intel/AMD x86 and the Apple/Motorola/IBM Power PC’s which are used in the Apple Macintosh. One common configuration for embedded systems is the system on a chip, an application-specific integrated circuit, for which the CPU was purchased as intellectual property to add to the IC's design.

Tools: Like a typical computer programmer, embedded system designers use compilers,
assemblers and debuggers to develop an embedded system. Those software tools can come from several sources: Software companies that specialize in the embedded market Ported from the GNU software development tools. Sometimes, development tools for a personal computer can be used if the embedded processor is a close relative to a common PC processor. Embedded system designers also use a few software tools rarely used by typical computer programmers. Some designers keep a utility program to turn data files into code, so that they can include any kind of data in a program. Most designers also have utility programs to add a checksum or CRC to a program, so it can check its program data before executing it.

Operating system: They often have no operating system, or a specialized embedded operating
system (often a real-time operating system), or the programmer is assigned to port one of these to the new system.

Debugging: Debugging is usually performed with an in-circuit emulator, or some type of
debugger that can interrupt the micro controller’s internal microcode. The microcode interrupt lets the debugger operate in hardware in which only the CPU works. The CPU-based debugger can be used to test and debug the electronics of the computer from the viewpoint of the CPU. Developers should insist on debugging which shows the high-level language, with breakpoints and single stepping, because these features are widely available. Also, developers should write and use simple logging facilities to debug sequences of real-time events. PC or mainframe programmers first encountering this sort of programming often become confused 2

about design priorities and acceptable methods. Mentoring, code-reviews and ego less programming are recommended.

1.3. DESIGN OF EMBEDDED SYSTEMS:
The electronics usually uses either a microprocessor or a microcontroller. Some large or old systems use general-purpose mainframes computers or minicomputers.

1.3.1. START-UP:
All embedded systems have start-up code. Usually it disables interrupts, sets up the electronics, tests the computer (RAM, CPU and software), and then starts the application code. Many embedded systems recover from short-term power failures by restarting (without recent self-tests). Restart times under a tenth of a second are common. Many designers have found one of more hardware plus software-controlled LED’s useful to indicate errors during development (and in some instances, after product release, to produce troubleshooting diagnostics). A common scheme is to have the electronics turn off the LED(s) at reset, whereupon the software turns it on at the first opportunity, to prove that the hardware and start-up software have performed their job so far. After that, the software blinks the LED(s) or sets up light patterns during normal operation, to indicate program execution progress and/or errors. This serves to reassure most technicians/engineers and some users.

1.3.2. THE CONTROL LOOP:
In this design, the software has a loop. The loop calls subroutines. Each subroutine manages a part of the hardware or software. Interrupts generally set flags, or update counters that are read by the rest of the software. A simple API disables and enables interrupts. Done right, it handles nested calls in nested subroutines, and restores the preceding interrupt state in the outermost enable. This is one of the simplest methods of creating an exocrine .Typically, there's some sort of subroutine in the loop to manage a list of software timers, using a periodic real time interrupt. When a timer expires, an associated subroutine is run, or flag is set. Any expected hardware event should be backed-up with a software timer. Hardware events fail about once in a trillion times. State machines may be implemented with a function-pointer per state-machine (in C++, C or assembly, anyway). A change of state stores a different function into the pointer. The function pointer is executed every time the loop runs. 3

Many designers recommend reading each IO device once per loop, and storing the result so the logic acts on consistent values. Many designers prefer to design their state machines to check only one or two things per state. Usually this is a hardware event, and a software timer. Designers recommend that hierarchical state machines should run the lower-level state machines before the higher, so the higher run with accurate information. Complex functions like internal combustion controls are often handled with multi-dimensional tables. Instead of complex calculations, the code looks up the values. The software can interpolate between entries, to keep the tables small and cheap. One major disadvantage of this system is that it does not guarantee a time to respond to any particular hardware event. Careful coding can easily assure that nothing disables interrupts for long. Thus interrupt code can run at very precise timings. Another major weakness of this system is that it can become complex to add new features. Algorithms that take a long time to run must be carefully broken down so only a little piece gets done each time through the main loop.This system's strength is its simplicity, and on small pieces of software the loop is usually so fast that nobody cares that it is not predictable. Another advantage is that this system guarantees that the software will run. There is no mysterious operating system to blame for bad behavior.

1.3.3. USER INTERFACES:
Interface designers 0at PARC, Apple Computer, Boeing and HP minimize the number of types of user actions. For example, use two buttons (the absolute minimum) to control a menu system (just to be clear, one button should be "next menu entry" the other button should be "select this menu entry"). A touch-screen or screen-edge buttons also minimize the types of user actions.Another basic trick is to minimize and simplify the type of output. Designs should consider using a status light for each interface plug, or failure condition, to tell what failed. A cheap variation is to have two light bars with a printed matrix of errors that they select- the user can glue on the labels for the language that she speaks. For example, Boeing's standard test interface is a button and some lights. When you press the button, all the lights turn on. When you release the button, the lights with failures stay on. The labels are in Basic English.Designers use colors. Red defines the users can get hurt- think of blood. Yellow defines something might be wrong. Green defines everything's ok.Another essential trick is to make any modes absolutely clear on the user's display. If an interface has modes, they must be reversible in an obvious way. Most designers prefer the display to respond to the user. The display should change immediately after a user action. If the machine is going to do anything, it should start within 7 seconds, or give progress reports.One of the most successful 4

general-purpose screen-based interfaces is the two menu buttons and a line of text in the user's native language. It's used in pagers, medium-priced printers, network switches, and other medium-priced situations that require complex behavior from users. When there's text, there are languages. The default language should be the one most widely understood.

CHAPTER 2 HARDWARE COMPONENTS
2.1. MICRO CONTROLLER AT89S52 2.1.1. DESCRIPTION:
The 89C51/89C52/89C54/89C58 contains a non-volatile FLASH program memory that is parallel programmable. Both families are Single-Chip 8-bit Microcontrollers manufactured in advanced CMOS process and are derivatives of the 80C51 microcontroller family. All the devices have the same instruction set as the 80C51.

2.1.2. FEATURES:
• 80C51 Central Processing Unit • On-chip FLASH Program Memory • Speed up to 33 MHz • Full static operation • RAM expandable externally to 64 k bytes • 4 level priority interrupt • 6 interrupt sources 5

• Four 8-bit I/O ports • Full-duplex enhanced UART – Framing error detection – Automatic address recognition • Power control modes – Clock can be stopped and resumed – Idle mode – Power down mode • Programmable clock out • Second DPTR register • Asynchronous port reset • Low EMI (inhibit ALE) • 3 16-bit timers • Wake up from power down by an external interrupt

2.1.3. PIN DESCRIPTION
This microcontroller has 4 ports with each port having 8 pins. We use pull up resistors near the ports which we are using so that they are not damaged.

6

Figure 2.1.2-1 Pin diagram of Micro Controller

7

Figure 2.1.2-2 Block diagram of Micro Controller PIN 40 – Power supply, 5v from voltage regulator to drive the IC. PIN 20 – Ground Point. Port 0: Port 0 is an 8-bit open-drain bi-directional I/O port as shown in figure 2.1.2-2. 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. Port0 may also be configured to be the multiplexed loworder address/data bus during accesses to external pro gram and data memory. In this mode P0 has internal pull-ups. Port0 also receives the code bytes during flash programming, and 8

outputs the code bytes during program program verification.

verification. External pull-ups are required during

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 memory that uses 16-bit addresses (MOVX @ DPTR). In this application, it uses strong internal pull-ups when emitting 1s. During accesses to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. Port2 also receives the high- order address bits and some control signals during flash programming and verification. Port 3: 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. Port3 also receives some Control signals for Flash pro gramming and verification. Port Pin P3.0 P3.1 P3.2 P3.3 P3.4 P3.5 P3.6 P3.7 Alternate Functions RXD (serial input port) TXD (serial output port) INT0 (external interrupt 0) INT1 (external interrupt 1) T0 (timer 0 external input). T1 (timer 1 external input). WR (external data memory write strobe). RD (external data memory read strobe).

Here we use Port 0 as Input Port and Port 2 as Output Port and Port 3.4 as Interrupt Port RST Reset input. A high on this pin for two machine cycles while the oscillator is running resets the 9

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/6 the oscillator frequency, and may be used for external timing or clocking purposes. Note, however, that one ALE is skipped during each access to external Data pulse Memory. If desired, ALE operation can be weakly pulled high. Setting the ALE

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 disable bit has no effect if the microcontroller is in external execution mode. PSEN Program Store Enable is the read strobe to external pro gram memory. When the AT89C51 is executing code from external pro gram 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. strapped to V for internal program Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be
CC

executions. This pin also receives the 12-volt internal clock operating

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 circuit. XTAL2 Output from the inverting oscillator amplifier.

10

2.1.4. INTERRUPTS:

The AT89S52 has a total of five interrupt vectors: two external interrupts (INT0 and INT1), two timer interrupts (Timers 0 and 1), and the serial port interrupt. These interrupts are all shown in Table 2.1.4.Each of these interrupt sources can be individually enabled or disabled by setting or clearing a bit in special Function register IE. IE also contains a global disable bit, EA, which disables all interrupts at once. Note that table shows that bit positions IE.6 and IE.5 are unimplemented. User software should not write 1s to these bit positions, since they may be used in future PT89 products. The Timer 0 and Timer 1 flags, TF0 and TF1, are set at S5P2 of the cycle in which the timers overflow. The values are then polled by the circuitry in the next cycle.

0Timer 0 and 1: Timer 0 and Timer 1 in the P89S51 operate the same way as Timer 0 and Timer 11

1 in the P89C51. The Timer 1 flags, TF) and TF1, are set at S5P2 of the cycle in which the timers overflow. The values are then polled by the circuitry in the next cycle.

2.1.5. SPECIAL FUNCTION REGISTERS:
A map of the on chip memory area called the Special Function Register (SFR) space is shown in Table. Note that not all of the addresses are occupied, and unoccupied addresses may not be implemented on the chip. Read accesses to these addresses will in general return random data, and write accesses will have an indeterminate effect.

2.1.6 OSCILLATOR CHARACTERISTICS:
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 Figure 2.1.6-1. Either a quartz crystal or ceramic resonant or 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 2.1.6-2. 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.

Figure 2.1.6-1 Oscillator Characteristics

12

Figure 2.1.6-2 Oscillator Connections

2.1.7 MODES:
Idle Mode: In idle mode, the CPU puts itself to sleep while all the on- chip peripherals remain active. The mode is invoked by software. The content of the on-chip RAM and all the special functions registers remain unchanged during this mode. The idle mode can be terminated by any enabled interrupt or by a hardware reset. It should be noted that when idle is terminated by a hardware reset, the device normally resumes program execu tion, from where it left off, up to two machine cycles before the internal reset algorithm takes control. On-chip hardware inhibits access to internal RAM in this event, but access to the port pins is not inhibited. To eliminate the possibility of an unexpected write to a port pin when Idle is terminated by reset, the instruction following the one that invokes Idle memory. Power-down mode: In the power-down mode, the oscillator is stopped, and the instruction that invokes power-down is the last instruction executed. The on-chip RAM and Special Function Registers retain their values until the power-down mode is terminated. The only exit from power-down is a hardware reset. Reset redefines the SFRs but does not change the on-chip RAM. The reset should not be activated before VCC is restored to its normal operating level and must be held active long enough to allow the oscillator to restart and stabilize. should not be one that writes to a port pin or to external

13

Table 2.1.7 Status of External Pins during Idle and Power-down Mode

2.2 VOLTAGE REGULATOR 2.2.1 DESCRIPTION
The L7800 series of three-terminal positive regulators is available in TO-220, TO-220FP, TO-3 and D2PAK packages and several fixed output voltages, making it useful in a wide range of applications. These regulators can provide local on-card regulation, eliminating the distribution problems associated with single point regulation. Each type employs internal current limiting, thermal shut-down and safe area protection, making it essentially indestructible. If adequate heat sinking is provided, they can deliver primarily as fixed voltage regulators, these devices can be used with external components to obtain adjustable voltage and currents. • • • • • Output current to 1.5A Output voltages of 5; 5.2; 6; 8; 8.5; 9; 12; 15; 18; 24V Thermal overload protection Short circuit protection Output transition SOA protection

14

Table 2.7 Electrical Characteristics of L7805CV

BLOCK DIAGRAM

Figure 2.2.1-1 Block Diagram of L7805CV

15

Figure 2.2.1-2 Pin Representation of L7805CV

2.3 LIGHT EMITTING DIODE
LEDs are semiconductor devices. Like transistors, and other diodes, LEDs are made out of silicon. What makes an LED give off light are the small amounts of chemical impurities that are added to the silicon, such as gallium, arsenide, indium, and nitride. When current passes through the LED, it emits photons as a byproduct as shown in figure 3.4. Normal light bulbs produce light by heating a metal filament until it's white hot. Because LEDs produce photons directly and not via heat, they are far more efficient than incandescent bulbs.

Figure 2.3.1-1 Light Emitting Diodes Not long ago LEDs were only bright enough to be used as indicators on dashboards or electronic equipment. But recent advances have made LEDs bright enough to rival traditional lighting technologies. Modern LEDs can replace incandescent bulbs in almost any application. LEDs with a voltage range of 1.2V – 3.3V are used for power supply and signal posts. At the signal posts resistors (450 Ohms) are used near LEDs to convert the LEDs to 5V.

CHAPTER 3
16

MEMS SENSOR
3.1 MEMS
The MMA7660FC is a ±1.5 g 3-Axis Accelerometer with Digital Output (I 2C). It is a very low power, low profile capacitive MEMS sensor featuring a low pass filter, compensation for 0g offset and gain errors, and conversion to 6-bit digital values at a user configurable samples per second. The device can be used for sensor data changes, product orientation, and gesture detection through an interrupt pin (INT). The device is housed in a small 3mm x 3mm x 0.9mm DFN package.

3.2 Features


Digital Output (I2C)

• 3mm x 3mm x 0.9mm DFN Package • Low Power Current Consumption: Off Mode: 0.4 µA, Standby Mode: 3 µA, Active Mode: 47 µA at 1 ODR • Configurable Samples per Second from 1 to 120 samples a second. • Low Voltage Operation: – Analog Voltage: 2.4 V - 3.6 V – Digital Voltage: 1.71 V - 3.6 V • Auto-Wake/Sleep Feature for Low Power Consumption • Tilt Orientation Detection for Portrait/Landscape Capability • Gesture Detection Including Shake Detection and Tap Detection • Robust Design, High Shocks Survivability (10,000 g) • RoHS Compliant • Halogen Free • Environmentally Preferred Product • Low Cost

3.3 Typical Applications
• Mobile Phone/ PMP/PDA: Orientation Detection (Portrait/Landscape), Image Stability, Text Scroll, Motion Dialing, Tap to Mute • Laptop PC: Anti-Theft • Gaming: Motion Detection, Auto-Wake/Sleep For Low Power Consumption • Digital Still Camera: image stability

17

Figure 3.3-1 Bottom view of MEMS

Figure 3.3-2 Top view of MEMS

Table 3.3-1 Pin Description and Status of Mems

18

Figure 3.3-3 connection of MMA7660FC with MCU

Figure 3.3-4Block diagram of MEMS

19

Table 3.3-2 Maximum rating of MEMS

3.4 PRINCIPLE OF OPERATION
The Free scale Accelerometer consists of a MEMS capacitive sensing g-cell and a signal conditioning ASIC contained in a single package. The sensing element is sealed hermetically at the wafer level using a bulk micro machined cap wafer. The g-cell is a mechanical structure formed from semiconductor materials (polysilicon) using masking and etching processes. The sensor can be modeled as a movable beam that moves between two mechanically fixed beams (Figure 4.4-1). Two gaps are formed; one being between the movable beam and the first stationary beam and the second between the movable beam and the second stationary beam. The ASIC uses switched capacitor techniques to measure the g-cell capacitors and extract the acceleration data from the proportional to acceleration. difference between the two capacitors. The ASIC also signal digital output that is conditions and filters (switched capacitor) the signal, providing a

20

Figure 3.4-1 Operation of Beam

3.4.1 MODES OF OPERATION
The sensor has three power modes: Off Mode, Standby Mode, and Active Mode to offer the customer different power consumption options. The sensor is only capable of running in one of these modes at a time. The Off Mode offers the lowest power consumption, approximately 0.4 µA and can only be reached by powering down the analog supply. See Figure 5. In this mode, there is no analog supply and all I 2C activity is ignored. The Standby Mode is ideal for battery operated products. When Standby Mode is active the device outputs are turned off providing a significant reduction in operating current. When the device is in Standby Mode the current will be reduced to approximately 3 µA. Standby Mode is entered as soon as both analog and digital power supplies are up. In this mode, the device can read and write to the registers with I 2C, but no new measurements can be taken. The mode of the device is controlled through the MODE (0x07) control register by accessing the mode bit in the Mode register. During the Active Mode, continuous measurement on all three axes is enabled. In addition, the user can choose to enable: Shake Detection, Tap Detection, Orientation Detection, and/or Auto-Wake/Sleep Feature and in this mode the digital analysis for any of these functions is done. The user can configure the samples per second to any of the following: 1 sample/second 2 samples/second, 4samples/second, 8samples/second, 16samples/second, 32 samples/second, 64 samples/second, and 120 samples/second, for the Auto-Sleep state. If the user is configuring the Auto-Wake feature, the selectable ranges are: vary. 1 sample/second, 8 samples/second, 16 samples/seconds and 32samples/second. Depending on the samples per second selected the power consumption will

21

CHAPTER 4 ADC(ANALOG TO DIGITAL CONVERTER)
4.1 A/D CONVERTER The Microchip Technology Inc. MCP3204/3208 devices are successive approximation 12-bit Analogto- Digital (A/D) Converters with on-board sample and hold circuity. The MCP3204 is programmable to provide two pseudo-differential input pairs or four singleended inputs. The MCP3208 is programmable to provide four pseudo-differential input pairs or eight singleended inputs. Differential Nonlinearity (DNL) is specified at ±1 LSB, while Integral Nonlinearity (INL) is offered in ±1 LSB (MCP3204/3208-B) and ±2 LSB (MCP3204/3208-C) versions. Communication with the devices is accomplished using a simple serial interface compatible with the SPI protocol.The devices are capable of conversion rates of upto 100 ksps. The MCP3204/3208 devices operate over a broad voltage range (2.7V - 5.5V). Low current design permits operation with typical standby and active currents of only 500 nA and 320 μA, respectively.The MCP3204 is offered in 14-pin PDIP, 150 mil SOIC and TSSOP packages. The MCP3208 is offered in 16-pin and SOIC package.

22

Figure 4.1-1 Functional Block Diagram

4.2 FEATURES
• 12-bit resolution • ± 1 LSB max DNL • ± 1 LSB max INL (MCP3204/3208-B) • ± 2 LSB max INL (MCP3204/3208-C) • 4 (MCP3204) or 8 (MCP3208) input channels • Analog inputs programmable as single-ended or pseudo-differential pairs • On-chip sample and hold • SPI serial interface (modes 0,0 and 1,1) • Single supply operation: 2.7V - 5.5V • 100 ksps max. sampling rate at VDD = 5V • 50 ksps max. sampling rate at VDD = 2.7V • Low power CMOS technology: - 500 nA typical standby current, 2 μA max. - 400 μA max. active current at 5V 23

• Industrial temp range: -40°C to +85°C • Available in PDIP, SOIC and TSSOP packages

Figure 4.2-1 Package type

CHAPTER 5
24

LIQUID CRYSTAL DISPLAY (LCD)
5.1 LCD DISPLAY:
LCD is a type of display used in digital watches and many portable computers. LCD displays utilize to sheets of polarizing material with a liquid crystal solution between them. An electric current passed through the liquid causes the crystals to align so that light cannot pass through them. LCD technology has advanced very rapidly since its initial inception over a decade ago for use in laptop computers. Technical achievement has resulted in brighter displace, higher resolutions, reduce response times and cheaper manufacturing process. The liquid crystals can be manipulated through an applied electric voltage so that light is allowed to pass or is blocked. By carefully controlling where and what wavelength (color) of light is allowed to pass, the LCD monitor is able to display images. A back light provides LCD monitor’s brightness. Over the years many improvements have been made to LCD to help enhance resolution, image, sharpness and response times. One of the latest such advancements is TFT or Thin Film Transistor. TFT-LCD’s make use of a very thin transistor that is applied to glass during acts as switch allowing control of light at the pixel level, greatly enhancing image sharpness and resolution. This has been particularly important for improving LCD’s ability to display smallsized fonts and image clearly. Other advances have allowed LCD’s to greatly reduce liquid crystal cell response times. Response time is basically the amount of time it takes for a pixel to “change colors”. In reality response time is the amount of time it takes a liquid crystal cell to go from being active to inactive. LCD interfacing with 8051 is a real-world application. In recent years the LCD is finding widespread use replacing LEDs (seven segment LEDs or other multisegment LEDs). This is due to following reasons: 1. The declining prices of LCDs. 2. The ability to display numbers, characters and graphics. This is in contrast to LEDs, which are limited to numbers and a few characters. An intelligent LCD display of two lines, 20 characters per line, that is interfaced to the 8051. 3. Incorporation of a refreshing controller into the LCD, thereby relieving the CPU to keep displaying the data.

5.2 PIN DIAGRAM
25

Most of the LCD modules conform to a standard interface specification. A 14pin access is provided having eight data lines, three control lines and three power lines. The connections are laid out in one of the two common configurations, either two rows of seven pins, or a single row of 14 pins. One of the, pins are numbered on the LCD’s print circuit board (PCB), but if not, it is quite easy to locate pin1. Since this pin is connected to ground, it often has a thicker PCB track, connected to it, and it is generally connected to metalwork at same point.

G 1

+5V 2

-5V 3

07

08

09

10

11

12

13

14

4

5

6

D0

D1 D2 D3

D4

D5 D6 D7

RS

R/W EN

Figure 5.2-1 LCD Display with 14 pins

5.3 PIN DESCRIPTIONS 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. a) 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., b) If RS=1 the data register is selected, allowing the user to send data to be displayed on the LCD. 26

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. EN, 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 450ns wide. D0-D7: The 8-bit data pins, D0-D7, are used to send information to the LCD or read the contents of the LCD’s internal register 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 There are also instruction command codes that can be sent to the LCD to clear the display or force the cursor to the home position or blink the instruction command codes. 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 is busy taking care of internal operations and will not accept any information. PIN 1 2 3 4 SYMBOL Vss Vcc Vee RS I/O ---I DESCRIPTION Ground +5V power supply Power supply to control contrast RS=0 to select command register RS=1 to select data register R/W=0 for write R/W=1 for read Enable The 8-bit data bus The 8-bit data bus The 8-bit data bus The 8-bit data bus The 8-bit data bus The 8-bit data bus The 8-bit data bus The 8-bit data bus

5 6 7 8 9 10 11 12 13 14

R/W

I

EN I/O DB0 I/O DB1 I/O DB2 I/O DB3 I/O DB4 I/O DB5 I/O DB6 I/O DB7 I/O Table 5.3-1 Pin Description of LCD 27

5.4 Prototype circuit:
For a LCD module to be used effectively in any piece of equipment, a microprocessor or a micro controller is usually required to drive it. However, before attempting to wire the two together, some initial experiments can be performed by connecting a series of switches to the pins of the module. This can be a quite beneficial step, if even you are thoroughly conversant with the workings of microprocessors.

5.5 Circuit description of LCD experiment:
The circuit can be wired up on a “plug-in-style” prototyping board, using dual-in-line switches for the data lines (S1-S8), a toggle switch for the RS input (S10) and a momentary action switch (or macro switch) for the EN (S9) input. The R/W is connected to ground as the display is only going to be written to for the time being. All the resistors (R1-R10) are 4K7 ohms. It is probably most convenient to use a single-in-line resistor pack for the eight pull-up resistors (R1-R8) on the data lines. The other two resistors (R9 and R10) can be of discrete type. Preset potentiometer is used for contrast control and shown with one end left disconnected. If desired this end can be connected to the positive line via a resistor of 4K7 ohms. All the switches should be connected so that they are ON when in the “down” position so that down generates a logic’0’ (low) and “up” provides a logic‘1’ (high).

28

CHAPTER-6 THE MOTOR DRIVER (L293D)

6.1 Description

29

6.2 BLOCK DIAGRAM

30

31

6.3 SCHEMATICS OF INPUTS AND OUTPUTS(L293D)

32

33

6.4 APPLICATION INFORMATION

34

CHAPTER 7

DC MOTOR:
INTRODUCTION: Industrial applications use dc motors because the speed-torque relationship can be varied to almost any useful form -- for both dc motor and regeneration applications in either direction of rotation. Continuous operation of dc motors is commonly available over a speed range of 8:1. Infinite range (smooth control down to zero speed) for short durations or reduced load is also common. Dc motors are often applied where they momentarily deliver three or more times their rated torque. In emergency situations, dc motors can supply over five times rated torque without stalling (power supply permitting). Dynamic braking (dc motor-generated energy is fed to a resistor grid) or regenerative braking (dc motor-generated energy is fed back into the dc motor supply) can be obtained with dc motors on applications requiring quick stops, thus eliminating the need for, or reducing the size of, a mechanical brake. Dc motors feature a speed, which can be controlled smoothly down to zero, immediately followed by acceleration in the opposite direction -- without power circuit switching. And dc motors respond quickly to changes in control signals due to the dc motor's high ratio of torque to inertia. 7.1 DC Motor types Wound-field dc motors are usually classified by shunt-wound, series-wound, and compound- wound. In addition to these, permanent-magnet and brushless dc motors are also available, normally as fractional-horsepower dc motors. Dc motors may be further classified for intermittent or continuous duty. Continuous-duty dc motors can run without an off period. 7.2 DC Motors - Speed control There are two ways to adjust the speed of a wound-field dc motor. Combinations of the two are sometimes used to adjust the speed of a dc motor. 7.3 DC Motor - Shunt-field control Reel drives require this kind of control. The dc motor's material is wound on a reel at constant linear speed and constant strip tension, regardless of diameter. Control is obtained by weakening the shunt-field current of the dc motor to increase speed and to reduce output torque for a given armature current. Since the rating of a dc motor is determined by heating, the maximum permissible armature current is approximately constant over the speed range. This means that at rated current, the dc motor's output torque varies inversely with speed, and the dc motor has constant-horsepower capability over its speed range. Dc motors offer a solution, which is good for only obtaining speeds greater than the base speed. A momentary speed reduction below the dc motor's base speed can be obtained by overexciting the field, but prolonged over excitation overheats the dc motor. Also, magnetic saturation in the dc motor permits only a small reduction in speed for a substantial increase in field voltage. 35

Dc motors have a maximum standard speed range by field control is 3:1, and this occurs only at low base speeds. Special dc motors have greater speed ranges, but if the dc motor's speed range is much greater than 3:1, some other control method is used for at least part of the range. 7.4 Armature-voltage DC Motor Control: In this method, shunt-field current is maintained constant from a separate source while the voltage applied to the armature is varied. Dc motors feature a speed, which is proportional to the counter emf. This is equal to the applied voltage minus the armature circuit IR drop. At rated current, the torque remains constant regardless of the dc motor speed (since the magnetic flux is constant) and, therefore, the dc motor has constant torque capability over its speed range. Horsepower varies directly with speed. Actually, as the speed of a self-ventilated motor is lowered, it loses ventilation and cannot be loaded with quite as much armature current without exceeding the rated temperature rise. 7.5 DC Motors-Selection Choosing a dc motor and associated equipment for a given application requires consideration of several factors. 7.5.1 DC Motors – Speed range If field control is to be used, and a large speed range is required, the base speed must be proportionately lower and the motor size must be larger. If speed range is much over 3:1, armature voltage control should be considered for at least part of the range. Very wide dynamic speed range can be obtained with armature voltage control. However, below about 60% of base speed, the motor should be derated or used for only short periods. 7.5.2 DC Motors - Speed variation with torque Applications requiring constant speed at all torque demands should use a shuntwound dc motor. If speed change with load must be minimized, a dc motor regulator, such as one employing feedback from a tachometer, must be used. When the dc motor speed must decrease as the load increases, compound or serieswound dc motors may be used. Or, a dc motor power supply with a drooping volt-ampere curve could be used with a shunt-wound dc motor. 7.6 DC Motors - Reversing This operation affects power supply and control, and may affect the dc motor's brush adjustment, if the dc motor cannot be stopped for switching before reverse operation. In this case, compound and stabilizing dc motor windings should not be used, and a suitable armature-voltage control system should supply power to the dc motor. 7.7 DC Motors - Duty cycle Direct current motors are seldom used on drives that run continuously at one speed and load. Motor size needed may be determined by either the peak torque requirement or heating.

7.8 DC Motors - Peak torque
The peak torque that a dc motor delivers is limited by that load at which damaging commutation begins. Dc motor brush and commentator damage depends on sparking severity and duration. Therefore, the dc motor's peak torque depends on the duration and 36

frequency of occurrence of the overload. Dc motor peak torque is often limited by the maximum current that the power supply can deliver. Dc motors can commutate greater loads at low speed without damage. NEMA standards specify that machines powered by dc motors must deliver at least 150% rated current for 1 min at any speed within rated range, but most dc motors do much better.

37

7.9 DC Motors - Heating
Dc motor temperature is a function of ventilation and electrical/mechanical losses in the machine. Some dc motors feature losses, such as core, shunt-field, and brushfriction losses, which are independent of load, but vary with speed and excitation. The best method to predict a given dc motor's operating temperature is to use thermal capability curves available from the dc motor manufacturer. If curves are not available, dc motor temperature can be estimated by the power-loss method. This method requires total losses versus load curve or an efficiency curve. For each portion of the duty cycle, power loss is obtained and multiplied by the duration of that portion of the cycle. The summation of these products divided by the total cycle time gives the dc motor's average power loss. The ratio of this value to the power loss at the motor rating is multiplied by the dc motor's rated temperature rise to give the approximate temperature rise of the dc motor when operated on that duty cycle. The speed of a DC motor is directly proportional to the supply voltage, so if we reduce the supply voltage from 12 Volts to 6 Volts, the motor will run at half the speed. How can this be achieved when the battery is fixed at 12 Volts? Theory of DC motor speed control: The speed controller works by varying the average voltage sent to the motor. It could do this by simply adjusting the voltage sent to the motor, but this is quite inefficient to do. A better way is to switch the motor's supply on and off very quickly. If the switching is fast enough, the motor doesn't notice it, it only notices the average effect. When you watch a film in the cinema, or the television, what you are actually seeing is a series of fixed pictures, which change rapidly enough that your eyes just see the average effect movement. Your brain fills in the gaps to give an average effect. Now imagine a light bulb with a switch. When you close the switch, the bulb goes on and is at full brightness, say 100 Watts. When you open the switch it goes off (0 Watts). Now if you close the switch for a fraction of a second, then open it for the same amount of time, the filament won't have time to cool down and heat up, and you will just get an average glow of 50 Watts. This is how lamp dimmers work, and the same principle is used by speed controllers to drive a motor. When the switch is closed, the motor sees 12 Volts, and when it is open it sees 0 Volts. If the switch is open for the same amount of time as it is closed, the motor will see an average of 6 Volts, and will run more slowly accordingly. As the amount of time that the voltage is on increases compared with the amount of time that it is off, the average speed of the motor increases. This on-off switching is performed by power MOSFETs. A MOSFET (Metal-OxideSemiconductor Field Effect Transistor) is a device that can turn very large currents on and off under the control of a low signal level voltage. For more detailed information, see the dedicated chapter on MOSFETs) The time that it takes a motor to speed up and slow down under switching conditions is dependant on the inertia of the rotor (basically how heavy it is), and how much friction and load torque there is. The graph below shows the speed of a motor that is being turned on and off fairly slowly: 38

7.2-1 Motor speed(speed vs time) You can see that the average speed is around 150, although it varies quite a bit. If the supply voltage is switched fast enough, it won’t have time to change speed much, and the speed will be quite steady. This is the principle of switch mode speed control. Thus the speed is set by PWM – Pulse Width Modulation.

7.10 Inductors
Before we go on to discuss the circuits, we must first learn something about the action of inductive loads, and inductors. Inductors do not allow the current flowing through them to change instantly (in the same way capacitors do not allow the voltage across them to change instantly). The voltage dropped across an inductor carrying a current i is given by the equation

where di/dt is the rate of change of the current. If the current is suddenly changed by opening a switch, or turning a transistor off, the inductor will generate a very high voltage across it. For example, turning off 100 Amps in 1 microsecond through a 100 microHenry inductor generates 10kV!

7.11 PWM frequency
The frequency of the resulting PWM signal is dependant on the frequency of the ramp waveform. What frequency do we want? This is not a simple question. Some pros and cons are:  Frequencies between 20Hz and 18kHz may produce audible screaming from the speed controller and motors - this may be an added attraction for your robot!  RF interference emitted by the circuit will be worse the higher the switching frequency is.  Each switching on and off of the speed controller MOSFETs results in a little power loss. Therefore the greater the time spent switching compared with the static on and off times, the greater will be the resulting 'switching loss' in the MOSFETs.  The higher the switching frequency, the more stable is the current waveform in the motors. 39

This waveform will be a spiky switching waveform at low frequencies, but at high frequencies the inductance of the motor will smooth this out to an average DC current level proportional to the PWM demand. This third point can be seen from the following two graphs. One shows the worst case on-off current waveform, the other the best case steady DC current waveform:

7.2-2 PWM Graph(current vs time)

CHAPTER 8 PRACTICAL RESULTS
40

Front Condition:

Back Condition:

Right condition

Left Condition

CHAPTER 9 CONCLUSION
9.1 Conclusion

41

According to the circuit designed and by the program code that is dumped into the micro controller we were able to achieve the aim that we desired. Hence by using the analysis of the above project we achieved the ease of industrial work with well established motion controlled password security system, solution for controlling multiple functions with security .This project can be used in any industries to decrease the human resource afford and to increase the security of work.

CHAPTER 10 BIBLIOGRAPHY
10.1Text books Referred
THE 8051 MICROCONTROLLER AND EMBEDDED SYATEMS MAZIDI THE 8051 MICROCONTROLLER architecture, programming & applications 42 by MUHAMMAD ALI by KENNETH J.AYALA

10.2Web References
http://www.technologystudent.com/_vti_bin/shtml.exe/index.html http://www.electronickits.com/kit/complete/complete.html http://www.youtube.com/watch?v=Srwk-i5aXRQ http://www.unibw.de/robotics/videos/ http://www.datasheet4u.com/html/7/8/0/7806_FairchildSemiconductor.pdf.

43

44

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close