# Servo library limited range

**URL:** <https://forum.arduino.cc/t/servo-library-limited-range/1228393>\
**Category:** Motors, Mechanics, Power and CNC\
**Created:** [February 25, 2024, 6:12pm UTC](https://forum.arduino.cc/t/servo-library-limited-range/1228393 "2024-02-25T18:12:56Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![heng1](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/heng1/32/1098565_2.png) [@heng1](https://forum.arduino.cc/u/heng1)\
**Post date:** [February 25, 2024, 6:12pm UTC](https://forum.arduino.cc/t/servo-library-limited-range/1228393/1 "2024-02-25T18:12:56Z")

</div>

hi  
just an FYI: did you notice that the servo library will cut off the range even if you force the writeMircoseconds? it will not do a full 500 to 2500 range.

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [February 25, 2024, 6:15pm UTC](https://forum.arduino.cc/t/servo-library-limited-range/1228393/2 "2024-02-25T18:15:10Z")

</div>

The normal range for a servo signal is between 1000 and 2000 microseconds so why are you surprised that it will not do 500 to 2500 ?

---

<div class="post-metadata">

**Author:** ![heng1](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/heng1/32/1098565_2.png) [@heng1](https://forum.arduino.cc/u/heng1)\
**Post date:** [February 25, 2024, 6:42pm UTC](https://forum.arduino.cc/t/servo-library-limited-range/1228393/3 "2024-02-25T18:42:07Z")

</div>

i have some really expensive special RC high power servos where the manufacturer tells me to use 500-2500 for the entire range which I really need. I sent them back already thinking there was a problem. I expect the library to do what you tell it so if I say writeMicroseconds 500 I want 500 not some cutoff signal. same at 2500. found out the servo even goes to 2600. I just use my own signal generator script then that works.

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [February 25, 2024, 6:53pm UTC](https://forum.arduino.cc/t/servo-library-limited-range/1228393/4 "2024-02-25T18:53:42Z")

</div>

> [@heng1](#):
>
> I expect the library to do what you tell

I expect the library to do what it is designed to do

What have you got the max and min pulse width values set to in the attach() for the servo

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [February 25, 2024, 7:36pm UTC](https://forum.arduino.cc/t/servo-library-limited-range/1228393/5 "2024-02-25T19:36:19Z")

</div>

> [@heng1](#):
>
> 500-2500

Forego a servo library.

> **[servoNOlibrary - Wokwi ESP32, STM32, Arduino Simulator](https://wokwi.com/projects/363651857283504129)**
>
> Run IoT and embedded projects in your browser: ESP32, STM32, Arduino, Pi Pico, and more. No installation required!

---

<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:** [February 25, 2024, 10:44pm UTC](https://forum.arduino.cc/t/servo-library-limited-range/1228393/6 "2024-02-25T22:44:37Z")

</div>

From Servo.h  
attach ( pin, min, max ) - Attaches to a pin setting min and max values in microseconds  
default min is 544, max is 2400

Try  
`myservo.attach(servoPin, 500, 2600);`  
Leo..

---

<div class="post-metadata">

**Author:** ![heng1](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/heng1/32/1098565_2.png) [@heng1](https://forum.arduino.cc/u/heng1)\
**Post date:** [February 27, 2024, 6:07pm UTC](https://forum.arduino.cc/t/servo-library-limited-range/1228393/7 "2024-02-27T18:07:20Z")

</div>

Ok tried it. still doesnt work correctly

---

<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:** [February 27, 2024, 7:17pm UTC](https://forum.arduino.cc/t/servo-library-limited-range/1228393/8 "2024-02-27T19:17:33Z")

</div>

You can try editing the _servo.h_ file with notepad++  
On my win11 machine it's in Program Files (x86)/Arduino/libraries/Servo/scr

```arduino
#define MIN_PULSE_WIDTH 544 // the shortest pulse sent to a servo  
#define MAX_PULSE_WIDTH 2400 // the longest pulse sent to a servo 
#define DEFAULT_PULSE_WIDTH 1500 // default pulse width when servo is attached
#define REFRESH_INTERVAL 20000 // minimum time to refresh servos in microseconds

```

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:** [August 25, 2024, 7:17pm UTC](https://forum.arduino.cc/t/servo-library-limited-range/1228393/9 "2024-08-25T19:17:38Z")

</div>

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