The current era is the period of technology that would make things easy and simple. This article of interfacing a servo motor with #Arduino is also one such example. A servomotor can drive or revolve an object. That is if one wants to rotate an object at some specific angles or distance, then the servo motor comes in use. Servo motors find applications in toy cars, RC helicopters, and planes, Robotics, Machine, etc. The article covers the working and configuration of servo motor with Arduino in detail.
List of components used:
1. Servo motor
A servo motor is actually a rotary actuator which gives a precise control in terms of its angular position, acceleration, and velocity. A servo motor works on the principle of PWM (Pulse width modulation). This implies that depending on the width of the pulse that is applied the rotor will turn in the desire position. For this interfacing, an SG90 servo motor is used. The white piece in the picture is a rotor and is controlled by a bunch of gears inside. If a DC source powers the motor then it is called a DC servo motor and if powered by an AC source then it is called an AC servo motor.

2. Arduino Board
Arduino Board can read inputs such as light on a sensor, a finger on a button, or a Twitter message and convert it to an output such as activating a motor, turning on an LED, publishing something online. All of this can be done by sending a set of instructions to the microcontroller on the board by the use of the Arduino #programming language.

Circuit Diagram
The circuit below shows the connection of an #SG90 servo motor with the Arduino board. There are three wires of the servo motor. The brown wire is the ground wire, the red one goes to the 5 volts, and the orange one is called the #PWM wire which is connected to the digital line.
Code
Working
A circuit diagram image presenting the view before the codes are executed.
