Hello friends, I hope you all are doing great. Today, I am going to share the new MG996R Servo Motor Library for Proteus V1.0. When a little SG90 is not strong enough - a robot arm that lifts something, the steering of an RC car, a pan-tilt head with a camera on it - makers reach for the black MG996R. It is a standard-size servo with metal gears and about five times the torque of a micro servo, and it is probably the most used servo in hobby robotics after the SG90.

Updates

MG996R Servo Motor Library for Proteus

Latest version: V1.0 (October 2026, this tutorial)

Other motors: SG90 Servo · TT Gear Motor · 28BYJ-48 Stepper · NEMA 17 Stepper · N20 Encoder Motor · JGA25-370 Encoder Motor · FS90R 360 Servo · 130 DC Motor · A2212 Brushless · X27.168 Gauge · Analog Panel Meter · DC Tachogenerator · LM393 Speed Sensor · MG90S Servo · DS3218 Servo · L12 Linear Servo · JGB37-520 Motor · RS-775 Motor · JGY-370 Worm Motor · 12V Linear Actuator · Coin Vibration Motor · Mini Submersible Water Pump · 12V Peristaltic Pump · 4-Pin PC Fan · 12V Push-Pull Solenoid · NEMA 23 Stepper Motor · Micro Linear Stepper · TYJ50 Synchronous Motor · Quartz Clock Movement · Air-Core Gauge · Electromechanical Counter · Split-Flap Display · Electric Bell · Wind Turbine · 8520 Coreless Motor · Car Wiper Motor · Car Door Lock Actuator · 12V Solenoid Water Valve · 12V Holding Electromagnet

Motor drivers: L298 · L9110S · TB6612FNG · BTS7960 · A4988 / DRV8825 · 28BYJ-48 + ULN2003 · PCA9685 Servo · Relay Module · 30A Brushless ESC · TB6600 Stepper Driver

Helping Tools

Now it has a Proteus library of its own. The model reads the pulses on its signal wire, runs the position loop of an analog servo and drives a strong motor through a metal gearbox, so the horn moves at the speed of a real MG996R and holds against the same loads. Above all, it draws its real current from the supply in your circuit: a few milliamps at rest, more than an amp when it starts a move and two amps when it stalls. The demo runs on our Arduino UNO V4.0 with the standard Servo.h library and a potentiometer as the knob.

NOTICE: a strong servo is a hungry servo, and that is exactly the part a simulator usually hides. So we built the MG996R from its physics - the pulse decoder, the position loop, the motor, the metal gears and the current it takes from V+ - and it took our team a lot of hard work. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below or in the Motor Driver board of our forum. And if our free libraries help you, you can buy us a coffee. So, let's get started with the MG996R Servo Motor Library for Proteus V1.0:

Figure: The MG996R Servo Motor Library for Proteus: the Arduino UNO V4.0 sends 1936 us pulses on D9 and the black MG996R holds its horn at 135 degrees, its PWR and SIG LEDs lit.

What is the MG996R Servo Motor?

The MG996R from TowerPro is a standard-size analog servo: a body of 40.7 x 19.7 mm with two mounting ears, a weight of 55 g and a splined output shaft for the horn. Inside it works like every hobby servo - a DC motor, a gear train, a potentiometer on the output shaft and a small control board that compares the angle it measures with the angle the pulses ask for - but every part is bigger. The gears are metal, the motor is stronger and the case is built for loads that would strip the plastic teeth of a micro servo.

It runs from 4.8 to 7.2 V and turns its horn through about 180 degrees. The torque grows with the voltage: 9.4 kg.cm at 4.8 V and 11 kg.cm at 6 V - roughly a 1 kg weight at the end of a 10 cm arm. The wires are the usual three: brown for GND, red for the supply and orange for the signal.

The MG996R at a glance
TowerPro MG996R
Supply4.8 - 7.2 V (the red wire)
Signalone pulse every 20 ms (50 Hz); 544 - 2400 us = 0 - 180 degrees with the Arduino Servo library
Stall torque9.4 kg.cm at 4.8 V, 11 kg.cm at 6 V
Speed0.17 s for 60 degrees at 4.8 V, 0.14 s at 6 V (no load)
Currentabout 10 mA at rest, 0.5 - 0.9 A moving, up to 2.5 A when it starts or stalls
Gearsmetal
Size and weight40.7 x 19.7 mm body, 55 g
Wiresbrown GND, red V+, orange SIG

Why the MG996R Needs Its Own Power Supply

Torque costs current. The MG996R's motor has a winding of only a few ohms, so in the first milliseconds of a move, before the motor has picked up speed and built its back-EMF, the current jumps well above an amp; against a load that it cannot move it stays at two amps or more. The 5V pin of an Arduino on USB power cannot give that. The voltage sags, the Arduino resets, and the servo twitches every time the sketch starts again - one of the most common questions in every robotics forum.

The fix is simple: the red wire gets its own 5 - 6 V supply of 2.5 A or more, and the GND of that supply is joined to the Arduino's GND. The library makes the problem visible before you meet it on the bench: the current is drawn from V+ in your circuit, the pop-up draws it on a graph, and the Check page says when the peaks reach the stall level.

What's New in MG996R Servo Motor Library for Proteus V1.0

  • The MG996R as a part of its own: the black standard-size servo seen from the top, with a white single-arm horn that turns to the simulated angle.
  • The MG996R's numbers: 9.4 kg.cm at 4.8 V and 11 kg.cm at 6 V, about 0.2 s for a 60 degree move at 4.8 V with the start and the settling.
  • Real current from V+: 10 mA at rest, more than an amp at the start of a move, 2.0 A stalled at 4.8 V and 2.5 A at 6 V.
  • The Servo library's pulses: 544 - 2400 us = 0 - 180 degrees by default, so write(90) means 90 degrees; PULSE_MIN and PULSE_MAX for other libraries.
  • Loads and a brake: 2 - 8 kg.cm from the pop-up, a LOAD property and a 13 kg.cm brake when you click the horn.
  • A pop-up window with Servo, Graphs, Event log and Check pages in the look of our serial monitor.
  • Warnings in words: no power, SIG stuck HIGH, analogWrite PWM, pulses too fast, a pulse beyond the range, a stall, and stall-level currents that call for a separate supply.
  • An A4 demo on our Arduino UNO V4.0 with a potentiometer as the knob and serial monitor commands.

The MG996R in Proteus

Figure: The part as the library draws it: the black MG996R on its plate, the horn at 30 degrees, the orange target marker, the PWR and SIG LEDs and the strip.

Search MG996R in Pick Devices; the device MG996RSERVOTEP is in TEPMG996R.LIB (category Electromechanical, Servo Motors) and its model is TEPMG996R.DLL. The servo is drawn at its real size from the top: the black body, the two ears with two holes each, the round boss of the output shaft and the white single-arm horn. The brown, red and orange cable leaves the body and runs to the plug at the top right with its GND, V+ and SIG pins.

The servo sits on a light TEP plate with a 0 - 180 degree scale round the horn. The horn always points at the angle the model has computed; a small orange triangle points at the angle the pulses ask for, so during a move you see the target first and the horn following it. The red PWR LED lights when V+ is high enough and the amber SIG LED while pulses come in. The strip under the plate shows the angle, the last pulse width and the current, and holds the OPEN PANEL button. The plate, the scale, the LEDs and the strip are TEP additions; the real servo has none of them.

Figure: SERVO1 in the running demo: the horn at 135 degrees, 1936 us on the strip and 10 mA - holding still costs almost nothing.

The Pins and the Properties

The three pins of the MG996R
PinWireWhat the model does with it
GNDbrownthe return of the servo's current
V+redthe supply, 4.8 - 7.2 V: the servo draws up to 2.5 A from it (3 V and less: nothing moves)
SIGorangea digital input: every edge is time-stamped; a 300 - 3000 us HIGH is a servo pulse
Double-click the servo to change them; every run starts again from the properties
PropertyDefaultWhat it does
PULSE_MIN544the pulse for 0 degrees, in us (the Servo library's number)
PULSE_MAX2400the pulse for 180 degrees, in us
START90the horn's angle when the simulation starts
LOAD0a constant load on the horn in kg.cm (the MG996R gives 9.4 kg.cm at 4.8 V, 11 kg.cm at 6 V)

A Click on the Horn: the 13 kg.cm Brake

While the simulation runs, a click on the horn holds it with 13 kg.cm - more than even an MG996R can push. An orange ring appears round the hub. Ask for a new angle and the horn stays where it is, the current climbs to the stall level and a red dot on the hub says STALLED. A second click lets go. It is the quickest way to see what a jammed robot arm does to your power supply.

Download MG996R Servo Motor Library for Proteus

The download link of MG996R-Servo-Motor-Library-for-Proteus-v1.0.zip (without the source code) will be added here soon. The zip file will contain:

  • README.txt: installation, the demo, the wiring, the properties, real hardware, troubleshooting and the limits.
  • Proteus Library Files: TEPMG996R.LIB and ArduinoV4TEP.LIB from our Arduino Library for Proteus V4.0.
  • Proteus Model Files: TEPMG996R.DLL and TEPARDUINO.DLL.
  • Proteus Simulation: MG996R-Servo-Motor-ArduinoUnoV4.pdsprj, MG996R_Servo_Demo.hex and copies of the two DLLs.
  • Arduino Code: MG996R_Servo_Demo.ino (the Servo library comes with the Arduino IDE).

No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.

How to Install MG996R Servo Motor Library for Proteus

  1. Close Proteus and extract the whole zip file, for example to your Desktop.
  2. Copy TEPMG996R.LIB and ArduinoV4TEP.LIB from Proteus Library Files into the LIBRARY folder of Proteus (usually C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\LIBRARY).
  3. Copy TEPMG996R.DLL and TEPARDUINO.DLL from Proteus Model Files into the MODELS folder. The two Arduino files belong to our Arduino Library V4.0; if you already have it, they are the same files.
  4. Delete TEPMG996R.IDX from the LIBRARY folder if it is there.
  5. Start Proteus, press P and search for MG996R.

Tip: keep the Proteus Simulation folder together, because the project needs its .hex file and the DLLs beside it. The library is tested in Proteus 8.5; Proteus 7 is not supported.

The Demo Circuit

Figure: The demo project running on its A4 sheet: ARD1, SERVO1 with its horn at 135 degrees and RV1 at 75 %.

Open MG996R-Servo-Motor-ArduinoUnoV4.pdsprj. The A4 sheet holds three parts: ARD1, an Arduino UNO V4.0 from our Arduino UNO Library for Proteus V4.0 running MG996R_Servo_Demo.hex with its serial monitor built in; SERVO1, the MG996R; and RV1, a 10k potentiometer on A0 that works as the knob. The SIG pin of the servo and D9 of the UNO meet through a net label called SIG; V+ is on the +5V power terminal and GND on a ground terminal.

The wiring of a real MG996R
MG996R wireArduino UNONote
brown (GND)GNDjoined with the GND of the servo supply
red (V+)a 5 - 6 V supply of 2.5 A or morenever the UNO's 5V pin on real hardware
orange (SIG)D9any digital pin: the Servo library makes the pulses with Timer1
RV1 wiperA0the ends of the pot on 5V and GND

About the +5V terminal: in Proteus the +5V terminal is an ideal source that never sags, so the demo can feed the servo from it and still show you the 2 A peaks. On your bench the same circuit needs a separate supply for the red wire, with its GND joined to the Arduino's GND.

The Arduino Code

The sketch uses the Servo library that comes with the Arduino IDE; if you know our older Servo Motor Control using Arduino tutorial, the commands are the same. New to Arduino? Start with Arduino Tutorial for Beginners and Introduction to Arduino UNO. The library, the two pins:

#include <Servo.h>

const int SERVO_PIN = 9;
const int POT_PIN = A0;

attach() starts the pulses on D9. From then on the Servo library sends one pulse every 20 ms in the background, so the rest of the sketch is free to read the pot and the monitor:

void setup() {
  Serial.begin(9600);
  servo.attach(SERVO_PIN);

The serial monitor is read one character at a time. A carriage return or a new line ends a command, so the sketch works with any line ending the monitor sends:

  while (Serial.available()) {
    char c = Serial.read();
    if (c == '\r' || c == '\n') { line[len] = 0; command(line); len = 0; }
    else if (len < sizeof(line) - 1) line[len++] = c;
  }

A number is an angle. write() turns it into a pulse between 544 and 2400 us, and the sketch prints the pulse it asked for:

  if (*s >= '0' && *s <= '9') {
    int a = atoi(s);
    if (a > 180) { Serial.println(F("Angle: 0 - 180")); return; }
    ensureAttached(); mode = FIXED;
    servo.write(a);
    report(a);
    return;
  }

In knob mode the pot on A0 is read every 15 ms and mapped onto 0 - 180 degrees, exactly as in the Knob example of the Arduino IDE:

    int raw = analogRead(POT_PIN);
    int angle = map(raw, 0, 1023, 0, 180);

The sweep turns round at the top. It counts up one degree every 15 ms, and at 180 it starts counting down:

    sweepAngle += sweepStep;
    if (sweepAngle > 180) { sweepAngle = 179; sweepStep = -1; }

And detach stops the pulses altogether. An analog servo is driven only while pulses come, so after detach() the MG996R no longer holds its angle with the motor, only with the friction of its gears:

  if (!strcmp(s, "detach")) { servo.detach(); mode = FIXED; Serial.println(F("detach(): no pulses - the horn is not driven")); return; }

The HEX file is in the package. To change the sketch, open it in the Arduino IDE and export the compiled binary, as in How to get the HEX file from Arduino. It needs 6,648 bytes of flash (20 % of the UNO) and 306 bytes of RAM.

Running the Demo

Press Run. The UNO's serial monitor and the servo's pop-up open over the schematic; move them aside. RV1 starts at 75 %, which asks for 135 degrees:

MG996R Servo Motor demo - The Engineering Projects
Turn the pot on A0, or type an angle.
Commands: 0-180 = angle, us 1500 = pulse width, sweep, knob, detach, help
Pot 768 -> Angle 135 deg -> pulse 1936 us

The horn leaves its start at 90 degrees and the Event log reports "reached 135.0 deg from 92.9 in 166 ms". Then it holds at 135.3 degrees and the strip shows 10 mA: holding an angle with no load costs the MG996R almost nothing.

Figure: ARD1's monitor: the pot at 135 degrees, then 30, knob, 150 and knob typed in the monitor.

Type an angle in the monitor and press Send. The pot is ignored until you type knob:

30
Angle 30 deg -> pulse 853 us
knob
Following the pot on A0
Pot 768 -> Angle 135 deg -> pulse 1936 us
150
Angle 150 deg -> pulse 2090 us

The long move from 135 down to 30 degrees takes 341 ms, an average of 308 degrees per second, and the way back after knob 345 ms. That is slower than the little SG90 - the price of the bigger gear ratio - and it matches the datasheet's 0.17 s for 60 degrees at 4.8 V once the start and the slow-down at the end are added.

The commands of the demo sketch
TypeWhat it doesWhat the run showed
0 - 180go to that angle and stay30: 853 us, "reached 30.0 deg from 135.3 in 341 ms"
us 1500writeMicroseconds(), 400 - 2900 usus 2800: the horn pushes against its end stop at stall current
sweep0 to 180 to 0 degrees, 1 degree every 15 msthe horn follows the target a little behind
knobfollow the pot on A0 againback to 135.2 degrees in 345 ms
detachstop the pulsesthe horn is no longer driven and holds by friction
helpthe list of commands

The Pop-Up Window

At Run the servo opens TEP MG996R Servo Motor, a window in the look of our TEP Serial Monitor Advance for Proteus. Its four tabs are Servo, Graphs, Event log and Check; the gear and question mark icons open Settings and Help, and the palette icon switches the theme. If you close it, OPEN PANEL on the strip brings it back.

Servo

Figure: The Servo page while the MG996R holds 135 degrees: the green banner, the dial, eight live values and the last pulse.

The banner names the state in big letters - HOLDING, MOVING, NO PULSES, STALLED or NO POWER - with the angle and the pulse. The dial shows the horn in white and the target in orange. Eight live values follow: the target, the angle, the pulse width, the pulse rate, the speed, the current, the supply and the load. The bottom panel draws one 20 ms frame and the last pulse against the 0, 90 and 180 degree marks. The toolbar puts a load of 2, 4, 6 or 8 kg.cm on the horn, or the brake.

Graphs

Figure: Graphs after knob: the horn (blue) follows the target (orange) from 30 to 135 degrees, and the current jumps above 1.2 A at the start of the move.

Graphs draws the angle of the horn and the target, the supply current and the pulse width over the last 1, 3 or 6 seconds. Look at the middle graph: the move starts with a sharp current peak of more than an amp while the motor speeds up, falls to a small running current, and drops back to 10 mA as soon as the horn arrives. That peak is what resets an Arduino that powers the servo from its own 5V pin. Freeze holds the page for a closer look.

Stalling the MG996R

Figure: The brake on and 150 degrees asked: the horn cannot move, the banner says STALLED and the servo draws 2093 mA.

Click the Brake chip on the pop-up, or the horn on the schematic, and type 150. The target jumps to 149.9 degrees, but the horn stays at 135. The banner turns red, the angle and the current get red frames, and the current settles at about 2.09 A - the stall current of an MG996R at 5 V. On a real servo that is a hot motor within seconds, and on an Arduino's 5V pin it is a reset.

Figure: The Event log, newest first: the moves of the run with their times and speeds, the brake and the STALLED warning.

The Event log tells the same story in words, newest first. It keeps the power, the first pulses, every target with its pulse width and every finished move with its time and average speed. At the top is the warning: "STALLED at 135.4 deg - the load (13.0 kg.cm) is above its torque (9.4 kg.cm at 4.8 V, 11 at 6 V), 2088 mA". Release the brake and type knob, and the horn returns to 135 degrees. With the smaller loads of the toolbar the servo still moves: the model's automatic tests show it still reaching its target with 6 kg.cm on the horn, a little slower and a fraction of a degree short, as a real analog servo droops.

The Check Page

Figure: The Check page after the run: everything green except the current, whose 2093 mA peak calls for a separate supply.

The Check page puts every condition in a row with a verdict - green for fine, amber for check, red for wrong. After the run the supply, the signal, the pulse rate, the pulse widths, the load and the position are green. The current is amber: "10 mA now, 2093 mA peak - stall-level peaks: give the MG996R its own 5 - 6 V supply (2.5 A), GND common". Under the rows are the lines of Arduino code a servo needs and a reminder to match PULSE_MIN and PULSE_MAX with your library.

SG90 or MG996R?

Both servos speak the same language - the same pulses, the same library, the same three wires - so the choice is about the job. Our SG90 Servo Motor Library for Proteus covers the little blue micro servo; this one the strong black standard servo. Their models were checked side by side with the same automatic tests:

The two servo libraries side by side
SG90MG996R
Torque1.8 kg.cm at 4.8 V9.4 kg.cm at 4.8 V, 11 at 6 V
60 degrees (with the settling)about 0.15 s at 4.8 Vabout 0.2 s at 4.8 V
Stall currentabout 0.65 A2.0 A at 4.8 V, 2.5 A at 6 V
Gearsplasticmetal
Weight9 g55 g
Good forpointers, flaps, small armsrobot arms, steering, pan-tilt heads

Need many of them? Our PCA9685 Servo Driver Library for Proteus drives sixteen servos over I2C. For MG996Rs the PCA9685 only makes the pulses; the servos still need a strong supply of their own on the board's V+ terminal.

How the Model Works

Proteus solves the analog part of a circuit in time steps and runs the digital part, the Arduino with its pulses, before each step. The servo keeps every edge on SIG with its exact time, so it measures each pulse to the microsecond. Over each analog step it integrates its motor and horn in 50 us slices: the pulse sets the target, the position loop compares it with the angle, the board drives the motor for about 22 ms after each pulse, and the 2.4 ohm motor fights its back-EMF, the friction and the load through the metal gearbox.

The current is part of your circuit. The model draws it from V+, so a supply with a series resistor sags under a stall in the simulation as it would on the bench, and an ammeter in the red wire reads what the pop-up shows. We checked the model on a PC with 26 automatic tests: a 60 degree move takes 0.197 s at 4.8 V and 0.161 s at 6 V with the start and the settling, the top speed is 345 degrees per second, the overshoot is 0.2 degrees, a 13 kg.cm load stalls it at 2.0 A, and the Sweep example is followed within 1.8 degrees.

Troubleshooting

  • The horn never moves and the pop-up says NO POWER: V+ is not connected or below 3 V; an MG996R wants 4.8 - 7.2 V.
  • WAITING FOR PULSES: SIG is on another pin than the one in attach(), or the sketch never calls attach().
  • "SIG stays HIGH" or "pulses under 300 us": digitalWrite() or analogWrite() on the SIG pin - use the Servo library.
  • The horn stops a few degrees short: a load - the LOAD property, a load button or the brake (the orange ring).
  • The horn sits at an end and the current is high: a pulse beyond the range, or PULSE_MIN / PULSE_MAX do not match the library; the Check page shows the widths it saw.
  • No horn, no UNO or no monitor: TEPMG996R.DLL or TEPARDUINO.DLL is missing from MODELS and the project folder; a closed monitor opens again with a click on the UNO's USB port.

Things to Know Before Using a Real MG996R

  • A separate supply: an MG996R draws 0.5 - 0.9 A while it moves and up to 2.5 A when it starts or stalls. Give the red wire its own 5 - 6 V supply - a 2 A or bigger adapter, a BEC or four AA cells - with GND common to the Arduino.
  • A capacitor: 470 - 1000 uF across the servo supply, close to the servo, smooths the start-up current.
  • Each servo has its own range: many MG996Rs turn less than 180 degrees for 544 - 2400 us, or hit their end stop early. Find the limits of yours and use attach(pin, min, max); a servo pushing against its stop runs hot.
  • analogWrite() is not a servo signal: it is 490 or 980 Hz PWM. Use the Servo library.
  • Jitter at rest: some MG996Rs hum or twitch while they hold; a clean supply and short signal wires help.

Limitations of the Simulation

  • The model is the standard 180 degree analog MG996R at 50 Hz; digital servos and continuous rotation servos are other parts.
  • Not modelled: the variation of the range and the dead band from one servo to the next, gear play, the jitter some MG996Rs show at rest, heating, and damage from a wrong supply (the model only warns).
  • The plate, the scale, the LEDs, the strip and the brake are TEP additions.
  • The model is our own, written from the typical data of the MG996R; this library is not made or endorsed by TowerPro, Arduino or Labcenter.
  • Licences: the demo HEX contains the Arduino Servo library 1.2.2 (LGPL 2.1) and the Arduino AVR core 1.8.6 (LGPL); the sketch is included and the README gives the source links. The potentiometer is Proteus's own POT-HG.
  • Tested in Proteus 8.5 in October 2026 with the demo as shipped: the knob, the angles, the brake, knob again and all four pages of the pop-up. Proteus 7 is not supported.

So, that was all about the MG996R Servo Motor Library for Proteus V1.0. I hope it helps you size the power supply of your robot arm before the first servo browns out your Arduino, and try your servo code with the real speed and torque of the MG996R. If you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!