Servo
Controlling Continuous Servo with ESP32
What is the Continuous Servo?
Continuous Servo practical reference
A servo modified for full continuous rotation rather than fixed-angle positioning, useful as a simple speed-controlled wheel drive.
Key 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)
Pinout and connection notes
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.
- GND: Ground — usually the brown or black wire
- VCC: Power, 4.8V-6V DC — usually the red wire
- Signal: PWM control input — usually the orange or yellow wire
Integration checklist
- Confirm the exact part number and breakout-board revision.
- Verify supply voltage, current demand, logic levels, and signal direction against the datasheet.
- Check controller pin assignments and bus address or interface mode against the example code.
- Power up with external loads disconnected, then test signals before full integration.
- If readings or communication fail, check power and ground first, then pin mapping, interface settings, and library initialization.
Troubleshooting and reproducibility
Record the board used, wiring, library/version, supply arrangement, and measured behavior. Use the selected board-specific wiring example as the source of truth. Never assume visually similar modules share identical voltage tolerance or pin order.
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 |
Swipe sideways to see every column →
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 Components
Active Buzzer
Self-oscillating buzzer that beeps with just a single HIGH signal — no PWM required.
BLDC ESC
High-speed brushless motor and electronic speed controller combo.
MG996R
High-torque metal-gear servo for robotic arms, RC vehicles, and load-bearing joints.
SG90
The classic 9g micro servo — small, cheap, and perfect for any hobby mechanism.
Related Guides & Projects
MicroPython vs Arduino on ESP32: Which Should You Learn First?
An honest comparison for beginners: where MicroPython is easier, where Arduino C++ is faster, how libraries and memory differ, and how to choose based on your project instead of hype.
MicroPython ESP32 Web Server: Control an LED or Relay from Your Browser
Create a working web server with the socket module, parse requests, serve a responsive control page for an LED or a relay, keep the displayed state truthful, choose a safe relay startup state and make the server survive bad or repeated requests.
MicroPython on ESP32 and Raspberry Pi Pico W: The Complete Guide
A structured MicroPython learning path for ESP32 and Pico W. Set up your tools, control GPIO, read sensors, connect to WiFi, build web servers, publish MQTT data and make projects reliable. Start here, then follow the links by level.
boot.py vs main.py in MicroPython: What Runs, When and Why
Understand the difference between boot.py and main.py in MicroPython, startup order, Wi-Fi setup, project structure, and recovery from boot errors.