Hi,
We're currently working with the Arduino Nano ESP32-S3 and attempting to control a servo SG90 180* using the ESP32Servo library. We've run into a problem where no PWM signal is being output from any of the GPIO pins, even though the code compiles and runs without errors.
We ran a GPIO test and discovered that the Nano pin mapping provided on the Arduino website seems to be incorrect, at least for PWM purposes. We’ve now created our own mapping between the labeled Nano pins (D0, D1, etc.) and the actual ESP32 GPIO numbers.
Here is a minimal example of the code we are using:
cpp
KopieraRedigera
#include <ESP32Servo.h>
Servo myServo;
void setup() {
myServo.setPeriodHertz(50); // 50 Hz for servo signal
myServo.attach(8, 500, 2400); // GPIO8 = D8 on Nano ESP32-S3
myServo.write(90); // Move to center position
}
void loop() {
delay(1000);
myServo.write(0);
delay(1000);
myServo.write(180);
delay(1000);
}
We’ve tried this with multiple pins (D0–D13, GPIO0–GPIO21, etc.), but in all cases the servo does not move, and we can confirm using a multimeter that no voltage is present on the signal wire of the servo.
What we’ve verified:
- The servo works fine on another board (e.g. Arduino Uno or ESP32 DevKit).
- Power and ground are correctly connected.
- We've tried using an external 5V supply to the servo.
- We verified pin mappings by testing output HIGH/LOW (digitalWrite) on all GPIOs and measuring voltage – this works.
- Only PWM output seems to be non-functional.
Question:
Is there anything special that needs to be done on the Nano ESP32-S3 to enable PWM output or servo control? Are there limitations on which GPIOs support PWM or issues with the ESP32Servo library on this board?
We would appreciate any guidance, especially if there is an updated or accurate pin mapping specific to PWM functionality on the Nano ESP32-S3.
Thanks in advance!


