
Now press these buttons from top to bottom and you will get the below results:.Upload this hex file to your Arduino board in Proteus and run the simulation.
2 SERVO MOTOR ARDUINO CODE SOFTWARE
So, now the next thing is the code, copy paste the below code in your Arduino software and get the hex file:.So, each button has its precise angle and it will move the motor to that angle only. I have added five buttons with Arduino and now with these five buttons, I will move the Servo motor to 90, 45, 0, -45 and -90 degrees.So, first of all, design a small design as shown in the below figure:.Now I am going to control Servo motor using five push buttons and each push button will move the Servo motor to a precise angle.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.Till now we have seen a simple control of Servo Motor with Arduino in Proteus ISIS, now let's have a look at a bit complex control of servo motor with Arduino.Ĭontrol Servo Motor with Arduino using Push Buttons.In this way, it will keep on moving between Position A and C.Now when you start it, first of all, it will show Position A in the 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.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 the below figures:.

2 SERVO MOTOR ARDUINO CODE HOW TO
You should read How to get Hex File from Arduino if you don't know already.Upload your hex file to your Proteus Arduino board.It's the same code as given in the Servo folder of Examples in Arduino software.Now compile this code and get your hex file.So, open your Arduino software and copy paste the below code in it. The next thing we need to do is to design the code for Arduino.I have connected the control pin to pin # 4 of Arduino. The center pin is the controlling pin and goes to any digital pin of Arduino.


So, in such cases instead of using a DC motor, I will prefer Servo Motor.

Stepper or DC.įor example, suppose I want to move an antenna at a precise angle of 47.5 degrees then if I use DC Motor, I have to use an encoder. We can move the servo motor at any desired angle, which is not possible in the case of other motors i.e. Servo Motor is a common motor used in engineering projects for precise circular motion. Today's post is about the Controlling of Servo Motor with Arduino in Proteus ISIS. Hello friends, hope you all are fine and having fun with your lives.
