Incorrect pin mapping on website and pwm problems

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!

Please do not hijack topics. Your question was split from an existing (unrelated) topic.

Did you see this
https://docs.arduino.cc/tutorials/nano-esp32/cheat-sheet/
or
https://docs.arduino.cc/tutorials/nano-esp32/pin-setup/
or
https://support.arduino.cc/hc/en-us/articles/10483225565980-Select-pin-numbering-for-Nano-ESP32-in-Arduino-IDE
also check your Tools menu

Well GPIO8 != D8. See pinout diagram.
For the SG90 the min and max times are 1000 and 2000.

confirm using a multimeter that no voltage is present on the signal wire

Depending on your multimeter you may not be able to measure PWM signals

1 Like

Incorrect, GPIO8 is D5 and D8 is GPIO17

Complete pin map is here https://docs.arduino.cc/tutorials/nano-esp32/cheat-sheet/

That should be your goto reference, in addition there is a slightly better pin out drawing which is worth printing and keeping close.

Which one is that?
Another thing is the 'cheat sheet' also has info re the 'Arduino Bootloader Mode', the 'ROM Boot Mode', and the 'Default Sketch' as well as all kinds of Arduino Nano ESP32 factoids. It is at HERE!

This is the page that has the link to the pin out, IMO the better pin out reference for the Nano ESP32 which complements the cheat sheet perfectly. It is not a suggested alternative it is an additional resource.

https://docs.arduino.cc/hardware/nano-esp32/?_gl=1*qoh8d7*_up*MQ.._gaMTU3OTg4MjcwNy4xNzUwODc1NTE5*_ga_NEXN8H46L5*czE3NTA4NzU1MTgkbzEkZzAkdDE3NTA4NzU1MTgkajYwJGwwJGgxNDAxMjk2MDQ3

1 Like