Easy Basics: Project 005c SG90 Micro Servo Motor

of Acoptex.com in UNO

Basics: Project 005c

Project name: SG90 Micro Servo Motor

Attachments: libraries and sketch

In this project, you need these parts :

1.Aruduino Uno R3 (you can also use the other version of Arduino)

2.SG90 Micro servo motor 9g

3.Arduino IDE ( you can download it from here  )

4.Jumper cables

5. Capacitor 100 uF 1 pc


In this project we will learn how to connect SG90 micro servo to arduino board.

Understanding the servo motors

Servo motors function based on the waves of pulses sent by a command, say from a transmitter, to create a mechanical motion. For example, we use a servo to control steering by adjusting the levers back and forth. We also use a servo to control the speed of the car by connecting it to the engine throttle.

The specification of a servo is normally being set by the turning angle per time at 60 degrees (speed) and the load carrying capacities (torque). There are also weight and dimension in the specifications.

In general, a servo contains a control circuit, DC motor, and potentiometer. The potentiometer is a position sensor that is connected to the output shaft. The shaft is attached to the control wheels by gears and the movement as well as its direction is controlled by an electrical signal.

So, how does the servo work? Well, firstly, there are three wires connected to the servo. One of them is the signal wire. This is the component that is responsible for supplying the electrical pulses. The motor turns to the appropriate direction as commanded by the pulses. When the motor rotates, it changes the resistance of the potentiometer and ultimately allows the control circuit to regulate the amount of movement and direction. When the shaft is at the desired position, the supply power shuts off.

Analog servo motor

An Analog servo motor is the standard type of servo. It regulates the speed of the motor by simply sending on and off pulses. Normally, the pulse voltage is at a range between 4.8 to 6.0 volts and constant while at that. The analog receives 50 pulses for every second and when at rest, there is no voltage sent to it. The longer the “On” pulse is being sent to the servo, the faster the motor spins and the higher the produced torque. One of the major drawbacks of the analog servo is its delay in reacting to small commands. It does not get the motor spinning quickly enough. Plus, it also produces a sluggish torque. This situation is called “deadband.”

Digital servo motor

A Digital Servo has a different way of sending pulse signals to the servo motor. If analog is designed to send a constant 50 pulse voltage per second, the digital RC servo is capable of sending up to 300 pulses per second! With this rapid pulse signals, the speed of the motor will increase significantly, and the torque will be more constant; it decreases the amount of deadband.  As a result, when the digital servo is used, it provides quicker response and faster acceleration to the RC component.

Also, with the fewer deadband, the torque also provides a better holding capability. When you operate using a digital servo, you can experience the immediate feel of the control.

Analog Vs Digital

Let say you are to link a digital and analog servo to a receiver. When you turn the analog servo wheel off-center, you will notice it responds and resists after a while – the delay is noticeable. However, when you turn the wheel of the digital servo off-center, you will feel like the wheel and shaft responds and holds to the position that you set very quickly and smoothly.

Physical wise, there is not much of a difference. Both use three-wire connection system and contain similar inner parts. The only difference is perhaps the digital has a microprocessor that automatically regulates the frequency of the pulses. When we compare the two RC servo motors, the difference is more obvious from the operational perspective. Upon comparison, we have learned that the digital version has several advantages over the analog.

  • Digital servos produce higher speeds and acceleration than analog servo
  • Digital servos have a higher torque and consequently better holding capability

As you can see from above, the digital type has a quicker and smoother output compared to analog. However, there is a little bit of disadvantage that comes with this type of servo – high power consumption. It makes sense because the signals of on/off are being sent more frequently compared to analog. Therefore, it sure has a greater accuracy, but it comes with the cost of power.

If you wish to switch from analog to digital servo for your RC models, we highly advise you to use a capable battery or switch to BEC circuit to power the servo. Once you adjust the battery or circuit to suit the powerful digital servo, the power consumption is no longer an issue.

Plus, the digital servo also comes with a little bit of noise when it is in a neutral mode or not being commanded to move. This is due to the rapid voltage adjustment made inside the motor. Regarding the monetary cost, digital servos are more expensive than the analog models.

In addition to that, the hundreds of voltage pulses sent to the motor can also drain the battery pretty quickly. On another note, you should know that not all digital servos are better than the analog ones. When you compare between the low-spec digital and high-spec analog, the latter might provide better speed and torque. In our project we will use SG90 Mini servo motor, tiny and lightweight with high output power. Servo can rotate approximately 180 degrees(90 in each direction), and works just like the standard kinds but smaller. You can use anyservo code, hardware or library to control these servos. Good for beginners who want to makestuff move without building a motor controller with feedback & gear box, especially since itwill fit in small places. It comes with a 3 horns (arms) and hardware.

See SG90 mini servo specification here

When a servo motor starts to move, it draws more current than if it were already in motion. This will cause a dip in the voltage on your board. By placing a 100uf capacitor across power and ground right next to the male headers you can smooth out any voltage changes that may occur. This capacitor called decoupling capacitor because its reduce, or decouple, changes caused by the components from the rest of the circuit. Be very careful to make sure you are connecting the cathode to ground (that’s the side with a black stripe down the side) and the anode to power. If you put the capacitors in backwards, they can explode.

Signals and contacts SG90 mini servo motor


The following picture shows the connections with Arduino Uno board.

Step by Step instruction

  1. Plug your Adruino Uno board into your PC and select the correct board and com port
  2. Open up serial monitor and set your baud to 9600 baud.
  3. Verify and upload the the sketch to your Adruino Uno.
  4. You can see the rocker arm of the servo rotate and stop at 90 degrees (15 degrees each time). And then it rotates in the opposite direction


We have learnt how to connect SG90 micro servo to arduino board.


  • See attachments on the begining of this project description.
  • The Servo library included in Adruino IDE program which installed in your PC.


  • See attachment on the begining of this project description

Other projects of Acoptex.com
Medium Basics: Project 083w Sipeed Maixduino board - Using PlatformIO IDE of Acoptex.com in Sipeed Maixduino 08-08-2019
Medium Basics: Project 083e Sipeed Maixduino board - Uploading MaixPy of Acoptex.com in Sipeed Maixduino 04-08-2019
Medium Basics: Project 083f Sipeed Maixduino board - Using MycroPython of Acoptex.com in Sipeed Maixduino 04-08-2019

Published at 14-08-2017
Viewed: 2334 times