Sie sind auf Seite 1von 57

1 PROJECT REPORT On VEHICLE SPEED CONTROL USING R.F.

TECHNOLOGY Submitted in partial fulfillment of the requirements For the award of the degree of MASTER OF TECHNOLOGY in COMMUNICATION SYSTEMS OF SRM INSTITUTE OF SCIENCE AND TECHNOLOGY (DEEMED UNIVERSITY) by A.S. SURYA PRAKASH Reg No: 15704017 Under the guidance of Ms.S.T.AARTHY, M.E., (Lecturer, Department of Electronics and Communication Engineering) JUNE 2006

DEPARTME NT OF ELECTRONICS AND COMMUNICATION ENGINEERING S.R.M. ENGINEERING COLLEGE S.R.M. Nagar, Kattankulathur, Kancheepuram District 603 203.

CHAPTER I

1.1 INTRODUCTION

Intelligent instruments are used in every part of our lives. It wont take much time to realize that most of our tasks are being done by Electronics. They will perform one of the most complicated tasks that a person does in a day, that of driving a vehicle. As the days of manned driving are getting extremely numbered, so are those of traffic jams, dangerous and rough drivers and more importantly, accidents. According to Mr. Willie D. Jones in the IEEE SPECTRUM magazine (September 2001), a person dies in a car crash every second. Automation of the driving control of two-wheelers is one of the most vital needs of the hour. This technology can very well implement what was absent before, controlled lane driving. Considering the hazards of driving and their more pronounced effect on two wheelers our VEHICLE CONTROL SYSTEM is exactly what is required. These systems have been implemented in France, Japan & U.S.A. by many companies, but only for cars and mass transport networks. In those systems, the acceleration and brake controls are left to the driver while the micro-processor simply handles the steering and the collision detection mechanism. This system is superior in the sense that majority of the tasks related to driving are automated. The driver just has to sit back and enjoy the ride.

1.2 SYSTEM MODEL


This is the basic system model of Smart Display and Control.

Zone Status Transmitting Unit


School Zone Speed Limit Transmitt er 433.92 MHz

Vehicle Speed Control & Monitoring Unit


Display Unit LCD

30KM U Turn Speed Limit 40KM Transmitt er 433.92 MHz


Receiver

Microcontr
oller Unit

433.92

Annun ci
ate

MHz

Buzzer

Motor Unit

Speed Control Valve

FIGURE 1.1: SYSTEM BLOCK DIAGRAM

There are various blocks. The two major blocks are listed below Zone status transmitting unit. Vehicle speed control and monitoring unit.

1.2.1 Zone status transmitting unit


This unit is fixed in sign boards at different locations. This gives the zone information. There are various zone information like 1 School zone. 2 U turn zone. 3 High way zone. 4 So on. Speed of the vehicle is controlled automatically according to the zone where the vehicle is located. Signal is transmitted from sign board at a frequency range of 433.92 MHz

1.2.2 Vehicle speed control and monitoring unit This unit is fixed in any vehicle. This unit receives the signal transmitted from the zone status transmitting unit. This unit consists of various blocks as mentioned below 1 Receiver unit 2 Transmitter unit 3 Micro controller unit 4 Display unit (LCD) 5 Annunciate buzzer 6 Motor unit 7 Speed control valve The various hardware devices and its functions are mentioned in forthcoming chapters.

CHAPTER II
SOFTWARE & HARDWARE MODULE DESCRIPTION

2.1 RF Module (Radio Frequency)


Radio Frequency, any frequency within the electromagnetic spectrum associated with radio wave propagation. When an RF current is supplied to an antenna, an electromagnetic field is created that then is able to propagate through space. Many wireless technologies are based on RF field propagation.

(A) RECEIVER MODULE (B) TRANSMITTER MODULE FIGURE 2.1 Radio Frequency 10 KHz to 300 GHz frequency range that can be used for wireless communication Radio Frequency. Also used generally to refer to the radio signal generated by the system transmitter, or to energy present from other sources that may be

picked up by a wireless receiver. There are various application of RF (Radio Frequency). 1 Wireless mouse, keyboard. 2 Wireless data communication. 3 Alarm and security systems. 4 Home Automation, Remote control.

6 1 Automotive Telemetry. 2 Intelligent sports equipment. 3 Handheld terminals, Data loggers. 4 Industrial telemetry and tele-communications. 5 In-building environmental monitoring and control. 6 High-end security and fire alarms.

2.1.1 Transmitter
The TWS-434 extremely small, and are excellent for applications requiring shortrange RF remote controls. The transmitter module is only 1/3 the size of a standard postage stamp, and can easily be placed inside a small plastic enclosure. TWS-434: The transmitter output is up to approximately walls. 400 foot (open area) outdoors. foot, and will go through most

8mW at 433.92MHz with a range of

Indoors, the range is

approximately 200 and makes

accepts bothVolts-DC, F linear Tdigital The TWS-434 transmitter inputs, 1.5 to

andbuilding a miniature handheld RF transmitter very caneasy. The TWS-434 is

operate fromapproximately 1/3 the size of 12a standard postage stamp.

FIGURE : 2.3 TWS-434 TRANSMITTER PIN DIAGRAM

FIGURE : 2.4 TRANSMITTER-ENCODER(HT12E) INTERFACE CIRCUIT

2.1.2 Receiver

8 RWS-434: The receiver also operates at 433.92MHz, and has a sensitivity of 3uV. The RWS-434 receiver operates from 4.5 to 5.5 volts-DC, and has both linear and digital outputs.

FIGURE 2.5 : RECEIVER PIN OUT DIAGRAM

2.1.3 Receiver application circuit

FIGURE: 2.6 RECEIVER-DECODER(HT12D) INTERFACE CIRCUIT

2.2 Antennas- WIRE WHIP


coated tip for safety and is 6.8 inches long, The WC418 is made of 26 gauge carbon steel music wire that can be soldered to a PC board. This antenna has a plastic allowing .1 inch for insertion in a terminal or PC board.

FIGURE 2.7 : ANTENNA

2.2.1 Antenna
The following should help in achieving optimum antenna performance: 1 Proximity to objects such a users hand or body, or metal objects will cause an antenna to detune. For this reason the antenna shaft and tip should be positioned as far away from such objects as possible. 2 Optimum performance will be obtained from a 1/4 or 1/2 wave straight whip mounted at a right angle to the ground plane. A 1/4 wave antenna for 418 MHz is 6.7 inches long. 3 In many antenna designs, particularly 1/4 wave whips, the ground plane acts as a counterpoise, forming in essence, a 1/2 wave dipole. Adequate ground plane area will give maximum performance. As a general rule the ground plane to be used as counterpoise should have a surface area equal to or greater than the overall length of the 1/4 wave radiating element (2.6 X 2.6 inches for a 6.7 inch long antenna). 4 Remove the antenna as far as possible from potential interference sources. Place

adequate ground plane under all potential sources of noise.

1 0

2.2

ATMEL AT89C51 Microcontroller


The AT89C51 is a low power, high performance CMOS 8-bit microcontroller

with 4Kbytes of Flash programmable and erasable read only memory (PEROM). This device is compatible with the industry standard 8051 instruction set and pinout. The onchip Flash allows the program memory to be quickly reprogrammed using a nonvolatile memory programmer such as the PG302 (with the ADT87 adapter).By combining an industry standard 8-bit CPU with Flash on a monolithic chip.

2.3.1 AT89C51 Microcontroller Pinout diagram


The AT89C51 is a powerful microcontroller which provides a highly flexible and cost effective solution to many embedded control applications.

FIGURE 2.8 : AT89C51 PINOUT.

11 The 8951 provides the following features: 1~ 2~ 3~ 4~ 5~ 6~ 7~ 4 Kbytes of Flash 128 bytes of RAM 32 I/O lines two16-bit timer/counters Five vector, two-level interrupt architecture full duplex serial port On chip oscillator and clock circuitry In addition, the AT89C51 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 (PDM) saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset.

2.3.2 AT89C51 layout

1 2

FIGURE 2.9 : BLOCK DIAGRAM OF AT89C51 Figure 2.9 is the layout of AT89C51 Microcontroller. Pin details are discussed in chapter 2.3.3.

2.3.3 Pin description VCC

1 3 Supply voltage

GND
Ground

Port 0
Port 0 is dual-function in that it in some designs port 0s I/O lines are available to the developer to access external devices while in other designs it is used to access external memory. If the circuit requires external RAM or ROM, the microcontroller will automatically use port 0 to clock in/out the 8-bit data word as well as the low 8 bits of the address in response to a MOVX instruction and port 0 I/O lines may be used for other functions as long as external RAM isnt being accessed at the same time. If the circuit requires external code memory, the microcontroller will automatically use the port 0 I/O lines to access each instruction that is to be executed. In this case, port 0 cannot be utilized for other purposes since the state of the I/O lines are constantly being modified to access external code memory. Note that there are no pull-up resistors on port 0, so it may be necessary to include your own pull-up resistors depending on the characteristics of the parts you will be driving via port 0.

Port 1
Port 1 consists of 8 I/O lines that you may use exclusively to interface to external parts. Unlike port 0, typical derivatives do not use port 1 for any functions themselves. Port 1 is commonly used to interface to external hardware such as LCDs, keypads, and other devices. With 8052 derivatives, two bits of port 1 are optionally used as described for extended timer 2 functions. These two lines are not assigned these special functions on 8051s since 8051s dont have a timer 2. Further, these lines can still be used for your own purposes if you dont need these features of timer 2. P1.0 (T2): If T2CON.1 is set (C/T2), then timer 2 will be incremented whenever there is a 1-0 transition on this line. With C/T2 set, P1.0 is the clock source for timer 2.

1 4 P1.1 (T2EX): If timer 2 is in auto-reload mode and T2CON.3 (EXEN2) is set, a 1-0 transition on this line will cause timer 2 to be reloaded with the auto-reload value. This will also cause the T2CON.6 (EXF2) external flag to be set, which may cause an interrupt if so enabled.

Port 2
Like port 0, port 2 is dual-function. In some circuit designs it is available for accessing devices while in others it is used to address external RAM or external code memory. When the MOVX @DPTR instruction is used, port 2 is used to output the high byte of the memory address that is to be accessed. In these cases, port 2 may be used to access other devices as long as the devices are not being accessed at the same time a MOVX instruction is using port 2 to address external RAM. If the circuit requires external code memory, the microcontroller will automatically use the port 2 I/O lines to access each instruction that is to be executed. In this case, port 2 cannot be utilized for other purposes since the state of the I/O lines are constantly being modified to access external code memory.

Port 3
Port 3 consists entirely of dual-function I/O lines. While the developer may access all these lines from their software by reading/writing to the P3 SFR, each pin has a pre-defined function that the microcontroller handles automatically when configured to do so and/or when necessary. P3.0 (RXD): The UART/serial port uses P3.0 as the receive line. In circuit designs that will be using the microcontrollers internal serial port, this is the line into which serial data will be clocked. Note that when interfacing an 8052 to an RS-232 port that you may not connect this line directly to the RS-232 pin; rather, you must pass it through a part such as the MAX232 to obtain the correct voltage levels. This pin is available for any use the developer may assign it if the circuit has no need to receive data via the integrated serial port.

1 5 P3.1 (TXD): The UART/serial port uses P3.1 as the transmit line. In circuit designs that will be using the microcontrollers internal serial port, this is the line that the microcontroller will clock out all data which is written to the SBUF SFR. Note that when interfacing an 8052 to an RS-232 port that you may not connect this line directly to the RS-232 pin; rather, you must pass it through a part such as the MAX232 to obtain the correct voltage levels. This pin is available for any use the developer may assign it if the circuit has no need to transmit data via the integrated serial port. P3.2 (-INT0): When so configured, this line is used to trigger an External 0 Interrupt. This may either be low-level triggered or may be triggered on a 1-0 transition. This pin is available for any use the developer may assign it if the circuit does not need to trigger an external 0 interrupt. P3.3 (-INT1): When so configured, this line is used to trigger an External 1 Interrupt. This may either be low-level triggered or may be triggered on a 1-0 transition. This pin is available for any use the developer may assign it if the circuit does not need to trigger an external 1 interrupt. P3.4 (T0): When so configured, this line is used as the clock source for timer 0. Timer 0 will be incremented either every instruction cycle that T0 is high or every time there is a 1-0 transition on this line, depending on how the timer is configured. This pin is available for any use the developer may assign it if the circuit does not to control timer 0 externally. P3.5 (T1): When so configured, this line is used as the clock source for timer 1. Timer 1 will be incremented either every instruction cycle that T1 is high or every time there is a 1-0 transition on this line, depending on how the timer is configured. Please see the chapter on timers for details. This pin is available for any use the developer may assign it if the circuit does not to control timer 1 externally.

1 6 P3.6 (-WR): This is external memory write strobe line. This line will be asserted low by the microcontroller whenever a MOVX instruction writes to external RAM. This line should be connected to the RAMs write (-W) line. This pin is available for any use the developer may assign it if the circuit does not write to external RAM using MOVX. P3.7 (-RD): This is external memory write strobe line. This line will be asserted low by the microcontroller whenever a MOVX instruction writes to external RAM. This line should be connected to the RAMs write (-W) line. This pin is available for any use the developer may assign it if the circuit does not read from external RAM using MOVX.

OSCILLATOR INPUTS (XTAL1, XTAL2) The 8052 is typically driven by a crystal connected to pins 18 (XTAL2) and 19 (XTAL1). Common crystal frequencies are 11.0592 MHz as well as 12 MHz, although many newer derivatives are capable of accepting frequencies as high as 40 MHz. While a crystal is the normal clock source, this isnt necessarily the case. A TTL clock source may also be attached to XTAL1 and XTAL2 to provide the microcontrollers clock.

RESET LINE (RST)


Pin 9 is the master reset line for the microcontroller. When this pin is brought high for two instruction cycles, the microcontroller is effectively reset. SFRs, including the I/O ports, are restored to their default conditions and the program counter will be reset to 0000h. Keep in mind that Internal RAM is not affected by a reset. The microcontroller will begin executing code at 0000h when pin 9 returns to a low state.

1 7 The reset line is often connected to a reset button/switch that the user may press to reset the circuit. It is also common to connect the reset line to a watchdog IC or a supervisor IC (such as MAX707). The latter is highly recommended for commercial and professional designs since traditional resistor-capacitor networks attached to the reset line, while often sufficient for students or hobbyists are not terribly reliable.

ADDRESS LATCH ENABLE (ALE)


The ALE at pin 30 is an output-only pin that is controlled entirely by the microcontroller and allows the microcontroller to multiplex the low-byte of a memory address and the 8-bit data itself on port 0. This is because, while the high-byte of the memory address is sent on port 2, port 0 is used both to send the low byte of the memory address and the data itself. This is accomplished by placing the low-byte of the address on port 0, exerting ALE high to latch the low-byte of the address into a latch IC (such as the 74HC573), and then placing the 8 data-bits on port 0. In this way the 8052 is able to output a 16-bit address and an 8-bit data word with 16 I/O lines instead of 24. The ALE line is used in this fashion both for accessing external RAM with MOVX @DPTR as well as for accessing instructions in external code memory. When your program is executed from external code memory, ALE will pulse at a rate of 1/6th that of the oscillator frequency. Thus if the oscillator is operating at 11.0592 MHz, ALE will pulse at a rate of 1,843,200 times per second. The only exception is when the MOVX instruction is executed one ALE pulse is missed in lieu of a pulse on WR or RD.

PROGRAM STORE ENABLE (PSEN)


external code memory. This line should be The Program Store Enable (PSEN) line at pin 29 is exerted low automatically by the microcontroller whenever it accesses attached to the Output Enable (OE) pin of the EPROM that contains your code memory.

1 8 PSEN will not be exerted by the microcontroller and will remain in a high state if the program is being executed from internal code memory.

EXTERNAL ACCESS (EA)


The External Access (EA) line at pin 31 is used to determine whether the 8052 will execute your program from external code memory or from internal code memory. If EA is tied high (connected to +5V) then the microcontroller will execute the program it finds in internal/on-chip code memory. If EA is tied low (to ground) then it will attempt to execute the program it finds in the attached external code memory EPROM. Of course, the EPROM must be properly connected for the microcontroller to be able to access the program in external code memory.

Port Pins P3.0 P3.1 P3.2 P3.3 P3.4 P3.5 P3.6 P3.7

Alternate Functions RXD(serial input port) TXD(serial output port) INT0(external interrupt o) INT1(external interrupt 1) T0(timer 0 external input) T1(timer 1 external input) WR(external data memory write strobe) RD(external data memory read strobe) TABLE 2.1 : ALTERNATE FUNCTIONS OF I/O PORT 3

1 9

2.4 Display Unit


The LCD Module can easily be used with an 8051 microcontroller such as the AT89C51 included with the microcontroller beginner kit. The LCD Module comes with a 16 pin connector.A type of display, usually numerical, used in electronic equipment. Dark characters are formed on a lighter background. Requires external back lighting to be visible under low-light conditions. One of the most popular output devices for embedded electronics is LCD. The LCD interface has become very simple. This is due to the availability modules for LCDs. The LCD along with necessary controller (LCD Controller) and mounting facility is made available in the module itself. The LCD controller takes care of everything necessary for the LCD. We communicate with the LCD controller with the help of a command set provided by the manufacturer.

2.4.1 Liquid Crystal Display (LCD)


Liquid Crystal Display is a type of display used especially in small portable electronic devices. This can be plugged into the breadboard as shown in figure 2.10.

2 0

FIGURE 2.10 : LCD MODULE.

The pins on the 16 pin connector of the LCD Module are defined in table 2.2. The table 2.2 also shows how to connect each pin to the AT89C51 microcontroller. To connect the LCD Module to a standard 40 pin AT89C51, use the pin names listed next page to find the correct pin number on the AT89C51 microcontroller.

Connected to which Pin No of LCD Pin No 1 2 3 4 5 6 7 8 Pin Detail Data line Data line Power (VDC) Not Connected Display Adjust Data line Data line Ground 7,19 2,14 (port 1.7) (port 1.2) AT89C51 Microcontroller 6,18 1,13 (port 1.6) (port 1.1) 5 vdc

9 10 11 12 13 14

Not Connected Data line LCD Enable Data line Data line LCD R/W 3,15 8 4,16 0,1 2 6 (port 1.3) (port3.4) (port 1.4) (port1.0) (port3.2)

2 1 15 16 Data line LCD Reset 5,17 7 (port1.5) (port3.3)

TABLE 2.2 : CONNECTION DETAILS FOR DISPLAY CONTROL The basic AT89C51 configuration is shown in figure 2.11. Build this circuit and then you will be ready to add the LCD Module.

FIGURE 2.11 : LCD INTERFACE WITH AT89C51 CIRCUIT

In the above figure 2.11, LCD pins can be interfaced with corresponding Microcontroller pins as listed in table 2.2.

2.5 Annunciate Buzzer


Atmel 2051 programmable microcontroller The first step is to build the circuit. This design is intended for use with an (a 20 pin version of the 8951 microcontroller). An

2 2 8951 or 8052 can be substituted for the 2051 if the connections are made to the appropriate pins on those chips.

2.5.1 Annunciate Buzzer circuit layout


Vcc = 5V and Gnd = 0V

FIGURE 2.12 : BUZZER CIRCUIT The basic process of compiling a program written in assembly language and then programming the resulting file into the microcontroller was covered in the first microcontroller tutorial. This project uses the same code as the first program. To start, we just make a minor change to the original assembly language program, ledtest.asm. Replace the line at the bottom that says ACALL DELAYHS with ACALL DELAYMS.

2 3

This changes the delay from half a second to one millisecond. Save it as a new file called sounds.asm. That change makes it. So that rather than delaying a half a second, we are only delaying one millisecond. Compile the sounds.asm file, load sounds.hex into the 2051 and put the chip back in the circuit. Connect the power. You should hear a tone coming from the speaker. If the LED was hooked up, it would be going on and off so fast that it would look like it was on all the time. But with the speaker, we can hear the voltage going on and off. You can only see the LED going on and off up to about 25 blinks per second. The speaker starts making noise at about 50 blinks per second. But instead of calling it blinks called cycles. Right now the microcontroller is putting out about 500 cycles per second. This is also called the frequency. It is a frequency of 500 Hertz (where Hertz means cycles per second).To make the frequency go down, add more delay. Adding another millisecond delay by inserting another ACALL DELAYMS. This will make the frequency 250 Hertz. Then sound is lower in frequency.

2.5.2 How to get exactly the frequency you want:


To figure out how to get an exact frequency, you have to carefully look at how long it takes for the microcontroller to switch the output from 0 volts to 5 volts and back to 0 volts again. This is one cycle.

FIGURE 2.13 : PULSE SIGNAL TO BUZZER.

2 4 Lets start by determining what frequency the sounds.asm program is creating. First lets look at the DELAYMS routine. We need to figure out how long this routine lasts. By just looking at the code, we can figure out that it goes through a loop 255 times. Each time through the loop it does 3 commands. The first two commands each take 12 clock cycles and the 3rd command (CJNE) takes 24 clock cycles. (You can find this out by looking for information on the commands in 2051arch.pdf). So each loop takes 48 clock cycles. To translate this into time, we need to look at the clock speed of the microcontroller. An 11.0592 MHz crystal is used. This means the clock is running at a frequency of 11,059,200 cycles per second. (MHz is Megahertz which is million cycles per second). Each cycle takes 1/11,059,200 seconds = 0.00000009 seconds. So each loop takes 48 * 0.00000009 = 0.00000434 seconds. And 255 loops takes 255*0.00000434 = 0.001106771 seconds which is slightly longer than 1 millisecond (1 millisecond = 0.001 seconds). If we wanted to get closer to exactly 1ms we could change the loop so that it only repeats 230 times rather than 255. So, the program makes the output go from 0 to 5 volts, and then waits 1ms, then goes from 5 volts to 0 volts, then waits 1 ms and that makes one cycle. So one cycle takes about 2 ms (This is called the period). To convert that to frequency, divide 1 cycle by 2 ms (1/0.002 = 500). Then you get 500 cycles per second. Or to be exact using the numbers above, one cycle takes 2.213542 ms for a frequency of 451.76 Hz. So, to get an exact frequency, you can start with the frequency and work backwards. Say you want to make 440 Hz, which is a musical, A note. To find the period, divide 1 by 440. This gives you the period equal to 0.002272727 seconds. Then divide this by 2 to find out how long each delay must be (there will be 2 delays per cycle). Each delay should be 0.001136364. Then find out how many microcontroller clock cycles this is by dividing by 0.00000009. This equals 12626 cycles (after dropping the decimal part). Using our loop that takes 48 cycles, this would be about 263 loops

2 5 (12626 / 48 = 263). We can only go up to 255 loops so then we can either make our loop take more time, or add in an extra DELAY routine that adds in the extra 8 loops. The easiest solution is to make our loop longer. We can add in an extra 12 cycles per loop by putting in a NOP (no operation) command. Then each loop is 60 cycles and we need about 210 loops (12626 / 60 = 210). The resulting code is shown in sound440.asm. That will not be exactly 440 Hz because we had to round off in some places (you can't do 210.43 loops but 210 is close. To figure out exactly what frequency that we made, we can do the same as we did above with the DELAYMS routine. Each loop is 0.00000009 * 60 = 0.0000054 seconds. Each DELAYMS takes 210 * 0.0000054 = 0.001134 seconds. With 2 delays per cycle this is a period of 0.002268. In terms of frequency, 1/0.002268 = 440.9 cycles per second which is close to 440. Note: To really be exactly right on the frequency you are making, you need to include the time in each cycle for the other commands, CPL, ACALL and RET, and the commands in the DELAYMS loop, MOV and RET. These add an extra 96 clock cycles each time through. Since it takes 2 times through to make a cycle on the output that is an extra 192 cycles. This equals 192 * 0.00000009 = 0.00001728 seconds. So the period is actually 0.002268 + 0.00001728 = 0.00228528 and the frequency is actually 437.6 M Hz. So this extra time must be considered if you are trying to get a very precise frequency. Note: You are limited in how close you can get to an exact frequency by the microcontroller clock speed. The faster the clock is, the more accurate you can be. For example, with an 11.0592 MHz clock where each cycle is 0.00000009 seconds, the closest you can get to 440 Hz is 440.0788621 Hz. This is found by 1/440 = 0.002272727 seconds and 0.002272727 / 0.00000009 = 25253 cycles (must round to closest whole number because you can't have part of a cycle). Since the shortest commands take 12 clock cycles, then you won't be able to write a routine that takes exactly 25253 cycles. It has to be some multiple of 12. The closest multiple of 12 is 25248. Then 25248 * 0.00000009 = 0.00227232 seconds and 1 / 0.00227232 = 440.0788621 Hz.

2 6

If you have a faster microcontroller clock speed you can be more accurate. For example, with a 24 MHz clock (The fastest you can use with a 2051 microcontroller) then you can get 440.0440044 Hz. Also, if you use a clock that gives you a different period you may be able to get exactly 440 Hz. For example, if you have a microcontroller clock that is 22,440,002.69 MHz then you can get much closer to 440 Hz, but you have to find a crystal that runs at that exact speed, and there probably is not one. The parts for this kit are included in Microcontroller Beginner Kit.

2.6 DC Servo Motor


an output shaft that can be positioned by DC servomotors have sending a coded signal to the motor. As the input to the motor changes, the angular

2 7 position of the output shaft changes as well. Servomotors are generally small and powerful for their size, and easy to control. Common types of DC servomotors include brushless or gear motor types.

FIGURE 2.14 : DC SERVOMOTOR Important performance specifications to consider when searching for DC servomotors include shaft speed, terminal voltage, continuous current, continuous torque, and continuous output power. The shaft speed is the No-load rotational speed of output shaft at rated terminal voltage. The terminal voltage is the design DC motor voltage. Continuous current is the maximum rated current that can be supplied to the motor windings without overheating. The continuous torque is the output torque capability of the motor under constant running conditions. Continuous output power is the mechanical power provided by the motor output. Motor construction choices for DC servomotors include permanent magnet, shunt wound, series wound, compound wound, disc armature, and coreless or slot less. A permanent magnet motor is a motor with permanent magnets embedded into the rotor assembly. The rotor aligns itself with the rotating magnetic field of the stator windings. PM

motors exhibit constant speed with varying load (zero slip) and provide relatively high torque, good efficiency, and lower current draw than comparable synchronous motors.

2 8 Shunt wound motors exhibit minimum speed variation through load range and can be configured for constant horsepower over an adjustable speed range. Frequent applications include machine tools, fans, and blowers. Series wound motors exhibit high starting torques for permanently attached loads. Frequently used in heavy industrial applications. Compound wound motors are designed with both a series and shunt field winding. They are often used where the primary load requirement is heavy starting torque, and adjustable speed is not required. They can exhibit speed variation from noload to full-load. Applications include elevators, hoists, and industrial shop equipment. Disc armatures are flat, pancake-shaped rotors that are driven by an axially, rather than radially, aligned magnetic field. The thin construction of these armatures can result in low inertia with resulting high acceleration. Coreless and slotless motors incorporate a cylindrical winding that is physically outside of a set of permanent magnets. The winding is not held by a slotted iron cage but is laminated together. In a slotless motor, the magnets attached to the rotor rotate, while in a coreless motor, the windings rotate around the permanent magnet stator. Commutation choices include brush or brushless. Brush motors have the armature windings on the rotor. The magnetic fields are commutated via direct contact of brushes with the rotor commutator. Brushless motors have their armature windings on the stator and the field on the rotor. They rely on internal noncontact sensing devices to activate external commutating electronics. The motor configuration in DC servomotors includes motor only or gearmotor. Gear motors include units with single integral gearheads, or replaceable / interchangeable gearhead options. Gearing choices, if applicable to the DC servomotor include spur, planetary, harmonic, worm, and bevel. The gearbox ratio of input to output speed is also important to consider.

2 9 Gearbox efficiency is the percentage of power or torque that is transferred through the gearbox. Shaft options for DC servomotors include in-line, offset or parallel, right angle, single-ended, double-ended or hollow. Feedback for the motor can be integral encoder, integral resolver, or integral tachometer. Other important parameters to consider when specifying DC servomotors include housing and enclosure features such as the design units, motor shape, diameter or width, housing length, NEMA frame size, enclosure options and special or extreme environments the motor might need to operate in. Common features include integral driver electronics, integral brake, integral clutch, and integral brake or clutch combination. Important environmental parameters to consider include operating temperature, shock rating, and vibration rating. DC motors are most commonly used in variable speed and torque applications. They include brushless and gear motors, as well as servomotors. Learn more about DC Motors DC servomotors are generally small and powerful for their size, and easy to control. Common types of DC servomotors include brushless or gear motors. Motor controllers receive supply voltages and provide signals to motor drives that are interfaced to motors. They include a power supply, amplifier, user interface, and position control circuitry.

2.6.1 About Linear Motors


in the direction of travel. A linear motor Linear motors generate force only applies thrust directly to a load, and does not require any intermediate mechanism to

3 0 convert rotary motion into linear motion. Linear motors are capable of extremely high speeds, quick acceleration, and accurate positioning. Choices for linear motors include moving coil, moving magnet, AC switched reluctance design, AC synchronous design, AC induction or traction design, linear stepping design, DC brushed design, and DC brushless design. In a moving coil design the coil moves and the magnet is fixed, such as an audio speaker. In a moving magnet design the magnet moves and the coil is fixed. AC synchronous motors are a class of motors that operate at constant speed up to full load. The rotor speed is equal to the speed of the rotating magnetic field of the stator; there is no slip. Reluctance and permanent magnet are the two major types of synchronous motors. Synchronous linear motors are often used where the exact speed of a motor must be maintained. AC induction or traction design motors are a class of motors that derives its name from the fact that current is induced into the rotor windings without any physical connection with the stator windings (which are directly connected to an AC power supply); adaptable to many different environments and capable of providing considerable power as well as variable speed control. Typically there is "slip," or loss of exact speed tracking with induction motors. Typically rolled flat version of rotary AC induction motors. Stepper motors use a magnetic field to move a rotor in small angular steps or fractions of steps. Stepper motors provide precise positioning and ease of use, especially in low acceleration or static load applications. Brush motors have the armature windings on the rotor. The magnetic fields are commutated via direct contact of brushes with the rotor commutator. Brushless linear motors have their armature windings on the stator and the field on the rotor. They rely on internal noncontact sensing devices to activate external commutating electronics. Important specifications to consider include rated continuous thrust force, peak force, maximum speed, maximum acceleration, nominal stator length, slider or carriage travel, slide or carriage width, and slider or carriage length.

3 1 The rated continuous thrust force is the maximum rated current that can be supplied to the motor windings without overheating. The peak force is the maximum force of the linear motor. The nominal stator length is the length of the fixed magnet or coil. The slider or carriage travel is the range of travel of the moving coil or magnet. The slider or carriage width and length are the dimensions of the moving coil or magnet. Important electrical properties to consider when specifying linear motors include continuous current, rated current per phase, motor force constant, and number of leads. The rated current per phase is the maximum rated current per phase or winding for a stepper motor. The number of leads specifies unipolar = 6 leads, bi-polar = 4. Mechanical properties to consider for linear motors include design units, linear stepper resolution, and maximum coil temperature. For the linear stepper resolution the Units are typically in 'distance per step' or 'steps per unit distance'. Common features include forced air-cooling, water-cooling, balanced design, integral position feedback, and modular stator. Important environmental parameters to consider for linear motors include operating temperature, maximum shock, and maximum vibration.

2.6.2 SERVO Motor Interfacing

VDD
8951 Port Pins Invertin g Buffers

SERVO MOTO R

A A B B

3 2

FIGURE 2.15 : SERVO MOTOR INTERFACE WITH AT89C51 2.7 Transmit and Receive Data 2.7.1 Generating Data The TWS-434 modules do not incorporate internal encoding. If you want to send simple control or status signals such as button presses or switch closures, consider using an encoder and decoder IC set that takes care of all encoding, error checking, and decoding functions. These chips are made by Motorola and Holtek. They are an excellent way to implement basic wireless transmission control.

2.7.2 Receiver Data Output


Zero volt to Vcc data output is available on pins. This output is normally used to drive a digital decoder IC or a microprocessor which is performing the data decoding. The receivers output will only transition when valid data is present. In instances when no carrier is present the output will remain low.

2.7.3 Decoding Data


The RWS-434 modules do not incorporate internal decoding. If you want to receive Simple control or status signals such as button presses or switch closures, you can use the encoder and decoder IC set described above. Decoders with momentary and latched outputs are available.

3 3

2.8 Transmitting and Receiving


Full duplex or simultaneous two-way operation is not possible with these modules. If transmit and receive module are in close proximity and data is sent to a remote receive module while attempting to simultaneously receive data from a remote transmit module, the receiver will be overloaded by its close proximity transmitter. This will happen even if encoders and decoders are used with different address settings for each transmitter and receiver pair. If two way communications is required, only half duplex operation is allowed.

2.9 Circuit Schematic

2.9.1 AT89C51 Circuit Schematic

3 4
40

20 GND

VCC

VCC

C4

0.1uF

U2 P1_ 0 P1_ 1 P1_ 2 P1_ 3 P1_ 4 P1_ 5 P1_ 6 P1_ 7 C5 1 2 3 4 5 6 7 8 1 0 3 9 3 8 3 7 3 6 3 5 3 4 3 3 3 2 3 1 P0 _0 P0 _1 P0 _2 P0 _3 P0 _4 P0 _5 P0 _6 P0 _7 2 3 4 5 6 7 8 9

R 2 1

VCC

P1.0 P1.1 P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 P3.0/RX D

P0.0/AD0 P0.1/AD1 P0.2/AD2 P0.3/AD3 P0.4/AD4 P0.5/AD5 P0.6/AD6 P0.7/AD7 EA/VPP

SIP 9 1k

VCC SW0 P3_ 5 P3_ 6 P3_ 7

10uF RST

1 1 1 2 1 3 1 4 1 5 1 6 1 7

P3.1/TX D P3.2/INT O P3.3/INT 1 P3.4/TO P3.5/T1 P3.6/WR P3.7/RD

ALE/PRO G PSEN

3 0 2 9

P2.7/A15 P2.6/A14 P2.5/A13 P2.4/A12 P2.3/A11 P2.2/A10

R3 8K2 11.0592MHz X1 C6 33PF

9 1 8 1 9 C 7 33 PF

RST XTAL2 XTAL1 AT89C51

P2.1/A9 P2.0/A8

2 8 2 7 2 6 2 5 2 4 2 3 2 2 2 1

P2 _3 P2 _2 P2 _1 P2 _0

FIGURE 2.16 : AT89C51 MICROCONTROLLER CIRCUIT SCHEMATIC.

The circuit schematic of AT89C51 microcontroller is shown figure 2.16. Detail explanation of various I/O ports, oscillator input (XTAL1, XTAL2), reset line (RST), address latch enable (ALE), program store enable (PSEN) and External access (EA) is mentioned in section 2.3.3.

2.9.2 Display Part

3 5
V C C

R 19

1 2 5 K

CN2

1 2 P 3 _ 5 P 3 _ 6 P 3 _ 7 P 1 _ 0 P 1 _ 1 P 1 _ 2 P 1 _ 3 P 1 _ 4 P 1 _ 5 P 1 _ 6 P 1 _ 7 3

10

11

12

13

14 15 16 2x16 LCD

VC C

u F 9. P0_7 AT89C51 I

2.

3 Al ar m i P FIGURE 2.18 : g arBUZZER- AT89C


INTERFACE.

3 6

The circuit schematic of alarm or buzzer part is shown in figure-19. Buzzer is on whenever vehicle enters particular zone in order to alert the driver. Hearing that buzzer driver can take precautionary steps to drive safely.

2.9.4 Speed control Block


K3 4 +9V 3 K 4 4 N S _ 1

+9 V

3 6 2 1 2 1 2 Q3 3BC5 47 5V

5 8 7

HW_1 1 D5 2

6 1 2 1 Q 4 3BC547 5 V

5 8 7

D4 1N40 07

P0_2R 6 1k

P0_3 R7

1k

1N400 7 2

+ 9 V 3 6 2 1N4007 P0_0R4 2 1 Q1 3B C54 7 1 2

K1 4 K2 4 5 8 7 UT_1

5 8 7

SZ_1

+ 9 V

3 6

D2 1

1 5V

D 3 1N4007

2 1

1 2 5V

P0_1R5 1k

1k

Q2 3BC547

FIGURE 2.19 : VARIOUS ZONAL CIRCUIT SCHEMATIC.

Figure 2.19 consists of four zones (as mentioned) speed control circuit schematic. So whenever vehicle travel in particular zone corresponding voltage is regulated in the DC Servomotor in turn speed is maintained to that particular zonal limit.

2.10 Relay Module


Electromechanical relays are devices that complete or interrupt a circuit by physically moving electrical contacts into contact with each other.

PDF to Wor

Das könnte Ihnen auch gefallen