

There are specially modified servo motors that can rotate beyond 360-degrees, but we won’t be working with those today. Most servos are limited in rotation to either 180 or 270 degrees, with 180-degree servo motors being more common. A high gear ratio allows a small servo to have an impressive torque rating. Servo motors are geared DC motors that have an integrated servomechanism with a feedback loop to allow precise positioning of the motor shaft. Built-in WiFi and Bluetooth open the door to all sorts of remote control possibilities. The latter reason is why many people choose the ESP32 over an Arduino for controlling servo motors. It has built-in WiFi and Bluetooth capabilities.It has a lot of PWM output pins, so it can drive several servo motors.


#Small servo motor arduino code
Arduino’s, for example, have no problem controlling servos and the Arduino IDE even comes with a built-in servo motor library and a few bits of sample code to get you started. Servos & ESP32Ĭontrolling an analog servo motor, which is the type of servo motors most commonly used by hobbyists, is a task that most microcontrollers have no problem performing. As you’ll soon see, controlling a servo motor with the ESP32 is quite similar to using an Arduino, with the added advantage of the ESP32’s wealth of ports and capabilities.
