# ESP32 Servos Not Working

**URL:** <https://forum.arduino.cc/t/esp32-servos-not-working/1394638>\
**Category:** 3rd Party Boards\
**Created:** [July 9, 2025, 4:08pm UTC](https://forum.arduino.cc/t/esp32-servos-not-working/1394638 "2025-07-09T16:08:04Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![xenopeltis](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xenopeltis/32/1226533_2.png) [@xenopeltis](https://forum.arduino.cc/u/xenopeltis)\
**Post date:** [July 9, 2025, 4:08pm UTC](https://forum.arduino.cc/t/esp32-servos-not-working/1394638/1 "2025-07-09T16:08:04Z")

</div>

Hi everyone, i recently bought an EPS32 (KEYESTUDIO ESP32 WROVER) board for a project.  
Setup everything loaded some script to test some components but when i decideed to use the servos i found out that the Base arduino Library (Servo.h) doesent work, looked up for solutions and found out about ESP32Servo.h (v3.0.8), installed but i cant get to run any of my servos, they work fine on my other arduino borads.  
The Servos are DS04-NFC (continuous) and SG90 (180°) i cant manage to make em move, i initially thought that the voltage in the middle pins was at 3.3v and not at 5v but after checking it, it is 5v, i saw a lot of video online but while doing the same i can get it to work.  
If someone can help, here a basic schema on how i attached the servo:

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/1/f/6/1f6b497783b9b369ab497d0daea10cbf1994078e.jpeg)

in the code i tried every combination while setting up the frequency to 50, allocating the ESP32PWM, attaching the servo using only the pin or specifing 1000 as min, 2000 as max, using write(180) or write(0) and even writeMicroseconds(2000),writeMicroseconds(1500) and writeMicroseconds(1000) , all this for the continuous one then i jumped on the other one and used the basic for with delays. i cant get it to work, if someone can tell me what i am doing wrong.

---

<div class="post-metadata">

**Author:** ![gilshultz](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gilshultz](https://forum.arduino.cc/u/gilshultz)\
**Post date:** [July 9, 2025, 4:22pm UTC](https://forum.arduino.cc/t/esp32-servos-not-working/1394638/2 "2025-07-09T16:22:22Z")

</div>

Your fuzzy picture does not show how it is connected. Please post a simple annotated schematic showing all connections, power, ground, and power sources.

---

<div class="post-metadata">

**Author:** ![xenopeltis](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xenopeltis/32/1226533_2.png) [@xenopeltis](https://forum.arduino.cc/u/xenopeltis)\
**Post date:** [July 9, 2025, 4:30pm UTC](https://forum.arduino.cc/t/esp32-servos-not-working/1394638/3 "2025-07-09T16:30:38Z")

</div>

I managed to solve this just by changing the library, for everyone after me dont use that library use [GitHub - Dlloydev/ESP32-ESP32S2-AnalogWrite: ESP32 PWM, Servo, Easing and Tone. Smart GPIO pin management and advanced control features.](https://github.com/Dlloydev/ESP32-ESP32S2-AnalogWrite)

with the following code:

```arduino
#include <pwmWrite.h>

#define pinServo 18

Pwm pwm = Pwm();

void setup()
{
  Serial.begin(115200);
}

void loop()
{
    Serial.println("Forward");
    pwm.writeServo(pinServo, 180);
    delay(5000);
    Serial.println("Stop");
    pwm.writeServo(pinServo, 90);
    delay(1000);
    Serial.println("Reverse");
    pwm.writeServo(pinServo, 0);
    delay(5000);
    Serial.println("Stop");
    pwm.writeServo(pinServo, 90);
    delay(1000);
  
}

```

---

<div class="post-metadata">

**Author:** ![LarryD](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/larryd/32/215550_2.png) [@LarryD](https://forum.arduino.cc/u/LarryD)\
**Post date:** [July 9, 2025, 4:32pm UTC](https://forum.arduino.cc/t/esp32-servos-not-working/1394638/4 "2025-07-09T16:32:13Z")

</div>

- Your servo should be powered by an external 5-7V power supply.

---

<div class="post-metadata">

**Author:** ![xenopeltis](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xenopeltis/32/1226533_2.png) [@xenopeltis](https://forum.arduino.cc/u/xenopeltis)\
**Post date:** [July 9, 2025, 4:34pm UTC](https://forum.arduino.cc/t/esp32-servos-not-working/1394638/5 "2025-07-09T16:34:13Z")

</div>

What do you mean, the image is clear the only thing i didn't mention is that i am using USB as power source but i assumed it obvious that's on me and the pin 18 but i think wont make much a difference, anyway i solved it, thanks.

---

<div class="post-metadata">

**Author:** ![xenopeltis](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xenopeltis/32/1226533_2.png) [@xenopeltis](https://forum.arduino.cc/u/xenopeltis)\
**Post date:** [July 9, 2025, 4:35pm UTC](https://forum.arduino.cc/t/esp32-servos-not-working/1394638/6 "2025-07-09T16:35:03Z")

</div>

why?

---

<div class="post-metadata">

**Author:** ![Brazilino](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/brazilino/32/1198404_2.png) [@Brazilino](https://forum.arduino.cc/u/Brazilino)\
**Post date:** [July 9, 2025, 5:06pm UTC](https://forum.arduino.cc/t/esp32-servos-not-working/1394638/7 "2025-07-09T17:06:49Z")

</div>

In general, most of the boards doesn't come with a voltage regulator that can handle many Ampéres of current. So it's recommended to have a separate power supply for servos and motors in general. In the other hand, some custom boards are made exactly for this use, which seems to be your case, given that the very Keyestudio site uses this image as an example:

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/9/5/4/954ba5a3e00a0cfe269e9cdd8b30f4413c6d2328.jpeg)

I didn't find technical data about the board though. So the bet is on the question: can the board deal with all your servos?

---

<div class="post-metadata">

**Author:** ![LarryD](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/larryd/32/215550_2.png) [@LarryD](https://forum.arduino.cc/u/LarryD)\
**Post date:** [July 9, 2025, 5:25pm UTC](https://forum.arduino.cc/t/esp32-servos-not-working/1394638/8 "2025-07-09T17:25:44Z")

</div>

- When you power a motor from an Arduino/ESP board, both the 5v and GND current paths run thru traces on the Arduino PCB.  
These currents are high in level and have motor noise mixed in.

- An external 5-7v external supply (with a common GND connection to the ARDUINO) connects to the servo directly bypassing the Arduino PCB (and subsequent traces).  
We refer to this as a **star connection** (you may want to add an On/Off switch).  
This prevents trace to trace noise coupling.

- Never power inductive loads from your Arduino 5V pin.  
This pin can only be used with non inductive **lower current loads**.

---

<div class="post-metadata">

**Author:** ![gilshultz](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gilshultz](https://forum.arduino.cc/u/gilshultz)\
**Post date:** [July 9, 2025, 11:58pm UTC](https://forum.arduino.cc/t/esp32-servos-not-working/1394638/9 "2025-07-09T23:58:17Z")

</div>

> [@xenopeltis](#):
>
> the image is clear

Sorry but it is not clear on my monitor. The servo picture is clear.

---

<div class="post-metadata">

**Author:** ![Wawa](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/wawa/32/1211303_2.png) [@Wawa](https://forum.arduino.cc/u/Wawa)\
**Post date:** [July 10, 2025, 1:42am UTC](https://forum.arduino.cc/t/esp32-servos-not-working/1394638/10 "2025-07-10T01:42:19Z")

</div>

> [@Brazilino](#):
>
> I didn't find technical data about the board though.

**[Can be found here.](https://wiki.keyestudio.com/KS5016_Keyestudio_ESP32_PLUS_Development_Board)**  
Servo power comes from the USB-C connector, through a backflow protection fet.

Powering servos from a computer port is a bad idea.  
Make sure you have a spare computer. Or use a tablet supply instead.  
Three small SG-90 servos plus an ESP32 could draw peak currents of 2.5Amp.  
Leo..

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [January 6, 2026, 1:42am UTC](https://forum.arduino.cc/t/esp32-servos-not-working/1394638/11 "2026-01-06T01:42:48Z")

</div>

Closed on January 6, 2026, 1:42am UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
