Servo Motor Interfacing with 8051 microcontroller (AT89S52)

Servo Motor Interfacing with 8051 microcontroller (AT89S52)

By:Fatima Hasnain

Intro to : Servo Motor, AT89S52 Microcontroller and how they interface :

Servomotor : A servomotor is a rotary actuator or linear actuator that allows for precise control of angular or linear position, velocity and acceleration. A servomotor is a closed-loop servomechanism that uses position feedback to control its motion and final position. The input to its control is a signal (either analogue or digital) representing the position commanded for the output shaft. Servo motors are used in robotics, embedded systems and industries because they are very precise and reliable. They are used to operate remote control toy cars, airplanes or robots. Their motion can be controlled by rotating them in particular angle. AT89S52 8-bit Microcontroller : The AT89S52 comes from the popular 8051 family of Atmel Microcontrollers. It is an 8-bit CMOS microcontroller with 8K as Flash memory and 256 bytes of RAM. Since it is similar to the trust worthy 8051 architecture these microcontrollers are as per industry standard. It has 32 I/O pins comprising of three 16-bit timers, external interrupts, full-duplex serial port, on-chip oscillator and clock circuitry. Servo Motor Interfacing with AT89S52 : We will control servo motor with AT89C51 microcontroller. Servo motor red and black wires are connected to battery and ground respectively. Its control wire is connected with any port pin of microcontroller. Servo Motor Applications : It is used in Press machines for cutting the pieces to size, It is used in the Sugar filling station, It is used in Labeling applications, It is used Packing system with random timing function, It is used used in aeroplanes


uploads/1981servo motor proteus.PNG

Interfacing details of Servo Motor with AT89S52 :

Servo motor working principle and operation is very simple, it consisted three wires where two of them (Black and red) used to provide power and the third wire is used to provide control signal. We are using a servo motor having angle of rotation from 0-180° and angular position can be controlled by varying the duty cycles among 1ms to 2ms. Here the servo motor interfacing with 8051 microcontroller (AT89S52), the black wire connected to the ground pin and the motor get the power from the red wire. The control of servo motor connected port 2.0 of 8051 microcontroller. The 11.0592MHz crystal oscillator is used to provide the clock pulsed to the microcontroller and 22pf ceramic capacitors used to stabilize the operation of crystal. 10KΩ and 10uf capacitor is used to provide the power on reset to the microcontroller. Servo motor working principle mainly depends upon duty cycles. It uses Pulse Width Modulated (PWM) waves as control signals. The angle of rotation is resolute by the pulse width of the control pin. Here the servo motor used for angle of rotation from 0 to 180 degrees. We can control the precise angular position by varying the pulse among 1ms to 2ms.

Servo Motor Programming With angular rotations :

Hex Code