pcbway





Servo Motor control with arduino,servo motor arduino control,controlling servo motor with arduino , arduino servo motor,interfacing of servo motor with arduinoHello friends, hope you all are fine and having fun with your lives. Today’s post is about Controlling of Servo Motor with Arduino in Proteus ISIS. Servo Motor is quite a common motor used in engineering projects. It is normally used where precise circular motion is required. The reason is because we can move the servo motor at any desired angle which is not possible in case of other motors. For example, I want to move my antenna at precise angle of 90 degree then in that case I can use DC Motor but in DC motor I have to use encoder if I want to move it precisely at 90 degrees. Or I can also move DC motor with delays but in that case it can stop at 85 of 95 something which is not very recise. So, in such cases instead of using DC motor, I will prefer Servo Motor.

I have already posted Angle Control of Servo Motor using 555 Timer in which I have controlled servo motor using 555 timer and another tutorial about Controlling of Servo Motor using PIC Microcotroller in whcih I have controlled it with PIC microcontroller. And today we are gonna Control Servo Motor with Arduino and will design the simulation in Proteus ISIS. First of all, we will have a look at simple control of servo motor with arduino in proteus ISIS and then we will check the control of servo motor with arduino using buttons in which we will move the servo motor to precise angles using buttons. So, let’s get started with it. 🙂

Simple Control of Servo Motor with Arduino in Proteus

  • First of all, open your Proteus ISIS software and design the below simple circuit.

Servo Motor control with arduino,servo motor arduino control,controlling servo motor with arduino , arduino servo motor,interfacing of servo motor with arduino

  • Servo Motor has three pins, one of them goes to Vcc, other one to GND while the center pin is the controlling pin and goes to any digital pin of Arduino. I have connected the control pin to pin # 4 of my Arduino.
  • Next thing we need to do is to design the code for Arduino. So, open your Arduino software and copy paste the below code in it.

  • Now compile this code and get your hex file. Its the same code as given in the Servo folder of Examples in Arduino software.
  • Upload your hex file in your Proteus Arduino board.

Note:

  • Now, run your simulation and you will see that your Servo motor will start moving from 90 degrees to -90 degrees and then back to 90 degrees and will keep on going like this, as shown in below figures:

Control Servo Motor with Arduino in Proteus

  • Now when you start it , first of all it will show the Position A in above figure then will move anticlockwise and pass the position B and finally will stop at Position C and then it will move clockwise and comes back to Position A after passing Position B.
  • In this way it will keep on moving between Position A and C.
  • Till now we have seen a simple control of Servo Motor with Arduino in Prtoteus ISIS, now lets have a look at a bit complex control of servo motor with Arduino.

Control Servo Motor with Arduino using Push Buttons

  • In the previous section, we have seen a simple Control of Servo Motor with Arduino in which we simply moved Servo motor from 90 degrees to -90 degrees and vice versa. Now I am gonna control Servo motor using five push buttons and each push button will move the Servo motor to a precise angle.
  • So, first of all, design a small design as shown in below figure:

Servo Motor control with arduino,servo motor arduino control,controlling servo motor with arduino , arduino servo motor,interfacing of servo motor with arduino

  • I have added five buttons with Arduino and now with these five buttons I will move Servo motor to 90 , 45 , 0 , -45 and -90 degrees. So, each buttons has its precise angle and it will move the motor to that angle only.
  • So, now next thing is the code, copy paste the below code in your Arduino software and get the hex file:

  • Upload this hex file to your Arduino board in Proteus and run the simulation.
  • Now press these buttons from top to bottom and you will get the below results:

Servo Motor control with arduino,servo motor arduino control,controlling servo motor with arduino , arduino servo motor,interfacing of servo motor with arduino

  • The above figure is quite self explanatory but still I explain a little.
  • In the first figure I pressed the first button and the motor moved to -90 degrees.
  • In the second figure I pressed the second button and the motor moved to -45 degrees.
  • In the third figure I pressed the third button and the motor moved to 0 degrees.
  • In the fourth figure I pressed the fourth button and the motor moved to 45 degrees.
  • In the fifth figure I pressed the fifth button and the motor moved to 90 degrees.
  • In the sixth figure all buttons are unpressed and the motor remained at the last position.

It was quite simple and hope I explained it quite simply, if you still have any questions then ask in comments and I will try to resolve them. That’s all for today, will see you guys in the next tutorial. Take care !!! 🙂

9 Comments

Leave a Reply

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

Post comment