Micro Controller Controlled Servo Motor With Keypad Input

5
Microcontroller Controlled Servo Motor with keypad input Midway project Report 5/9/2011 Group Members: Umar Shehzad 340 Ibn I Rushd Ilyas 349

Transcript of Micro Controller Controlled Servo Motor With Keypad Input

Page 1: Micro Controller Controlled Servo Motor With Keypad Input

Microcontroller Controlled Servo Motor with keypad inputMidway project Report

5/9/2011

Group Members:

Umar Shehzad 340

Ibn I Rushd Ilyas 349

Ahmed Moein 313

Page 2: Micro Controller Controlled Servo Motor With Keypad Input

Introduction:

A servomotor (servo) is an electromechanical device in which we use electrical input to determine the position of the armature of a motor. Servos are used extensively in robotics and radio-controlled cars, airplanes, and boats.

We have used a 5V operated servo motor to rotate an antenna mounted on it for rotating it to the specified angle by the user for communication purposes. The position of the armature is determined by the duty cycle of a periodic rectangular pulse train. The duty cycle of a rectangular pulse train is expressed in %: It is the ratio of the pulse duration to the pulse period times 100%

   Figure: Illustration of Servomotor Identifying the Armature

   Figure: Examples of Duty Cycle Calculation

Secondly we have used a microcontroller AT89C51 for the purpose of controlling the input to Servo motor and other components(keypad and LCD).

AT89C51 is a microcontroller used in basic applications of embedded systems.

Thirdly we have used 16x2 LCD to display the level of degrees the user has entered.

And fourthly we’ll be using either a 4x3 or 4x4 keypad (primarily we decided to use a 4x3 keypad but due to its unavailability in market we’ve considered using a 4x4 keypad)

Abstract:

Page 3: Micro Controller Controlled Servo Motor With Keypad Input

We’ll be using AT89C51 microcontroller to operate 5V servo motor, 4x3/4x4 keypad and a 16x2 LCD.

User will Enter the number of degrees he wants to rotate the motor at through the keypad, ports P0 and P2 of the microcontroller will be used as interface to keypad.

LCD will represent the number of degrees the user has entered, P0 and P2 ports will interface with the LCD too.

The microcontroller then will rotate the motor at desired angle to rotate the antenna. Before connecting to the control wire of servo, the output from the microcontroller (P1^0) is fed through a comparator IC (LM324) so that the signal is protected from any loss due to overloading.

How it will work:

We will use 8051 timers to generate a 50 µs delay. A timer function is written which produces delay in multiples of 50 µs. A variable is taken as the argument from the user through keypad to this function that determines the multiples. Initially when the microcontroller executes program, a pulse with ON time of 700 µs (14 x 50 µs) followed by OFF time of 18 ms is generated. This shifts the servo horn to 0° angle. The angle entered by the user is stored in a variable whose value is added to the argument of the timer function. For example, if the user enters 45, the argument of the timer function is increased by 45 and becomes 59 .The ON time for the next train of pulses then corresponds to multiple of 50 µs. In this case the ON time of the next train of pulses will be 2950 µs (59 x 50 usec) followed by OFF time of 18 ms. This maintains the servo at 45° angle until the user enters the next angle

What we have done so far:

We haven’t implemented the hardware yet, but have almost completed the code for the microcontroller , for it to be able to control the other components.

We have also prepared the project’s simulation on proteus, which works fine.

References:

http://people.ee.duke.edu/~cec/final/node59.html