AT89S52 Mini Development Board – Servo Motor Interfacing

Servos have simple electrical interface – they have 3 wires, one for power, one for ground and the other for the pulse train. Once the servo is powered, the signal wire is ready to receive signal in the form of pulse width modulation (PWM) from an external source.
The signal expects to be updated every 20 ms with a pulse between 0.5ms and 2.5ms. With a 1.5 ms pulse, the servo motor will be at the natural 90° position. With a 0.5 ms pulse, the servo will be at the 0° position, and with a 2.5 ms pulse, the servo will be at 180°. You can obtain the full range of motion by updating the servo with a value in between.

AT89S52 mini development board has a dedicated connector K13 to interface Servo motor. Regulated 5V is available on power supply pin and the signal pin is connected at the port pin P2.3. Sample code to check servo motor is given below, Upon code execution, servo turns each angle.

Note: Use adapter for powering since USB doesn’t provide required current


Sample Code

The following screenshots explain how to test the sample code.

  • Step 1: Open  Realterm

  • Step 2: RealTerm opens as shown below

  •  Step 3: Go to ‘Port’ option, set correct baudrate (which is set as 9600 in the sample code) and correct port
  •  Step 4: Click ‘Change’ (encircled in red) to apply the changes. Now check the status of Port. If it is closed, click ‘Open’ button (encircled in green) to open it.

  • Step 5: Type the command to transmit in the corresponding data box  and then click over Send ASCII as shown below .The transmitted data  available in black window , as per this servo turns.

Topics related to AT89S52 Mini Development Board

  1. AT89S52 Mini Development Board – Overview
  2. AT89S52 Mini Development Board – LED Interfacing
  3. AT89S52 Mini Development Board – LCD Interfacing
  4. AT89S52 Mini Development Board – Serial communication
  5. AT89S52 Mini Development Board – EEPROM Interfacing
  6. AT89S52 Mini Development Board – Buzzer Interfacing
  7. AT89S52 Mini Development Board – Servo Motor Interfacing
  8. AT89S52 Mini Development Board – Switch Interfacing
  9. AT89S52 Mini Development Board – RFID Interfacing


How to buy?

SupportPlease share your ideas with us, visit our forum for discussion



Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">