A servo twitches even though your program says “hold still.” Is its power supply sagging, is the program changing the command, or is the mechanism simply noisy? Replacing an MG995 with an MG996R cannot answer that question. A controlled experiment can.
In this project, an Arduino UNO R3 sends one known command while a separate supply powers one unloaded positional servo. You will compare a constant command with a deliberately changing one, measure voltage at two places, and write down what each observation actually proves.
First understand the three wires
A servo is a motor, gearbox and feedback controller packaged together. A positional servo tries to move its shaft toward a requested position. The feedback is information about its present position used to correct the difference. A continuous-rotation version instead uses its command to request rotation direction and speed; it is not suitable for this position-holding experiment.
MG995 and MG996R are model names, not electrical interface guarantees. TowerPro warns about counterfeits and documents more than one MG996R variant. Its current standard MG996R page gives a 4.8–6.6 V operating range, but does not specify the input voltage thresholds or a complete pulse-to-angle calibration. Do not silently fill those gaps with a reseller’s diagram.
- Power positive: energy for the motor and its internal controller. Here it comes directly from the separate supply.
- Ground, GND: the common electrical reference and return connection. The servo and Arduino must share a reference for the signal to be meaningful.
- Signal: a command from Arduino digital pin D9. It does not carry the motor’s operating power.
Wire colors are clues, not identification. Verify the connector order and wire functions from the documentation for your actual unit. This article deliberately labels the wires by function instead of relying on a color code.
What “jitter” can mean
Pulse width is the time a command stays at its high voltage. A microsecond, written µs, is one millionth of a second. A millisecond, ms, is one thousandth of a second. The Arduino Servo library repeats the requested pulse in the background; for one channel its nominal minimum refresh interval is 20 ms, corresponding to 50 repetitions per second. That is a library timing setting, not a measurement of this assembled circuit.
Jitter is unwanted variation. Specify what varies: command numbers, physical pulse widths, supply voltage or shaft position. A constant number printed in the Serial Monitor only establishes the program’s requested value. It does not measure the outgoing waveform or the shaft.
Pulse-width modulation, PWM, means encoding information using pulse duration. Hobby-servo control uses pulse duration as its command; it is not interchangeable with Arduino’s analogWrite() duty-cycle output. Duty cycle is the fraction of each period spent high. Do not replace the Servo calls in this experiment with analogWrite(9, 128).
Parts and compatibility gate
| Item | Exact choice or requirement | Purpose |
|---|---|---|
| Controller | Original Arduino UNO R3, ATmega328P version; Arduino AVR Boards 1.8.6; Arduino Servo library 1.2.2 | One 5 V digital command channel; do not substitute an UNO R4 or a 3.3 V board without a new interface review. |
| Servo | One traceable TowerPro MG996R positional unit, supplier-confirmed to accept a 5 V signal and the 1400–1600 µs window used here, including 1500 µs at startup | The device under test. An MG995 may be tested separately only after the same checks against its own exact documentation. |
| Motor supply | Regulated, isolated low-voltage bench output set to 5.0 V; adjustable current limit; short power leads and screw-terminal distribution rated for at least the selected 2 A limit | Keeps motor current out of the UNO’s power path. Its transient response still needs checking. |
| R1, R2 | 1 kΩ series resistor; 100 kΩ pull-down resistor, each ±5%, 0.125 W or greater | R1 limits incidental signal-path current; R2 weakly holds the servo signal low while the controller pin is inactive. Neither is a level converter or guaranteed power-sequencing protection. |
| C1, C2 | 470 µF, 16 V polarized electrolytic and 100 nF, 16 V or greater ceramic, directly across the servo connector supply | Local charge storage and high-frequency bypass. These are starting component choices, not a guaranteed cure. |
| Tools | A digital multimeter with a voltage range above 5 V; optional oscilloscope; a rigid case clamp and an accessible supply-off control | Check wiring, voltage and, optionally, fast electrical behavior. |
Hardware documentation: Arduino UNO Rev3 — official hardware documentation · MG996R — TowerPro product documentation. Confirm the positional variant and the exact-unit interface requirements below before selecting a servo.
Optional solderless breadboards for the signal resistors in this experiment. Keep servo motor power and its return on separate, suitably rated terminals.
Optional accessory: a solderless breadboard holds parts with spring contacts, without soldering. Use it only for the signal resistors in this experiment. Keep servo motor positive and return on the rated terminal wiring, outside the breadboard. If used, one board is enough. Check the contact groups with all power disconnected before wiring.
Temu affiliate offer · Product idea
Optional electronics starter-kit advertisement
Electronics component starter kit with a breadboard, jumper wires and assorted parts. Arduino controller board not included.

Product idea only, not a verified experiment parts list. Use the exact hardware and wiring specified in the article; this kit is not a confirmed substitute. Tricky Circuit has not bench-tested this kit.
Some links below are Temu affiliate links. Tricky Circuit may earn a commission if you buy through them.
AVR is the name of the processor architecture used by this board’s ATmega328P; Arduino AVR Boards is the software package that supplies its build support. Universal Serial Bus, USB, powers the UNO from the computer and carries the Serial Monitor messages. The Serial Monitor is the Arduino editor’s text terminal for sending commands and reading the program’s replies.
A regulated supply attempts to maintain its set output voltage. An isolated supply electrically separates its low-voltage output from the mains input. A current limit restricts output current, often by reducing voltage when the limit is reached. For this unloaded single-servo protocol, 2 A is a proposed ceiling for compatible wiring and a verified unit, not a universal MG995/MG996R requirement or a certified safe limit for every sample. If the output enters limiting, turn it off and investigate; do not keep raising the setting until the symptom disappears.
Before powering anything, record the servo’s exact model, variant, source and connection diagram. Obtain its signal compatibility and allowed pulse range. If those cannot be confirmed, stop at the unpowered wiring and software exercises. The model label alone is insufficient evidence. The 1400–1600 µs software window is deliberately narrow, but “narrow” does not make an undocumented position mechanically safe.
Build the power path separately from the signal path
A node is a set of electrically connected points. The star return below is one junction where separate return wires meet. It keeps the large motor return current out of the short Arduino reference lead. Every real wire has resistance, so the layout matters even when a diagram calls several points “ground.”

- Disconnect USB and turn the motor supply off. Remove the horn, the arm attached to the output shaft, and all external loads. Clamp the servo’s case so it cannot drag the leads. Keep fingers clear of the shaft.
- Connect the bench supply negative terminal to a short terminal-block junction, labeled STAR. Run a separate suitably rated return wire from STAR to the servo ground.
- Run a separate reference wire from UNO GND to STAR. Do not make the servo’s motor return travel through an UNO header, a thin jumper or a solderless breadboard power rail.
- Connect bench supply positive directly to the servo power-positive terminal using the rated power path. Leave UNO 5 V, 3.3 V and VIN disconnected from this external positive node.
- Connect UNO D9 → R1, 1 kΩ → servo signal. Connect R2, 100 kΩ, from the servo side of R1 to the servo ground terminal. A resistor’s value describes how strongly it opposes current; kΩ means one thousand ohms.
- Connect C1 and C2 across servo positive and servo ground near the connector. A capacitor stores charge between two terminals. For C1, verify the actual polarity markings: its positive terminal goes to positive supply, its negative terminal goes to ground. C2 is not polarized.
- With all power absent, inspect for reversed power, loose strands and shorts. Use the meter’s continuity function only on the unpowered circuit to verify the common return. Continuity can establish a connection; it cannot certify that a wire can carry the motor current.
Put the signal resistors on a small breadboard if convenient, while keeping the servo supply on the rated terminal path. Do not open or modify a mains adapter. The experiment uses only its isolated low-voltage output.
Calculate why a capacitor cannot fix every problem
Ohm’s law relates voltage drop, current and resistance: ΔV = I × R. Here ΔV means the amount of lost voltage, I is current in amperes (A), and R is total outgoing-plus-return resistance in ohms (Ω). Use hypothetical numbers to understand scale, then replace them with real measurements.
If the complete cable-and-contact path has 0.30 Ω resistance and the servo draws a hypothetical 1.20 A pulse, the path loses 1.20 × 0.30 = 0.36 V. A supply terminal at 5.0 V could then coexist with about 4.64 V at the servo, before considering the supply’s own response. This is a calculation example, not an MG996R current measurement. It would fall below the manufacturer’s stated 4.8 V lower operating limit for the named standard MG996R.
For an ideal capacitor supplying a current deficit, ΔV = I × Δt / C, where Δt is the duration in seconds and C is capacitance in farads (F). µF means one millionth of a farad. A 470 µF capacitor alone supplying 1 A for 1 ms would lose approximately 1 × 0.001 / 0.000470 = 2.13 V. Real capacitor resistance adds an immediate drop as well. Local capacitors can help with short disturbances, but they cannot make a weak sustained power source strong.
To limit that same idealized 1 A, 1 ms deficit to 0.20 V would require C = I × Δt / ΔV = 0.005 F = 5000 µF, before tolerances and resistance. This is not an instruction to install an arbitrarily large capacitor: larger capacitance changes startup charging current and may conflict with the supply. Fix the source, wiring and load first.
The complete command experiment
Create a sketch folder named servo_power_jitter containing the following two files. In the Arduino editor, select Arduino Uno from Arduino AVR Boards 1.8.6 and install Servo 1.2.2 in Library Manager. An integrated development environment, IDE, is the editor/build/upload application; “Arduino IDE” is the name used in its menus. This pinned software choice makes the intended setup repeatable; no successful target compilation is claimed here.
The program starts with the signal held low and requires a before sending commands. It never reads a knob or a sensor. j enables deliberate command dither, a known alternating request of 1490 and 1510 µs once per second; it is an explanatory test pattern, not random electrical jitter. Stopping that mode freezes its latest width. + and - change the request by 10 µs within the chosen window, while c requests 1500 µs.
x stops pulses and drives D9 low. It does not remove motor power or guarantee torque release. Your physical supply-off control remains the way to remove servo power. Do not use a disconnected signal as an emergency stop.
File 1: bench_controller.h
#ifndef TRICKY_SERVO_BENCH_CONTROLLER_H
#define TRICKY_SERVO_BENCH_CONTROLLER_H
#include <stdint.h>
// Application policy only. This does not measure the servo or its pulse waveform.
// Sink provides start(int), command(int), stop(), report(const char*, int).
template<class Sink> class BenchController {
public:
static const int kCenterUs = 1500;
static const int kLowUs = 1400;
static const int kHighUs = 1600;
explicit BenchController(Sink& hardwareSink)
: sink_(hardwareSink), armed_(false), dither_(false), target_(kCenterUs),
nextHigh_(true), lastToggle_(0) {}
bool armed() const { return armed_; }
bool dither() const { return dither_; }
int target() const { return target_; }
void input(char c, uint32_t now) {
if (c == '\r' || c == '\n' || c == ' ') return;
if (c == 'x') {
dither_ = false;
armed_ = false;
sink_.stop();
sink_.report("STOP_SIGNAL_NOT_POWER", target_);
return;
}
if (c == 'a') {
// Repeated a is idempotent: do not restart a live channel unexpectedly.
if (!armed_) {
target_ = kCenterUs;
dither_ = false;
sink_.start(target_);
armed_ = true;
sink_.report("ARM_COMMAND_US", target_);
}
return;
}
if (!armed_) {
sink_.report("DISARMED_TYPE_a", target_);
return;
}
if (c == 'j') {
dither_ = !dither_;
if (dither_) {
target_ = 1490;
nextHigh_ = true;
lastToggle_ = now;
sink_.command(target_);
sink_.report("DELIBERATE_DITHER_US", target_);
} else {
// Freeze the last requested width; no hidden return to the center.
sink_.report("FIXED_COMMAND_US", target_);
}
return;
}
int requested = target_;
if (c == '+') requested += 10;
else if (c == '-') requested -= 10;
else if (c == 'c') requested = kCenterUs;
else {
sink_.report("UNKNOWN_COMMAND", target_);
return;
}
dither_ = false;
if (requested < kLowUs) requested = kLowUs;
if (requested > kHighUs) requested = kHighUs;
target_ = requested;
sink_.command(target_);
sink_.report("FIXED_COMMAND_US", target_);
}
void tick(uint32_t now) {
// Unsigned subtraction handles the 32-bit millisecond clock rollover.
if (!armed_ || !dither_ || uint32_t(now - lastToggle_) < 1000U) return;
// A delayed loop makes one change, never a burst of missed changes.
lastToggle_ = now;
target_ = nextHigh_ ? 1510 : 1490;
nextHigh_ = !nextHigh_;
sink_.command(target_);
sink_.report("DELIBERATE_DITHER_US", target_);
}
private:
Sink& sink_;
bool armed_, dither_;
int target_;
bool nextHigh_;
uint32_t lastToggle_;
};
#endif
File 2: servo_power_jitter.ino
// Arduino UNO R3 (ATmega328P), Arduino AVR Boards 1.8.6, Servo 1.2.2.
// Verify the exact servo accepts 5 V control and the chosen pulse window first.
// The servo uses a separate 5.0 V supply; connect grounds, not positive rails.
#include <Arduino.h>
#include <Servo.h>
#include "bench_controller.h"
const uint8_t kSignalPin = 9;
Servo benchServo;
struct ArduinoSink {
void start(int pulseUs) {
// Keep library default attach bounds. The controller enforces 1400..1600.
// On re-arm, a first pulse may use the previous width before this write.
benchServo.attach(kSignalPin);
benchServo.writeMicroseconds(pulseUs);
}
void command(int pulseUs) { benchServo.writeMicroseconds(pulseUs); }
void stop() {
if (benchServo.attached()) benchServo.detach();
pinMode(kSignalPin, OUTPUT);
digitalWrite(kSignalPin, LOW);
}
void report(const char* label, int pulseUs) {
Serial.print(label);
Serial.print(' ');
Serial.println(pulseUs);
}
};
ArduinoSink sink;
BenchController<ArduinoSink> controller(sink);
void setup() {
sink.stop();
Serial.begin(115200);
Serial.println("BOOT: signal off. a=arm, x=signal off, +/-=10us, c=center, j=dither");
}
void loop() {
// Bound serial work so a continuously busy input cannot monopolize loop().
for (uint8_t n = 0; n < 16 && Serial.available() > 0; ++n) {
controller.input(char(Serial.read()), uint32_t(millis()));
}
controller.tick(uint32_t(millis()));
}
The controller file contains application policy: arming, bounds and the test pattern. The sketch adapts that policy to Arduino hardware. It keeps the library’s default attachment bounds and enforces the narrower window in its own controller. On re-arming, an initial pulse may retain the previous requested width before the center write takes effect; both must be safe for the documented unit. millis() is the elapsed-time counter in milliseconds; unsigned subtraction makes the interval test tolerate its 32-bit wraparound. A delayed loop makes one pattern change instead of a burst of “catch-up” movements. The 16-character processing budget bounds serial work per loop.
On the named UNO R3, this Servo implementation uses Timer1, an internal hardware counter. Do not combine this experiment with other Timer1-dependent libraries or expect ordinary analogWrite() behavior on D9/D10 while Servo is active. The tiny project uses neither other timer clients nor analog outputs.
Run three short trials
Use the same unit, no load, same power setting and same wire routing for the first three trials. Keep the source off while rewiring. A baseline is a recorded reference condition against which later changes are compared. Write observations even when the result is “no visible movement.”
- Unpowered-servo software baseline: leave motor power off. Connect USB, upload the sketch and open Serial Monitor at 115200 baud, its text transmission rate. Expect one BOOT message. Send
+: the reply should say DISARMED and no servo channel should start. Do not arm with servo power absent; this avoids deliberately driving an unpowered servo input. - Constant-command trial: with the program still disarmed and D9 low, enable the already verified 5.0 V motor output. Check polarity and measured voltage at the servo terminals. Send
a. Observe for 20 seconds without changing anything. Record movement, sound, supply-limit indicator, terminal voltage and any new BOOT message. Do not call the shaft angle “90 degrees”: 1500 µs is a command, not an angle calibration. - Known-changing-command trial: send
jand observe five logged changes. The requested widths should alternate once per second. Movement may be too small to see, and motion size is not specified by this article. Sendjagain: the last request should become constant. Check whether movement continues. Sendconly if the unit’s verified range and clearance allow it. - Small-step trial: use one
+or-at a time, allowing the unit to settle between requests. Do not seek the mechanical endpoints or hold the shaft by hand. Stop if it hits a limit, turns continuously, heats quickly, chatters strongly or causes the supply to limit. These symptoms invalidate continuation; they do not identify one universal fault. - Shutdown: send
x, switch motor power off, then unplug USB. Before any wiring change, disconnect both sources and allow C1 to discharge. Verify its voltage with the meter before handling the circuit.
If opening Serial Monitor resets the UNO, the new BOOT line is expected at that moment; a repeated banner during an untouched trial deserves investigation. A restart is evidence of a controller reset, not proof that the servo supply caused it.

Measure at the servo, not only at the supply
A digital multimeter, DMM, samples electrical quantities and displays numbers. In voltage mode, place it in parallel across the points being compared. Never leave its red lead in a current jack while measuring supply voltage; that can create a short circuit. Follow the meter’s own instructions.
Measure source positive to STAR, then servo positive to servo ground during the same repeated trial. If one meter is used, the readings are sequential and cannot prove what happened at the identical instant. A meter’s minimum/maximum capture is useful only within its documented capture capability. A steady display cannot exclude brief voltage dips.
| Record for each trial | What it tells you | What it does not establish |
|---|---|---|
| Command labels and requested µs | Whether the application intentionally changed its request | Physical pulse width or actual shaft position |
| Supply-terminal and servo-terminal voltage | Voltage where the source is connected versus where the load is connected | All fast dips, or cable resistance without simultaneous current data |
| Current-limit indicator | The supply reports that its selected limit is involved | A universal servo current specification or proof the servo is defective |
| BOOT messages | The program restarted, subject to serial connection behavior | The root cause of the reset |
| Shaft observations and sound | The mechanical symptom under your recorded conditions | Calibrated angle, torque, waveform jitter or model-wide quality |
An oscilloscope displays voltage versus time. If you already know how to use yours safely, inspect the pulse at the servo signal relative to servo ground and inspect supply disturbances at the connector. Check actual pulse widths, repetition and high/low levels against the exact unit’s limits. A logic analyzer can help inspect timing but cannot by itself validate analog voltage margins.
Use the instrument manufacturer’s grounding procedure. Bench oscilloscope ground clips may connect to protective earth; never clip one to the positive rail or defeat protective earth. This isolated low-voltage circuit does not authorize probing mains, opening a supply or attaching an unknown ground path through another instrument.
Change one thing, then repeat
- Commands vary and the shaft follows: first test with dither off. This separates intentional movement from the original complaint.
- Commands stay fixed but the physical pulse changes: inspect timer conflicts, long interrupt-blocking code, connectors and signal reference. This minimal sketch removes many application variables, but its host tests do not certify pulse timing.
- The servo voltage falls while the source stays acceptable: investigate the complete outgoing-and-return path, connectors and wire rating. Rewire only with both sources off, then repeat the same trial. Do not intentionally introduce a weak wire to cause failure.
- The supply limits or its output falls: disconnect and review source capability, the unit’s documented demand and whether the shaft is constrained. An arbitrary current-limit increase is not a diagnosis.
- Electrical observations look stable but motion remains: consider unit variant, internal feedback behavior, gearbox play and mechanical loading. A repeatable symptom on one sample is not evidence that every MG995 is worse than every MG996R.
Gearbox play is small free movement caused by mechanical clearances. Do not estimate it by forcing the powered shaft. The purpose here is an observation log, not a torque or destructive stall test. Stall means the motor is prevented from turning despite a drive request; intentionally causing it adds heat and stress without helping this beginner protocol.
Challenge: where did the missing voltage go?
In a hypothetical simultaneous measurement, the supply is 5.02 V and the servo terminal is 4.72 V while current is 1.0 A. Estimate the total power-path resistance. Would adding C1 guarantee a constant voltage throughout a long movement?
Answer and reasoning
The drop is 0.30 V, so R = ΔV / I = 0.30 Ω for the complete outgoing-plus-return path under those conditions. A capacitor can supply charge temporarily; it cannot remove that path resistance or support a sustained current deficit indefinitely. Improve the wiring/source/load situation and repeat measurements. The arithmetic assumes simultaneous current and voltage data; sequential DMM readings may not satisfy that assumption.
What has actually been checked
The downloadable source includes host tests of the actual C++ application controller and a mocked execution of the actual Arduino sketch. They check disarmed behavior, command bounds, intentional dither, stopping, delayed calls and time-counter wraparound. The calculator checks the stated Ohm’s-law and capacitor examples. Host compilation is compilation for the desktop computer, not an ATmega328P firmware build.
These checks do not include target compilation or execution, physical electrical tests, angle calibration or current measurement. Use the bench log to document your actual unit instead of presenting calculated examples as measurements.
Continue with the right next question
Use the existing MG995 versus MG996R comparison for model-selection context and the MG996R overview for the archive’s introduction. Keep model comparison separate from diagnosing your own sample. A later experiment can characterize a documented mechanical range, using a measured pulse waveform and an unloaded fixture; do not turn this narrow test into an automatic full sweep.
Primary references
- TowerPro standard MG996R product documentation — operating range, manufacturer current entries and variant/counterfeit caveats. The page does not provide a complete command-interface specification.
- TowerPro made-to-order MG996R Robot Servo page — a different named variant despite the historical MG995 URL; not proof of interchangeability.
- Arduino UNO R3 documentation — exact controller family and downloadable pinout.
- Arduino servo troubleshooting — separate power and common-ground checks.
- Arduino Servo 1.2.2 source — pulse generation, default 1500 µs and timer behavior for the pinned version. Library bounds are not the servo’s mechanical limits.


