ESP32 MG996R Servo
The MG996R is a high-torque servo motor ideal for robotics and demanding DIY projects. Operating on 4.8V to 7.2V, it delivers up to 11 kg·cm torque at 6V, with a ~120° rotation range controlled via PWM signals. Weighing 55g, its durable metal gears and dimensions (40.7mm x 19.7mm x 42.9mm) make it suitable for heavy-duty applications requiring strength and reliability.
Quick Links
mg996r Price
About MG996R Servo
The MG996R is a high-torque servo motor commonly used in robotics, RC models, and heavy-duty DIY electronics projects. It operates on an input voltage range of 4.8V to 7.2V and provides a torque of up to 11 kg·cm at 6V. The servo supports an angular range of approximately 120° (60° in each direction) and is controlled via PWM signals, where a pulse width of 1ms corresponds to 0°, 1.5ms to the midpoint, and 2ms to the maximum position. Weighing around 55 grams, the MG996R features robust metal gears and has dimensions of 40.7mm x 19.7mm x 42.9mm. Its high torque and durability make it ideal for demanding applications requiring strength and reliability, such as robotic arms, steering systems, and other heavy-duty mechanisms.
mg996r Sensor Technical Specifications
Below you can see the MG996R Servo Technical Specifications. The sensor is compatible with the ESP32, operating within a voltage range suitable for microcontrollers. For precise details about its features, specifications, and usage, refer to the sensor’s datasheet.
- Protocol: PWM
- Interface: PWM
- Stall Torque: 9.4 kg·cm (4.8V), 11 kg·cm (6V)
- Operating Speed: 0.17 s/60° (4.8V), 0.14 s/60° (6V)
- Operating Voltage: 4.8V to 7.2V
- Running Current: 500 mA (4.8V), 900 mA (6V)
- Stall Current: 2.5 A (6V)
- Dead Band Width: 5 µs
- Temperature Range: 0°C to 55°C
- Weight: 55 grams
- Dimensions: 40.7mm x 19.7mm x 42.9mm
- Gear Type: Metal
- Rotation Range: Approximately 120° (60° in each direction)
mg996r Sensor Pinout
Below you can see the pinout for the MG996R Servo. The VCC
pin is used to supply power to the sensor, and it typically requires 3.3V or 5V (refer to the datasheet for specific voltage requirements). The GND
pin is the ground connection and must be connected to the ground of your ESP32!
- The servo's
GND
wire (brown) is used to complete the electrical circuit and must be connected to the ground of the ESP32 and/or the external power source. - The servo's
+5V
wire (red) supplies power to the servo motor and must receive 5 to 7.2 volts from an external power source capable of providing sufficient current (up to 2.5A during stall conditions). - The servo's
DATA
wire (orange) carries the PWM signal to control the servo's position and should be connected to a PWM-capable GPIO pin on the ESP32.
mg996r Wiring with ESP32
Below you can see the wiring for the MG996R Servo with the ESP32. Connect the VCC pin of the sensor to the 3.3V pin on the ESP32 or external power supply for power and the GND pin of the sensor to the GND pin of the ESP32. Depending on the communication protocol of the sensor (e.g., I2C, SPI, UART, or analog), connect the appropriate data and clock or signal pins to compatible GPIO pins on the ESP32, as shown below in the wiring diagram.
- Connect the MG996R servo's signal wire (orange) to a PWM-capable GPIO pin on the ESP32 (e.g.,
GPIO 13
). - Connect the power wire (red) to the
5V
pin on the ESP32 or an external power source capable of supplying sufficient current (up to 2.5A during stall conditions). - Connect the ground wire (brown) to the ESP32's
GND
pin and ensure it is shared with the external power source if used.
Code Examples
Below you can find code examples of MG996R Servo with ESP32 in several frameworks:
ESP32 mg996r Arduino IDE Code Example
You can find the ESP32 MG996R Arduino IDE code in General Servo sensor page.
ESP32 mg996r ESP-IDF Code ExampleExample in Espressif IoT Framework (ESP-IDF)
You can find the ESP32 MG996R ESP-IDF code in General Servo sensor page.
ESP32 mg996r ESPHome Code Example
You can find the ESP32 MG996R ESPHome code in General Servo sensor page.
ESP32 mg996r PlatformIO Code Example
You can find the ESP32 MG996R PlatformIO code in General Servo sensor page.
ESP32 mg996r MicroPython Code Example
You can find the ESP32 MG996R MicroPython code in General Servo sensor page.
Conclusion
We went through technical specifications of MG996R Servo, its pinout, connection with ESP32 and MG996R Servo code examples with Arduino IDE, ESP-IDF, ESPHome and PlatformIO.