Component guide · Beginner · 3 min read
DS04-NFC 360 Degree Continuous Rotation Servo

Speed Control, Wiring and Code
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
The DS04-NFC is a standard-size servo modified for continuous rotation. Instead of moving to an angle, the PWM pulse sets speed and direction: about 1500 us stops it, shorter pulses spin one way and longer pulses spin the other. It is an easy way to drive robot wheels with a built-in gearbox and motor driver, using one signal pin.
Key specs at a glance
- Type
- Continuous rotation, analog
- Supply
- 4.8 to 6 V
- Torque
- About 5.5 kg-cm at 6 V
- Speed
- About 0.22 s/60 degrees equivalent, around 45 RPM no load
- Signal
- 50 Hz PWM, 1000 to 2000 us (1500 us = stop)
- Size
- Standard servo, 40 x 20 x 38 mm
What the DS04-NFC continuous rotation servo is
Inside is the same motor, gearbox and driver as a normal servo, but the position pot is replaced with fixed resistors and the end stop is removed. The servo always thinks it is at the centre, so any pulse away from 1500 us makes it turn, faster the further away.
There is no position feedback. For distance, add a wheel encoder or use time-based moves. If it creeps at 1500 us, trim the neutral point in code (try 1480 to 1520) or with the small trimmer if your unit has one.
DS04-NFC continuous rotation servo pinout
The pins on the DS04-NFC continuous rotation servo and what each one does.
| Pin | Function |
|---|---|
| Brown / black | Ground |
| Red | Supply, 4.8 to 6 V (see specs) |
| Orange / yellow / white | PWM signal, 50 Hz, 500 to 2500 us pulses |
- Brown / black
- Ground
- Red
- Supply, 4.8 to 6 V (see specs)
- Orange / yellow / white
- PWM signal, 50 Hz, 500 to 2500 us pulses
Wiring the DS04-NFC continuous rotation servo
Power two or more of these from a separate 5 to 6 V supply, not the Uno 5V pin, and join the grounds. Stall current can exceed 1 A.
| DS04-NFC continuous rotation servo pin | Arduino Uno | ESP32 |
|---|---|---|
| Brown (GND) | GND, also to the servo supply ground | GND, also to the servo supply ground |
| Red (V+) | External 5 to 6 V supply (not the 5V pin for big servos) | External 5 to 6 V supply |
| Signal | D9 | GPIO 18 |
- Brown (GND)
- Arduino Uno:
- GND, also to the servo supply ground
- ESP32:
- GND, also to the servo supply ground
- Red (V+)
- Arduino Uno:
- External 5 to 6 V supply (not the 5V pin for big servos)
- ESP32:
- External 5 to 6 V supply
- Signal
- Arduino Uno:
- D9
- ESP32:
- GPIO 18
Example code
On ESP32 use the ESP32Servo library with the same writeMicroseconds calls.
#include <Servo.h>
Servo wheel;
const int STOP_US = 1500; // adjust if it creeps
void setup() { wheel.attach(9); }
void loop() {
wheel.writeMicroseconds(1700); // forward
delay(2000);
wheel.writeMicroseconds(STOP_US);
delay(1000);
wheel.writeMicroseconds(1300); // reverse
delay(2000);
wheel.writeMicroseconds(STOP_US);
delay(1000);
}Setup and tuning
find the exact stop pulse for each servo and store it.
speed is not linear; most change happens within 200 us of neutral.
mount the servos facing opposite ways, so one needs the reverse pulse to go forward.
use the 25T horn screw pattern or a matching servo wheel.
What you need
Shop this list5 of 6 found in our store · ₹1,195
DS04-NFC 360° Continuous Rotation Servo: the part this guide coversDS04-NFC 360° Continuous Rotation Servo₹387- Uno R3 development board: the controller used in the wiring tableFind this part
ESP32-WROOM-32 38-pin development board: for Wi-Fi logging and dashboardsESP32-WROOM-32 38-Pin Development Board₹389
XL4015 5A buck converter with voltmeter: a separate 5 to 6 V supply for the servosXL4015 5A Buck Converter with Voltmeter₹304
RC servo motor tester (3-channel): to centre and test servos without codeRC Servo Motor Tester (3-Channel)₹99
Electrolytic capacitor: bulk capacitance across the supplyElectrolytic Capacitor₹16
Alternatives and when to choose them
- Servo motors overview: positional vs continuous rotation.
- TT and BO gear motors: cheaper wheels with a motor driver.
- N20 gear motor: smaller, with encoder options.
Common mistakes to avoid
- Expecting it to hold an angle.
- Powering several from the Arduino 5V pin.
- Not trimming the neutral, so the robot creeps.
- Forgetting the common ground with an external supply.
Frequently asked questions
Can it move to 90 degrees?
No, it only controls speed and direction.
How do I stop it?
Send the neutral pulse, about 1500 us, or detach the signal.
Why does it creep at 1500?
Each unit's neutral is slightly different; trim it in code.
Does it need a motor driver?
No, the driver is inside the servo.
Can I measure distance?
Not directly; add a wheel encoder.
Parts for this guide
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

