Вы находитесь на странице: 1из 69

CHAPTER-1 INTRODUCTION

1.1 OBJECTIVE
We need to design a robot which changes its position i.e. ; forward, reverse, right or left depending upon different hand gestures. It is a simple robot like any other robot but the only difference is that this is derived by an accelerometer based circuit. This accelerometer based circuit changes voltage when it is tilted in any direction. To send this voltage to the robot we use RF transmitter and at the robot a receiver is used to receive this signal (change in voltage level).

1.2 PROJECT OVERVIEW


As the name suggest it is a robot which moves according to the gesture of our hand. At our hand there is a circuit at which there is an accelerometer sensor which measures the acceleration of our hand. Here the term acceleration does not means linear acceleration but the gravitational acceleration, so this accelerometer sensor measure the g-force and generates the three coordinates X,Y,Z. These three values are processed by the microprocessor, as the output of accelerometer sensor is analog and the microcontroller works on digital input so an analog to digital converter is connected between accelerometer sensor and microcontroller.

Fig 1.1 Accelerometer based circuit on hand

Fig 1.2 Gesture Controlled Robot

This ADC converts the analog input into digitat output and gives to microcontroller. Microcontroller according to this digital input sends the data to the encoder and to the lcd display. Encoder encodes the data which is to be transmitted to the receiver and gives to the RF module. The RF module transmitted the signal with the help of antenna, provided on it. Now the receiving section which we already installed on the robot will receive the signals and send the received signals to the motor driver, on the basis of which motor driver will drive the robot and robot moves according to our hand movement.. Radio Frequency is a flexible technology that is convenient, easy to use, and well suited for automatic operation. Microcontroller gives the ASCII values of X,Y,Z to the lcd display and accordingly values of X,Y,Z displayed on the lcd.

CHAPTER-2 OPERATING PRINCIPLE

2.1 PRINCIPLE OF ACCELEROMETER


2.1.1 GENERAL DESCRIPTION The ADXL335 is a small, thin, low power, complete 3-axis accelerometer with signal conditioned voltage outputs. The product measures acceleration with a minimum full-scale range of 3 g. It can measure the static acceleration of gravity in tilt-sensing applications, as well as dynamic acceleration resulting from motion, shock, or vibration. The user selects the bandwidth of the accelerometer using the CX, CY, and CZ capacitors at the XOUT, YOUT, and ZOUT pins. Bandwidths can be selected to suit the application, with a range of 0.5 Hz to 1600 Hz for the X and Y axes, and a range of 0.5 Hz to 550 Hz for the Z axis. The ADXL335 is available in a small, low profile, 4 mm 4 mm 1.45 mm, 16-lead, plastic lead frame chip scale package (LFCSP_LQ).

Fig 2.1 Functional block diagram of ADXL335

2.1.2 THEORY OF OPERATION The ADXL335 is a complete 3-axis acceleration measurement system. The ADXL335 has a measurement range of }3 g minimum. It contains a polysilicon surface-micro machined sensor and signal conditioning circuitry to implement an open-loop acceleration measurement architecture. The output signals are analog voltages that are proportional to acceleration. The accelerometer can measure the static acceleration of gravity in tilt-sensing applications as well as dynamic acceleration resulting from motion, shock, or vibration. The sensor is a poly silicon surface-micro machined structure built on top of a silicon wafer. Poly silicon springs suspend the structure over the surface of the wafer and provide a resistance against acceleration forces. Deflection of the structure is measured using a differential capacitor that consists of independent fixed plates and plates attached to the moving mass. The fixed plates are driven by 180 out-of-phase square waves. Acceleration deflects the moving mass and unbalances the differential capacitor resulting in a sensor output whose amplitude is proportional to acceleration. Phase-sensitive demodulation techniques are then used to determine the magnitude and direction of the acceleration. The demodulator output is amplified and brought off-chip through a 32 k resistor. The user then sets the signal bandwidth of the device by adding a capacitor. This filtering improves measurement resolution and helps prevent aliasing.

2.1.3 MECHANICAL SENSOR The ADXL335 uses a single structure for sensing the X, Y, and Z axes. As a result, the three axes sense directions are highly orthogonal and have little cross-axis sensitivity. Mechanical misalignment of the sensor die to the package is the chief source of cross-axis sensitivity. Mechanical misalignment can, of course, be calibrated out at the system level.

2.1.4 PERFORMANCE Rather than using additional temperature compensation circuitry, innovative design techniques ensure that high performance is built in to the ADXL335. As a result, there is no quantization error or non monotonic behaviour, and temperature hysteresis is very low (typically less than 3 mg over the 25C to +70C temperature range).

2.1.5 APPLICATIONS INFORMATION 2.1.5.1 Power supply decoupling For most applications, a single 0.1 F capacitor, CDC, placed close to the ADXL335 supply pins adequately decouples the accelerometer from noise on the power supply. However, in applications where noise is present at the 50 kHz internal clock frequency (or care in power supply bypassing is required because this noise can cause errors in acceleration measurement. If additional decoupling is needed, a 100 (or smaller) resistor or ferrite bead can be inserted in the supply line. Additionally, a larger bulk bypass capacitor (1 F or greater) can be added in parallel to CDC. Ensure that the connection from the ADXL335 ground to the power supply any harmonic thereof), additional ground is low impedance because noise transmitted through ground has a similar effect to noise transmitted through VS.

2.2 PRINCIPLE OF RF COMMUNICATION


RF communication works by creating electromagnetic waves at a source and being able to pick up those electromagnetic waves at a particular destination. These electromagnetic waves travel through the air at near the speed of light. The wavelength of an electromagnetic signal is inversely proportional to the frequency; the higher the frequency, the shorter the wavelength. Frequency is measured in Hertz (cycles per second) and radio frequencies are measured in kilohertz (KHz or thousands of cycles per second), megahertz (MHz or millions of cycles per second) and gigahertz (GHz or billions of cycles per second). Higher frequencies result in shorter wavelengths. The wavelength for a 900 MHz device is longer than that of a 2.4 GHz device. In general, signals with longer wavelengths travel a greater distance and penetrate through, and around objects better than signals with shorter wavelengths.

2.2.1 How does an RF communication system work? Imagine an RF transmitter wiggling an electron in one location. This wiggling electron causes a ripple effect, somewhat akin to dropping a pebble in a pond. The effect is an electromagnetic (EM) wave that travels out from the initial location resulting in electrons wiggling in remote locations. An RF receiver can detect this remote electron wiggling. The RF communication system then utilizes this phenomenon by wiggling electrons in a specific

pattern to represent information. The receiver can make this same information available at a remote location; communicating with no wires. In most wireless systems, a designer has two overriding constraints: it must operate over a certain distance (range) and transfer a certain amount of information within a time frame (data rate). Then the economics of the system must work out (price) along with acquiring government agency approvals

2.2.2 BLOCK DIAGRAM OF Tx AND Rx SYSTEM

Fig 2.2 Transmitter and Receiver system

2.2.3 METHODOLOGY Its transmitter uses switch, encoder and RF transmitter. it encodes the signal which comes from switch., and this encoded signal is directly applied to the RF transmitter. Radio waves transfer data between an item to which an RFID device is attached and an RFID reader. The device can contain data about the item, such as what the item is, what time the device traveled through a certain zone, perhaps even a parameter such as temperature. RFID devices, such as a tag or label, can be attached to virtually anything from a vehicle to a pallet of merchandise. RF technology uses frequencies within the range of 50 kHz to 2.5 GHz. An RFID system typically includes the following component. And its receiver uses RF receiver decoder ,microcontroller, motor driver and motor. RF receiver receives the radio frequency signal which is provided by RF transmitter. and decoder decode the signal which comes from the RF receiver. Microcontroller process and control the signal and send to motor driver where motor is driven by motor driver.

2.3 PRINCIPLE OF H-BRIDGE


The most common method to drive DC motors in two directions under control of a computer is with an H-bridge motor driver. H-bridges can be built from scratch with bi-polar junction transistors (BJT) or with field effect transistors (FET), or can be purchased as an integrated unit in a single integrated circuit package such as the L293. The L293 is simplest and inexpensive for low current motors, for high current motors, it is less expensive to build your own H-bridge from scratch. The L293 is an integrated circuit motor driver that can be used for simultaneous, bidirectional control of two small motors. The L293 is limited to 600 mA, but in reality can only handle much small currents unless you have done some serious heat sinking to keep the case temperature down. Unsure about whether the L293 will work with your motor? Hook up the circuit and run your motor while keeping your finger on the chip. If it gets too hot to touch, you can't use it with your motor.

CHAPTER-3 PROJECT WORKING

3.1 BLOCK DIAGRAM OF PROJECT

3.2 HOW IT WORKS


In this project we use two circuit. One is transmitter and second is receiver circuit. In the transmitter circuit we use 3 Axis accelerometer base circuit and on the receiver end we use small ROBO with RF receiver circuit. In the transmitter circuit we measure the value of 3 Axis accelerometer and converted into digital with the help of ADC 0809. ADC converts the data from sensor and proceed to the microcontroller for further conversion.

Microcontroller. Microcontroller gets the hex data from the accelerometer and converted into ASCII code for LCD display. LCD display the XYZ values and display the values on the LCD. At the same time microcontroller gets the data and compare inside with pre-defined variables. As we change the position of hand, values are change automatically and change values are also shown on the LCD. We use the readings of accelerometer for Robot movements. We use one encoder circuit and one transmitter circuit with the

microcontroller circuit for wireless transmission. We specify four variables for the Robot motion. As the position of hand change, data from the controller is also changes automatically. We gets a four output from the controller. Pin no 5,6,7,8 is the output pins for encoder. We use HT12 E encoder for serial communication. Data from the microcontroller is connected to these pins of encoder and transmits via pin no 17 of the encoder. Output from the pin no 17 is connected to the RF transmitter module. RF transmitter module gets the signal from the encoder and transmit via RF frequency 433 Mhz. We use 2 by 16 LCD with port 0. Pin no 40 is connected to the positive supply and pin no 20 is connected to the negative voltage . Pin no 18,19 is connected to the external crystal oscillator for external clock pulse. Output from the 3 axis accelerometer is connected to the pin no 26,27,28 of the ADC 0809. Pin no 23,24,25 is the address line of the ADC. With the help of these address line we select the desired input for digital signal one by one. data conversion. ADC converts the Accelerometer data into

3.3 STATIC ACCELERATION


People naturally sense acceleration on three axes, forward/backward, left/right and up/down. Just think about the last time you were in the passenger seat of a car on a hilly and curvy road. Forward/backward acceleration is the sensation of speeding up and slowing 9

down. Left/right acceleration involved making turns, and up down acceleration is what you felt going over hills. Up/down acceleration is also the way we sense gravity. When on the ground, people tend to sense gravity as their own weight. In free-fall, they sense gravity as weightlessness. In physics terms, gravity is a form of acceleration. When an object is on the ground, gravity is sometimes called static acceleration. When an object is rolling down hill or falling, gravity becomes dynamic acceleration. Instead of the three axes people sense, the MM7260Q accelerometer senses acceleration on two axes. The acceleration it senses depends on how its positioned. By holding it one way, it can sense forward/backward and left/right. If you hold it a different way, it can sense up/down and forward/backward. Two axes of acceleration is enough for many of the applications listed earlier. However, you can always mount and monitor a second accelerometer to capture that third axis.

3.4 CIRCUIT DIAGRAM OF TRANSMITTER

10

3.5 CIRCUIT DIAGRAM OF RECEIVER

11

CHAPTER-3 COMPONENTS USED AND THEIR SPECIFICATION

3.1 COMPONENTS USED:


3.1.1 Major component: Accelerometer (ADXL-335) ADC 0809 Microcontroller (AT 89S52) LCD Display DC Motors IC L293D (H-Bridge IC) IC HT12E IC HT12D Voltage Regulator(IC LM7805) RF transmitter module RF receiver module LED Crystal Oscillator

3.1.2 Minor components 2-pin connector 3-pin connector 4-pin connector Burge Strip female 1 M Resistance 51 k Resistance 470 Resistance 18-Pin dip base 16-Pin dip base

12

28-Pin dip base 40-Pin dip base 1000 F Capacitance 10 F Capacitance 33 pF Capacitance

3.2 COMPONENT SPECIFICATION


3.2.1 ACCELEROMETER(ADXL-335)
An accelerometer is a device that measures the proper acceleration of the device. This is not necessarily the same as the coordinate acceleration (change of velocity of the device in space), but is rather the type of acceleration associated with the phenomenon of weight experienced by a test mass that resides in the frame of reference of the accelerometer device. For an example of where these types of acceleration differ, an accelerometer will measure a value when sitting on the ground, because masses there have weights, even though they do not change velocity. However, an accelerometer in gravitational free fall toward the centre of the Earth will measure a value of zero because, even though its speed is increasing, it is in an inertial frame of reference, in which it is weightless.

Fig 1.2 Integrated Accelerometer

13

With the help of the accelerometer we can control the movement of any robotic arm or movement or control of any electrical appliances. If we install our accelerometer to our hand, then it is possible to control anything with the help of our hand . So in our project we use accelerometer to control the direction of any robot . With the help of four different motions we control the direction of robot for forward, reverse left and right. IC MMA7260Q is an accelerometer, and the pin connection of that IC are shown in the following top view

An accelerometer thus measures weight per unit of (test) mass, a quantity also known as specific force, or g-force. Another way of stating this is that by measuring weight, an accelerometer measures the acceleration of the free-fall reference frame (inertial reference frame) relative to itself. Most accelerometers do not display the value they measure, but supply it to other devices. Real accelerometers also have practical limitations in how quickly they respond to changes in acceleration, and cannot respond to changes above a certain frequency of change.

3.2.2 ADC 0809

Fig 1.3 ADC0809

General Description

The ADC0808, ADC0809 data acquisition component is a monolithic CMOS device with an 8-bit analog-to-digital converter, 8-channel multiplexer and microprocessor compatible control logic. The 8-bit A/D converter uses successive approximation as the conversion technique. The converter features a high impedance chopper stabilized comparator, a 256R voltage divider with analog switch tree and a successive approximation register. The 8-channel multiplexer can directly access any of 8-single-ended analog signals. The device eliminates the need for external zero and full-scale adjustments. Easy interfacing to microprocessors is provided by the latched and decoded multiplexer address 14

inputs and latched TTL TRI-STATE outputs. The design of the ADC0808, ADC0809 has been optimized by incorporating the most desirable aspects of several A/D conversion techniques. The ADC0808, ADC0809 offers high speed, high accuracy, minimal temperature dependence, excellent long-term accuracy and repeatability, and consumes minimal power. These features make this device ideally suited to applications from process and machine control to consumer and automotive application.

Block diagram

Fig 1.3: Block diagram of ADC0809

15

Pin Description

Fig1.4: Pin description of ADC0809

Pin Number

Description

1 2 3 4 5

IN3 - Analog Input 3 IN4 - Analog Input 4 IN5 - Analog Input 5 IN6 - Analog Input 6 IN7 - Analog Input 7

16

6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

START - Start Conversion EOC - End Of Conversion 2(-5) - Tri-State Output Bit 5 OUT EN - Output Enable CLK Clock Vcc - Positive Supply Vref+ - Positive Voltage Reference Input GND Ground 2(-7) - Tri-State Output Bit 7 2(-6) - Tri-State Output Bit 6 Vref- Voltage Reference Negative Input 2(-8) - Tri-State Output Bit 8 2(-4) - Tri-State Output Bit 4 2(-3) - Tri-State Output Bit 3 2(-2) - Tri-State Output Bit 2 2(-1) - Tri-State Output Bit 1 ALE - Address Latch Enable ADD C - Address Input C ADD B - Address Input B ADD A - Address Input A IN0 - Analog Input 0 IN1 - Analog Input 1 IN2 - Analog Input 2

Table no.1.1 : Pin description of ADC0809

17

Features Key Specifications Resolution 8 Bits Total Unadjusted Error 12 LSB and 1 LSB Single Supply 5 VDC Low Power 15 mW Conversion Time 100 s Easy interface to all microprocessors Operates ratio metrically or with 5 VDC or analog span adjusted voltage reference No zero or full-scale adjust required 8-channel multiplexer with address logic 0V to 5V input range with single 5V power supply Outputs meet TTL voltage level specifications Standard hermetic or molded 28-pin DIP package 28-pin molded chip carrier package ADC0808 equivalent to MM74C949 ADC0809 equivalent to MM74C949-1

3.3.3 Microcontroller
A microcontroller is a computer-on-a-chip, or, if you prefer, a single-chip computer. Micro suggests that the device is small, and controller tells you that the device might be used to control objects, processes, or events. Another term to describe a microcontroller is embedded controller, because the microcontroller and its support circuits are often built into, or embedded in, the devices they control. You can find microcontrollers in all kinds of things these days. Any device that measures, stores, controls, calculates, or displays information is a candidate for putting a microcontroller inside. The largest single use for microcontrollers is in automobilesjust about every car manufactured today includes at least one microcontroller for engine control, and often more to control additional systems in the car. In desktop computers, you can find microcontrollers inside keyboards, modems, printers, and other peripherals. In test equipment, microcontrollers make it easy to add features such as the ability to store measurements, to create and store user routines,

18

and to display messages and waveforms. Consumer products that use microcontrollers include cameras, video recorders, compact-disk players, and ovens. And these are just a few examples.

Microcontroller Basics
A microcontroller is similar to the microprocessor inside a personal computer. Examples of microprocessors include Intels 8086, Motorolas 68000, and Zilogs Z80. Both microprocessors and microcontrollers contain a central processing unit, or CPU. The CPU executes instructions that perform the basic logic, math, and data-moving functions of a computer. To make a complete computer, a microprocessor requires memory for storing data and programs, and input/output (I/O) interfaces for connecting external devices like keyboards and displays. In contrast, a microcontroller is a single-chip computer because it contains memory and I/O interfaces in addition to the CPU. Because the amount of memory and interfaces that can fit on a single chip is limited, microcontrollers tend to be used in smaller systems that require little more than the microcontroller and a few support components. Examples of popular microcontrollers are Intels 8052 (including the 8052-BASIC, which is the focus of this book), Motorolas 68HC11, and Zilogs Z8.

Microcontroller History
To understand how microcontrollers fit into the always-expanding world of computers, we need to look back to the roots of micro computing. In its January 1975 issue, Popular Electronics magazine featured an article describing the Altair 8800 computer, which was the first microcomputer that hobbyists could build and program themselves. The basic Altair included no keyboard, video display, disk drives, or other elements we now think of as essential elements of a personal computer. Its 8080 microprocessor was programmed by flipping toggle switches on the front panel. Standard RAM was 256 bytes and a kit version cost $397 ($498 assembled). A breakthrough in the Altairs usability occurred when a small company called Microsoft offered a version of the BASIC programming language for it. Of course, the computer world has changed a lot since the introduction of the Altair. Microsoft has become an enormous software publisher, and a typical personal computer now includes a keyboard, video display, disk drives, and Megabytes of RAM. Whats more, theres no longer any need to build a personal computer from scratch, since mass production has drastically lowered the price of assembled systems. At most, building a personal computer now involves only installing assembled boards and other major components in an enclosure.

19

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-tophone-line 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.

3.3.3.1 AT89S52 Microcontroller

20

Features Compatible with MCS -51 Products 8K Bytes of In-System Programmable (ISP) Flash Memory Endurance: 1000 Write/Erase Cycles 4.0V to 5.5V Operating Range Fully Static Operation: 0 Hz to 33 MHz Three-level Program Memory Lock 256 x 8-bit Internal RAM 32 Programmable I/O Lines Three 16-bit Timer/Counters Eight Interrupt Sources Full Duplex UART Serial Channel Low-power Idle and Power-down Modes Interrupt Recovery from Power-down Mode Watchdog Timer Dual Data Pointer Power-off Flag Fast Programming Timer Flexible ISP Programming (Byte and Page Mode) Green (Pb/Halide-free) Packaging Option

Description The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes of in-system programmable Flash memory. The device is manufactured using Atmels high-density nonvolatile memory technology and is compatible with the industrystandard 80C51 instruction set and pinout. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful microcontroller which provides a highly-flexible and costeffective solution to many embedded control applications. The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a sixvector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock 21

circuitry. In addition, the AT89S52 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 interrupt or hardware reset.

22

3.4 DC MOTORS: A DC motor is designed to run on DC electric power. Two examples of pure DC designs are Michael Faraday's homopolar motor (which is uncommon), and the ball bearing motor, which is (so far) a novelty. By far the most common DC motor types are the brushed and brushless types, which use internal and external commutation respectively to create an oscillating AC current from the DC sourceso they are not purely DC machines in a strict sense.

3.4.1 Brushed DC motor: The classic DC motor design generates an oscillating current in a wound rotor, or armature,

with a split ring commutator, and either a wound or permanent magnet stator. A rotor consists of one or more coils of wire wound around a core on a shaft; an electrical power source is connected to the rotor coil through the commutator and its brushes, causing current to flow in it, producing electromagnetism. The commutator causes the current in the coils to be switched as the rotor turns, keeping the magnetic poles of the rotor from ever fully aligning with the magnetic poles of the stator field, so that the rotor never stops (like a compass needle does) but rather keeps rotating indefinitely (as long as power is applied and is sufficient for the motor to overcome the shaft torque load and internal losses due to friction, etc.) Many of the limitations of the classic commutator DC motor are due to the need for brushes to press against the commutator. This creates friction. At higher speeds, brushes have increasing 23

difficulty in maintaining contact. Brushes may bounce off the irregularities in the commutator surface, creating sparks. (Sparks are also created inevitably by the brushes making and breaking circuits through the rotor coils as the brushes cross the insulating gaps between commutator sections. Depending on the commutator design, this may include the brushes shorting together adjacent sectionsand hence coil endsmomentarily while crossing the gaps. Furthermore, the inductance of the rotor coils causes the voltage across each to rise when its circuit is opened, increasing the sparking of the brushes.) This sparking limits the maximum speed of the machine, as too-rapid sparking will overheat, erode, or even melt the commutator. The current density per unit area of the brushes, in combination with their resistivity, limits the output of the motor. The making and breaking of electric contact also causes electrical noise, and the sparks additionally cause RFI. Brushes eventually wear out and require replacement, and the commutator itself is subject to wear and maintenance (on larger motors) or replacement (on small motors). The commutator assembly on a large machine is a costly element, requiring precision assembly of many parts.

Fig 2.7: Cross Section of Brushed Dc Motor Large brushes are desired for a larger brush contact area to maximize motor output, but small brushes are desired for low mass to maximize the speed at which the motor can run without the brushes excessively bouncing and sparking (comparable to the problem of "valve float" in internal combustion engines). (Small brushes are also desirable for lower cost.) Stiffer brush springs can also be used to make brushes of a given mass work at a higher speed, but at the cost of greater friction losses (lower efficiency) and accelerated brush and 24

commutator wear. Therefore, DC motor brush design entails a trade-off between output power, speed, and inefficiency/wear. There are five types of brushed DC motor: DC shunt wound motor DC series wound motor DC compound motor (two configurations): Cumulative compound Differentially compounded Permanent Magnet DC Motor (not shown) Separately-excited (not shown)

3.4.2 Brushless DC motors: Some of the problems of the brushed DC motor are eliminated in the brushless design. In this motor, the mechanical "rotating switch" or commutator/brush gear assembly is replaced by an external electronic switch synchronized to the rotor's position. Brushless motors are typically 85-90% efficient or more (higher efficiency for a brushless electric motor of up to 96.5% were reported by researchers at the Tokai University in Japan in 2009),[14] whereas DC motors with brush gear are typically 75-80% efficient. Midway between ordinary DC motors and stepper motors lies the realm of the brushless DC motor. Built in a fashion very similar to stepper motors, these often use a permanent magnet external rotor, three phases of driving coils, one or more Hall effect sensors to sense the position of the rotor, and the associated drive electronics.

Fig 2.8: Brushless Dc Motor 25

The coils are activated, one phase after the other, by the drive electronics as cued by the signals from either Hall effect sensors or from the back EMF (electromotive force) of the undriven coils. In effect, they act as three-phase synchronous motors containing their own variable-frequency drive electronics. A specialized class of brushless DC motor controllers utilizes EMF feedback through the main phase connections instead of Hall Effect sensors to determine position and velocity. These motors are used extensively in electric radiocontrolled vehicles. When configured with the magnets on the outside, these are referred to by mode lists as out runner motors. Brushless DC motors are commonly used where precise speed control is necessary, as in computer disk drives or in video cassette recorders, the spindles within CD, CD-ROM (etc.) drives, and mechanisms within office products such as fans, laser printers and photocopiers. They have several advantages over conventional motors: to AC fans using shaded-pole motors, they are very efficient, running much cooler than the equivalent AC motors. This cool operation leads to much-improved life of the fan's bearings. be significantly longer compared to a DC motor using brushes and a commutator. 18 Commutation also tends to cause a great deal of electrical and RF noise; without a commutator or brushes, a brushless motor may be used in electrically sensitive devices like audio equipment or computers.

convenient tachometer signal for closed-loop control (servo-controlled) applications. In fans, the tachometer signal can be used to derive a "fan OK" signal.

precise speed control.

better suited to environments with volatile chemicals and fuels. Also, sparking generates ozone which can accumulate in poorly ventilated buildings risking harm to occupants' health.

generally used to get rid of unwanted heat.

is affected by vibrations. 26

kilowatts. Larger brushless motors up to about 100 kW rating are used in electric vehicles. They also find significant use in high-performance electric model aircraft.

2.8.4 L293D Motor Driver and H-Bridge:


The most common method to drive DC motors in two directions under control of a computer is with an H-bridge motor driver. H-bridges can be built from scratch with bi-polar junction transistors (BJT) or with field effect transistors (FET), or can be purchased as an integrated unit in a single integrated circuit package such as the L293. The L293 is simplest and inexpensive for low current motors, for high current motors, it is less expensive to build your own H-bridge from scratch.
19

The L293 is an integrated circuit motor driver that can be used for simultaneous, bidirectional control of two small motors. Small means small. The L293 is limited to 600 mA ,

27

but in reality can only handle much small currents unless you have done some serious heat sinking to keep the case temperature down. Unsure about whether the L293 will work with your motor? Hook up the circuit and run your motor while keeping your finger on the chip. If it gets too hot to touch, you can't use it with your motor.

Fig 2.9: IC L293D

The L293D is a quadruple high-current half-H driver designed to provide bidirectional drive currents of up to 600-mA at voltages from 4.5 V to36 V. It is designed to drive inductive loads such as relays, solenoids, dc and bipolar stepping motors, as well as other highcurrent/ high-voltage loads in positive-supply applications .All inputs are TTL-compatible. Each output is a complete totem-pole drive circuit with a Darlington transistor sink and a pseudo-Darlington source. Drivers are enabled in pairs with drivers 1 and 2enabled by 1,2EN and drivers 3 and 4 enabled b3, 4 EN. When an enable input is high, the associated drivers are enabled, and their outputs are active and in phase with their inputs. External high-speed output clamp diodes should be used for inductive transient suppression. When the enable input is low, those drivers are disabled, and their outputs are off and in a high-impedance state. With the proper data inputs, each pair of drivers forms a full-H (or bridge) reversible drive suitable for solenoid or motor applications. L293D is a bipolar motor driver IC. This is a high voltage, high current push pull four channel driver compatible to TTL logic levels and drive inductive loads. It has 600 mA output current capabilities per channel and internal clamp diodes. The L293 is designed to provide bidirectional drive currents of up to 1A at voltages from 4.5 V to 36 V. The L293D is designed to provide bidirectional drive currents of
20

up to 600-mA at voltages from 4.5 V to 36 V. Both devices are designed to drive inductive 28

loads such as relays, solenoids, dc and bipolar stepping motors, as well as other highcurrent/ high-voltage loads in positive supply applications. All inputs are TTL compatible. Each output is a complete totem-pole drive circuit, with a Darlington transistor sink and a pseudo-Darlington source. Drivers are enabled in pairs, with drivers 1 and 2 enabled by 1,2EN and drivers 3 and 4 enabled by 3,4EN. When an enable input is high, the associated drivers are enabled, and their outputs are active and in phase with their inputs. When the enable input is low, those drivers are disabled, and their outputs are off and in the highimpedance state. With the proper data inputs, each pair of drivers forms a full-H (or bridge) reversible drive suitable for solenoid or motor applications Features: -mA Output Current Capability Per iver Pulsed Current 1.2-A Per Driver

-Logic Supply

-Noise-Immunity Inputs l Replacement for SGS L293D


21

2.8.4.1 Pin Diagram:

29

Fig 2.10: Pin Diagram of IC L293D

2.8.4.2 Logic Diagram:

Fig 2.11: Logic diagram of IC L293D

22

2.8.4.3Functional Table:

30

Table 2.1: Functional table of IC L293D

2.8.4.4 Pin Connections

31

Fig 2.12: Pins connection of IC L293D

23

Truth Table:

Table 2.2: Truth table of IC L293D

1.3.2 HT12E
The encoders are a series of CMOS LSIs for remote control system applications. They are capable of encoding information which consists of N address bits and 12_N data bits. Each address/ data input can be set to one of the two logic states. The programmed addresses/data are transmitted together with the header bits via an RF or an infrared transmission medium upon receipt of a trigger signal. The capability to select a TE trigger on the HT12E or a DATA trigger on the HT12A further enhances the application flexibility of the 212 series of encoders. The HT12A additionally provides a 38kHzcarrier for infrared systems.

32

Fig 1.5 HT12E Chip

This given diagram shows the all internal blocks of a HT12E IC and all pins are also shown to provide all information about the connections. This has some following features Operating voltage O 2.4V~12V for the HT12E o Low power and high noise immunity CMOS technology o Low standby current: 0.1 A (typ.) at VDD=5V o HT12A with a 38kHz carrier for infrared transmission medium

pin diagram 33

Fig 1.6 Pin Diagram of HT12E

Pin no 1to 8 is address pin. Pin no 9 is ground pin. Pin no 10,11,12,13 is data insertion pin. We provide a 0 bit on the entire address pin. But it is not necessary. We select the address line pins as our requirement. For providing a data to data pins either we provide a 4 bit data from microcontroller or any other digital circuit or we connect DIP switches Dip switches are connected with the pin no 10,11,12,13 . Pin no 14 is transmit control pin. We control the pin no 14 by connecting a pin no 14 to ground pin. When this pin is ground then only, data is to be transmit from the IC . Pin no 15 and 16 is the oscillator pin of the encoder IC . On this pin we connect a 1 M ohm resistor. Pin no 17 is data output pin. Data from this pin is connected to the input of transmitter module. Data receive by the radio frequency receiver module. This receiver module is same as the frequency of transmitter module. Output from radio frequency module is further decoded by the decoder IC. Output of the decoder IC is further converted into parallel and proceeds to the microcontroller for further process. Or we get the data from decoder directly .

1.3.2 Block diagram of IC HT12E

Fig block diagram of IC HT12E

34

1.3.5 HT12D
The 212 decoders are a series of CMOS LSIs for remote control system applications. They are paired with Holteks 212 series of encoders (refer to the encoder/decoder cross reference table). For proper operation, a pair of encoder/decoder with the same number of addresses and data format should be chosen. The decoders receive serial addresses and data from a programmed 212 series of encoders that are transmitted by a carrier using an RF or an IR transmission medium. They compare the serial input data three times continuously with their local addresses. If no error or unmatched codes are found, the input data codes are decoded and then transferred to the output pins. The VT pin also goes high to indicate a valid transmission.

35

36

The 212 series of decoders are capable of decoding information that consist of N bits of address and 12_N bits of data. Of this series, the HT12D is arranged to provide 8 address bits and 4 data bits, and HT12F is used to decode 12 bits of address information. It has some following features: O Operating voltage: 2.4V~12V O Low power and high noise immunity CMOS technology O Low standby current O Capable of decoding 12 bits of information O Binary address setting O Received codes are checked 3 times O Address/Data number combination O HT12D: 8 address bits and 4 data bits

2.8.7 Voltage Regulator: Voltage regulator ICs are available with fixed (typically 5, 12 and 15V) or variable output voltages. The maximum current they can pass also rates them. Negative voltage regulators are available, mainly for use in dual supplies. Most regulators include some automatic protection from excessive current (over load protection) and overheating (thermal protection). Many of fixed voltage regulator ICs has 3 leads. They include a hole for attaching a heat sink if necessary.

Fig 2.19: Voltage Regulator IC LM7805

Description: These voltage regulators are monolithic circuit integrated circuit designed as fixed voltage regulators for a wide variety of applications including local, on card regulation. These regulators employ internal current limiting, thermal safe-area compensation. With adequate heat sinking they can deliver output current in excess of 1.0 A. Although designed primarily 37

as a fixed voltage regulator, these devices can be used with external components to obtain adjustable voltage and current shutdown, and safe-area compensation. With adequate heat sinking they can deliver output current in excess of 1.0 A. Although designed primarily as a fixed voltage regulator, these devices can be used with external components to obtain adjustable voltage and current.
28

Features:

ent limiting -area compensation

-lead transistor packages

1.3.3 RF Transmitter
In the transmitter circuit we use one RF module to send the data serially via radio frequency . Here in this project we use 434 MHz radio frequency module o send the data serially. Modulating frequency of the project is 434 Mhz and modulation type is ASK.

Fig 1.7 RF Transmitter Whenever we want to send a data we use encoder ic to convert the parallel data into serial. This serial data is transmitting by the radio frequency module in air. For selecting a data base we use DIP switches. In actual practice we use internal data base. But in this project we use external data base to selection. Here we use four bit data with the help of DIP switches. Data is to be converted

38

into serial with the help of the encoder IC. Here we use HT 12E encoder IC. HT12E encoder IC convert the parallel data into serial data.

Features: 434 MHz Transmitter Operation. 500 Ft. Range - Dependent on Transmitter Power Supply. 2400 or 4800bps transfer rate. Low cost. Extremely small and light weight

39

1.3.4 Receiver
This receiver type is good for data rates up to 4800bps and will only work with the 434MHz transmitter. Multiple 434MHz receivers can listen to one 434MHz transmitter. This wireless data is the easiest to use, lowest cost RF link we have ever seen! Use these components to transmit position data, temperature data, even current program register values wirelessly to the receiver. These modules have up to 500 ft range in open space. The receiver is operated at 5V. We have used these modules extensively and have been very impressed with their ease of use and direct interface to an MCU. The theory of operation is very simple. What the transmitter 'sees' on its data pin is what the receiver outputs on its data pin. If you can configure the UART module on a PIC, you have an instant wireless data connection. Data rates are limited to 4800bps. The typical range is 500ft for open area. This receiver has a sensitivity of 3uV. It operates from 4.5 to 5.5 volts-DC and has digital output. The typical sensitivity is -103dbm and the typical current consumption is 3.5mA for 5V operation voltage.

This has some following features O 434 MHz Operation O 500 Ft. Range - Dependent on Transmitter Power Supply O 4800 bps transfer rate O Low cost O Extremely small and light weight

40

A light-emitting diode (LED) is a semiconductor light source. LEDs are used as indicator lamps in many devices and are increasingly used for other lighting. Introduced as a practical electronic component in 1962,[4] early LEDs emitted low-intensity red light, but modern versions are available across the visible, ultraviolet, and infrared wavelengths, with very high brightness. When a light-emitting diode is forward-biased (switched on), electrons are able to recombine with electron holes within the device, releasing energy in the form of photons. This effect is called electroluminescence and the color of the light (corresponding to the energy of the photon) is determined by the energy gap of the semiconductor. LEDs are often small in area (less than 1 mm2), and integrated optical components may be used to shape its radiation pattern.[5] LEDs present manyadvantages over incandescent light sources including lower energy consumption, longer lifetime, improved robustness, smaller size, and faster switching. LEDs powerful enough for room lighting are relatively expensive and require more precise current and heat management than compact fluorescent lamp sources of comparable output. Light-emitting diodes are used in applications as diverse as aviation lighting, automotive lighting, advertising, general lighting, and traffic signals. LEDs have allowed new text, video displays, and sensors to be developed, while their high switching rates are also useful in advanced communications technology. Infrared LEDs are also used in the remote control units of many commercial products including televisions, DVD players, and other domestic appliances. Efficiency: LEDs emit more light per watt than incandescent light bulbs.[93] Their efficiency is not affected by shape and size, unlike fluorescent light bulbs or tubes.

41

Color: LEDs can emit light of an intended color without using any color filters as traditional lighting methods need. This is more efficient and can lower initial costs. Size: LEDs can be very small (smaller than 2 mm2[94]) and are easily populated onto printed circuit boards. On/Off time: LEDs light up very quickly. A typical red indicator LED will achieve full brightness in under a microsecond.[95] LEDs used in communications devices can have even faster response times. Cycling: LEDs are ideal for uses subject to frequent on-off cycling, unlike fluorescent lamps that fail faster when cycled often, or HID lamps that require a long time before restarting. Dimming: LEDs can very easily be dimmed either by pulse-width modulation or lowering the forward current.[96] Cool light: In contrast to most light sources, LEDs radiate very little heat in the form of IR that can cause damage to sensitive objects or fabrics. Wasted energy is dispersed as heat through the base of the LED. Slow failure: LEDs mostly fail by dimming over time, rather than the abrupt failure of incandescent bulbs.[97] Lifetime: LEDs can have a relatively long useful life. One report estimates 35,000 to 50,000 hours of useful life, though time to complete failure may be longer.[98] Fluorescent tubes typically are rated at about 10,000 to 15,000 hours, depending partly on the conditions of use, and incandescent light bulbs at 1,000 2,000 hours.

Shock resistance: LEDs, being solid state components, are difficult to damage with external shock, unlike fluorescent and incandescent bulbs, which are fragile. Focus: The solid package of the LED can be designed to focus its light. Incandescent and fluorescent sources often require an external reflector to collect light and direct it in a usable manner.

Oscillator
A crystal oscillator is an electronic oscillator 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 (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 became known as "crystal oscillators." Quartz crystals are manufactured for frequencies from a few tens of kilohertz to tens of megahertz. More than two billion (2109) crystals are manufactured annually. Most are used for consumer devices such as wristwatches, clocks, radios,computers, and cellphones. Quartz crystals are also found inside test and measurement equipment, such as counters, signal generators, and oscilloscopes.

42

working A crystal is a solid in which the constituent atoms, molecules, or ions are packed in a regularly ordered, repeating pattern extending in all three spatial dimensions. Almost any object made of an elastic material could be used like a crystal, with appropriate transducers, since all objects have natural resonant frequencies of vibration. For example, steel is very elastic and has a high speed of sound. It was often used inmechanical filters before quartz. The resonant frequency depends on size, shape, elasticity, and the speed of sound in the material. High-frequency crystals are typically cut in the shape of a simple, rectangular plate. Low-frequency crystals, such as those used in digital watches, are typically cut in the shape of a tuning fork. For applications not needing very precise timing, a low-cost ceramic resonator is often used in place of a quartz crystal. When a crystal of quartz is properly cut and mounted, it can be made to distort in an electric field by applying a voltage to an electrode near or on the crystal. This property is known as piezoelectricity. When the field is removed, the quartz will generate an electric field as it returns to its previous shape, and this can generate a voltage. The result is that a quartz crystal behaves like a circuit composed of an inductor, capacitor and resistor, with a precise resonant frequency. (See RLC circuit.) Quartz has the further advantage that its elastic constants and its size change in such a way that the frequency dependence on temperature can be very low. The specific characteristics will depend on the mode of vibration and the angle at which the quartz is cut (relative to its crystallographic axes). [8] Therefore, the resonant frequency of the plate, which depends on its size, will not change much, either. This means that a quartz clock, filter or oscillator will remain accurate. For critical applications the quartz oscillator is mounted in a temperature-controlled container, called a crystal oven, and can also be mounted on shock absorbers to prevent perturbation by external mechanical vibrations.

43

CHAPTER 4 APPLICATIONS AND ADVANTAGES

4.1 APPLICATIONS OF ACCELEROMETERS


Accelerometers are very important in the sensor world because they can sense such a wide range of motion. They're used in the latest Apple Power books (and other laptops) to detect when the computer's suddenly moved or tipped, so the hard drive can be locked up during movement. They're used in cameras, to control image stabilization functions. They're used in pedometers, gait meters, and other exercise and physical therapy devices. They're used in gaming controls to generate tilt data. They're used in automobiles, to control airbag release when there's a sudden stop. There are countless other applications for them. Possible uses for accelerometers in robotics:
OSelf balancing robots OTilt-mode game controllers OModel airplane auto pilot OAlarm systems OCollision detection OHuman motion monitoring OLeveling sensor, inclinometer OVibration Detectors for Vibration Isolators OG-Force Detectors

44

4.2 AXIS OF ACCELERATION


The tiny micro-structures can only measure force in a single direction, or axis of acceleration. This means with a single axis measured, you can only know the force in either the X, Y, or Z directions, but not all. So if say your X-axis accelerometer endowed robot was running around and ran into a wall (in the X direction). Your robot could detect this collision. But if say another robot rammed into it from the side (the Y direction), your robot would be oblivious to it. There are many other situations where a single axis would not be enough. It is always a good idea to have at least 2 axes (more than one axis).

Fig 4.1 Axis of Robot

4.3 GRAVITY
Gravity is an acceleration. A such, your accelerometer will always be subject to a -9.81 m/s^2 acceleration (negative means towards the ground). Because of this, your robot can detect what angle it is in respect to gravity. If your robot is a biped, and you want it to always remain balanced and standing up, just simply use a 2-axis accelerometer. As long as the X and Y axes detect zero acceleration, this means your robot device is perfectly level and balanced.

45

4.4 ACCELEROMETERS , RATED g


When you buy your accelerometer, you will notice it saying something like 'rated at 2g' or '3g accelerometer.' This is the maximum g force your sensor can report. Gravity accelerates objects at 1g, or 9.81 m/s^2. For example, if your robot is moving at 1g upwards, then that means you sensor will detect 2g. For most robotics applications a 2g rating will be fine. So why not just get the highest rating possible? The lower the rating, the more sensitive it will be to changes in motion. You will always have a more fine tuned sensor the lower the rating. But then again, more sensitive sensors are more affected by vibration interference.

4.5 APPLICATION IN WHEEL CHAIR


The objective of the project is to control a certain object with the help of the movement of the palm. The movement represents different operations such as forward, reverse, left and right. By using this mechanism we move a wheel chair here by the movement of the palm.

46

4.6 ADVANTAGES OF ACCELEROMETER


No Moving Parts

arge Dynamic Range

47

CHAPTER 5 CONCLUSION
We have concluded that in the continuous growing world in the field of technology . This project will play an important role due to its unique features such as relieve from clicking buttons . An accelerometer is a device that measures proper acceleration, the acceleration experienced relative to freefall. Single- and multi-axis models are available to detect magnitude and direction of the acceleration as a vector quantity, and can be used to sense orientation, acceleration, vibration shock, and falling. Micro machined accelerometers are increasingly present in portable electronic devices and video game controllers, to detect the position of the device or provide for game input. It is a capable of measuring how fast the speed of something is changing. It is used as an input to control systems .Sensor voltage output should be determined as a percentage of voltage input for consistency .40

48

BIBLIOGRAPHY
[1] http://www.atmel.com/dyn/resources/prod_documents/doc3286.pdf [2] http://www.botskool.com/downloads/electronics/datasheets/HT12D.pdf [3] http://www.ipic.co.jp/Pdffiles/ht12e.pdf [4] http://www.datasheetcatalog.org/datasheets/228/390068_DS.pdf [5] http://www.datasheetcatalog.org/datasheet/texasinstruments/l293d.pdf [6] http://www.national.com/ds/LM/LM124.pdf [7] http://en.wikipedia.org/wiki/Ultrasonic_sensor [8] http://www.vegakitindia.com/productdetails.asp?ProdID=RF01B433 [9] http://www.rapidonline.com/netalogue/specs/63-0010e.pdf [10] http://en.wikipedia.org/wiki/Stepper_motor
[11]file:///C:/Users/USER/Downloads/How%20to%20Build%20a%20Robot%20Tutorial%20-

%20Society%20of%20Robots.htm 41

49

APPENDIX(A)
SOURSE CODE
#include <reg52.h> //#define LCDDATA P0 #define ADC_DATA P2 #define HIGH 1 #define LOW 0 #define FALSE 0 #define TRUE 1 #define CURRENT 0 #define LINE1 1 #define LINE2 2 sbit LCD_D4 = P0^0; sbit LCD_D5 = P0^1; sbit LCD_D6 = P0^2; sbit LCD_D7 = P0^3; sbit LCD_RS = P0^4; sbit LCD_RW = P0^5; sbit LCD_EN = P0^6; sbit ADC_ADDA = P1^0; sbit ADC_ADDB = P1^1; sbit ADC_ADDC = P1^2; sbit MOTORLC = P1^4; sbit MOTORLA = P1^5; sbit MOTORRC = P1^6; sbit MOTORRA = P1^7; sbit ADC_START = P3^4; sbit ADC_ALE = P3^5; sbit ADC_EOC = P3^6; sbit ADC_OE = P3^7; sbit KEY = P3^3; void delay(ui); void lcdinit(); bit clearlineflag; extern void lcdinit(); extern uc checkADC(); uc LCDDATA; uc XDATA,YDATA,ZDATA; uc adc_val; uc checkADC(); void main () { systeminit(); while(1) { // nxt_loop1: // // // //

if(KEY == LOW) goto nxt_loop2; else { ADC_ADDA = LOW; ADC_ADDB = LOW; ADC_ADDC = LOW; ZDATA = checkADC();

50

ADC_ADDA = HIGH; ADC_ADDB = LOW; ADC_ADDC = LOW; YDATA = checkADC(); ADC_ADDA = LOW; ADC_ADDB = HIGH; ADC_ADDC = LOW; XDATA = checkADC(); temphund = XDATA; tempone = temphund%10; temphund/=10; tempten = temphund%10; temphund/=10; lcddata(' '); //lcddata(temphund+48); lcddata(tempten+48); lcddata(tempone+48); temphund = tempone = temphund%10; temphund/=10; tempten = temphund%10; temphund/=10; lcddata(' '); lcddata('Y'); lcddata(' '); //lcddata(temphund+48); lcddata(tempten+48); lcddata(tempone+48); temphund = tempone = temphund%10; temphund/=10; tempten = temphund%10; temphund/=10; lcddata(' '); lcddata('Z'); lcddata(' '); //lcddata(temphund+48); lcddata(tempten+48); lcddata(tempone+48); delay(3000); ZDATA; YDATA;

51

// // { ",LINE2);

} goto nxt_loop1; displayline("STOP MOTORLC = HIGH; MOTORLA = HIGH; MOTORRC = HIGH; MOTORRA = HIGH; delay(3000);

} if(ZDATA > 27 && ZDATA < 39 && YDATA > 41 && YDATA < 53 && XDATA > 38 && XDATA < 50) { displayline("FORWORD ",LINE2); MOTORLC = LOW; MOTORLA = HIGH; MOTORRC = LOW; MOTORRA = HIGH; delay(3000); } { displayline("BACK ",LINE2); MOTORLA = LOW; MOTORLC = HIGH; MOTORRA = LOW; MOTORRC = HIGH; delay(3000); { displayline("RIGHT ",LINE2); MOTORLC = HIGH; MOTORLA = LOW; MOTORRC = LOW; MOTORRA = HIGH; delay(3000); } displayline("LEFT ",LINE2); MOTORLC = LOW; MOTORLA = HIGH; MOTORRC = HIGH; MOTORRA = LOW; delay(3000); // // // ",LINE2); // } } } else { displayline(" }

52

void systeminit() { P0 = 0xff; P1 = 0xff; P2 = 0xff; P3 = 0xff; ADC_START = 0; ADC_EOC = 1; ADC_OE = 0; ADC_ALE = 0; MOTORLC = HIGH; MOTORLA = HIGH; MOTORRC = HIGH; MOTORRA = HIGH; clearlineflag = FALSE; delay(1); lcdinit(); display(0); } uc checkADC() { asm{0,0,0}; ADC_ALE = 1; asm{0,0,0}; ADC_START = 1; asm{0,0,0}; ADC_ALE = 0; asm{0}; ADC_START = 0; asm{0}; ADC_DATA = 0xff; while(ADC_EOC == 0); ADC_OE = 1; asm{0,0}; adc_val = ADC_DATA; ADC_OE = 0; delay(1); return adc_val; } void display(int mode) { switch(mode) { case 0 : displayline(" ACCLERO METER ",LINE1); displayline(" ",LINE2); break; ",LINE1); displayline(" ",LINE2); displayline("

53

case 1 : lcdcommand(0x01); break; } } void displayline(char *p,int line) { int i; if(line == LINE1) { lcdcommand(0x80); } else { lcdcommand(0xc0); } for(i=0;i<16;i++,p++) { lcddata(*p); } return; } void lcdcommand(int com) { LCD_EN = 0; LCD_RS = 0; asm{0,0}; LCD_RW = 0; LCD_D4 = com&0x10; LCD_D5 = com&0x20; LCD_D6 = com&0x40; LCD_D7 = com&0x80; asm{0,0}; LCD_EN = 1; asm{0}; LCD_EN = 0; LCD_D4 = com&0x01; LCD_D5 = com&0x02; LCD_D6 = com&0x04; LCD_D7 = com&0x08; asm{0,0}; LCD_EN = 1; asm{0}; LCD_EN = 0; delay(146); return; } void lcddata(char val) { LCD_EN = 0; LCD_RS = 1; asm{0,0}; LCD_RW = 0; LCD_D4 = val&0x10;

54

LCD_D5 = val&0x20; LCD_D6 = val&0x40; LCD_D7 = val&0x80; asm{0,0}; LCD_EN = 1; asm{0}; LCD_EN = 0; ; LCD_D7 = val&0x08; asm{0,0}; LCD_EN = 1; asm{0}; LCD_EN = 0; delay(146); return; } void delay(ui time) { for(;time > 0;time--); } void lcdinit() { LCD_RS = 0; LCD_RW = 0; LCD_EN = 0; LCD_D7 = 0; LCD_D6 = 0; LCD_D5 = 1; LCD_D4 = 1; asm{0}; LCD_EN = 1; asm{0}; LCD_EN = 0; delay(120); LCD_EN = 1; asm{0}; LCD_EN = 0; delay(29); LCD_EN = 1; asm{0}; LCD_EN = 0; delay(29); LCD_D4 = 0; asm{0}; LCD_EN = 1; asm{0}; LCD_EN = 0; lcdcommand(0x06); LCD_RS = 0; LCD_RW = 0; LCD_EN = 0; lcdcommand(0x01); return;

55

DESCRIPTION OF PINS OF AT 89S52: VCC Pin no.40 is used for the supply to the microcontroller.. GND Ground. RST This is pin no.9, used to reset the device by keeping it high for 2 machine cycles. The microcontroller should be reset at the time of starting. Oscillator Pins XTAL1 and XTAL2 are used for connecting a quartz crystal for the internal oscillator. Crystal Frequency-10 MHz External Access(EA) The 8051 family members, all come with on-chip ROM to store the program. In such case, EA pin is connected to Vcc. To indicate that the code is stored in external ROM, EA pin must be connected to ground. PSEN PSEN stands for Program Store Enable.This is an output pin and is connected to OE pin of ROM Port 0 Port 0 is an 8-bit open drain bi-directional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance inputs. Port 0 can also be configured to be the multiplexed lower order address/data bus during accesses to external program and data memory. In this mode, 45

56

P0 has internalpullups.Port 0 also receives the code bytes during Flash programming and outputs the code bytes during program verification. External pullups are required during program verification. Port 1 and Port2 Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port1 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. In addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count input (P1.0/T2) and the timer/counter 2. Port 3 It has internal pull-ups and can sink/source 4 TTL inputs. Port 3 occupies a total of 8 pins, pins 10 through 17. It can be used as input or output. Port 3 has additional function of providing some extremely signal as interrupts. Table : Alternate Function of 89s51(2)

RST: Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device. This pin drives high for 98 oscillator periods after the Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the default state of bit DISRTO, the RESET HIGH out feature is enabled.

ALE/PROG:

57

Address Latch Enable (ALE) is an 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 pulse is skipped during each access to external data memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode. PSEN: Program Store Enable (PSEN) is the read strobe to external program memory. When the AT89S52 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory. EA/VPP: External Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin also receives the 12-volt programming enable voltage (VPP) during Flash programming. XTAL1: Input to the inverting oscillator amplifier and input to the internal clock operating circuit. XTAL2: Output from the inverting oscillator amplifier.

58

Memory Organization:

MCS-51 devices have a separate address space for Program and

Data Memory. Up to 64K bytes each of external Program and Data Memory can be addressed. Program Memory: If the EA pin is connected to GND, all program fetches are directed to external memory. On the AT89S52, if EA is connected to VCC, program fetches to addresses 0000H through 1FFFH are directed to internal memory and fetches to addresses 2000H through FFFFH are to external memory. Data Memory: The AT89S52 implements 256 bytes of on-chip RAM. The upper 128 bytes occupy a parallel address space to the Special Function Registers. This means that the upper 128 bytes have the same addresses as the SFR space but are physically separate from SFR space. When an instruction accesses an internal location above address 7FH, the address mode used in the instruction specifies whether the CPU accesses the upper 128 bytes of RAM or the SFR space. Instructions which use direct addressing access the SFR space. For example, the following direct addressing instruction accesses the SFR at location 0A0H (which is P2). MOV 0A0H, #data Instructions that use indirect addressing access the upper 128 bytes of RAM. For example, the following indirect addressing instruction, where R0 contains 0A0H, accesses the data byte at address 0A0H, rather than P2 (whose address is 0A0H). MOV @R0, #data Note that stack operations are examples of indirect addressing, so the upper 128 bytes of data RAM are available as stack space. Features: Advanced code editor to aid in the writing of source code. Included libraries covering communications, data acquisition, displays and much more dramatically speed up development. Code explorer allows you to monitor your program's structure, variables and functions. Generates commented, human-readable assembly language files and HEX files compatible with any Atmel 8051 programmer. Integrated simulator lets you inspect program flow and debug executable code. 48

59

Code Editor: MikroC's code editor is an advanced text editor fashioned to satisfy the needs of professionals. Advanced editor features include adjustable syntax highlighting, code assistant offering an auto-complete function, auto-correction of common typos, the ability to comment/uncomment a block of code with single mouse-click and bookmarks that can be set to aid navigation through even the largest program code. Code Explorer/Quick Help/Keyboard Shortcuts: To the left of the main window area a pane contains mikroC's code explorer, quick-help. The code explorer tab provides a clear view of every declared item within the source code and from here you can jump to the declarations of those items. The quick help tab lists all the available built-in library functions as a helpful reference. Finally, the keyboard shortcuts tab lists all available keyboard shortcuts that may be used within mikroC. Simulator: The source-level debugger is an integral component of the mikroC development environment and has been designed to simulate the operations of Atmel's 8051 microcontrollers to assist users in the debugging of their programs. The simulator simulates program flow and execution of instruction lines, although not operating in real-time it does not update timers, interrupt flags, etc. Once you have successfully compiled your project, you can run the simulator allowing you to carry out operations such as single-stepping code and running the code to a cursor position. A simulator watch window enables you to monitor program variables and registers of the 8051 with their values updated as you carry out simulation operations. Values changed as the simulation progresses are coloured red to clearly identify them. You can also edit values of variables and registers during the simulation process.

60

A stopwatch window is also provided for use when simulating to calculate the processor cycles and execution time since the last debugger action. A view RAM window acts in a similar manner to the watch window and shows the contents of RAM, again with recently changed values highlighted in red and with the ability to manually change values.

H-BRIDGE connection diagram

61

PCB LAYOUT OF H-BRIDGE:

62

PCB LAYOUT OF TRANSMITTER

63

PCB LAYOUT OF RECEIVER

64

APPENDIX (D)
LM324 SINGLE SUPPLY QUAD OPERATIONAL AMPLIFIERS

The LM324 series are lowcost, quad operational amplifiers with true differential inputs. They have several distinct advantages over standard operational amplifier types in single supply applications. The quad -amplifier can operate at supply voltages as low as 3.0 V or as high as 32 V with quiescent currents about onefifth of those associated with the MC1741 (on a per amplifier basis). The common necessity for external biasing components in many applications. The output voltage range also includes the negative power supply voltage.

lly Compensated

Device Operation

PIN CONNECTIONS :

65

LM324 AS A COMPARATOR SCHEMATIC DIAGRAM:

CERAMIC CAPACITOR

66

The ceramic dielectric materials are made from earth under extreme heat. By use of titanium dioxide or several types of silicates, very high values of dielectric constant can be obtained.

In the disk form, silver is fired onto both side of the ceramic, to form the conductor plates. For tabular ceramics, the hollow ceramic tube has a silver coating plates on the inside and outside surfaces. Temperature Coefficient: It is given in parts per million per degree Celsius with the reference of 25C. Ceramic capacitors are often used for the temperature compensation, to increase or decrease capacitance with the rise in the temperature. RESISTOR NETWORKS: Thick film resistor networks have a Metal Glaze Element on the ceramic substrates with a strong clip construction terminal and are coated with special epoxy resin. They are most suitable to meet the density of modern PCB layouts.

67

Schematics Common: 1 2 3..n

Common parts are characterized by having a number of resistive elements all of the same nominal value. All elements are connected to pin1 Isolated:

Isolated parts are characterized by having number of resistive elements, all of the same nominal value. All elements are independent. DIODES A device having two terminals and has a low resistance to electrical current in one direction and a high resistance in the other direction. Diode is a two-element device which passes a signal in one direction only. They are used most commonly to convert AC to DC, because they pass the positive part of the wave, and block the negative part of the AC signal, or, if they are reversed, they pass only the negative part and not the positive part. Here we used only one type of diode:

68

The stripe stamped on one end of the diode shows indicates the polarity of the diode. The stripe shows the cathode side. The top two devices shown in the picture are diodes used for rectification. They are made to handle relatively high currents. The device on top can handle as high as 6A, and the one below it can safely handle up to 1A.However, it is best used at about 70% of its rating because this current value is a maximum rating. The third device from the top (red color) has a part number of 1S1588. This diode is used for switching, because it can switch on and off at very high speed. However, the maximum current it can handle is 120 mA. This makes it well suited to use within digital circuits. The maximum reverse voltage (reverse bias) this diode can handle is 30V. The device at the bottom of the picture is a voltage regulation diode with a rating of 6V. When this type of diode is reverse biased, it will resist changes in voltage. If the input voltage is increased, the output voltage will not change. (Or any change will be an insignificant amount.) While the output voltage does not increase with an increase in input voltage, the output current will. This requires some thought for a protection circuit so that too much current does not flow. The rated current limit for the device is 30 mA. Generally, a 3-terminal voltage regulator is used for the stabilization of a power supply. Therefore, this diode is typically used to protect the circuit from momentary voltage spikes. 3 terminal regulators use voltage regulation diodes inside. FEATURES: Low forward voltage drop. Diffused Junction High Current Capability

69

Вам также может понравиться