Now let s see how to use an arduino to control a servo motor.
Arduino servo motor controller.
The basics and composition of an sg90 will be explored and the application of several servo codes and applications will be given for another type of servo motor the mg90s.
The darkest or even black one is usually the ground.
For most servos a 1 ms pulse results in a zero degree rotation a 1 5 ms pulse results in a 90 degree rotation and a 2 ms pulse results in a 180 degree rotation.
This library can control a great number of servos.
In this tutorial an arduino board will be used to power and control a small servo motor.
You can also see the 3 wires that connect to the outside world.
Connect the power cable that in all standards should be red to 5v on the arduino.
It makes careful use of timers.
Working of a servo motor.
The servo expects one pulse every 20 ms.
The guts of a servo motor is shown in the following picture.
Connecting the servo motor to the arduino.
The library can control 12 servos using only 1 timer.
The servo motor has a female connector with three pins.
Connect this to the arduino gnd.
One is for power 5volts ground and the white wire is the control wire.
You can connect small servo motors directly to an arduino to control the shaft position very precisely.
Allows arduino genuino boards to control a variety of servo motors.
Because servo motors use feedback to determine the position of the shaft you can control that position very precisely.
On the arduino due you can control up to 60 servos.
You can see the control circuitry the motor a set of gears and the case.