You are on page 1of 51

WIRELESS STEPPER MOTOR CONTROL USING RF

CHAPTER-1
ABSTRCT
The main idea of this project is to control the speed of a Stepper Motor by wire
less communication using RF technology which is implemented by an embedded
controller. In this we are using transceiver unit for wire less communication. To meet this
requirement we have designed an embedded system.

A machine that converts electrical power into mechanical power is called Motor.
Power devices are used in speed control circuits of STEPPER motors to get high reliable
operations at large currents. Various methods are available to control the speed of the
STEPPER motor; here we control the motor speed by applying the RF technology.

The controlling device controls the speed of the motor. Here there are mobile
keys, which serve the purpose of increasing or decreasing the speed of the motor. In this
stepper motor we are using where we want the stepping sequences. This speed of the
stepper motor varies in steps according to the selection of key over the particular range.

BLOCK DIAGRAM:
TRANSMITTER:

RF LCD
MICRO
MODULE CONTROLLER

RECEIVER:

LCD
RF MICRO
MODULE CONTROLLER

RRE

STEPPER
MOTOR
CONTROL
UNIT STEPPER
MOTOR

UNDERSTANDING OF: Embedded Controller, STEPPER Motor, LCD Module, RF
MODULE, Keil Compiler.

CHAPTER-2
SCHEMATIC DIAGRAM

10K PU LLU P

C
R8
R7
R6
R5
R4
R3
R2
R1
VC C
9
8
7
6
5
4
3
2
1

VC C
1 4 0
2 (O C 0 / T 0 ) P B 0 VC C 3 9
3 (T 1 ) P B 1 P A 0 /A D 0 3 8
X B E E (D O U T ) (R X D 1 ) P B 2 P A 1 /A D 1
4 3 7
X B E E (D IN ) (T X D 1 ) P B 3 P A 2 /A D 2
5 3 6
6 (S S ) P B 4 P A 3 /A D 3 3 5
F R O M IS P (M O S I ) P B 5 P A 4 /A D 4
7 3 4
F R O M IS P (M IS O ) P B 6 P A 5 /A D 5
8 3 3 V C C = 3 .3 V
F R O M IS P (S C K ) P B 7 P A 6 /A D 6 AD0
3 2 1 vcc 2 0
9 P A 7 /A D 7 3 1 2 DOUT AD1 1 9
R ESET R ESET P E 0 (IC P /IN T 2 ) PB 2 DIN AD2
3 1 8
1 0 30 PB 3 4 CD AD3 1 7
R 2O U T(M A X 32 3 2) 1 1 (R X D 0 ) P D 0 P E 1 (A L E ) 5 RESET AD6 1 6
T 2 IN ( M A X 3 2 3 2 ) 1 2 (T D X 0 ) P D 1 29 6 PWM0 AD5 1 5
1 3 (IN T 0 ) P D 2 P E 2 (O C 1 B ) 7 NC VREF 1 4
1 4 (IN T 1 ) P D 3 2 8 8 NC SLEEP 1 3
1 5 (O C 3 A ) P D 4 P C 7 (A 1 5 ) 2 7 9 DTR CTS 1 2
1 6 (O C 1 A ) P D 5 P C 6 (A 1 4 ) 2 6 10 GND AD4 1 1
1 7 (W R ) P D 6 P C 5 (A 1 3 ) 2 5
1 8 (R D ) P D 7 P C 4 (A 1 2 ) 2 4
XTA L2 XT A L2 P C 3 (A 1 1 )
P C 2 (A 1 0 )
2 3 GND X BEE MO D U LE
2 2
19 P C 1 (A 9 ) 2 1
XTA L1 XT A L1 P C 0 (A 8 )
20
G N D

GND A TM E G A 162
1

B R ID G E R E C T IF IE R
LM 1117T R E G U LA TO R V C C = 3 .3 V
2 2 - + 4 3 2
1 V IN VO U T VC C VC C
1 1 0 u f /6 3 V
GND 220 ohm 1 C1+ VCC 16
2 3 0 V ,A .C TRANSFORMER
(9V,1 AMP) 2 VS+ GND 15
33pf 104pf 1 0 u f /6 3 V
3

1 0 0 0 u f /3 5 V 3 C1- T1OUT 14
LED 4 C2+ R1IN 13 GND
5 C2- R1OUT 12
1 0 u f /6 3 V
P O W E R S U P P L Y 3 .3 V D C ) 6 VS– T1IN 11
GND
1 0u f/63 V 7 T2OUT T2IN 10
P 3 .1
VC C
8 R2IN R2OUT 9
P 3 .0
GND
3 MA X3232
22 pf 22K G N D 2
1
XTA L2
R ESET
1 I 2
PB6
S W IT C H

22 pf 8 .0 0 M H z 3 4 RS232 GND
PB7
XTA L1
0 .1 u f /3 5 V 5 S 6
R ESET
7 8
9 P 10
PB5
GND T it le
VC C W IR E L E S S C H A T IN G U S IN G R F (T X )
ATMEG A 162 C R YSTAL GND A T M E G A 1 6 2 IS P
S iz e D ocum ent N um ber R ev
R ESET A <D oc> <R ev C ode>

D a te : F r id a y , F e b r u a r y 2 0 , 2 0 0 9 Sheet 1 of 1

+ 4 3 2 1 V IN VO U T VC C VC C 1 1 0 u f /6 3 V GND 220 ohm 1 C1+ VCC 16 2 3 0 V .1 AMP) 2 VS+ GND 15 33pf 104pf 1 0 u f /6 3 V 3 1 0 0 0 u f /3 5 V 3 C1. F e b r u a r y 2 0 .3 V D C ) 6 VS– T1IN 11 GND 1 0u f/63 V 7 T2OUT T2IN 10 P 3 . 2 0 0 9 Sheet 1 of 1 .1 u f /3 5 V 5 S 6 R ESET 7 8 9 P 10 PB5 GND T it le VC C W IR E L E S S C H A T IN G U S IN G R F (T X ) ATMEG A 162 C R YSTAL GND A T M E G A 1 6 2 IS P S iz e D ocum ent N um ber R ev R ESET A <D oc> <R ev C ode> D a te : F r id a y . T1OUT 14 LED 4 C2+ R1IN 13 GND 5 C2.3 V F R O M IS P (S C K ) P B 7 P A 6 /A D 6 AD0 3 2 1 vcc 2 0 9 P A 7 /A D 7 3 1 2 DOUT AD1 1 9 R ESET R ESET P E 0 (IC P /IN T 2 ) PB 2 DIN AD2 3 1 8 1 0 30 PB 3 4 CD AD3 1 7 R 2O U T(M A X 32 3 2) 1 1 (R X D 0 ) P D 0 P E 1 (A L E ) 5 RESET AD6 1 6 T 2 IN ( M A X 3 2 3 2 ) 1 2 (T D X 0 ) P D 1 29 6 PWM0 AD5 1 5 1 3 (IN T 0 ) P D 2 P E 2 (O C 1 B ) 7 NC VREF 1 4 1 4 (IN T 1 ) P D 3 2 8 8 NC SLEEP 1 3 1 5 (O C 3 A ) P D 4 P C 7 (A 1 5 ) 2 7 9 DTR CTS 1 2 1 6 (O C 1 A ) P D 5 P C 6 (A 1 4 ) 2 6 10 GND AD4 1 1 1 7 (W R ) P D 6 P C 5 (A 1 3 ) 2 5 1 8 (R D ) P D 7 P C 4 (A 1 2 ) 2 4 XTA L2 XT A L2 P C 3 (A 1 1 ) P C 2 (A 1 0 ) 2 3 GND X BEE MO D U LE 2 2 19 P C 1 (A 9 ) 2 1 XTA L1 XT A L1 P C 0 (A 8 ) 20 G N D GND A TM E G A 162 1 B R ID G E R E C T IF IE R LM 1117T R E G U LA TO R V C C = 3 .C TRANSFORMER (9V.RECEIVER: 10K PU LLU P C R8 R7 R6 R5 R4 R3 R2 R1 VC C 9 8 7 6 5 4 3 2 1 VC C 1 4 0 2 (O C 0 / T 0 ) P B 0 VC C 3 9 3 (T 1 ) P B 1 P A 0 /A D 0 3 8 X B E E (D O U T ) (R X D 1 ) P B 2 P A 1 /A D 1 4 3 7 X B E E (D IN ) (T X D 1 ) P B 3 P A 2 /A D 2 5 3 6 6 (S S ) P B 4 P A 3 /A D 3 3 5 F R O M IS P (M O S I ) P B 5 P A 4 /A D 4 7 3 4 F R O M IS P (M IS O ) P B 6 P A 5 /A D 5 8 3 3 V C C = 3 . R1OUT 12 1 0 u f /6 3 V P O W E R S U P P L Y 3 .0 0 M H z 3 4 RS232 GND PB7 XTA L1 0 .1 VC C 8 R2IN R2OUT 9 P 3 .0 GND 3 MA X3232 22 pf 22K G N D 2 1 XTA L2 R ESET 1 I 2 PB6 S W IT C H 22 pf 8 .3 V 2 2 .A .

Complete studies of all the above points are useful to develop this project.e. the RF TLP and RLP (434) modules are used. POWER SUPPLY SECTION: In-order to work with any components basic requirement is power supply. therefore we need a step-down transformer that reduces the line voltage to certain voltage that will help us to convert it in to a 5V DC. 1) Designing the power supply for the entire circuitry. we came to a conclusion to choose a transformer. whose secondary voltage is 3 . In this section there is a requirement of two different voltage levels. For wireless communication. Now the aim is to design the power supply section which converts 230V AC in to 5V DC. Since 230V AC is too high to reduce it to directly 5V DC. 2) Selection of microcontroller that suits our application. Those are 1) 5V DC power supply. Here the stepper motor is connected to the receiver circuit and is controlled through the transmitter. 4) Selection of LCD. In order to fulfill this application there are few steps that has been performed i. CHAPETR-3 CIRCUIT DESCRIPTION DESIGNING: Since the main intension of this project is to design a wireless stepper motor control using RF. 3) Selection of RF Module. Considering the efficiency factor of the bridge rectifier.

since there is no requirement for any negative voltage for our application. For this application 0-9V transformers is used. Even though the efficiency of full wave and bridge rectifier are the same. because half wave rectifier has we less in efficiency. it feed to rectifier that converts AC to pulsating DC.e. Since the output voltage of the rectifier is pulsating DC. The output of the transformer is 9V AC. Those are 1) 8051 Family 2) AVR microcontroller Family 3) PIC microcontroller Family 4) ARM Family Basic AVR family is enough for our application. hence we are not concentrating on higher end controller families. The most easy way to regulate this voltage is by using a 7805 voltage regulator. SELECTION OF MICROCONTROLLER: As we know that there so many types of micro controller families that are available in the market.to 4 V higher than the required voltage i. since it is easily available in the market. In order to fulfill our application basic that is . As we all know that there are 3 kind of rectifiers that is 1) half wave 2) Full wave and 3) Bridge rectifier Here we short listed to use Bridge rectifier. 5V. whose output voltage is constant 5V DC irrespective of any fluctuation in line voltage. we gone with bridge rectifier. in order to convert it into pure DC we use a high value (1000UF/1500UF) of capacitor in parallel that acts as a filter.

Ideally suited for interfacing between low-level logic circuitry and multiple peripheral power loads .ATMEGA162 controller is enough. high-current Darlington arrays feature continuous load current ratings to 500mA for each of the seven drivers. SELECTION OF STEPPER MOTORS: . the series ULN20xxA/L high-voltage . Those are: 1) power supply section 2) Pull-ups for ports. high-current darlighton driver comprised of seven NPN darlington pairs . flat panel made up of any number of color or monochrome pixels filled with liquid crystals and arrayed in front of a light source (backlight) or reflector. SELECTION OF LCD: A liquid crystal display (LCD) is an electronically-modulated optical device shaped into a thin. ltd) ULN 2003 is high-voltage . SELECTION OF ULN 2003 The UTC(unisonic technologies co. There are minimum requirements for proper operation of microcontroller. 3) Reset circuit 4) Crystal circuit 5) ISP circuit (for program dumping) Reset circuit is used to reset the microcontroller. Crystal circuit is used for the microcontroller for timing pluses.

direction . CONNECTION OF RF: . HVAC control. step angle . CONNECTIONS OF LCD: We can connect LCD in 8 bit mode or 4 bit mode. In such applications. CONNECTIONS OF TRANSMITTEER SECTION: a. wireless telemetry. so we can use 4 bit mode to reduce pins . CONNECTION OF RF: In this project I am using RF module to transfer the data from one place to another place. SELECTION OF RF MODULE: RF Communication is a wireless technology developed as an open global standard to address the needs of low-cost. if use 8 bit mode more pins necessary to interface LCD. low-power. CONNECTIONS RECEIVER SECTION: a. heating control and environmental control. operating modes( single coil or double coil). b. smoke and CO detectors. AMR (automatic meter reading). and wherever an accurate positioning is required .In this project i used 4 bit mode and it is connected to PORT0. robots.Stepper Motor is widely used in CNC machine drives . RF enables the broad-based deployment of wireless networks that can run for years on inexpensive batteries for monitoring applications such as lighting controls. The data pins of RF encoder are connected to the PORT2 pins of controller. speed and position are important considerations.

so we can use 4 bit mode to reduce pins .In this project I used 4 bit mode and it is connected to PORT 0.Whenever the switches are pressed micro controller send the data trough RF module. if use 8 bit mode more pins necessary to interface LCD. In this project I am using RF module to transfer the data from one place to another place.In this project switches are connected to Microcontroller port pins. CONNECTIONS OF LCD: We can connect LCD in 8 bit mode or 4 bit mode. the RF receive module will receive the data and send to the micro controller. based on the received commands the micro controller will control the stepper motor rotating directions. PORT2 pins are connected to the ULN2003 driver inputs and the corresponding outputs are connected to the Stepper motor. b. The data pins of RF decoder are connected to the PORT2 of controller. In the receiver section. CIRCUIT OPERATION: In this application we are using RF to transmit as well as to receive the data . c. CONNECTIONS OF STEPPER MOTOR: Stepper motor is connected to the micro controller thought the ULN 2003 motor driver. Here the stepper motor is connected to the micro controller through the motor driver (ULN2003) . .

Embedded systems technologies are usually fairly expensive due to the necessary development time and built in efficiencies. Embedded systems designers usually have a significant grasp of hardware technologies. Whereas a regular computer has many different applications and software that can be applied to various tasks. but they are also highly valued in specific industries. Another way to think of an embedded system is as a computer system that is created with optimal efficiency. INTRODUCTION TO EMBEDDED SYSTEMS Embedded systems are electronic devices that incorporate microprocessors with in their implementations. Or in other words embedded computer systems are electronic systems that include a microcomputer to perform a specific dedicated application. Embedded systems are ubiquitous. or adding new features are only matter of rewriting the software that controls the device. making modifications. Embedded systems are self-contained programs that are embedded within a piece of hardware. Every week millions of tiny computer chips come pouring out of factories finding their way into our everyday products. The main purposes of the microprocessors are to simplify the system design and provide flexibility. companies offer embedded systems development kits and other embedded systems tools for use by engineers and businesses. They use specific programming languages and software to develop embedded systems and manipulate the equipment. . Smaller businesses may wish to hire a consultant to determine what sort of embedded systems will add value to their organization. thereby allowing it to complete specific functions as quickly as possible. When searching online. CHAPTER-4 INTRODUCTION 1. embedded systems are usually set to a specific task that cannot be altered without physically manipulating the circuitry. Having a microprocessor in the device helps in removing the bugs. The computer is hidden inside these products.

CHARACTERISTICS: Two major areas of differences are cost and power consumption.g. embedded systems often use peripherals controlled by synchronous serial interfaces. 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. Firmware is usually developed and tested too much harsher requirements than is general-purpose software. and a small keypad and LCD screen may be used instead of a PC's keyboard and screen. e. The slowness is not just clock speed. in one or more ROM/Flash memory IC chips. for which the CPU was purchased as intellectual property to add to the IC's design. One common configuration for embedded systems is the system on a chip. Programs on an embedded system often run with real-time constraints with limited hardware resources: often there is no disk drive. Since many embedded systems are produced in tens of thousands to millions of units range. Embedded systems are routinely expected to maintain 100% reliability while running continuously for long periods. reducing cost is a major concern. A flash drive may replace rotating media. sometimes measured in years. which can usually be easily restarted if a problem occurs. keyboard or screen. an application-specific integrated circuit. PLATFORM: There are many different CPU architectures used in embedded designs. Firmware is the name for software that is embedded in hardware devices. Embedded systems often use a (relatively) slow processor and small memory size to minimize costs. The whole architecture of the computer is often intentionally simplified to lower costs. operating system. . For example. which are ten to hundreds of times slower than comparable peripherals used in PCs.

Those software tools can come from several sources: Software companies that specialize in the embedded market Ported from the GNU software development tools. with breakpoints and single stepping. DEBUGGING: Debugging is usually performed with an in-circuit emulator. assemblers and debuggers to develop an embedded system. Embedded system designers also use a few software tools rarely used by typical computer programmers. so that they can include any kind of data in a program. or a specialized embedded operating system (often a real-time operating system). The microcode interrupt lets the debugger operate in hardware in which only the CPU works. embedded system designers use compilers. Some designers keep a utility program to turn data files into code. The CPU- based debugger can be used to test and debug the electronics of the computer from the viewpoint of the CPU. or some type of debugger that can interrupt the micro controller’s internal microcode. or the programmer is assigned to port one of these to the new system.TOOLS: Like a typical computer programmer. because these features are widely . Sometimes. OPERATING SYSTEM: They often have no operating system. so it can check its program data before executing it. development tools for a personal computer can be used if the embedded processor is a close relative to a common PC processor. Most designers also have utility programs to add a checksum or CRC to a program. Developers should insist on debugging which shows the high-level language.

to indicate program execution progress and/or errors. START-UP: All embedded systems have start-up code. or . Usually it disables interrupts. developers should write and use simple logging facilities to debug sequences of real-time events. code-reviews and ego less programming are recommended. Many designers have found one of more hardware plus software- controlled LED’s useful to indicate errors during development (and in some instances.available. whereupon the software turns it on at the first opportunity. PC or mainframe programmers first encountering this sort of programming often become confused about design priorities and acceptable methods. Mentoring. sets up the electronics. the software has a loop. Each subroutine manages a part of the hardware or software. after product release. tests the computer (RAM. The loop calls subroutines. This serves to reassure most technicians/engineers and some users. DESIGN OF EMBEDDED SYSTEMS: The electronics usually uses either a microprocessor or a microcontroller. the software blinks the LED(s) or sets up light patterns during normal operation. to prove that the hardware and start-up software have performed their job so far. and then starts the application code. CPU and software). Also. Restart times under a tenth of a second are common. to produce troubleshooting diagnostics). THE CONTROL LOOP: In this design. After that. Some large or old systems use general-purpose mainframes computers or minicomputers. A common scheme is to have the electronics turn off the LED(s) at reset. Interrupts generally set flags. Many embedded systems recover from short-term power failures by restarting (without recent self-tests).

and restores the preceding interrupt state in the outermost enable. Designers recommend that hierarchical state machines should run the lower-level state machines before the higher. and a software timer. C or assembly.update counters that are read by the rest of the software. This system's strength is its simplicity. to keep the tables small and cheap. and storing the result so the logic acts on consistent values. Typically. anyway). so the higher run with accurate information. Instead of complex calculations. Another advantage is . Hardware events fail about once in a trillion times. A change of state stores a different function into the pointer. it handles nested calls in nested subroutines. The software can interpolate between entries. A simple API disables and enables interrupts. State machines may be implemented with a function-pointer per state- machine (in C++. Many designers recommend reading each IO device once per loop. using a periodic real time interrupt. or flag is set. When a timer expires. an associated subroutine is run. 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. Thus interrupt code can run at very precise timings. the code looks up the values. Done right. Usually this is a hardware event. and on small pieces of software the loop is usually so fast that nobody cares that it is not predictable. Any expected hardware event should be backed-up with a software timer. One major disadvantage of this system is that it does not guarantee a time to respond to any particular hardware event. This is one of the simplest methods of creating an exocrine. The function pointer is executed every time the loop runs. Many designers prefer to design their state machines to check only one or two things per state. there's some sort of subroutine in the loop to manage a list of software timers. Complex functions like internal combustion controls are often handled with multi-dimensional tables. Careful coding can easily assure that nothing disables interrupts for long.

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

They are also used in automobiles. such as sensors. power consumption. INTRODUCTION TO MICROCONTROLLER Microcontrollers as the name suggests are small controllers. availability. They are like single chip computers that are often embedded into other systems to function as processing/controlling unit.. there is only one application software that is typically burned into ROM. keyboard. size. switches. toys . displays. Many microcontroller designs typically mix multiple interfacing methods. On . Many interface methods have been developed over the years to solve the complex problem of balancing circuit design criteria such as features. reliability. For example the remote control you are using probably has microcontrollers inside that do decoding and other controlling functions. a micro-controller system can be viewed as a system that reads from (monitors) inputs. washing machines. Micro-controllers are useful to the extent that they communicate with other devices. cost. An embedded product uses a microprocessor or microcontroller to do one task only. motors. or components for receiving and sending data must be added to it. where automation is needed. In order for a microprocessor to be used. memory and even other micro-controllers. First and the most important is its functionality. manufacturability. Embedded system means the processor is embedded into the required application. etc.. In a very simplistic form.2. other components such as memory. keypads.A single chip that contains the CPU or most of the computer Microcontroller . microwave ovens. In short that means that microprocessor is the very heart of the computer. In an embedded system. performs processing and writes to (controls) outputs.A single chip used to control other devices Microcontroller differs from a microprocessor in many ways. weight. Example: printer. video game player Microprocessor .

RAM. it gives rise to an electro magnetic field that propagates through space. MICROPROCESSOR VS MICROCONTROLLER: Microprocessor:  CPU is stand-alone.the lowest allocated wireless communications frequency (it's within the range of human hearing). we save the time and space needed to construct devices. . When an RF current is supplied to an antenna. microcontroller is designed to be all of that in one. I/O ports • for applications in which cost. I/O and timer are all on a single chip • fix amount of on-chip ROM. This field is sometimes called an RF field.the other hand. ROM. These frequencies cover a significant portion of the electromagnetic radiation spectrum. extending from nine kilohertz (9 kHz). INTRODUCTION TO RF (RADIO FREQUENCY) MODULE Radio frequency (RF) is a term that refers to alternating current (AC) having characteristics such that. ROM. timer are separate  Designer can decide on the amount of ROM. power and space are critical • single-purpose 3. No other external components are needed for its application because all necessary peripherals are already built into it. I/O. RAM. RAM. if the current is input to an antenna. RAM and I/O ports.  expensive  versatility general-purpose Microcontroller: • CPU. Thus. an electromagnetic (EM) field is generated suitable for wireless broadcasting and/or communications. to thousands of gigahertz(GHz).

Examples include most television-set remote-control boxes. communication with 100. radio and television broadcast stations. satellite communications systems." Any RF field has a wavelength that is inversely proportional to the frequency. and a few wireless hi-fi stereo headsets.000– low ELF 3–30 Hz sound. ultraviolet (UV). communication with mines . The RF spectrum is divided into several ranges or bands.000 km frequency submarines Super low 1. Some wireless devices operate at IR or visible-light frequencies. the free-space wavelength is approximately 33 kilometers (km). The frequency of an RF signal is inversely proportional to the wave length of the EM field to which it corresponds. EM energy takes the form of infrared (IR). the EM wavelengths measure approximately one millimeter (1 mm). visible. Many types of wireless devices make use of RF fields.in less technical jargon it is a "radio wave. At the highest radio frequencies. At 9 kHz. each band represents an increase of frequency corresponding to an order of magnitude (power of 10). some cordless computer keyboards and mice. whose electromagnetic wavelengths are shorter than those of RF fields.000– Directly audible when converted to SLF 30–300 Hz frequency 10. Cordless and cellular telephone.000 km sound. With the exception of the lowest-frequency segment. FREQUENCIES: Name Symbol Frequency Wavelength Applications Extremely Directly audible when converted to 10. and two-way radio services all operate in the RF spectrum. AC power grids (50–60 Hz) Ultra low 300– 100– Directly audible when converted to ULF frequency 3000 Hz 1. The SHF and EHF bands are often referred to as the microwave spectrum. As the frequency is increased beyond that of the RF spectrum. X rays. and gamma rays.000 km sound. showing frequency and bandwidth ranges. The table depicts the eight bands in the RF spectrum.

GPR Wireless networking. amateur radio. cordless Ultra high 300– UHF 10–100 cm telephones. aviation. satellite links. maritime and aviation frequency 3000 kHz communication High Shortwave. wireless networking. satellite television. mobile telephones. Directly audible when converted to Very low VLF 3–30 kHz 10–100 km sound (below ca. citizens' HF 3–30 MHz 10–100 m frequency band radio Very high 30– FM broadcasting. frequency door openers Microwave data links. 20 kHz. INTRODUCTION TO KIEL SOFTWARE . remote sensing. frequency 3000 MHz remote keyless entry for automobiles. Super high SHF 3–30 GHz 1–10 cm microwave links. low FER Navigational beacons. VHF 1–10 m frequency 300 MHz broadcast television. amateur radio. high EHF 1–10 mm 300 GHz advanced weapons systems. radio Extremely 30– astronomy. GPR Broadcast television. microwave ovens. AM Medium 300– MF 100–1000 m broadcasting. amateur radio. navigational LF 1–10 km frequency 300 kHz beacons. advanced frequency security scanning 4. or frequency ultrasound otherwise) Low 30– AM broadcasting.

Many companies provide the 8051 assembler. you must:  Select Project–Open Project (For example. CREATING YOUR OWN APPLICATION IN UVISION2: To create a new project in uVision2.Rebuild all target files or Build target.New Project. Kiel is one of them. and link) an application in uVision2. assembles. It encapsulates the following components:  A project manager  A make facility  Tool configuration  Editor  A powerful debugger To get start here are some several example programs BUILDING AN APPLICATION IN UVISION2: To build (compile.UV2)  Select Project .  Select a directory and enter the name of the project file. and debug embedded programs. \C166\EXAMPLES\HELLO\HELLO. and links the files in your project. the size of code for these shareware versions is limited and we have to consider which assembler is suitable for our application. We can download them from their Websites. KIEL U VISION2: This is an IDE (Integrated Development Environment) that helps you write. compile. . you must:  Select Project . some of them provide shareware version of their product on the Web. assemble. However. UVision2 compiles.

and add the source files to the project. Groups. you must:  Select Debug . DEBUGGING AN APPLICATION IN UVISION2: To debug an application created using uVision2. select Source Group1. Add/Files.  Use the Step toolbar buttons to single-step through your program. C251.  Debug your program using standard options like Step. LIMITATIONS OF EVALUATION SOFTWARE: The following limitations apply to the evaluation versions of the C51.  Select Project . APPLICATIONS:  Select Project .Options and set the tool options. You only need to configure the memory map of your target hardware.Start/Stop Debug Session. Note when you select the target device from the Device Database all-special options are set automatically.  Select Project . Programs that generate more than 2 .  Select Project . Default memory model settings are optimal for most. linker.Rebuild all target files or Build target. and so on. or C16x/ST10 device from the Device  Database  Create source files to add to the project. Break. or C166 tool chains.Targets. and debugger are limited to 2 Kbytes of object code but source Code may be any size. 251.Select Device and select an 8051. You may enter G. C51 Evaluation Software Limitations:  The compiler. Go.  Open the Serial Window using the Serial #1 button on the toolbar. and Files. assembler. main in the Output Window to execute to the main C function.

in u vision2.  No hardware support is available for multiple DPTR registers. We are constantly adding new devices and simulation support for on-chip peripherals so be sure to check Device Database often. To discover which peripherals of a device are supported. Select the Simulated Peripherals item from the Help menu.  The debugger supports files that are 2 Kbytes and smaller. . EVALUATION SOFTWARE:  Code-Banking Linker/Locator  Library Manager. Kbytes of object code will not compile. assemble.  RTX-51 Tiny Real-Time Operating System PERIPHERAL SIMULATION: The u vision2 debugger provides complete simulation for the CPU and on chip peripherals of most embedded devices.  No support is available for user libraries or floating-point arithmetic.  Programs begin at offset 0x0800 and cannot be programmed into single-chip devices. You may also use the web-based device database. or link the startup code generated includes LJMP's and cannot be used in single-chip devices supporting Less than 2 Kbytes of program space like the Philips 750/751/752.

CHAPTER-5 COMPONENT DESCRIPTION MICROCONTROLLER 89S52 FEATURES:  8K Bytes of In-System Reprogrammable Flash Memory  Endurance: 1.AT89S52: . PIN DIAGRAM . By combining a versatile 8-bit CPU with Flash on a monolithic chip. The on- chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. which provides a highly flexible and cost-effective solution to many embedded control applications. the Atmel AT89C52 is a powerful microcomputer. high-performance CMOS 8-bit microcomputer with 8Kbytes of Flash programmable and erasable read only memory (PEROM).000 Write/Erase Cycles  Fully Static Operation: 0 Hz to 24 MHz  256 x 8-bit Internal RAM  32 Programmable I/O Lines  Three 16-bit Timer/Counters  Eight Interrupt Sources  Programmable Serial Channel  Low-power Idle and Power-down Modes DESCRIPTION: The AT89C52 is a low-power.

PIN DESCRIPTION: VCC .Pin diagram of 89S52.Supply voltage. GND . Port 0: .Ground.

the pins can be used as high-impedance inputs. External pull-ups are required during program verification. The Port 1 output buffers can sink/source four TTL inputs. As inputs. In this application.0 and P1. Port 0 can also be configured to be the multiplexed low-order address/data bus during accesses to external program and data memory. PORT PIN ALTERNATE FUNCTIONS: P1. Port 0 also receives the code bytes during Flash programming and outputs the code bytes during program verification. Port 1: Port 1 is an 8-bit bi-directional I/O port with internal pull-ups.1 T2EX (Timer/Counter 2 capture/reload trigger and direction control Port 2: Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. During accesses to external data memory that uses 8-bit addresses (MOVX @ RI). Port 2 uses strong internal pull-ups when emitting 1s.1/T2EX). Port 0 is an 8-bit open drain bi-directional I/O port. When 1s are written to port 0 pins.0 T2 (external count input to Timer/Counter 2). In this mode.1 can be configured to be the timer/counter 2 external count input (P1.0/T2) and the timer/counter 2 trigger input (P1. each pin can sink eight TTL inputs. As an output port. 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 addition. The Port 2 output buffers can sink/source four TTL inputs. they are pulled high by the internal pull-ups and can be used as inputs. Port 1 pins that are externally being pulled low will source current (I IL) because of the internal pull-ups. they are pulled high by the internal pull-ups and can be used as inputs. Port 2 pins that are externally being pulled low will source current (I IL) because of the internal pull-ups. respectively. As inputs. P0 has internal pull-ups. Port 2 . When 1s are written to Port 1 pins. clock-out P1. When 1s are written to Port 2 pins. P1. Port 2 emits the contents of the P2 Special Function Register.

The Port 3 output buffers can sink/source four TTL inputs. Port 3: Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. Port 3 also receives some control signals for Flash programming and verification.3 INT1 (external interrupt 1) P3.6 WR (external data memory write strobe) P3.4 T0 (timer 0 external input) P3.also receives the high-order address bits and some control signals during Flash programming and verification. they are pulled high by the internal pull-ups and can be used as inputs. As inputs.2 INT0 (external interrupt 0) P3. When 1s are written to Port 3 pins.5 T1 (timer 1 external input) P3. Port 3 also serves the functions of various special features of the AT89C51. This pin is also the program pulse input (PROG) during flash programming.1 TXD (serial output port) P3. In normal operation.0 RXD (serial input port) P3. A high on this pin for two machine cycles while the oscillator is running resets the device. PORT PIN ALTERNATE FUNCTIONS: P3. Port 3 pins that are externally being pulled low will source current (I IL) because of the pull- ups. RST: Reset input.7 RD (external data memory read strobe). ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used for external timing or clocking . ALE/PROG: Address Latch Enable is an output pulse for latching the low byte of the address during accesses to external memory.

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

BLOCK DIAGRAM OF 89S52: EXTERNAL INTERRUPTS TIMER/CO UNTER INTERRUPT ON-CHIP ON- CONTROL ROM FOR CHIP TIMER 1 COUNTER PROGRAM RAM INPUTS CODE TIMER 0 CPU BUS 4 I/O SERIAL OSC CONTROL PORTS PORT P0 P1 P2 P3 Tx Rx .

ARCHITECHTURE OF 8052 MICROCONTROLLER: .

Architecture of 89S52 .

XTAL2 should be left unconnected while XTAL1 is driven. It should be noted that when idle is terminated by a hardware reset. The idle mode can be terminated by any enabled interrupt or by a hardware reset. from where it left off. To eliminate the possibility of an unexpected write to a port pin when Idle is terminated by reset. of an inverting amplifier. since the input to the internal clocking circuitry is through a divide-by-two flip-flop. On-chip hardware inhibits access to internal RAM in this event. the CPU puts itself to sleep while all the on-chip peripherals remain active. OSCILLATOR CONNECTIONS: . respectively. The mode is invoked by software. The content of the on-chip RAM and all the special functions registers remain unchanged during this mode. Either a quartz crystal or ceramic resonator may be used. but minimum and maximum voltage high and low time specifications must be observed. the device normally resumes program execution. There are no requirements on the duty cycle of the external clock signal. but access to the port pins is not inhibited. which can be configured for use as an on-chip oscillator.OSCILLATOR CHARACTERISTICS: XTAL1 and XTAL2 are the input and output. up to two machine cycles before the internal reset algorithm takes control. IDLE MODE: In idle mode. To drive the device from an external clock source. the instruction following the one that invokes Idle should not be one that writes to a port pin or to external memory.

OSCILLATOR CONNECTIONS: Note: C1. C2 = 30 pF ± 10 pF for Crystals = 40 pF ± 10 pF for Ceramic Resonators External Clock drives Configuration. .

5-12V operation  4. FEATURES:  1.11mA current consumption at 3V  Small size  DBm output power at 3V etc. The transmitter employs a SAW-stabilized oscillator. The manufacturing-friendly SIP style package and low-cost make the STT- 433 suitable for high volume applications.433.1. Output power and harmonic emissions are easy to control. RF MODULE OVERVIEW: The STT-433 is ideal for remote control applications where low cost and longer range is required. Low Cost  3. ensuring accurate frequency control for best range performance.5-12V supply. 2. making it ideal for battery-powered applications. The transmitter operates from a 1. making FCC and ETSI compliance easy. APPLICATIONS:  Remote Keyless Entry (RKE)  Remote Lighting Controls  On-Site Paging  Asset Tracking  Wireless Alarm and Security Systems  Long Range RFID  Automated Resource Management .92 MHz Frequency  2.

DIAGRAM OF TRANSMITTER AND RECEIVER: TRANSMITTER (TLP434A): RECEIVER (RLP434A): .

it can take up to 750mSec for the data output to become valid.SPECIFICATIONS: POWER SUPPLY: The STR-433 is designed to operate from a 5V power supply. ANTENNA INPUT: .7uF tantalum capacitor.1uF low-ESR ceramic capacitor and a 4. It is crucial that this power supply be very quiet. These capacitors should be placed as close to the power pins as possible. The power supply should be bypassed using a 0. The STR-433 is designed for continuous duty operation. From the time power is applied.

A data zero is supposed to be the absence of a data zero. It will support most antenna types. it should be a 50 ohm micro strip. Because we have a limiting amplifier with a gain of ×2000. including printed antennas integrated directly onto the PCB and simple single core wire of about 17cm. PIN DESCRIPTION: IMPROVED MODULATION: A striking weakness of our RF transmission system is that we do not transmit data zeros. Any time a trace is longer than 1/8th the wavelength of the frequency it is carrying. The performance of the different antennas varies. We transmit only data ones. the moment a powerful data one disappears .

This Transmitter is ideal for remote control projects or data transfer to a remote object. This compact unit operates from only 2V up to 12V and we are using 5v as the microcontroller operates in the same range. 433 MHz lingering from a previous data one can induce a false zero. which is possible with an antenna fitted and when 12V battery is used. This has a range of up to 200m.92MHz) which is an Ultra Small Wireless module. and so we can get false zeros. At close ranges. RF RECEIVER (RLP434A): . This module can work directly with HT12D or similar decoder. We begin to amplify whatever interference or noise our antenna might be receiving. CIRCUIT DESCRYPTION: RF TRANSMITTER (TLP434A): TLP434A V C C C 1 10UF 1 2 3 4 E 1 A N TE N N A Circuit Diagram of RF transmitter The RF transmitter module for this project is TLP434A (433.

8 KHz. In this receiver end too we are using 5V power supply as the operational voltage of the microcontroller is the same. without the need for a hard-wired connection. This is suitable for data rates of up to 4. R LP 434A J 2 1 2 3 4 V C C C 4 5 6 E 1 7 A N TE N N A 8 Circuit diagram of RF receiver The RLP434A is a Compact Radio Receiver (RF) which works directly with the TLP434A transmitter on an operating frequency of 433. The Receiver collects the data and sends it to the Microcontroller PINS OUT OF RECEIVER: . where commands can be sent directly to the robot.92MHz.5mA. and the typical operating current is only 4. This is an ideal device for many applications. including robots.

direction .3. These coils produce a magnetic field when suitable current flows through them this field produces a torque in the rotor which makes it rotate. robots. Because of this precise position controllability . WHAT IS A STEPPER MOTOR ?? stepper motor is a simple dc motor with a permanent magnet rotor and a stator with armature consisting of coils. speed and position are important considerations. stepper motors are excellent for applications that require high positioning accuracy. and wherever an accurate positioning is required . These motors have usually 5 -6 wires coming out of them where 1 . INTRODUCTION TO STEPPER MOTOR Stepper Motor is widely used in CNC machine drives . step angle .8 degrees / step . In such applications.Well these are a little more complicated to control than the simple DC motors but these provide exact step wise rotation with an overall turn of 1.The ones available in the market are basically uni-polar stepper motors which means that they have four coils which independently control the rotation . The step wise motion can be easily controlled by a stepper controller which is a simple circuit which takes digital logic and then uses it to turn the motor step wise . Stepper . These motors are recommended where the positioning of the motor is to be taken into consideration and exact rotation of the motor shaft is required .2 are common ground. The shaft of a stepper motor moves between discrete rotary positions typically separated by a few degrees . operating modes( single coil or double coil).

from one position . to the next. stepper motor is a simple dc motor with a permanent magnet rotor and a stator with armature consisting of coils. These motors have usually 5 -6 wires coming out of them where 1 .The ones available in the market are basically uni-polar stepper motors which means that they have four coils which independently control the rotation . Stepper motors have several electromagnetic coils that must be powered sequentially to make the motor turn .2 are common ground. computer printer head positioning . a stepper motor can be made to reverse direction . or step . Typical stepper motors have two or four coils.motors are used in X-Y scanners . plotters . The step wise motion can be easily controlled by a stepper controller which is a simple circuit which takes digital logic and then uses it to turn the motor step wise . These coils produce a magnetic field when suitable current flows through them this field produces a torque in the rotor which makes it rotate. robots. operating modes( single coil or double coil). speed and position are important considerations. stepper . and numerous other applications. step angle . By reversing the order that the coils are powered .Well these are a little more complicated to control than the simple DC motors but these provide exact step wise rotation with an overall turn of 1. Because of this precise position controllability . The rate at which the coils are respectively energized determines the velocity of the motor up to a physical limit. Stepper Motor is widely used in CNC machine drives . and machine tools . and wherever an accurate positioning is required . In such applications. direction . The shaft of a stepper motor moves between discrete rotary positions typically separated by a few degrees . floppy and hard disk drive head positioning . These motors are recommended where the positioning of the motor is to be taken into consideration and exact rotation of the motor shaft is required .8 degrees / step .

high-current darlighton driver comprised of seven NPN darlington pairs . All devices are pinned with outputs opposite inputs to facilitate ease of Circuit board layout . to the next. 4. The ULN2003 A/L are the standard darlington arrays . The ULN2003A/L have series input resisters selected for operation directly with 5V TTL or CMOS. Ideally suited for interfacing between low-level logic circuitry and multiple pheripheral power loads . the series ULN20xxA/L high-voltage . Outputs may be paralleled for higher load current capability. and machine tools . . Stepper motors are used in X-Y scanners . a stepper motor can be made to reverse direction . The rate at which the coils are respectively energized determines the velocity of the motor up to a physical limit. All devices are rated for operation over the temperature range of -20˚ C to 85˚ C .The outputs are capable of sinking 500mA and will with stand atleast 50V in the OFF state. from one position . By reversing the order that the coils are powered . FEATURES  Output current (single output) 500mA MAX .mountable SOIC’s . floppy and hard disk drive head positioning . high-current Darlington arrays feature continuous load current ratings to 500mA for each of the seven drivers. ULN 2003 LINEAR INTEGRATED CIRCUIT DESCRIPTION The UTC(unisonic technlogies co. ltd) ULN 2003 is high-voltage . Typical stepper motors have two or four coils.motors are excellent for applications that require high positioning accuracy. Stepper motors have several electromagnetic coils that must be powered sequentially to make the motor turn .The darlington arrays are furnished in 16-pin Dual-in-line plastic package and 16-lead surface. and numerous other applications. computer printer head positioning . or step .  High sustaining voltage output 50V MIN . plotters .

 Output clamp diodes .  Inputs compatible with various types of logic . .  Dual In-Line Plastic Package or Small-Outline IC Package.

.

cmd_lcd(0x01). display_lcd("DIRECTION CONTROL"). sbit sw3=P2^0.Black ///// #include<reg52. motor=0x00. void reverse(unsigned int). unsigned int a=10.h> #include<lcd. void forward(unsigned int). void main() { init_lcd(). display_lcd("STEPPER MOTOR"). sbit sw2=P2^1. CHAPTER-6 SOURCE CODE //Red. motor=0x00. void stop(). delay_ms(100). #define motor P1 sbit sw1=P2^2. delay_ms(5). motor=0x00. cmd_lcd(0xc0).Yellow. delay_ms(5).h> void delay_us(unsigned int i). init_lcd(). delay_ms(5). .White. motor=0x00. delay_ms(5).

display_lcd("CLOCK WISE"). display_lcd("ANTI-CLOCK WISE"). display_lcd("MOTOR ROTATE IN "). cmd_lcd(0xc0). } else if(sw2==1) a=a+1. if(sw1==1) . } else if(sw2==1) { cmd_lcd(0x01). if(sw1==1) { if(a!=1) a=a-1. do{ reverse(a). }while(sw3==0). while(1) { if(sw1==1) { cmd_lcd(0x01). display_lcd("MOTOR ROTATE IN"). delay_ms(1500). stop(). do{ forward(a). cmd_lcd(0xc0).

//9A65 motor=0x33. delay_ms(n). //for CW direction "936C" delay_ms(n). } else if(sw3==1) stop(). }while(sw3==0). motor=0x66. delay_ms(n). { if(a!=1) a=a-1. . motor=0x66. } void forward(unsigned int n) { motor=0xcc. } else if(sw2==1) a=a+1. delay_ms(n). motor=0xcc. delay_ms(n). } } void reverse(unsigned int n) { motor=0x99.

motor=0x00. delay_ms(n). while(i-->0). motor=0x00. motor=0x99. motor=0x00. delay_ms(5). motor=0x33. display_lcd("STOP CONDITION"). } void delay_us(unsigned int i) { unsigned int j. } void stop() { cmd_lcd(0x01). display_lcd("MOTOR IS IN"). delay_ms(n). motor=0x00. cmd_lcd(0xc0). delay_ms(n). delay_ms(5). delay_ms(5). } . delay_ms(5).

8051 Microcontroller Architecture. Pearson Education. CHAPTER-7 REFERENCE TEXT BOOKS REFERED: 1. 2. “The 8051 Microcontroller and Embedded Systems” by Muhammad Ali Mazidi and Janice Gillispie Mazidi. programming and application by KENNETH JAYALA .

ATMEL 89s52 Data sheets 4. 3.atmel.com  www.com .beyondlogic.com  www.org  www.alldatasheets. Hand book for Digital IC’s from Analogic Devices WEBSITES VIEWED:  www.maxim-ic.com  www.dallassemiconductors.com  www.howstuffworks.