Servo
Controlling Continuous Servo with ESP32
What is the Continuous Servo?
A servo modified for full continuous rotation rather than fixed-angle positioning, useful as a simple speed-controlled wheel drive.
Specifications
| Operating voltage | 4.8V - 6V DC (5V typical) |
| Control signal | PWM, 50Hz, 1ms-2ms pulse width — but the pulse now sets speed and direction, not angle |
| Neutral point | ~1.5ms pulse = stopped; shorter/longer pulses spin one way or the other, further from 1.5ms = faster |
| Positioning | None — fully open-loop, no feedback on shaft angle, only continuous rotation |
| Typical no-load speed | ~50-60 RPM, varies by donor servo and how it was modified |
| Weight | ~9g-55g depending on donor servo (SG90-based vs MG996R-based) |
Continuous Servo Pinout
| Pin | Name | Description |
|---|---|---|
| 1 | GND | Ground — usually the brown or black wire |
| 2 | VCC | Power, 4.8V-6V DC — usually the red wire |
| 3 | Signal | PWM control input — usually the orange or yellow wire |
Every unit's stop point drifts slightly from the textbook 1.5ms. Sweep 1.3ms-1.7ms in code once and hard-code the value that actually stops your specific servo.
Setting Up Continuous Servo with ESP32
Library
Servo by Arduino
Bundled with the Arduino IDE core
Wiring
| Component pin | ESP32 pin | Note |
|---|---|---|
| VCC | 5V (VIN, if available on your ESP32 board) | Use an external 5V supply if the board resets when the servo moves |
| GND | GND | — |
| Signal | GPIO18 | Any PWM-capable GPIO works |
Example code
Unlike a positional servo, write() here sets speed and direction, not an angle -- 90 is stop, values above/below rotate at a speed proportional to distance from 90. The exact stop point varies per unit and may need trimming (e.g. write(88)).
Related Guides & Projects

ESP32-CAM Web Server: Stream Live Video in 5 Minutes
A complete, no-guesswork walkthrough for flashing an AI-Thinker ESP32-CAM as a live MJPEG video stream -- wiring, Arduino IDE setup, the CameraWebServer sketch, and every failure mode that actually causes problems.

ESP32 MQTT Tutorial: Publish and Subscribe with Arduino IDE
A complete, broker-agnostic ESP32 MQTT tutorial -- topics, QoS, retained messages, Last Will and Testament, TLS security for production, and a working publish/subscribe example with PubSubClient.

Installing ESP8266 in Arduino IDE: NodeMCU (ESP-12E) Complete Setup Guide for Windows
From driver headaches to a blinking LED — the full Windows walkthrough for getting NodeMCU ESP8266 boards running in Arduino IDE, plus notes for Mac and the bare ESP-01 module.

ESP32 Pinout Guide: Every GPIO, ADC, PWM, and Restricted Pin Explained
Complete ESP32 pinout guide covering all GPIOs, input-only pins, strapping pins, flash-reserved pins, dual ADC channels, PWM via LEDC, I2C, SPI, UART, and deep sleep wake pins.