Arduino 5 Minute Tutorials: Lesson 5 - Servo Motors

@Hadi Unfortunately providing advice for creating specific code is beyond the scope of this article. You will need to learn how to program in Arduino.

sir my problem was out my 3 mg995 servos one of them keeps jittering but when they are only 2 then there’s no problem what do you think was the reason sir…?? please… thank you

@dan It might be a power issue; if you are using a battery or power supply, it might not be able to provide enough current.

Thank you for your tutorial, this is so useful for me to finished my project.

Can anyone help me plz…I want to make a robot that picks up something within a certain range…how do we set the distance calculated by Ultrasonic finder to make it an output to a DC motor so that the robot stops near an object?..thnx

@Yantoy You need intermediate electronics including a microcontroller and a motor controller. We encourage you to read through this series to get more information.

how to control two servos simultaneously

@sathish Any normal servo controller and most microcontrollers can easily control two servos simultaneously.

Im creating an automatic time scheduled light switch with the servo. I have watched this video and it was very helpful to make my servo move automatically on set milli seconds but I dont know if that would be best for something that needs to run daily on current time. Do have any suggestions?

@jasmine Ideally would need to add a real time clock (RTC) since on its own, a microcontroller like an Arduino is not really meant to measure large periods of “time” (great for milliseconds and seconds though).

Hi, i have a question, I am using a servomotor to rotate a circular disk at 3 different angles according to light values. do we need to bring motor to its initial position after every rotation or it can continue from 1 to 3 position(example… thanks

@Mohammad Anas Shafiq No, an RC servo uses a built-in potentiomter to know its position at all times: the angle is absolute as opposed to relative (like a DC gear motor or stepper).

hi sir… a i have a question… i bought a servo motor 360 continous… but when i test it… i cannot stop it in a accurate angle…is there any program or library that can help me?

@archel Standard continuous rotation servos do not allow you to specify an angle - they only allow you to control speed and direction.

Hi there,
I am just wondering, in that video, why does it need to be at a certain angle. Also, we can loop that code as many times as we want, and change the angle measure and the delay time for each, right?

@Maggie Kwan You can do whatever you want in the code :slight_smile: You need to specify positions for the servo.

i am needing some help i am new to arduino but i need it to make a real world invention and can’t seem to figure out how to make two servos or stepper motors move in sequence from the push of a button. any help would be much appreciated and can i use a nano to do this ? thank you

@scott If you are new to robotics, using two servos is easier than two stepper motors, and you can use the Arduino servo library. You need a line or two of code which reads the state of the button and if it’s pressed, it moves the servos to a specific angle. For more support, please contact us on the RobotShop or Arduino forums.

how can I control servo speed and position with PID? plz tell me

@Khalid Normally this is handled within the servo, within the onboard chip and you simply send the RC servo a position.